diff --git a/firmware/application/ais_app.cpp b/firmware/application/ais_app.cpp index 5c51adbf..6c1f2e40 100644 --- a/firmware/application/ais_app.cpp +++ b/firmware/application/ais_app.cpp @@ -297,7 +297,7 @@ void AISRecentEntryDetailView::set_entry(const AISRecentEntry& entry) { set_dirty(); } -AISAppView::AISAppView() { +AISAppView::AISAppView(NavigationView&) { add_children({ { &recent_entries_view, &recent_entry_detail_view, diff --git a/firmware/application/ais_app.hpp b/firmware/application/ais_app.hpp index 2c7a435c..c0352bc3 100644 --- a/firmware/application/ais_app.hpp +++ b/firmware/application/ais_app.hpp @@ -23,6 +23,8 @@ #define __AIS_APP_H__ #include "ui_widget.hpp" +#include "ui_navigation.hpp" + #include "log_file.hpp" #include "ais_packet.hpp" @@ -129,7 +131,7 @@ private: class AISAppView : public View { public: - AISAppView(); + AISAppView(NavigationView& nav); ~AISAppView(); void set_parent_rect(const Rect new_parent_rect) override; diff --git a/firmware/application/ert_app.cpp b/firmware/application/ert_app.cpp index 0242baa2..203fa98f 100644 --- a/firmware/application/ert_app.cpp +++ b/firmware/application/ert_app.cpp @@ -93,7 +93,7 @@ void RecentEntriesView::draw( painter.draw_string(target_rect.pos, draw_style, line); } -ERTAppView::ERTAppView() { +ERTAppView::ERTAppView(NavigationView&) { add_children({ { &recent_entries_view, } }); diff --git a/firmware/application/ert_app.hpp b/firmware/application/ert_app.hpp index 8614b076..6100441a 100644 --- a/firmware/application/ert_app.hpp +++ b/firmware/application/ert_app.hpp @@ -22,6 +22,8 @@ #ifndef __ERT_APP_H__ #define __ERT_APP_H__ +#include "ui_navigation.hpp" + #include "log_file.hpp" #include "ert_packet.hpp" @@ -72,7 +74,7 @@ using ERTRecentEntriesView = RecentEntriesView; class ERTAppView : public View { public: - ERTAppView(); + ERTAppView(NavigationView& nav); ~ERTAppView(); void set_parent_rect(const Rect new_parent_rect) override; diff --git a/firmware/application/tpms_app.cpp b/firmware/application/tpms_app.cpp index 08aeeb88..74cf4c13 100644 --- a/firmware/application/tpms_app.cpp +++ b/firmware/application/tpms_app.cpp @@ -199,7 +199,7 @@ void RecentEntriesView::draw( painter.draw_string(target_rect.pos, draw_style, line); } -TPMSAppView::TPMSAppView() { +TPMSAppView::TPMSAppView(NavigationView&) { add_children({ { &recent_entries_view, } }); diff --git a/firmware/application/tpms_app.hpp b/firmware/application/tpms_app.hpp index a79ebb1e..ce58d0ac 100644 --- a/firmware/application/tpms_app.hpp +++ b/firmware/application/tpms_app.hpp @@ -22,6 +22,8 @@ #ifndef __TPMS_APP_H__ #define __TPMS_APP_H__ +#include "ui_navigation.hpp" + #include "field_reader.hpp" #include "baseband_packet.hpp" #include "manchester.hpp" @@ -195,7 +197,7 @@ using TPMSRecentEntriesView = RecentEntriesView; class TPMSAppView : public View { public: - TPMSAppView(); + TPMSAppView(NavigationView& nav); ~TPMSAppView(); void set_parent_rect(const Rect new_parent_rect) override; diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index 90cacbbf..a92312b5 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -28,6 +28,10 @@ #include "ui_debug.hpp" #include "ui_receiver.hpp" +#include "ais_app.hpp" +#include "ert_app.hpp" +#include "tpms_app.hpp" + #include "m4_startup.hpp" namespace ui { @@ -88,11 +92,30 @@ void NavigationView::focus() { } } +/* TransceiversMenuView **************************************************/ + +TranspondersMenuView::TranspondersMenuView(NavigationView& nav) { + add_items<3>({ { + { "AIS: Boats", [&nav](){ nav.push(); } }, + { "ERT: Utility Meters", [&nav](){ nav.push(); } }, + { "TPMS: Cars", [&nav](){ nav.push(); } }, + } }); +} + +/* ReceiverMenuView ******************************************************/ + +ReceiverMenuView::ReceiverMenuView(NavigationView& nav) { + add_items<2>({ { + { "Audio", [&nav](){ nav.push(); } }, + { "Transponders", [&nav](){ nav.push(); } }, + } }); +} + /* SystemMenuView ********************************************************/ SystemMenuView::SystemMenuView(NavigationView& nav) { add_items<7>({ { - { "Receiver", [&nav](){ nav.push(); } }, + { "Receiver", [&nav](){ nav.push(); } }, { "Capture", [&nav](){ nav.push(); } }, { "Analyze", [&nav](){ nav.push(); } }, { "Setup", [&nav](){ nav.push(); } }, diff --git a/firmware/application/ui_navigation.hpp b/firmware/application/ui_navigation.hpp index 273af656..ca15b11d 100644 --- a/firmware/application/ui_navigation.hpp +++ b/firmware/application/ui_navigation.hpp @@ -76,6 +76,16 @@ private: View* push_view(std::unique_ptr new_view); }; +class TranspondersMenuView : public MenuView { +public: + TranspondersMenuView(NavigationView& nav); +}; + +class ReceiverMenuView : public MenuView { +public: + ReceiverMenuView(NavigationView& nav); +}; + class SystemMenuView : public MenuView { public: SystemMenuView(NavigationView& nav); diff --git a/firmware/application/ui_receiver.cpp b/firmware/application/ui_receiver.cpp index ed13ae83..a5f59584 100644 --- a/firmware/application/ui_receiver.cpp +++ b/firmware/application/ui_receiver.cpp @@ -514,22 +514,10 @@ void ReceiverView::on_modulation_changed(ReceiverModel::Mode mode) { widget_content = std::make_unique(mode); break; - case ReceiverModel::Mode::AIS: - widget_content = std::make_unique(); - break; - case ReceiverModel::Mode::SpectrumAnalysis: widget_content = std::make_unique(); break; - case ReceiverModel::Mode::TPMS: - widget_content = std::make_unique(); - break; - - case ReceiverModel::Mode::ERT: - widget_content = std::make_unique(); - break; - default: break; } diff --git a/firmware/application/ui_receiver.hpp b/firmware/application/ui_receiver.hpp index 922e1f73..131d26e4 100644 --- a/firmware/application/ui_receiver.hpp +++ b/firmware/application/ui_receiver.hpp @@ -407,9 +407,6 @@ private: { " AM ", toUType(ReceiverModel::Mode::AMAudio) }, { "NFM ", toUType(ReceiverModel::Mode::NarrowbandFMAudio) }, { "WFM ", toUType(ReceiverModel::Mode::WidebandFMAudio) }, - { "AIS ", toUType(ReceiverModel::Mode::AIS) }, - { "TPMS", toUType(ReceiverModel::Mode::TPMS) }, - { "ERT", toUType(ReceiverModel::Mode::ERT) }, { "SPEC", toUType(ReceiverModel::Mode::SpectrumAnalysis) }, } };