mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-02-02 09:35:20 -05:00
Jammer manual set range 2 & 3 bugfix
Menu capture/replay confusion bugfix
This commit is contained in:
parent
607e6c5bd4
commit
c352458114
@ -23,8 +23,6 @@
|
|||||||
// Color bitmaps generated with:
|
// Color bitmaps generated with:
|
||||||
// Gimp image > indexed colors (16), then "xxd -i *.bmp"
|
// Gimp image > indexed colors (16), then "xxd -i *.bmp"
|
||||||
|
|
||||||
//BUG: Set description in frequency save makes everything go crazy
|
|
||||||
//BUG: Distorted audio in WFM receiver
|
|
||||||
//BUG: (fixed ?) POCSAG: Bad console scroll init
|
//BUG: (fixed ?) POCSAG: Bad console scroll init
|
||||||
//BUG: POCSAG misses alphanum messages, cuts them off sometimes
|
//BUG: POCSAG misses alphanum messages, cuts them off sometimes
|
||||||
//BUG: Check AFSK transmit end, skips last bits ?
|
//BUG: Check AFSK transmit end, skips last bits ?
|
||||||
|
@ -76,21 +76,21 @@ void JammerView::update_range(const uint32_t n) {
|
|||||||
texts_info[n].set(label);
|
texts_info[n].set(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JammerView::update_button(const uint32_t n) {
|
void JammerView::update_button(const uint32_t id) {
|
||||||
std::string label;
|
std::string label;
|
||||||
rf::Frequency f;
|
rf::Frequency f;
|
||||||
|
|
||||||
if (n & 1)
|
if (id & 1)
|
||||||
f = frequency_range[n / 2].max;
|
f = frequency_range[id / 2].max;
|
||||||
else
|
else
|
||||||
f = frequency_range[n / 2].min;
|
f = frequency_range[id / 2].min;
|
||||||
|
|
||||||
auto f_mhz = to_string_dec_int(f / 1000000, 4);
|
auto f_mhz = to_string_dec_int(f / 1000000, 4);
|
||||||
auto f_hz100 = to_string_dec_int((f / 1000) % 1000, 3, '0');
|
auto f_hz100 = to_string_dec_int((f / 1000) % 1000, 3, '0');
|
||||||
|
|
||||||
label = f_mhz + "." + f_hz100 + "M";
|
label = f_mhz + "." + f_hz100 + "M";
|
||||||
|
|
||||||
buttons_freq[n].set_text(label);
|
buttons_freq[id].set_text(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JammerView::on_retune(const rf::Frequency freq, const uint32_t range) {
|
void JammerView::on_retune(const rf::Frequency freq, const uint32_t range) {
|
||||||
@ -142,18 +142,21 @@ JammerView::JammerView(NavigationView& nav) {
|
|||||||
|
|
||||||
const auto button_freq_fn = [this, &nav](Button& button) {
|
const auto button_freq_fn = [this, &nav](Button& button) {
|
||||||
rf::Frequency * value_ptr;
|
rf::Frequency * value_ptr;
|
||||||
|
uint32_t id = button.id;
|
||||||
|
|
||||||
if (button.id & 1)
|
if (id & 1)
|
||||||
value_ptr = &frequency_range[id].max;
|
value_ptr = &frequency_range[id >> 1].max;
|
||||||
else
|
else
|
||||||
value_ptr = &frequency_range[id].min;
|
value_ptr = &frequency_range[id >> 1].min;
|
||||||
|
|
||||||
auto new_view = nav.push<FrequencyKeypadView>(*value_ptr);
|
auto new_view = nav.push<FrequencyKeypadView>(*value_ptr);
|
||||||
new_view->on_changed = [this, value_ptr, &button](rf::Frequency f) {
|
new_view->on_changed = [this, value_ptr, id](rf::Frequency f) {
|
||||||
*value_ptr = f;
|
*value_ptr = f;
|
||||||
update_button(button.id);
|
update_button(id);
|
||||||
update_range(button.id >> 1);
|
update_range(id >> 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
update_button(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto checkbox_fn = [this](Checkbox& checkbox, bool v) {
|
const auto checkbox_fn = [this](Checkbox& checkbox, bool v) {
|
||||||
|
@ -352,17 +352,17 @@ SystemMenuView::SystemMenuView(NavigationView& nav) {
|
|||||||
add_items<12>({ {
|
add_items<12>({ {
|
||||||
{ "Play dead", ui::Color::red(), &bitmap_icon_playdead, [&nav](){ nav.push<PlayDeadView>(); } },
|
{ "Play dead", ui::Color::red(), &bitmap_icon_playdead, [&nav](){ nav.push<PlayDeadView>(); } },
|
||||||
{ "Receivers", ui::Color::cyan(), &bitmap_icon_receiver, [&nav](){ nav.push<ReceiverMenuView>(); } },
|
{ "Receivers", ui::Color::cyan(), &bitmap_icon_receiver, [&nav](){ nav.push<ReceiverMenuView>(); } },
|
||||||
{ "Capture", ui::Color::cyan(), &bitmap_icon_capture, [&nav](){ nav.push<NotImplementedView>(); } }, //CaptureAppView
|
{ "Capture", ui::Color::cyan(), &bitmap_icon_capture, [&nav](){ nav.push<CaptureAppView>(); } }, //CaptureAppView
|
||||||
{ "Replay", ui::Color::grey(), &bitmap_icon_replay, [&nav](){ nav.push<ReplayAppView>(); } },
|
{ "Replay", ui::Color::grey(), &bitmap_icon_replay, [&nav](){ nav.push<NotImplementedView>(); } },
|
||||||
{ "Code transmitters", ui::Color::green(), &bitmap_icon_codetx, [&nav](){ nav.push<TransmitterCodedMenuView>(); } },
|
{ "Code transmitters", ui::Color::green(), &bitmap_icon_codetx, [&nav](){ nav.push<TransmitterCodedMenuView>(); } },
|
||||||
{ "Audio transmitters", ui::Color::green(), &bitmap_icon_audiotx, [&nav](){ nav.push<TransmitterAudioMenuView>(); } },
|
{ "Audio transmitters", ui::Color::green(), &bitmap_icon_audiotx, [&nav](){ nav.push<TransmitterAudioMenuView>(); } },
|
||||||
{ "Close Call", ui::Color::orange(),&bitmap_icon_closecall, [&nav](){ nav.push<CloseCallView>(); } },
|
{ "Close Call", ui::Color::orange(),&bitmap_icon_closecall, [&nav](){ nav.push<CloseCallView>(); } },
|
||||||
{ "Jammer", ui::Color::orange(),&bitmap_icon_jammer, [&nav](){ nav.push<JammerView>(); } },
|
{ "Jammer", ui::Color::orange(),&bitmap_icon_jammer, [&nav](){ nav.push<JammerView>(); } },
|
||||||
{ "Utilities", ui::Color::purple(),nullptr, [&nav](){ nav.push<UtilitiesView>(); } },
|
{ "Utilities", ui::Color::purple(),nullptr, [&nav](){ nav.push<UtilitiesView>(); } },
|
||||||
{ "Setup", ui::Color::white(), nullptr, [&nav](){ nav.push<SetupMenuView>(); } },
|
{ "Setup", ui::Color::white(), nullptr, [&nav](){ nav.push<SetupMenuView>(); } },
|
||||||
//{ "Debug", ui::Color::white(), nullptr, [&nav](){ nav.push<DebugMenuView>(); } },
|
//{ "Debug", ui::Color::white(), nullptr, [&nav](){ nav.push<DebugMenuView>(); } },
|
||||||
{ "HackRF mode", ui::Color::white(), &bitmap_icon_hackrf, [this, &nav](){ hackrf_mode(nav); } },
|
{ "HackRF mode", ui::Color::white(), &bitmap_icon_hackrf, [this, &nav](){ hackrf_mode(nav); } },
|
||||||
{ "About", ui::Color::white(), nullptr, [&nav](){ nav.push<AboutView>(); } }
|
{ "About", ui::Color::white(), nullptr, [&nav](){ nav.push<AboutView>(); } }
|
||||||
} });
|
} });
|
||||||
|
|
||||||
set_highlighted(1); // Startup selection is "Receivers"
|
set_highlighted(1); // Startup selection is "Receivers"
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user