More pretty icons, BW setting change in BHT TX

This commit is contained in:
furrtek 2017-01-06 02:51:09 +01:00
parent c0909fa298
commit 9fab42eb7c
11 changed files with 142 additions and 14 deletions

View File

@ -29,6 +29,98 @@ namespace ui {
// Use firmware/tools/make_bitmap.py !
static constexpr uint8_t bitmap_icon_audiotx_data[] = {
0x00, 0x70,
0x00, 0x7F,
0xC0, 0x4F,
0xC0, 0x60,
0x40, 0x5E,
0xC0, 0x41,
0x40, 0x40,
0x40, 0x40,
0x40, 0x40,
0x40, 0x70,
0x70, 0x7C,
0x7C, 0x7E,
0x7E, 0x3E,
0x3E, 0x1C,
0x1C, 0x00,
0x00, 0x00,
};
static constexpr Bitmap bitmap_icon_audiotx {
{ 16, 16 }, bitmap_icon_audiotx_data
};
static constexpr uint8_t bitmap_icon_capture_data[] = {
0xEF, 0x29,
0xEF, 0x69,
0xEF, 0xE9,
0xEF, 0xE9,
0xEF, 0xEF,
0x1F, 0xF0,
0xFF, 0xFF,
0xFF, 0xFF,
0x03, 0xC0,
0xFB, 0xDF,
0x0B, 0xD9,
0xFB, 0xDF,
0x4B, 0xDE,
0xFB, 0xDF,
0x03, 0xC0,
0xFE, 0x7F,
};
static constexpr Bitmap bitmap_icon_capture {
{ 16, 16 }, bitmap_icon_capture_data
};
static constexpr uint8_t bitmap_icon_codetx_data[] = {
0x00, 0x00,
0xF0, 0x07,
0x0C, 0x18,
0x03, 0x60,
0xE0, 0x83,
0x18, 0x0C,
0x04, 0x10,
0xC0, 0x01,
0x20, 0x02,
0x00, 0x00,
0x00, 0x00,
0xBB, 0x6D,
0x2A, 0x49,
0x2A, 0x49,
0x3A, 0x49,
0x00, 0x00,
};
static constexpr Bitmap bitmap_icon_codetx {
{ 16, 16 }, bitmap_icon_codetx_data
};
static constexpr uint8_t bitmap_icon_receiver_data[] = {
0xC0, 0x07,
0x30, 0x18,
0x10, 0x10,
0x88, 0x23,
0x48, 0x24,
0x40, 0x24,
0x80, 0x10,
0x80, 0x10,
0xC0, 0x08,
0xE0, 0x08,
0x60, 0x04,
0x08, 0x04,
0x08, 0x02,
0x10, 0x01,
0xE0, 0x00,
0x00, 0x00,
};
static constexpr Bitmap bitmap_icon_receiver {
{ 16, 16 }, bitmap_icon_receiver_data
};
static constexpr uint8_t bitmap_icon_adsb_data[] = {
0x80, 0x01,
0xC0, 0x03,
@ -282,6 +374,29 @@ static constexpr Bitmap bitmap_icon_nuoptix {
{ 16, 16 }, bitmap_icon_nuoptix_data
};
static constexpr uint8_t bitmap_icon_playdead_data[] = {
0x80, 0x01,
0x80, 0x01,
0xE0, 0x07,
0xE0, 0x07,
0x80, 0x01,
0x80, 0x01,
0x80, 0x01,
0xE0, 0x07,
0xB0, 0x0A,
0x50, 0x0D,
0xA8, 0x1A,
0x58, 0x15,
0xAC, 0x2A,
0x54, 0x35,
0x04, 0x20,
0xF8, 0x1F,
};
static constexpr Bitmap bitmap_icon_playdead {
{ 16, 16 }, bitmap_icon_playdead_data
};
static constexpr uint8_t bitmap_icon_rds_data[] = {
0x00, 0x00,
0x00, 0x00,

View File

@ -44,7 +44,7 @@ BHTView::~BHTView() {
void BHTView::generate_message() {
if (!_mode) {
text_message.set(
gen_message_xy(header_code_a.value(), header_code_b.value(), city_code_xy.value(), subfamily_code.value(),
gen_message_xy(header_code_a.value(), header_code_b.value(), city_code_xy.value(), family_code_xy.value(),
checkbox_wcsubfamily.value(), subfamily_code.value(), checkbox_wcid.value(), receiver_code.value(),
relay_states[0].selected_index(), relay_states[1].selected_index(),
relay_states[2].selected_index(), relay_states[3].selected_index())
@ -82,7 +82,7 @@ void BHTView::start_tx() {
}
audio::set_rate(audio::Rate::Hz_24000);
baseband::set_tones_data(6000, CCIR_SILENCE, 20, false, checkbox_speaker.value());
baseband::set_tones_data(field_bw.value() * 20, CCIR_SILENCE, 20, false, checkbox_speaker.value());
}
void BHTView::on_tx_progress(const int progress, const bool done) {
@ -104,7 +104,7 @@ void BHTView::on_tx_progress(const int progress, const bool done) {
chThdSleepMilliseconds(tempo_cligno.value() * 1000); // Dirty :(
// Invert all relay states
for (c = 0; c < 4; c++) {
for (c = 0; c < 1; c++) {
sr = relay_states[c].selected_index();
if (sr > 0) relay_states[c].set_selected_index(sr ^ 3);
}
@ -144,6 +144,7 @@ BHTView::BHTView(NavigationView& nav) {
&checkbox_wcid,
&text_freq,
&options_freq,
&field_bw,
&text_relais,
&progressbar,
&text_message,
@ -156,7 +157,7 @@ BHTView::BHTView(NavigationView& nav) {
options_mode.set_selected_index(0); // Start up in Xy mode
header_code_a.set_value(0);
header_code_b.set_value(0);
city_code_xy.set_value(18);
city_code_xy.set_value(10);
city_code_ep.set_value(220);
family_code_xy.set_value(1);
family_code_ep.set_selected_index(2);
@ -167,6 +168,8 @@ BHTView::BHTView(NavigationView& nav) {
progressbar.set_max(20);
relay_states[0].set_selected_index(1); // R1 OFF
field_bw.set_value(10);
options_mode.on_change = [this](size_t mode, OptionsField::value_t) {
_mode = mode;
@ -297,8 +300,10 @@ BHTView::BHTView(NavigationView& nav) {
button_transmit.on_select = [this, &nav](Button&) {
if ((tx_mode == IDLE) && (!_mode)) { // DEBUG
if (speaker_enabled && _mode)
audio::headphone::set_volume(volume_t::decibel(90 - 99) + audio::headphone::volume_range().max);
if (speaker_enabled)
chThdSleepMilliseconds(40 * 1000); // DEBUG 40s
//if (speaker_enabled && _mode)
// audio::headphone::set_volume(volume_t::decibel(90 - 99) + audio::headphone::volume_range().max);
tx_mode = SINGLE;
button_transmit.set_style(&style_cancel);
button_transmit.set_text("Wait");

View File

@ -197,11 +197,11 @@ private:
};
Text text_freq {
{ 6 * 8, 8 * 16, 10 * 8, 16 },
{ 1 * 8, 8 * 16, 10 * 8, 16 },
"Frequence:"
};
OptionsField options_freq {
{ 17 * 8, 8 * 16},
{ 12 * 8, 8 * 16},
7,
{
{ "31.3250", 0 },
@ -214,6 +214,14 @@ private:
}
};
NumberField field_bw {
{ 20 * 8, 8 * 16 },
2,
{ 0, 99 },
1,
' '
};
Text text_relais {
{ 8, 19 * 8, 13 * 8, 16 },
"Etats relais:"

View File

@ -338,11 +338,11 @@ void SystemMenuView::hackrf_mode(NavigationView& nav) {
SystemMenuView::SystemMenuView(NavigationView& nav) {
add_items<11>({ {
{ "Play dead", ui::Color::red(), nullptr, [&nav](){ nav.push<PlayDeadView>(); } },
{ "Receivers", ui::Color::cyan(), nullptr, [&nav](){ nav.push<ReceiverMenuView>(); } },
{ "Capture", ui::Color::cyan(), nullptr, [&nav](){ nav.push<CaptureAppView>(); } },
{ "Code transmitters", ui::Color::green(), nullptr, [&nav](){ nav.push<TransmitterCodedMenuView>(); } },
{ "Audio transmitters", ui::Color::green(), nullptr, [&nav](){ nav.push<TransmitterAudioMenuView>(); } },
{ "Play dead", ui::Color::red(), &bitmap_icon_playdead, [&nav](){ nav.push<PlayDeadView>(); } },
{ "Receivers", ui::Color::cyan(), &bitmap_icon_receiver, [&nav](){ nav.push<ReceiverMenuView>(); } },
{ "Capture", ui::Color::cyan(), &bitmap_icon_capture, [&nav](){ nav.push<CaptureAppView>(); } },
{ "Code transmitters", ui::Color::green(), &bitmap_icon_codetx, [&nav](){ nav.push<TransmitterCodedMenuView>(); } },
{ "Audio transmitters", ui::Color::green(), &bitmap_icon_audiotx, [&nav](){ nav.push<TransmitterAudioMenuView>(); } },
{ "Close Call", ui::Color::orange(),&bitmap_icon_closecall, [&nav](){ nav.push<CloseCallView>(); } },
{ "Jammer", ui::Color::orange(),&bitmap_icon_jammer, [&nav](){ nav.push<JammerView>(); } },
{ "Utilities", ui::Color::purple(),nullptr, [&nav](){ nav.push<UtilitiesView>(); } },

View File

@ -452,7 +452,7 @@ SetupMenuView::SetupMenuView(NavigationView& nav) {
{ "Frequency correction", ui::Color::white(), nullptr, [&nav](){ nav.push<SetFrequencyCorrectionView>(); } },
{ "Antenna Bias Voltage", ui::Color::white(), nullptr, [&nav](){ nav.push<AntennaBiasSetupView>(); } },
{ "Touch screen", ui::Color::white(), nullptr, [&nav](){ nav.push<TouchCalibrationView>(); } },
{ "Play dead", ui::Color::red(), nullptr, [&nav](){ nav.push<SetPlayDeadView>(); } }
{ "Play dead", ui::Color::red(), &bitmap_icon_playdead, [&nav](){ nav.push<SetPlayDeadView>(); } }
} });
on_left = [&nav](){ nav.pop(); };
}

Binary file not shown.

BIN
graphics/PP_AUDIOTX.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

BIN
graphics/PP_CAPTURE.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

BIN
graphics/PP_CODETX.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

BIN
graphics/PP_PLAYDEAD.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

BIN
graphics/PP_RECEIVER.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B