diff --git a/openrtx/include/ui/ui_mod17.h b/openrtx/include/ui/ui_mod17.h index 10f17765..848cb153 100644 --- a/openrtx/include/ui/ui_mod17.h +++ b/openrtx/include/ui/ui_mod17.h @@ -170,12 +170,17 @@ typedef struct layout_t point_t line5_pos; point_t bottom_pos; fontSize_t top_font; - fontSize_t top_symbol_font; + symbolSize_t top_symbol_font; fontSize_t line1_font; + symbolSize_t line1_symbol_font; fontSize_t line2_font; + symbolSize_t line2_symbol_font; fontSize_t line3_font; + symbolSize_t line3_symbol_font; fontSize_t line4_font; + symbolSize_t line4_symbol_font; fontSize_t line5_font; + symbolSize_t line5_symbol_font; fontSize_t bottom_font; fontSize_t input_font; fontSize_t menu_font; diff --git a/openrtx/src/ui/module17/ui.c b/openrtx/src/ui/module17/ui.c index 12fd399e..ea8d209b 100644 --- a/openrtx/src/ui/module17/ui.c +++ b/openrtx/src/ui/module17/ui.c @@ -228,10 +228,15 @@ layout_t _ui_calculateLayout() const symbolSize_t top_symbol_size = SYMBOLS_SIZE_6PT; // Middle line fonts: 5, 8, 8 pt const fontSize_t line1_font = FONT_SIZE_6PT; + const symbolSize_t line1_symbol_size = SYMBOLS_SIZE_6PT; const fontSize_t line2_font = FONT_SIZE_6PT; + const symbolSize_t line2_symbol_size = SYMBOLS_SIZE_6PT; const fontSize_t line3_font = FONT_SIZE_6PT; + const symbolSize_t line3_symbol_size = SYMBOLS_SIZE_6PT; const fontSize_t line4_font = FONT_SIZE_6PT; + const symbolSize_t line4_symbol_size = SYMBOLS_SIZE_6PT; const fontSize_t line5_font = FONT_SIZE_6PT; + const symbolSize_t line5_symbol_size = SYMBOLS_SIZE_6PT; // Bottom bar font: 6 pt const fontSize_t bottom_font = FONT_SIZE_6PT; // TimeDate/Frequency input font @@ -277,10 +282,15 @@ layout_t _ui_calculateLayout() top_font, top_symbol_size, line1_font, + line1_symbol_size, line2_font, + line2_symbol_size, line3_font, + line3_symbol_size, line4_font, + line4_symbol_size, line5_font, + line5_symbol_size, bottom_font, input_font, menu_font, diff --git a/openrtx/src/ui/module17/ui_main.c b/openrtx/src/ui/module17/ui_main.c index b26f73cf..d8d9f915 100644 --- a/openrtx/src/ui/module17/ui_main.c +++ b/openrtx/src/ui/module17/ui_main.c @@ -63,8 +63,6 @@ void _ui_drawModeInfo(ui_state_t* ui_state) char bw_str[8] = { 0 }; char encdec_str[9] = { 0 }; - rtxStatus_t cfg = rtx_getCurrentStatus(); - switch(last_state.channel.mode) { case OPMODE_FM: @@ -101,25 +99,63 @@ void _ui_drawModeInfo(ui_state_t* ui_state) break; case OPMODE_M17: { - char *dst = NULL; + rtxStatus_t rtxStatus = rtx_getCurrentStatus(); - if(ui_state->edit_mode) - dst = ui_state->new_callsign; + if(rtxStatus.lsfOk) + { + gfx_drawSymbol(layout.line2_pos, layout.line2_symbol_font, TEXT_ALIGN_LEFT, + color_white, SYMBOL_CALL_RECEIVED); + gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER, + color_white, "%s", rtxStatus.M17_dst); + gfx_drawSymbol(layout.line1_pos, layout.line1_symbol_font, TEXT_ALIGN_LEFT, + color_white, SYMBOL_CALL_MADE); + gfx_print(layout.line1_pos, layout.line2_font, TEXT_ALIGN_CENTER, + color_white, "%s", rtxStatus.M17_src); + + if(rtxStatus.M17_orig[0] != '\0') + { + gfx_drawSymbol(layout.line4_pos, layout.line3_symbol_font, TEXT_ALIGN_LEFT, + color_white, SYMBOL_ACCESS_POINT); + gfx_print(layout.line4_pos, layout.line2_font, TEXT_ALIGN_CENTER, + color_white, "%s", rtxStatus.M17_orig); + } + + if(rtxStatus.M17_refl[0] != '\0') + { + gfx_drawSymbol(layout.line3_pos, layout.line4_symbol_font, TEXT_ALIGN_LEFT, + color_white, SYMBOL_NETWORK); + gfx_print(layout.line3_pos, layout.line2_font, TEXT_ALIGN_CENTER, + color_white, "%s", rtxStatus.M17_refl); + } + } else - dst = (!strnlen(cfg.destination_address, 10)) ? - "--" : cfg.destination_address; - // Print CAN - gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_RIGHT, - color_white, "CAN %02d", state.settings.m17_can); - gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER, - color_white, "LAST"); - // Print M17 Destination ID on line 2 - gfx_print(layout.line3_pos, layout.line3_font, TEXT_ALIGN_CENTER, - color_white, "%s", dst); - // Menu - gfx_print(layout.line5_pos, layout.line5_font, TEXT_ALIGN_RIGHT, - color_white, "Menu"); - break; + { + char *dst = NULL; + if(ui_state->edit_mode) + { + dst = ui_state->new_callsign; + } + else + { + if(strnlen(rtxStatus.destination_address, 10) == 0) + dst = "--"; + else + dst = rtxStatus.destination_address; + } + + // Print CAN + gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_RIGHT, + color_white, "CAN %02d", state.settings.m17_can); + gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER, + color_white, "LAST"); + // Print M17 Destination ID on line 2 + gfx_print(layout.line3_pos, layout.line3_font, TEXT_ALIGN_CENTER, + color_white, "%s", dst); + // Menu + gfx_print(layout.line5_pos, layout.line5_font, TEXT_ALIGN_RIGHT, + color_white, "Menu"); + break; + } } } }