mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-15 08:47:51 +00:00
Added HamItUp option (#840)
* Added HamItUp option to allow quick offset of the tuned frequency * New HamItUp icon for top bar * HamItUp checkbox status and frequency persistent settings in Settings/Radio
This commit is contained in:
@@ -166,7 +166,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "AIS Boats RX"; };
|
||||
std::string title() const override { return "AIS RX"; };
|
||||
|
||||
private:
|
||||
static constexpr uint32_t initial_target_frequency = 162025000;
|
||||
|
@@ -53,7 +53,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "Analog TV RX"; };
|
||||
std::string title() const override { return "AnalogTV RX"; };
|
||||
|
||||
private:
|
||||
static constexpr ui::Dim header_height = 3 * 16;
|
||||
|
@@ -125,7 +125,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "ERT Meter RX"; };
|
||||
std::string title() const override { return "ERT RX"; };
|
||||
|
||||
private:
|
||||
ERTRecentEntries recent { };
|
||||
|
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "Soundboard TX"; };
|
||||
std::string title() const override { return "Soundbrd TX"; };
|
||||
|
||||
private:
|
||||
NavigationView& nav_;
|
||||
|
@@ -102,8 +102,8 @@ public:
|
||||
void paint(Painter&) override { };
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "TPMS Cars RX"; };
|
||||
|
||||
std::string title() const override { return "TPMS RX"; };
|
||||
|
||||
private:
|
||||
static constexpr uint32_t initial_target_frequency = 315000000;
|
||||
|
@@ -52,7 +52,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "AFSK RX (beta)"; };
|
||||
std::string title() const override { return "AFSK RX"; };
|
||||
|
||||
private:
|
||||
void on_data(uint32_t value, bool is_data);
|
||||
|
@@ -179,7 +179,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "BHT Xy/EP TX"; };
|
||||
std::string title() const override { return "BHT TX"; };
|
||||
|
||||
private:
|
||||
// app save settings
|
||||
|
@@ -40,7 +40,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "BurgerPgr TX"; };
|
||||
std::string title() const override { return "BurgerPgrTX"; };
|
||||
|
||||
private:
|
||||
enum tx_modes {
|
||||
|
@@ -48,7 +48,7 @@ public:
|
||||
void load_directory_contents(const std::filesystem::path& dir_path);
|
||||
std::filesystem::path get_selected_path();
|
||||
|
||||
std::string title() const override { return "File manager"; };
|
||||
std::string title() const override { return "Fileman"; };
|
||||
|
||||
protected:
|
||||
NavigationView& nav_;
|
||||
|
@@ -87,7 +87,7 @@ class FrequencySaveView : public FreqManBaseView {
|
||||
public:
|
||||
FrequencySaveView(NavigationView& nav, const rf::Frequency value);
|
||||
|
||||
std::string title() const override { return "Save frequency"; };
|
||||
std::string title() const override { return "Save freq."; };
|
||||
|
||||
private:
|
||||
std::string desc_buffer { };
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
|
||||
FrequencyLoadView(NavigationView& nav);
|
||||
|
||||
std::string title() const override { return "Load frequency"; };
|
||||
std::string title() const override { return "Load freq."; };
|
||||
|
||||
private:
|
||||
void refresh_widgets(const bool v);
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
FrequencyManagerView(NavigationView& nav);
|
||||
~FrequencyManagerView();
|
||||
|
||||
std::string title() const override { return "Freq. manager"; };
|
||||
std::string title() const override { return "Freqman"; };
|
||||
|
||||
private:
|
||||
std::string desc_buffer { };
|
||||
|
@@ -49,7 +49,7 @@ namespace ui
|
||||
GlassView& operator=(const GlassView &nav);
|
||||
|
||||
~GlassView();
|
||||
std::string title() const override { return "Looking Glass"; };
|
||||
std::string title() const override { return "LookingGlass"; };
|
||||
|
||||
void on_show() override;
|
||||
void on_hide() override;
|
||||
|
@@ -38,7 +38,7 @@ public:
|
||||
~WipeSDView();
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "Wipe SD Card"; };
|
||||
std::string title() const override { return "Wipe sdcard"; };
|
||||
|
||||
private:
|
||||
NavigationView& nav_;
|
||||
|
@@ -38,6 +38,8 @@ using namespace portapack;
|
||||
#include "ui_font_fixed_8x16.hpp"
|
||||
#include "cpld_update.hpp"
|
||||
|
||||
#include "freqman.hpp"
|
||||
|
||||
namespace ui {
|
||||
|
||||
SetDateTimeView::SetDateTimeView(
|
||||
@@ -144,6 +146,8 @@ SetRadioView::SetRadioView(
|
||||
}
|
||||
|
||||
add_children({
|
||||
&check_hamitup,
|
||||
&button_hamitup_freq,
|
||||
&check_clkout,
|
||||
&field_clkout_freq,
|
||||
&labels_clkout_khz,
|
||||
@@ -168,6 +172,28 @@ SetRadioView::SetRadioView(
|
||||
EventDispatcher::send_message(message);
|
||||
};
|
||||
|
||||
check_hamitup.set_value(portapack::persistent_memory::config_hamitup());
|
||||
check_hamitup.on_select = [this](Checkbox&, bool v) {
|
||||
portapack::persistent_memory::set_config_hamitup(v);
|
||||
// Retune to take hamitup change in account
|
||||
receiver_model.set_tuning_frequency( portapack::persistent_memory::tuned_frequency() );
|
||||
//Refresh status bar with/out UP!
|
||||
StatusRefreshMessage message { };
|
||||
EventDispatcher::send_message(message);
|
||||
};
|
||||
|
||||
button_hamitup_freq.set_text( to_string_short_freq( portapack::persistent_memory::config_hamitup_freq() ) + "MHz");
|
||||
|
||||
button_hamitup_freq.on_select = [this, &nav](Button& button) {
|
||||
auto new_view = nav.push<FrequencyKeypadView>(portapack::persistent_memory::config_hamitup_freq() );
|
||||
new_view->on_changed = [this, &button](rf::Frequency f) {
|
||||
portapack::persistent_memory::set_config_hamitup_freq( f );
|
||||
// Retune to take hamitup change in account
|
||||
receiver_model.set_tuning_frequency( portapack::persistent_memory::tuned_frequency() );
|
||||
button_hamitup_freq.set_text( "<" + to_string_short_freq( f ) + " MHz>" );
|
||||
};
|
||||
};
|
||||
|
||||
field_clkout_freq.set_value(portapack::persistent_memory::clkout_freq());
|
||||
value_freq_step.set_style(&style_text);
|
||||
|
||||
@@ -376,13 +402,13 @@ SettingsMenuView::SettingsMenuView(NavigationView& nav) {
|
||||
add_items( { { "..", ui::Color::light_grey(),&bitmap_icon_previous, [&nav](){ nav.pop(); } } } );
|
||||
}
|
||||
add_items({
|
||||
{ "Audio", ui::Color::dark_cyan(), &bitmap_icon_speaker, [&nav](){ nav.push<SetAudioView>(); } },
|
||||
{ "Radio", ui::Color::dark_cyan(), &bitmap_icon_options_radio, [&nav](){ nav.push<SetRadioView>(); } },
|
||||
{ "User Interface", ui::Color::dark_cyan(), &bitmap_icon_options_ui, [&nav](){ nav.push<SetUIView>(); } },
|
||||
{ "Date/Time", ui::Color::dark_cyan(), &bitmap_icon_options_datetime, [&nav](){ nav.push<SetDateTimeView>(); } },
|
||||
{ "Calibration", ui::Color::dark_cyan(), &bitmap_icon_options_touch, [&nav](){ nav.push<TouchCalibrationView>(); } },
|
||||
{ "App Settings", ui::Color::dark_cyan(), &bitmap_icon_setup, [&nav](){ nav.push<SetAppSettingsView>(); } },
|
||||
{ "QR Code", ui::Color::dark_cyan(), &bitmap_icon_qr_code, [&nav](){ nav.push<SetQRCodeView>(); } }
|
||||
{ "Audio", ui::Color::dark_cyan(), &bitmap_icon_speaker, [&nav](){ nav.push<SetAudioView>(); } },
|
||||
{ "Radio", ui::Color::dark_cyan(), &bitmap_icon_options_radio, [&nav](){ nav.push<SetRadioView>(); } },
|
||||
{ "User Interface", ui::Color::dark_cyan(), &bitmap_icon_options_ui, [&nav](){ nav.push<SetUIView>(); } },
|
||||
{ "Date/Time", ui::Color::dark_cyan(), &bitmap_icon_options_datetime, [&nav](){ nav.push<SetDateTimeView>(); } },
|
||||
{ "Calibration", ui::Color::dark_cyan(), &bitmap_icon_options_touch, [&nav](){ nav.push<TouchCalibrationView>(); } },
|
||||
{ "App Settings", ui::Color::dark_cyan(), &bitmap_icon_setup, [&nav](){ nav.push<SetAppSettingsView>(); } },
|
||||
{ "QR Code", ui::Color::dark_cyan(), &bitmap_icon_qr_code, [&nav](){ nav.push<SetQRCodeView>(); } }
|
||||
});
|
||||
set_max_rows(2); // allow wider buttons
|
||||
}
|
||||
|
@@ -124,7 +124,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "Radio settings"; };
|
||||
std::string title() const override { return "Radio"; };
|
||||
|
||||
private:
|
||||
const Style style_text {
|
||||
@@ -154,7 +154,7 @@ private:
|
||||
{ { 6 * 8, 4 * 16 }, "PPM", Color::light_grey() },
|
||||
};
|
||||
|
||||
Checkbox check_clkout {
|
||||
Checkbox check_clkout {
|
||||
{ 18, (6 * 16 - 4) },
|
||||
13,
|
||||
"Enable CLKOUT"
|
||||
@@ -193,11 +193,21 @@ private:
|
||||
};
|
||||
|
||||
Checkbox check_bias {
|
||||
{ 28, 13 * 16 },
|
||||
{ 18, 12 * 16 },
|
||||
5,
|
||||
"Turn on bias voltage"
|
||||
};
|
||||
|
||||
Checkbox check_hamitup {
|
||||
{ 18, 14 * 16},
|
||||
7,
|
||||
"HamItUp"
|
||||
};
|
||||
Button button_hamitup_freq {
|
||||
{ 240 - 15 * 8 , 14 * 16 , 15 * 8 , 24 },
|
||||
"",
|
||||
};
|
||||
|
||||
Button button_save {
|
||||
{ 2 * 8, 16 * 16, 12 * 8, 32 },
|
||||
"Save"
|
||||
@@ -219,7 +229,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "UI settings"; };
|
||||
std::string title() const override { return "UI"; };
|
||||
|
||||
private:
|
||||
|
||||
@@ -299,7 +309,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "App Settings"; };
|
||||
std::string title() const override { return "AppSettings"; };
|
||||
|
||||
private:
|
||||
|
||||
@@ -332,7 +342,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "Audio settings"; };
|
||||
std::string title() const override { return "Audio"; };
|
||||
|
||||
private:
|
||||
Labels labels {
|
||||
|
@@ -62,7 +62,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "Radiosonde RX"; };
|
||||
std::string title() const override { return "Radiosnd RX"; };
|
||||
|
||||
|
||||
|
||||
|
@@ -53,7 +53,7 @@ public:
|
||||
void focus() override;
|
||||
void paint(Painter&) override;
|
||||
|
||||
std::string title() const override { return "SSTV TX (beta)"; };
|
||||
std::string title() const override { return "SSTV TX"; };
|
||||
|
||||
private:
|
||||
NavigationView& nav_;
|
||||
|
@@ -110,7 +110,7 @@ public:
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "TouchTunes TX"; };
|
||||
std::string title() const override { return "TouchTunes"; };
|
||||
|
||||
private:
|
||||
uint32_t scan_button_index { };
|
||||
|
@@ -37,7 +37,7 @@ namespace ui
|
||||
public:
|
||||
WhipCalcView(NavigationView &nav);
|
||||
void focus() override;
|
||||
std::string title() const override { return "Antenna length"; };
|
||||
std::string title() const override { return "Ant. length"; };
|
||||
|
||||
private:
|
||||
const double speed_of_light_mps = 299792458.0; // m/s
|
||||
|
Reference in New Issue
Block a user