kopia lustrzana https://github.com/OpenRTX/OpenRTX
VFO screen cleanup: removed unused options, introduced compressed frequency print and lock icon.
Contribution by tarxvf.pull/200/head
rodzic
7e291fe6fd
commit
7612044d91
|
@ -81,7 +81,7 @@
|
||||||
|
|
||||||
/* UI main screen functions, their implementation is in "ui_main.c" */
|
/* UI main screen functions, their implementation is in "ui_main.c" */
|
||||||
extern void _ui_drawMainBackground();
|
extern void _ui_drawMainBackground();
|
||||||
extern void _ui_drawMainTop();
|
extern void _ui_drawMainTop(ui_state_t* ui_state);
|
||||||
extern void _ui_drawVFOMiddle();
|
extern void _ui_drawVFOMiddle();
|
||||||
extern void _ui_drawMEMMiddle();
|
extern void _ui_drawMEMMiddle();
|
||||||
extern void _ui_drawVFOBottom();
|
extern void _ui_drawVFOBottom();
|
||||||
|
|
|
@ -34,7 +34,7 @@ void _ui_drawMainBackground()
|
||||||
gfx_drawHLine(SCREEN_HEIGHT - layout.bottom_h - 1, layout.hline_h, color_grey);
|
gfx_drawHLine(SCREEN_HEIGHT - layout.bottom_h - 1, layout.hline_h, color_grey);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _ui_drawMainTop()
|
void _ui_drawMainTop(ui_state_t * ui_state)
|
||||||
{
|
{
|
||||||
#ifdef RTC_PRESENT
|
#ifdef RTC_PRESENT
|
||||||
// Print clock on top bar
|
// Print clock on top bar
|
||||||
|
@ -56,22 +56,9 @@ void _ui_drawMainTop()
|
||||||
layout.status_v_pad};
|
layout.status_v_pad};
|
||||||
gfx_drawBattery(bat_pos, bat_width, bat_height, last_state.charge);
|
gfx_drawBattery(bat_pos, bat_width, bat_height, last_state.charge);
|
||||||
#endif
|
#endif
|
||||||
// Print radio mode on top bar
|
if (ui_state->input_locked == true)
|
||||||
switch(last_state.channel.mode)
|
gfx_drawSymbol(layout.top_pos, layout.top_symbol_size, TEXT_ALIGN_LEFT,
|
||||||
{
|
color_white, SYMBOL_LOCK);
|
||||||
case OPMODE_FM:
|
|
||||||
gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_LEFT,
|
|
||||||
color_white, currentLanguage->fm);
|
|
||||||
break;
|
|
||||||
case OPMODE_DMR:
|
|
||||||
gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_LEFT,
|
|
||||||
color_white, currentLanguage->dmr);
|
|
||||||
break;
|
|
||||||
case OPMODE_M17:
|
|
||||||
gfx_print(layout.top_pos, layout.top_font, TEXT_ALIGN_LEFT,
|
|
||||||
color_white, currentLanguage->m17);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _ui_drawBankChannel()
|
void _ui_drawBankChannel()
|
||||||
|
@ -91,18 +78,21 @@ void _ui_drawModeInfo(ui_state_t* ui_state)
|
||||||
switch(last_state.channel.mode)
|
switch(last_state.channel.mode)
|
||||||
{
|
{
|
||||||
case OPMODE_FM:
|
case OPMODE_FM:
|
||||||
|
|
||||||
// Get Bandwidth string
|
// Get Bandwidth string
|
||||||
if(last_state.channel.bandwidth == BW_12_5)
|
if(last_state.channel.bandwidth == BW_12_5)
|
||||||
snprintf(bw_str, 8, "12.5");
|
snprintf(bw_str, 8, "NFM");
|
||||||
else if(last_state.channel.bandwidth == BW_20)
|
else if(last_state.channel.bandwidth == BW_20)
|
||||||
snprintf(bw_str, 8, "20");
|
snprintf(bw_str, 8, "FM20");
|
||||||
else if(last_state.channel.bandwidth == BW_25)
|
else if(last_state.channel.bandwidth == BW_25)
|
||||||
snprintf(bw_str, 8, "25");
|
snprintf(bw_str, 8, "FM");
|
||||||
|
|
||||||
// Get encdec string
|
// Get encdec string
|
||||||
bool tone_tx_enable = last_state.channel.fm.txToneEn;
|
bool tone_tx_enable = last_state.channel.fm.txToneEn;
|
||||||
bool tone_rx_enable = last_state.channel.fm.rxToneEn;
|
bool tone_rx_enable = last_state.channel.fm.rxToneEn;
|
||||||
|
|
||||||
if (tone_tx_enable && tone_rx_enable)
|
if (tone_tx_enable && tone_rx_enable)
|
||||||
snprintf(encdec_str, 9, "E+D");
|
snprintf(encdec_str, 9, "ED");
|
||||||
else if (tone_tx_enable && !tone_rx_enable)
|
else if (tone_tx_enable && !tone_rx_enable)
|
||||||
snprintf(encdec_str, 9, " E");
|
snprintf(encdec_str, 9, " E");
|
||||||
else if (!tone_tx_enable && tone_rx_enable)
|
else if (!tone_tx_enable && tone_rx_enable)
|
||||||
|
@ -111,17 +101,21 @@ void _ui_drawModeInfo(ui_state_t* ui_state)
|
||||||
snprintf(encdec_str, 9, " ");
|
snprintf(encdec_str, 9, " ");
|
||||||
|
|
||||||
// Print Bandwidth, Tone and encdec info
|
// Print Bandwidth, Tone and encdec info
|
||||||
|
if (tone_tx_enable || tone_rx_enable)
|
||||||
gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER,
|
gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER,
|
||||||
color_white, "B:%s T:%4.1f S:%s",
|
color_white, "%s %4.1f %s", bw_str,
|
||||||
bw_str, ctcss_tone[last_state.channel.fm.txTone]/10.0f,
|
ctcss_tone[last_state.channel.fm.txTone]/10.0f, encdec_str);
|
||||||
encdec_str);
|
else
|
||||||
|
gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER,
|
||||||
|
color_white, "%s", bw_str );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPMODE_DMR:
|
case OPMODE_DMR:
|
||||||
// Print talkgroup
|
// Print talkgroup
|
||||||
gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER,
|
gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER,
|
||||||
color_white, "TG:%s",
|
color_white, "DMR TG%s", "");
|
||||||
"");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPMODE_M17:
|
case OPMODE_M17:
|
||||||
{
|
{
|
||||||
// Print M17 Destination ID on line 3 of 3
|
// Print M17 Destination ID on line 3 of 3
|
||||||
|
@ -179,9 +173,8 @@ void _ui_drawModeInfo(ui_state_t* ui_state)
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER,
|
gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER,
|
||||||
color_white, "#%s", dst);
|
color_white, "M17 #%s", dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -189,14 +182,11 @@ void _ui_drawModeInfo(ui_state_t* ui_state)
|
||||||
|
|
||||||
void _ui_drawFrequency()
|
void _ui_drawFrequency()
|
||||||
{
|
{
|
||||||
unsigned long frequency = platform_getPttStatus() ?
|
unsigned long frequency = platform_getPttStatus() ? last_state.channel.tx_frequency
|
||||||
frequency = last_state.channel.tx_frequency : last_state.channel.rx_frequency;
|
: last_state.channel.rx_frequency;
|
||||||
|
|
||||||
// Print big numbers frequency
|
// Print big numbers frequency
|
||||||
gfx_print(layout.line3_large_pos, layout.line3_large_font, TEXT_ALIGN_CENTER,
|
gfx_print(layout.line3_large_pos, layout.line3_large_font, TEXT_ALIGN_CENTER,
|
||||||
color_white, "%03lu.%05lu",
|
color_white, "%.7g", (float) frequency / 1000000.0f);
|
||||||
(unsigned long)frequency/1000000,
|
|
||||||
(unsigned long)frequency%1000000/10);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _ui_drawVFOMiddleInput(ui_state_t* ui_state)
|
void _ui_drawVFOMiddleInput(ui_state_t* ui_state)
|
||||||
|
@ -294,7 +284,7 @@ void _ui_drawMainBottom()
|
||||||
void _ui_drawMainVFO(ui_state_t* ui_state)
|
void _ui_drawMainVFO(ui_state_t* ui_state)
|
||||||
{
|
{
|
||||||
gfx_clearScreen();
|
gfx_clearScreen();
|
||||||
_ui_drawMainTop();
|
_ui_drawMainTop(ui_state);
|
||||||
_ui_drawModeInfo(ui_state);
|
_ui_drawModeInfo(ui_state);
|
||||||
|
|
||||||
// Show VFO frequency if the OpMode is not M17 or there is no valid LSF data
|
// Show VFO frequency if the OpMode is not M17 or there is no valid LSF data
|
||||||
|
@ -308,7 +298,7 @@ void _ui_drawMainVFO(ui_state_t* ui_state)
|
||||||
void _ui_drawMainVFOInput(ui_state_t* ui_state)
|
void _ui_drawMainVFOInput(ui_state_t* ui_state)
|
||||||
{
|
{
|
||||||
gfx_clearScreen();
|
gfx_clearScreen();
|
||||||
_ui_drawMainTop();
|
_ui_drawMainTop(ui_state);
|
||||||
_ui_drawVFOMiddleInput(ui_state);
|
_ui_drawVFOMiddleInput(ui_state);
|
||||||
_ui_drawMainBottom();
|
_ui_drawMainBottom();
|
||||||
}
|
}
|
||||||
|
@ -316,7 +306,7 @@ void _ui_drawMainVFOInput(ui_state_t* ui_state)
|
||||||
void _ui_drawMainMEM(ui_state_t* ui_state)
|
void _ui_drawMainMEM(ui_state_t* ui_state)
|
||||||
{
|
{
|
||||||
gfx_clearScreen();
|
gfx_clearScreen();
|
||||||
_ui_drawMainTop();
|
_ui_drawMainTop(ui_state);
|
||||||
_ui_drawModeInfo(ui_state);
|
_ui_drawModeInfo(ui_state);
|
||||||
|
|
||||||
// Show channel data if the OpMode is not M17 or there is no valid LSF data
|
// Show channel data if the OpMode is not M17 or there is no valid LSF data
|
||||||
|
|
|
@ -1072,6 +1072,10 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
|
||||||
#endif // UI_NO_KEYBOARD
|
#endif // UI_NO_KEYBOARD
|
||||||
gfx_print(layout.line3_large_pos, layout.top_font, TEXT_ALIGN_RIGHT,
|
gfx_print(layout.line3_large_pos, layout.top_font, TEXT_ALIGN_RIGHT,
|
||||||
yellow_fab413, "9 ");
|
yellow_fab413, "9 ");
|
||||||
|
if( ui_state->input_locked == true )
|
||||||
|
gfx_print(layout.line3_large_pos, layout.top_font, TEXT_ALIGN_RIGHT,
|
||||||
|
color_white, "Unlk");
|
||||||
|
else
|
||||||
gfx_print(layout.line3_large_pos, layout.top_font, TEXT_ALIGN_RIGHT,
|
gfx_print(layout.line3_large_pos, layout.top_font, TEXT_ALIGN_RIGHT,
|
||||||
color_white, "Lck");
|
color_white, "Lck");
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue