diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_inver.png b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_inver.png new file mode 100644 index 000000000..64f251238 Binary files /dev/null and b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_inver.png differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_lockch.png b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_lockch.png new file mode 100644 index 000000000..360923a09 Binary files /dev/null and b/radio/sdcard/horus/THEMES/Darkblue/mask_monitor_lockch.png differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_add.png b/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_add.png new file mode 100644 index 000000000..14f4ecc23 Binary files /dev/null and b/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_add.png differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_multi.png b/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_multi.png new file mode 100644 index 000000000..bcf79695f Binary files /dev/null and b/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_multi.png differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_replace.png b/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_replace.png new file mode 100644 index 000000000..faccba0ea Binary files /dev/null and b/radio/sdcard/horus/THEMES/Darkblue/mask_mplex_replace.png differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_mixer.png b/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_mixer.png new file mode 100644 index 000000000..154406419 Binary files /dev/null and b/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_mixer.png differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_output.png b/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_output.png new file mode 100644 index 000000000..12d599823 Binary files /dev/null and b/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_output.png differ diff --git a/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_to.png b/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_to.png new file mode 100644 index 000000000..813610307 Binary files /dev/null and b/radio/sdcard/horus/THEMES/Darkblue/mask_sbar_to.png differ diff --git a/radio/sdcard/horus/THEMES/Default/mask_sbar_mixer.png b/radio/sdcard/horus/THEMES/Default/mask_sbar_mixer.png new file mode 100644 index 000000000..154406419 Binary files /dev/null and b/radio/sdcard/horus/THEMES/Default/mask_sbar_mixer.png differ diff --git a/radio/sdcard/horus/THEMES/Default/mask_sbar_output.png b/radio/sdcard/horus/THEMES/Default/mask_sbar_output.png new file mode 100644 index 000000000..12d599823 Binary files /dev/null and b/radio/sdcard/horus/THEMES/Default/mask_sbar_output.png differ diff --git a/radio/sdcard/horus/THEMES/Default/mask_sbar_to.png b/radio/sdcard/horus/THEMES/Default/mask_sbar_to.png new file mode 100644 index 000000000..813610307 Binary files /dev/null and b/radio/sdcard/horus/THEMES/Default/mask_sbar_to.png differ diff --git a/radio/src/gui/horus/bitmapbuffer.cpp b/radio/src/gui/horus/bitmapbuffer.cpp index 85bd749ff..81207a429 100644 --- a/radio/src/gui/horus/bitmapbuffer.cpp +++ b/radio/src/gui/horus/bitmapbuffer.cpp @@ -507,6 +507,19 @@ BitmapBuffer * BitmapBuffer::loadMask(const char * filename) return bitmap; } +BitmapBuffer * BitmapBuffer::loadMaskOnBackground(const char * filename, LcdFlags foreground, LcdFlags background) +{ + BitmapBuffer * result = NULL; + BitmapBuffer * mask = BitmapBuffer::loadMask(getThemePath(filename)); + if (mask) { + result = new BitmapBuffer(BMP_RGB565, mask->getWidth(), mask->getHeight()); + result->clear(background); + result->drawMask(0, 0, mask, foreground); + delete mask; + } + return result; +} + FIL imgFile __DMA; BitmapBuffer * BitmapBuffer::load_bmp(const char * filename) diff --git a/radio/src/gui/horus/bitmapbuffer.h b/radio/src/gui/horus/bitmapbuffer.h index 5b4c6fa2d..670fa8c17 100644 --- a/radio/src/gui/horus/bitmapbuffer.h +++ b/radio/src/gui/horus/bitmapbuffer.h @@ -177,6 +177,8 @@ class BitmapBuffer: public BitmapBufferBase static BitmapBuffer * load(const char * filename); static BitmapBuffer * loadMask(const char * filename); + + static BitmapBuffer * loadMaskOnBackground(const char * filename, LcdFlags foreground, LcdFlags background); void drawMask(coord_t x, coord_t y, BitmapBuffer * mask, LcdFlags flags, coord_t offset=0, coord_t width=0); diff --git a/radio/src/gui/horus/bitmaps.cpp b/radio/src/gui/horus/bitmaps.cpp index 9cdfe8361..ef14a758c 100644 --- a/radio/src/gui/horus/bitmaps.cpp +++ b/radio/src/gui/horus/bitmaps.cpp @@ -185,3 +185,11 @@ BitmapBuffer * modelselSdFreeBitmap = NULL; BitmapBuffer * modelselModelQtyBitmap = NULL; BitmapBuffer * modelselModelMoveBackground = NULL; BitmapBuffer * modelselModelMoveIcon = NULL; +BitmapBuffer * chanMonLockedBitmap = NULL; +BitmapBuffer * chanMonInvertedBitmap = NULL; +BitmapBuffer * mixerSetupMixerBitmap = NULL; +BitmapBuffer * mixerSetupToBitmap = NULL; +BitmapBuffer * mixerSetupOutputBitmap = NULL; +BitmapBuffer * mixerSetupAddBitmap = NULL; +BitmapBuffer * mixerSetupMultiBitmap = NULL; +BitmapBuffer * mixerSetupReplaceBitmap = NULL; diff --git a/radio/src/gui/horus/bitmaps.h b/radio/src/gui/horus/bitmaps.h index dea1eef29..9d4361f76 100644 --- a/radio/src/gui/horus/bitmaps.h +++ b/radio/src/gui/horus/bitmaps.h @@ -77,4 +77,16 @@ extern BitmapBuffer * modelselModelQtyBitmap; extern BitmapBuffer * modelselModelMoveBackground; extern BitmapBuffer * modelselModelMoveIcon; +// Channels monitor bitmaps +extern BitmapBuffer * chanMonLockedBitmap; +extern BitmapBuffer * chanMonInvertedBitmap; + +// Mixer setup bitmaps +extern BitmapBuffer * mixerSetupMixerBitmap; +extern BitmapBuffer * mixerSetupToBitmap; +extern BitmapBuffer * mixerSetupOutputBitmap; +extern BitmapBuffer * mixerSetupAddBitmap; +extern BitmapBuffer * mixerSetupMultiBitmap; +extern BitmapBuffer * mixerSetupReplaceBitmap; + #endif // _BITMAPS_H_ diff --git a/radio/src/gui/horus/menu_model_mixes.cpp b/radio/src/gui/horus/menu_model_mixes.cpp index 8c4815219..c3645df39 100644 --- a/radio/src/gui/horus/menu_model_mixes.cpp +++ b/radio/src/gui/horus/menu_model_mixes.cpp @@ -272,14 +272,22 @@ bool menuModelMixOne(evt_t event) #define MIX_LINE_WEIGHT_POS 110 #define MIX_LINE_SRC_POS 115 -#define MIX_LINE_CURVE_POS 162 -#define MIX_LINE_SWITCH_POS 210 -#define MIX_LINE_DELAY_POS 255 -#define MIX_LINE_FM_POS 270 -#define MIX_LINE_NAME_POS 384 +#define MIX_LINE_CURVE_POS 165 +#define MIX_LINE_SWITCH_POS 230 +#define MIX_LINE_DELAY_POS 270 +#define MIX_LINE_FM_POS 290 +#define MIX_LINE_NAME_POS 405 #define MIX_LINE_SELECT_POS 50 #define MIX_LINE_SELECT_POS 50 #define MIX_LINE_SELECT_WIDTH (LCD_W-MIX_LINE_SELECT_POS-15) +#define MIX_STATUS_MARGIN_LEFT MENUS_MARGIN_LEFT + 45 +#define MIX_STATUS_ICON_MIXER MENUS_MARGIN_LEFT + 185 +#define MIX_STATUS_ICON_TO MENUS_MARGIN_LEFT + 205 +#define MIX_STATUS_ICON_OUTPUT MENUS_MARGIN_LEFT + 240 +#define MIX_STATUS_OUT_NAME MENUS_MARGIN_LEFT + 265 +#define MIX_STATUS_OUT_BAR MENUS_MARGIN_LEFT + 320 +#define MIX_STATUS_BAR_W 130 +#define MIX_STATUS_BAR_H 13 void lineMixSurround(coord_t y, LcdFlags flags=CURVE_AXIS_COLOR) { @@ -330,8 +338,28 @@ void displayMixLine(coord_t y, MixData *md) displayFlightModes(MIX_LINE_FM_POS, y, md->flightModes, 0); } +void displayMixStatus(uint8_t channel) +{ + lcdDrawNumber(MENUS_MARGIN_LEFT, MENU_FOOTER_TOP, channel + 1, MENU_TITLE_COLOR, 0, "CH", NULL); + drawSingleMixerBar(MIX_STATUS_MARGIN_LEFT, MENU_FOOTER_TOP + 4, MIX_STATUS_BAR_W, MIX_STATUS_BAR_H, channel); + + lcd->drawBitmap(MIX_STATUS_ICON_MIXER, MENU_FOOTER_TOP, mixerSetupMixerBitmap); + lcd->drawBitmap(MIX_STATUS_ICON_TO, MENU_FOOTER_TOP, mixerSetupToBitmap); + lcd->drawBitmap(MIX_STATUS_ICON_OUTPUT, MENU_FOOTER_TOP, mixerSetupOutputBitmap); + + lcdDrawSizedText(MIX_STATUS_OUT_NAME, MENU_FOOTER_TOP, g_model.limitData[channel].name, sizeof(g_model.limitData[channel].name), MENU_TITLE_COLOR | LEFT | ZCHAR); + drawSingleOutputBar(MIX_STATUS_OUT_BAR, MENU_FOOTER_TOP + 4, MIX_STATUS_BAR_W, MIX_STATUS_BAR_H, channel); +} + bool menuModelMixAll(evt_t event) { + BitmapBuffer * mpx_mode[] = { + mixerSetupAddBitmap, + mixerSetupMultiBitmap, + mixerSetupReplaceBitmap + }; + + int sub = menuVerticalPosition; if (s_editMode > 0) { @@ -454,7 +482,7 @@ bool menuModelMixAll(evt_t event) char str[6]; sprintf(str, "%d/%d", getMixesCount(), MAX_MIXERS); - lcdDrawText(MENU_TITLE_NEXT_POS, MENU_TITLE_TOP+2, str, HEADER_COLOR); + lcdDrawText(MENU_TITLE_NEXT_POS, MENU_TITLE_TOP+1, str, HEADER_COLOR); sub = menuVerticalPosition; s_currCh = 0; @@ -482,11 +510,12 @@ bool menuModelMixAll(evt_t event) } else if (sub == cur) { s_currIdx = i; + displayMixStatus(ch - 1); } if (cur-menuVerticalOffset >= 0 && cur-menuVerticalOffset < NUM_BODY_LINES) { LcdFlags attr = ((s_copyMode || sub != cur) ? 0 : INVERS); - if (mixCnt > 0) lcdDrawTextAtIndex(6, y, STR_VMLTPX2, md->mltpx, 0); + if (mixCnt > 0) lcd->drawBitmap(10, y, mpx_mode[md->mltpx]); putsMixerSource(MIX_LINE_SRC_POS, y, md->srcRaw); diff --git a/radio/src/gui/horus/menus.h b/radio/src/gui/horus/menus.h index 1027f6efe..bb0ee42db 100644 --- a/radio/src/gui/horus/menus.h +++ b/radio/src/gui/horus/menus.h @@ -242,6 +242,8 @@ enum EnumTabMonitors extern const MenuHandlerFunc menuTabMonitors[e_MonTabChannelsPagesCount]; extern uint8_t lastMonitorPage; +extern void drawSingleMixerBar(coord_t, coord_t, coord_t, coord_t, uint8_t); +extern void drawSingleOutputBar(coord_t, coord_t, coord_t, coord_t, uint8_t); extern const MenuHandlerFunc menuTabScreensSetup[1+MAX_CUSTOM_SCREENS] PROGMEM; diff --git a/radio/src/gui/horus/themes/darkblue.cpp b/radio/src/gui/horus/themes/darkblue.cpp index d1c60fa48..e1c3eed9c 100644 --- a/radio/src/gui/horus/themes/darkblue.cpp +++ b/radio/src/gui/horus/themes/darkblue.cpp @@ -116,7 +116,34 @@ class DarkblueTheme: public Theme loadMenuIcon(ICON_MONITOR_CHANNELS3, "mask_monitor_channels3.png"); loadMenuIcon(ICON_MONITOR_CHANNELS4, "mask_monitor_channels4.png"); loadMenuIcon(ICON_MONITOR_LOGICAL_SWITCHES, "/mask_monitor_logsw.png"); + + // Channels monitor screen + delete chanMonLockedBitmap; + chanMonLockedBitmap = BitmapBuffer::loadMaskOnBackground("mask_monitor_lockch.png", TEXT_COLOR, TEXT_BGCOLOR); + + delete chanMonInvertedBitmap; + chanMonInvertedBitmap = BitmapBuffer::loadMaskOnBackground("mask_monitor_inver.png", TEXT_COLOR, TEXT_BGCOLOR); + + // Mixer setup screen + delete mixerSetupMixerBitmap; + mixerSetupMixerBitmap = BitmapBuffer::loadMaskOnBackground("mask_sbar_mixer.png", MENU_TITLE_COLOR, HEADER_BGCOLOR); + + delete mixerSetupToBitmap; + mixerSetupToBitmap = BitmapBuffer::loadMaskOnBackground("mask_sbar_to.png", TEXT_BGCOLOR, HEADER_BGCOLOR); + + delete mixerSetupOutputBitmap; + mixerSetupOutputBitmap = BitmapBuffer::loadMaskOnBackground("mask_sbar_output.png", MENU_TITLE_COLOR, HEADER_BGCOLOR); + + delete mixerSetupAddBitmap; + mixerSetupAddBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_add.png", TEXT_COLOR, TEXT_BGCOLOR); + + delete mixerSetupMultiBitmap; + mixerSetupMultiBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_multi.png", TEXT_COLOR, TEXT_BGCOLOR); + + delete mixerSetupReplaceBitmap; + mixerSetupReplaceBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_replace.png", TEXT_COLOR, TEXT_BGCOLOR); } + virtual void load() const { diff --git a/radio/src/gui/horus/themes/default.cpp b/radio/src/gui/horus/themes/default.cpp index 74ef66a15..b8003d8f1 100644 --- a/radio/src/gui/horus/themes/default.cpp +++ b/radio/src/gui/horus/themes/default.cpp @@ -26,19 +26,6 @@ const ZoneOption OPTIONS_THEME_DEFAULT[] = { { NULL, ZoneOption::Bool } }; -BitmapBuffer * loadMaskOnBackground(const char * filename, LcdFlags foreground, LcdFlags background) -{ - BitmapBuffer * result = NULL; - BitmapBuffer * mask = BitmapBuffer::loadMask(getThemePath(filename)); - if (mask) { - result = new BitmapBuffer(BMP_RGB565, mask->getWidth(), mask->getHeight()); - result->clear(background); - result->drawMask(0, 0, mask, foreground); - delete mask; - } - return result; -} - class DefaultTheme: public Theme { public: @@ -158,11 +145,11 @@ class DefaultTheme: public Theme currentMenuBackground->drawMask(10, 39, dot, MENU_TITLE_COLOR); delete topleftBitmap; - topleftBitmap = loadMaskOnBackground("topleft.png", TITLE_BGCOLOR, HEADER_BGCOLOR); + topleftBitmap = BitmapBuffer::loadMaskOnBackground("topleft.png", TITLE_BGCOLOR, HEADER_BGCOLOR); // Model Selection screen delete modelselIconBitmap; - modelselIconBitmap = loadMaskOnBackground("modelsel/mask_iconback.png", TITLE_BGCOLOR, TEXT_BGCOLOR); + modelselIconBitmap = BitmapBuffer::loadMaskOnBackground("modelsel/mask_iconback.png", TITLE_BGCOLOR, TEXT_BGCOLOR); if (modelselIconBitmap) { BitmapBuffer * bitmap = BitmapBuffer::load(getThemePath("modelsel/icon_default.png")); modelselIconBitmap->drawBitmap(25, 8, bitmap); @@ -170,17 +157,43 @@ class DefaultTheme: public Theme } delete modelselSdFreeBitmap; - modelselSdFreeBitmap = loadMaskOnBackground("modelsel/mask_sdfree.png", TEXT_COLOR, TEXT_BGCOLOR); + modelselSdFreeBitmap = BitmapBuffer::loadMaskOnBackground("modelsel/mask_sdfree.png", TEXT_COLOR, TEXT_BGCOLOR); delete modelselModelQtyBitmap; - modelselModelQtyBitmap = loadMaskOnBackground("modelsel/mask_modelqty.png", TEXT_COLOR, TEXT_BGCOLOR); + modelselModelQtyBitmap = BitmapBuffer::loadMaskOnBackground("modelsel/mask_modelqty.png", TEXT_COLOR, TEXT_BGCOLOR); delete modelselModelMoveBackground; modelselModelMoveBackground = BitmapBuffer::loadMask(getThemePath("modelsel/mask_moveback.png")); delete modelselModelMoveIcon; modelselModelMoveIcon = BitmapBuffer::loadMask(getThemePath("modelsel/mask_moveico.png")); + + // Channels monitor screen + delete chanMonLockedBitmap; + chanMonLockedBitmap = BitmapBuffer::loadMaskOnBackground("mask_monitor_lockch.png", TEXT_COLOR, TEXT_BGCOLOR); + + delete chanMonInvertedBitmap; + chanMonInvertedBitmap = BitmapBuffer::loadMaskOnBackground("mask_monitor_inver.png", TEXT_COLOR, TEXT_BGCOLOR); + + // Mixer setup screen + delete mixerSetupMixerBitmap; + mixerSetupMixerBitmap = BitmapBuffer::loadMaskOnBackground("mask_sbar_mixer.png", MENU_TITLE_COLOR, HEADER_BGCOLOR); + + delete mixerSetupToBitmap; + mixerSetupToBitmap = BitmapBuffer::loadMaskOnBackground("mask_sbar_to.png", MENU_TITLE_COLOR, HEADER_BGCOLOR); + delete mixerSetupOutputBitmap; + mixerSetupOutputBitmap = BitmapBuffer::loadMaskOnBackground("mask_sbar_output.png", MENU_TITLE_COLOR, HEADER_BGCOLOR); + + delete mixerSetupAddBitmap; + mixerSetupAddBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_add.png", TEXT_COLOR, TEXT_BGCOLOR); + + delete mixerSetupMultiBitmap; + mixerSetupMultiBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_multi.png", TEXT_COLOR, TEXT_BGCOLOR); + + delete mixerSetupReplaceBitmap; + mixerSetupReplaceBitmap = BitmapBuffer::loadMaskOnBackground("mask_mplex_replace.png", TEXT_COLOR, TEXT_BGCOLOR); + delete background; delete shadow; delete dot; diff --git a/radio/src/gui/horus/view_channels.cpp b/radio/src/gui/horus/view_channels.cpp index b077d0755..a8d25cae5 100644 --- a/radio/src/gui/horus/view_channels.cpp +++ b/radio/src/gui/horus/view_channels.cpp @@ -67,67 +67,85 @@ void drawOutputBarLimits(coord_t left, coord_t right, coord_t y) lcd->drawSolidHorizontalLine(right - 3, y + BAR_HEIGHT - 1, 3, TEXT_COLOR); } -void drawSingleMixerBar(coord_t x, coord_t y, uint8_t chan) +void drawSingleMixerBar(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t channel) { - int16_t chanVal = calcRESXto100(ex_chans[chan]); + int16_t chanVal = calcRESXto100(ex_chans[channel]); + int16_t displayVal = chanVal; + chanVal = limit(-100, chanVal, 100); + + lcdDrawSolidFilledRect(x, y, w, h, BARGRAPH_BGCOLOR); + if (chanVal > 0) { + lcdDrawSolidFilledRect(x + w / 2, y, divRoundClosest(chanVal * w, 200), h, BARGRAPH2_COLOR); + lcdDrawNumber(x - 10 + w / 2, y - 2, displayVal, SMLSIZE | TEXT_COLOR | RIGHT, 0, NULL, "%"); + } + else if (chanVal < 0) { + uint16_t endpoint = x + w / 2; + uint16_t size = divRoundClosest(-chanVal * w, 200); + lcdDrawSolidFilledRect(endpoint - size, y, size, h, BARGRAPH2_COLOR); + lcdDrawNumber(x + 10 + w / 2, y - 2, displayVal, SMLSIZE | TEXT_COLOR, 0, NULL, "%"); + } + + lcd->drawSolidVerticalLine(x + w / 2, y, h, TEXT_COLOR); +} + +void drawSingleOutputBar(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t channel) +{ + int16_t chanVal = calcRESXto100(channelOutputs[channel]); int16_t displayVal = chanVal; chanVal = limit(-100, chanVal, 100); - - lcdDrawSolidFilledRect(x, y, COLUMN_SIZE, BAR_HEIGHT, BARGRAPH_BGCOLOR); + + lcdDrawSolidFilledRect(x, y, w, h, BARGRAPH_BGCOLOR); if (chanVal > 0) { - lcdDrawSolidFilledRect(x + COLUMN_SIZE / 2, y, divRoundClosest(chanVal * COLUMN_SIZE, 200), BAR_HEIGHT, BARGRAPH2_COLOR); - lcdDrawNumber(x - 10 + COLUMN_SIZE / 2, y, displayVal, SMLSIZE | TEXT_COLOR | RIGHT, 0, NULL, "%"); + lcdDrawSolidFilledRect(x + w / 2, y, divRoundClosest(chanVal * w, 200), h, BARGRAPH1_COLOR); + lcdDrawNumber(x - 10 + w / 2, y - 2, displayVal, SMLSIZE | TEXT_COLOR | RIGHT, 0, NULL, "%"); } else if (chanVal < 0) { - uint16_t endpoint = x + COLUMN_SIZE / 2; - uint16_t size = divRoundClosest(-chanVal * COLUMN_SIZE, 200); - lcdDrawSolidFilledRect(endpoint - size, y, size, BAR_HEIGHT, BARGRAPH2_COLOR); - lcdDrawNumber(x + 10 + COLUMN_SIZE / 2, y, displayVal, SMLSIZE | TEXT_COLOR, 0, NULL, "%"); + uint16_t endpoint = x + w / 2; + uint16_t size = divRoundClosest(-chanVal * w, 200); + lcdDrawSolidFilledRect(endpoint - size, y, size, h, BARGRAPH1_COLOR); + lcdDrawNumber(x + 10 + w / 2, y - 2, displayVal, SMLSIZE | TEXT_COLOR, 0, NULL, "%"); } - lcd->drawSolidVerticalLine(x + COLUMN_SIZE / 2, y, BAR_HEIGHT, TEXT_COLOR); + lcd->drawSolidVerticalLine(x + w / 2, y, h, TEXT_COLOR); } -void drawSingleOutputBar(coord_t x, coord_t y, uint8_t channel) +void drawComboOutputBar(coord_t x, coord_t y, coord_t w, coord_t h, uint8_t channel) { char chanString[] = "Ch32 "; uint16_t limits = (g_model.extendedLimits ? 300 : 200); int16_t chanVal = calcRESXto100(channelOutputs[channel]); LimitData * ld = limitAddress(channel); - static const BitmapBuffer * locked_bmp = BitmapBuffer::load(getThemePath("mask_monitor_lockch.png")); - static const BitmapBuffer * inver_bmp = BitmapBuffer::load(getThemePath("mask_monitor_inver.png")); - strAppendSigned(&chanString[2], channel + 1, 2); lcdDrawText(x, y, chanString, SMLSIZE | TEXT_COLOR | LEFT); lcdDrawSizedText(x + 45, y, g_model.limitData[channel].name, sizeof(g_model.limitData[channel].name), SMLSIZE | TEXT_COLOR | LEFT | ZCHAR); int usValue = PPM_CH_CENTER(channel) + channelOutputs[channel] / 2; - lcdDrawNumber(x + COLUMN_SIZE, y, usValue, SMLSIZE | TEXT_COLOR | RIGHT, 0, NULL, STR_US); + lcdDrawNumber(x + w, y, usValue, SMLSIZE | TEXT_COLOR | RIGHT, 0, NULL, STR_US); - lcdDrawSolidFilledRect(x, y + Y_OUTBAR, COLUMN_SIZE, BAR_HEIGHT, BARGRAPH_BGCOLOR); - lcd->drawSolidVerticalLine(x + posOnBar(calcRESXto100(ld->offset)), y + Y_OUTBAR, BAR_HEIGHT, MAINVIEW_GRAPHICS_COLOR); + lcdDrawSolidFilledRect(x, y + Y_OUTBAR, w, h, BARGRAPH_BGCOLOR); + lcd->drawSolidVerticalLine(x + posOnBar(calcRESXto100(ld->offset)), y + Y_OUTBAR, h, MAINVIEW_GRAPHICS_COLOR); if (chanVal > 0) - lcdDrawNumber(x - 10 + COLUMN_SIZE / 2, y + BAR_HEIGHT, chanVal, SMLSIZE | TEXT_COLOR | RIGHT, 0, NULL, "%"); + lcdDrawNumber(x - 10 + w / 2, y + h, chanVal, SMLSIZE | TEXT_COLOR | RIGHT, 0, NULL, "%"); else - lcdDrawNumber(x + 10 + COLUMN_SIZE / 2, y + BAR_HEIGHT, chanVal, SMLSIZE | TEXT_COLOR, 0, NULL, "%"); + lcdDrawNumber(x + 10 + w / 2, y + h, chanVal, SMLSIZE | TEXT_COLOR, 0, NULL, "%"); chanVal = limit(-limits / 2, chanVal, limits / 2); if (posOnBar(chanVal) > posOnBar(calcRESXto100(ld->offset))) { - lcdDrawSolidFilledRect(x + posOnBar(calcRESXto100(ld->offset)), y + Y_OUTBAR, posOnBar(chanVal) - posOnBar(calcRESXto100(ld->offset)), BAR_HEIGHT, BARGRAPH1_COLOR); + lcdDrawSolidFilledRect(x + posOnBar(calcRESXto100(ld->offset)), y + Y_OUTBAR, posOnBar(chanVal) - posOnBar(calcRESXto100(ld->offset)), h, BARGRAPH1_COLOR); } else if (posOnBar(chanVal) < posOnBar(calcRESXto100(ld->offset))) { uint16_t endpoint = x + posOnBar(calcRESXto100(ld->offset)); uint16_t size = posOnBar(calcRESXto100(ld->offset)) - posOnBar(chanVal); - lcdDrawSolidFilledRect(endpoint - size, y + Y_OUTBAR, size, BAR_HEIGHT, BARGRAPH1_COLOR); + lcdDrawSolidFilledRect(endpoint - size, y + Y_OUTBAR, size, h, BARGRAPH1_COLOR); } drawOutputBarLimits(x + posOnBar(-100 + ld->min / 10), x + posOnBar(100 + ld->max / 10), y + Y_OUTBAR); - if (safetyCh[channel] != OVERRIDE_CHANNEL_UNDEFINED) lcd->drawBitmap(x - X_OFFSET + 7, y + 7, locked_bmp); - if (ld->revert) lcd->drawBitmap(x - X_OFFSET + 7, y + 25, inver_bmp); - lcd->drawSolidVerticalLine(x + COLUMN_SIZE / 2, y + Y_OUTBAR, BAR_HEIGHT, TEXT_COLOR); + if (safetyCh[channel] != OVERRIDE_CHANNEL_UNDEFINED) lcd->drawBitmap(x - X_OFFSET + 7, y + 7, chanMonLockedBitmap); + if (ld->revert) lcd->drawBitmap(x - X_OFFSET + 7, y + 25, chanMonInvertedBitmap); + lcd->drawSolidVerticalLine(x + w / 2, y + Y_OUTBAR, h, TEXT_COLOR); } coord_t drawChannelsMonitorLegend(coord_t x, const pm_char * s, int color) @@ -148,14 +166,14 @@ bool menuChannelsMonitor(evt_t event, uint8_t page) x = X_OFFSET; for (uint8_t i = 0; i < 4; i++, channel++, y += ROW_HEIGHT) { - drawSingleOutputBar(x, y, channel); - drawSingleMixerBar(x, y + Y_MIXBAR + 1, channel); + drawComboOutputBar(x, y, COLUMN_SIZE, BAR_HEIGHT, channel); + drawSingleMixerBar(x, y + Y_MIXBAR + 1, COLUMN_SIZE, BAR_HEIGHT, channel); } x = 1 + LCD_W / 2 + X_OFFSET; y = Y_OFFSET; for (uint8_t i = 0; i < 4; i++, channel++, y += ROW_HEIGHT) { - drawSingleOutputBar(x, y, channel); - drawSingleMixerBar(x, y + Y_MIXBAR + 1, channel); + drawComboOutputBar(x, y, COLUMN_SIZE, BAR_HEIGHT, channel); + drawSingleMixerBar(x, y + Y_MIXBAR + 1, COLUMN_SIZE, BAR_HEIGHT, channel); } return true; }