[X9D] Navigation reworked
This commit is contained in:
+16
-16
@@ -48,44 +48,44 @@ void menuChannelsMonitor(uint8_t event)
|
||||
lcd_putsCenter(0*FH, CHANNELS_MONITOR);
|
||||
lcd_invert_line(0);
|
||||
|
||||
// Column separator
|
||||
lcd_vline(LCD_W/2+1, FH, LCD_H-FH);
|
||||
|
||||
uint8_t ch = 0;
|
||||
|
||||
for (uint8_t col=0; col<2; col++) {
|
||||
|
||||
uint8_t x = col*LCD_W/2+1;
|
||||
|
||||
// Column separator
|
||||
if (col == 1)
|
||||
lcd_vline(x-1, FH, LCD_H-FH);
|
||||
|
||||
// Channels
|
||||
for (uint8_t line=0; line<8; line++) {
|
||||
uint8_t y = 9+line*7;
|
||||
int16_t val = g_chans512[ch];
|
||||
int32_t val = g_chans512[ch];
|
||||
uint8_t ofs = (col ? 0 : 1);
|
||||
|
||||
// Channel name if present, number if not
|
||||
if (*g_model.limitData[ch].name != '\0')
|
||||
uint8_t lenLabel = zlen(g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name));
|
||||
if (lenLabel > 0)
|
||||
lcd_putsnAtt(x+1-ofs, y, g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name), ZCHAR | SMLSIZE);
|
||||
else {
|
||||
else
|
||||
putsChn(x+1-ofs, y, ch+1, SMLSIZE);
|
||||
}
|
||||
lcd_outdezNAtt(x+18+37-ofs, y+1, calcRESXto1000(val), PREC1 | TINSIZE);
|
||||
|
||||
#define WBAR 48
|
||||
uint8_t wbar = (lenLabel > 4 ? 48 : 58);
|
||||
|
||||
lcd_rect(x+18+37-ofs, y, WBAR+2, 6);
|
||||
// Value
|
||||
lcd_outdezNAtt(x+LCD_W/2-3-wbar-ofs, y+1, calcRESXto1000(val), PREC1 | TINSIZE);
|
||||
|
||||
// Gauge
|
||||
lcd_rect(x+LCD_W/2-3-wbar-ofs, y, wbar+1, 6);
|
||||
uint16_t lim = g_model.extendedLimits ? 640*2 : 512*2;
|
||||
uint8_t len = limit((uint8_t)1, uint8_t((abs(val) * WBAR/2 + lim/2) / lim), uint8_t(WBAR/2));
|
||||
uint8_t x0 = (val>0) ? x+19+WBAR/2 : x+19+WBAR/2-len;
|
||||
x0 = x0 + 37 - ofs;
|
||||
uint8_t len = limit((uint8_t)1, uint8_t((abs(val) * wbar/2 + lim/2) / lim), uint8_t(wbar/2));
|
||||
uint8_t x0 = (val>0) ? x+LCD_W/2-ofs-3-wbar/2 : x+LCD_W/2-ofs-2-wbar/2-len;
|
||||
lcd_hline(x0, y+1, len);
|
||||
lcd_hline(x0, y+2, len);
|
||||
lcd_hline(x0, y+3, len);
|
||||
lcd_hline(x0, y+4, len);
|
||||
ch++;
|
||||
|
||||
#undef WBAR
|
||||
ch++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user