Added menu group for transceivers (#2623)

* Added menu group for transceivers

* Reorder apps icons
This commit is contained in:
Oleg Belousov 2025-04-15 11:46:49 +03:00 committed by GitHub
parent a153cbf30b
commit 806219f46e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 78 additions and 4 deletions

View File

@ -92,6 +92,9 @@ void ExternalModuleView::on_tick_second() {
case app_location_t::TX:
btnText += " (TX)";
break;
case app_location_t::TRX:
btnText += " (TRX)";
break;
case app_location_t::SETTINGS:
btnText += " (Settings)";
break;

View File

@ -4221,6 +4221,44 @@ static constexpr Bitmap bitmap_icon_tpms{
{16, 16},
bitmap_icon_tpms_data};
static constexpr uint8_t bitmap_icon_tranceivers_data[] = {
0x80,
0x01,
0xC0,
0x03,
0xE0,
0x07,
0xB0,
0x0D,
0x98,
0x19,
0x80,
0x01,
0x80,
0x01,
0x80,
0x01,
0x98,
0x19,
0xB0,
0x0D,
0xE0,
0x07,
0xC0,
0x03,
0x83,
0xC1,
0x03,
0xC0,
0xFF,
0xFF,
0xFF,
0xFF,
};
static constexpr Bitmap bitmap_icon_tranceivers{
{16, 16},
bitmap_icon_tranceivers_data};
static constexpr uint8_t bitmap_icon_transmit_data[] = {
0x80,
0x01,

View File

@ -75,7 +75,7 @@ __attribute__((section(".external_app.app_remote.application_information"), used
},
/*.icon_color = */ ui::Color::green().v,
/*.menu_location = */ app_location_t::HOME,
/*.desired_menu_position = */ 4,
/*.desired_menu_position = */ 6,
/*.m4_app_tag = portapack::spi_flash::image_tag_replay */ {'P', 'R', 'E', 'P'},
/*.m4_app_offset = */ 0x00000000, // will be filled at compile time

View File

@ -117,10 +117,10 @@ const NavigationView::AppList NavigationView::appList = {
/* HOME ******************************************************************/
{nullptr, "Receive", HOME, Color::cyan(), &bitmap_icon_receivers, new ViewFactory<ReceiversMenuView>()},
{nullptr, "Transmit", HOME, Color::cyan(), &bitmap_icon_transmit, new ViewFactory<TransmittersMenuView>()},
{nullptr, "Tranceiver", HOME, Color::cyan(), &bitmap_icon_tranceivers, new ViewFactory<TranceiversMenuView>()},
{"recon", "Recon", HOME, Color::green(), &bitmap_icon_scanner, new ViewFactory<ReconView>()},
{"capture", "Capture", HOME, Color::red(), &bitmap_icon_capture, new ViewFactory<CaptureAppView>()},
{"replay", "Replay", HOME, Color::green(), &bitmap_icon_replay, new ViewFactory<PlaylistView>()},
{"recon", "Recon", HOME, Color::green(), &bitmap_icon_scanner, new ViewFactory<ReconView>()},
{"microphone", "Microphone", HOME, Color::green(), &bitmap_icon_microphone, new ViewFactory<MicTXView>()},
{"lookingglass", "Looking Glass", HOME, Color::green(), &bitmap_icon_looking, new ViewFactory<GlassView>()},
{nullptr, "Utilities", HOME, Color::cyan(), &bitmap_icon_utilities, new ViewFactory<UtilitiesMenuView>()},
{nullptr, "Games", HOME, Color::cyan(), &bitmap_icon_games, new ViewFactory<GamesMenuView>()},
@ -147,6 +147,8 @@ const NavigationView::AppList NavigationView::appList = {
{"soundbrd", "Soundbrd", TX, ui::Color::green(), &bitmap_icon_soundboard, new ViewFactory<SoundBoardView>()},
{"touchtune", "TouchTune", TX, ui::Color::green(), &bitmap_icon_touchtunes, new ViewFactory<TouchTunesView>()},
{"signalgen", "SignalGen", TX, Color::green(), &bitmap_icon_cwgen, new ViewFactory<SigGenView>()},
/* TRX ********************************************************************/
{"microphone", "Mic", TRX, Color::green(), &bitmap_icon_microphone, new ViewFactory<MicTXView>()},
/* UTILITIES *************************************************************/
{"filemanager", "File Manager", UTILITIES, Color::green(), &bitmap_icon_dir, new ViewFactory<FileManagerView>()},
{"freqman", "Freq. Manager", UTILITIES, Color::green(), &bitmap_icon_freqman, new ViewFactory<FrequencyManagerView>()},
@ -841,6 +843,20 @@ void TransmittersMenuView::on_populate() {
add_external_items(nav_, app_location_t::TX, *this, return_icon ? 1 : 0);
}
/* TranceiversMenuView **************************************************/
TranceiversMenuView::TranceiversMenuView(NavigationView& nav)
: nav_(nav) {}
void TranceiversMenuView::on_populate() {
bool return_icon = pmem::show_gui_return_icon();
if (return_icon) {
add_items({{"..", Theme::getInstance()->fg_light->foreground, &bitmap_icon_previous, [this]() { nav_.pop(); }}});
}
add_apps(nav_, *this, TRX);
add_external_items(nav_, app_location_t::TRX, *this, return_icon ? 1 : 0);
}
/* UtilitiesMenuView *****************************************************/
UtilitiesMenuView::UtilitiesMenuView(NavigationView& nav)

View File

@ -379,6 +379,16 @@ class TransmittersMenuView : public BtnGridView {
void on_populate() override;
};
class TranceiversMenuView : public BtnGridView {
public:
TranceiversMenuView(NavigationView& nav);
std::string title() const override { return "Tranceiver"; };
private:
NavigationView& nav_;
void on_populate() override;
};
class UtilitiesMenuView : public BtnGridView {
public:
UtilitiesMenuView(NavigationView& nav);

View File

@ -691,6 +691,9 @@ static void printAppInfo(BaseSequentialStream* chp, ui::AppInfoConsole& element)
case TX:
chprintf(chp, "[TX]\r\n");
break;
case TRX:
chprintf(chp, "[TRX]\r\n");
break;
case UTILITIES:
chprintf(chp, "[UTIL]\r\n");
break;
@ -715,6 +718,9 @@ static void printAppInfo(BaseSequentialStream* chp, const ui::AppInfo& element)
case TX:
chprintf(chp, "[TX]\r\n");
break;
case TRX:
chprintf(chp, "[TRX]\r\n");
break;
case UTILITIES:
chprintf(chp, "[UTIL]\r\n");
break;

View File

@ -73,7 +73,8 @@ enum app_location_t : uint32_t {
DEBUG,
HOME,
SETTINGS,
GAMES
GAMES,
TRX
};
struct standalone_application_information_t {

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B