Port changes for M17 Call Info to module17

This commit is contained in:
marco 2023-09-09 20:00:31 +02:00 committed by Silvano Seva
parent 7a67768c8d
commit 22afe0ecde
3 changed files with 71 additions and 20 deletions

View File

@ -170,12 +170,17 @@ typedef struct layout_t
point_t line5_pos; point_t line5_pos;
point_t bottom_pos; point_t bottom_pos;
fontSize_t top_font; fontSize_t top_font;
fontSize_t top_symbol_font; symbolSize_t top_symbol_font;
fontSize_t line1_font; fontSize_t line1_font;
symbolSize_t line1_symbol_font;
fontSize_t line2_font; fontSize_t line2_font;
symbolSize_t line2_symbol_font;
fontSize_t line3_font; fontSize_t line3_font;
symbolSize_t line3_symbol_font;
fontSize_t line4_font; fontSize_t line4_font;
symbolSize_t line4_symbol_font;
fontSize_t line5_font; fontSize_t line5_font;
symbolSize_t line5_symbol_font;
fontSize_t bottom_font; fontSize_t bottom_font;
fontSize_t input_font; fontSize_t input_font;
fontSize_t menu_font; fontSize_t menu_font;

View File

@ -228,10 +228,15 @@ layout_t _ui_calculateLayout()
const symbolSize_t top_symbol_size = SYMBOLS_SIZE_6PT; const symbolSize_t top_symbol_size = SYMBOLS_SIZE_6PT;
// Middle line fonts: 5, 8, 8 pt // Middle line fonts: 5, 8, 8 pt
const fontSize_t line1_font = FONT_SIZE_6PT; 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 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 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 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 fontSize_t line5_font = FONT_SIZE_6PT;
const symbolSize_t line5_symbol_size = SYMBOLS_SIZE_6PT;
// Bottom bar font: 6 pt // Bottom bar font: 6 pt
const fontSize_t bottom_font = FONT_SIZE_6PT; const fontSize_t bottom_font = FONT_SIZE_6PT;
// TimeDate/Frequency input font // TimeDate/Frequency input font
@ -277,10 +282,15 @@ layout_t _ui_calculateLayout()
top_font, top_font,
top_symbol_size, top_symbol_size,
line1_font, line1_font,
line1_symbol_size,
line2_font, line2_font,
line2_symbol_size,
line3_font, line3_font,
line3_symbol_size,
line4_font, line4_font,
line4_symbol_size,
line5_font, line5_font,
line5_symbol_size,
bottom_font, bottom_font,
input_font, input_font,
menu_font, menu_font,

View File

@ -63,8 +63,6 @@ void _ui_drawModeInfo(ui_state_t* ui_state)
char bw_str[8] = { 0 }; char bw_str[8] = { 0 };
char encdec_str[9] = { 0 }; char encdec_str[9] = { 0 };
rtxStatus_t cfg = rtx_getCurrentStatus();
switch(last_state.channel.mode) switch(last_state.channel.mode)
{ {
case OPMODE_FM: case OPMODE_FM:
@ -101,25 +99,63 @@ void _ui_drawModeInfo(ui_state_t* ui_state)
break; break;
case OPMODE_M17: case OPMODE_M17:
{ {
char *dst = NULL; rtxStatus_t rtxStatus = rtx_getCurrentStatus();
if(ui_state->edit_mode) if(rtxStatus.lsfOk)
dst = ui_state->new_callsign; {
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 else
dst = (!strnlen(cfg.destination_address, 10)) ? {
"--" : cfg.destination_address; char *dst = NULL;
// Print CAN if(ui_state->edit_mode)
gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_RIGHT, {
color_white, "CAN %02d", state.settings.m17_can); dst = ui_state->new_callsign;
gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER, }
color_white, "LAST"); else
// Print M17 Destination ID on line 2 {
gfx_print(layout.line3_pos, layout.line3_font, TEXT_ALIGN_CENTER, if(strnlen(rtxStatus.destination_address, 10) == 0)
color_white, "%s", dst); dst = "--";
// Menu else
gfx_print(layout.line5_pos, layout.line5_font, TEXT_ALIGN_RIGHT, dst = rtxStatus.destination_address;
color_white, "Menu"); }
break;
// 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;
}
} }
} }
} }