3djc/chan mon improve (#3604)
* Prepare for more flexibility (and a much better look) * [Horus] Preparation for a new Channels menu * monitor bar icons added * Add ICONS structure and populate for MONITOR pages * Restore old widget (had used it for temp work), will likely update to the newer look later Functionnal output monitor 1,2, still need extended and overrides * extended limits * Overrides are now managed * Back to Red ;) Add outL outR to hightlight out of limits values * Rewrite of posOnBar, as it was getting overly complex subtrin now fulland more logicaly managed * Fix overrides * Center bar drawn last to be always visible * Limits need to go through extend limits display calculation as well * remove debug printf * Add inverted output icon * Tidy up and cosmetics
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 698 B |
|
After Width: | Height: | Size: 543 B |
|
After Width: | Height: | Size: 530 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 295 B |
|
After Width: | Height: | Size: 299 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
@@ -20,6 +20,15 @@
|
|||||||
|
|
||||||
#include "opentx.h"
|
#include "opentx.h"
|
||||||
|
|
||||||
|
const MenuHandlerFunc menuTabGeneral[] = {
|
||||||
|
menuGeneralSetup,
|
||||||
|
menuGeneralSdManager,
|
||||||
|
menuGeneralCustomFunctions,
|
||||||
|
menuGeneralTrainer,
|
||||||
|
menuGeneralHardware,
|
||||||
|
menuGeneralVersion,
|
||||||
|
};
|
||||||
|
|
||||||
bool menuGeneralCustomFunctions(evt_t event)
|
bool menuGeneralCustomFunctions(evt_t event)
|
||||||
{
|
{
|
||||||
MENU(STR_MENUGLOBALFUNCS, RADIO_ICONS, menuTabGeneral, e_GeneralCustomFunctions, NUM_CFN, { NAVIGATION_LINE_BY_LINE|4/*repeated*/ });
|
MENU(STR_MENUGLOBALFUNCS, RADIO_ICONS, menuTabGeneral, e_GeneralCustomFunctions, NUM_CFN, { NAVIGATION_LINE_BY_LINE|4/*repeated*/ });
|
||||||
|
|||||||
@@ -20,6 +20,27 @@
|
|||||||
|
|
||||||
#include "opentx.h"
|
#include "opentx.h"
|
||||||
|
|
||||||
|
const MenuHandlerFunc menuTabModel[] = {
|
||||||
|
menuModelSetup,
|
||||||
|
CASE_HELI(menuModelHeli)
|
||||||
|
CASE_FLIGHT_MODES(menuModelFlightModesAll)
|
||||||
|
menuModelExposAll,
|
||||||
|
menuModelMixAll,
|
||||||
|
menuModelLimits,
|
||||||
|
CASE_CURVES(menuModelCurvesAll)
|
||||||
|
#if defined(GVARS) && defined(FLIGHT_MODES)
|
||||||
|
CASE_GVARS(menuModelGVars)
|
||||||
|
#endif
|
||||||
|
menuModelLogicalSwitches,
|
||||||
|
menuModelCustomFunctions,
|
||||||
|
#if defined(LUA_MODEL_SCRIPTS)
|
||||||
|
menuModelCustomScripts,
|
||||||
|
#endif
|
||||||
|
CASE_FRSKY(menuModelTelemetry)
|
||||||
|
CASE_MAVLINK(menuTelemetryMavlinkSetup)
|
||||||
|
CASE_TEMPLATES(menuModelTemplates)
|
||||||
|
};
|
||||||
|
|
||||||
extern uint8_t s_curveChan;
|
extern uint8_t s_curveChan;
|
||||||
|
|
||||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, evt_t event, uint8_t attr);
|
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, evt_t event, uint8_t attr);
|
||||||
|
|||||||
@@ -95,6 +95,9 @@ enum MenuIcons {
|
|||||||
ICON_STATS_TIMERS,
|
ICON_STATS_TIMERS,
|
||||||
ICON_STATS_ANALOGS,
|
ICON_STATS_ANALOGS,
|
||||||
ICON_STATS_DEBUG,
|
ICON_STATS_DEBUG,
|
||||||
|
ICON_MONITOR,
|
||||||
|
ICON_MONITOR_OUTPUTS1,
|
||||||
|
ICON_MONITOR_OUTPUTS2,
|
||||||
MENUS_ICONS_COUNT
|
MENUS_ICONS_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -113,6 +116,7 @@ enum EnumTabModel {
|
|||||||
e_CustomScripts,
|
e_CustomScripts,
|
||||||
#endif
|
#endif
|
||||||
CASE_FRSKY(e_Telemetry)
|
CASE_FRSKY(e_Telemetry)
|
||||||
|
e_TabModelPagesCount
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t RADIO_ICONS[] = {
|
const uint8_t RADIO_ICONS[] = {
|
||||||
@@ -153,6 +157,12 @@ const uint8_t STATS_ICONS[] = {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const uint8_t MONITOR_ICONS[] = {
|
||||||
|
ICON_MONITOR,
|
||||||
|
ICON_MONITOR_OUTPUTS1,
|
||||||
|
ICON_MONITOR_OUTPUTS2
|
||||||
|
};
|
||||||
|
|
||||||
bool menuModelSetup(evt_t event);
|
bool menuModelSetup(evt_t event);
|
||||||
bool menuModelHeli(evt_t event);
|
bool menuModelHeli(evt_t event);
|
||||||
bool menuModelFlightModesAll(evt_t event);
|
bool menuModelFlightModesAll(evt_t event);
|
||||||
@@ -168,27 +178,7 @@ bool menuModelCustomScripts(evt_t event);
|
|||||||
bool menuModelTelemetry(evt_t event);
|
bool menuModelTelemetry(evt_t event);
|
||||||
bool menuModelExpoOne(evt_t event);
|
bool menuModelExpoOne(evt_t event);
|
||||||
|
|
||||||
const MenuHandlerFunc menuTabModel[] = {
|
extern const MenuHandlerFunc menuTabModel[e_TabModelPagesCount];
|
||||||
// menuModelSelect,
|
|
||||||
menuModelSetup,
|
|
||||||
CASE_HELI(menuModelHeli)
|
|
||||||
CASE_FLIGHT_MODES(menuModelFlightModesAll)
|
|
||||||
menuModelExposAll,
|
|
||||||
menuModelMixAll,
|
|
||||||
menuModelLimits,
|
|
||||||
CASE_CURVES(menuModelCurvesAll)
|
|
||||||
#if defined(GVARS) && defined(FLIGHT_MODES)
|
|
||||||
CASE_GVARS(menuModelGVars)
|
|
||||||
#endif
|
|
||||||
menuModelLogicalSwitches,
|
|
||||||
menuModelCustomFunctions,
|
|
||||||
#if defined(LUA_MODEL_SCRIPTS)
|
|
||||||
menuModelCustomScripts,
|
|
||||||
#endif
|
|
||||||
CASE_FRSKY(menuModelTelemetry)
|
|
||||||
CASE_MAVLINK(menuTelemetryMavlinkSetup)
|
|
||||||
CASE_TEMPLATES(menuModelTemplates)
|
|
||||||
};
|
|
||||||
|
|
||||||
enum EnumTabRadio {
|
enum EnumTabRadio {
|
||||||
e_Setup,
|
e_Setup,
|
||||||
@@ -197,6 +187,7 @@ enum EnumTabRadio {
|
|||||||
e_Trainer,
|
e_Trainer,
|
||||||
e_Hardware,
|
e_Hardware,
|
||||||
e_Vers,
|
e_Vers,
|
||||||
|
e_TabRadioPagesCount
|
||||||
};
|
};
|
||||||
|
|
||||||
bool menuGeneralSetup(evt_t event);
|
bool menuGeneralSetup(evt_t event);
|
||||||
@@ -207,14 +198,7 @@ bool menuGeneralVersion(evt_t event);
|
|||||||
bool menuGeneralHardware(evt_t event);
|
bool menuGeneralHardware(evt_t event);
|
||||||
bool menuGeneralCalib(evt_t event);
|
bool menuGeneralCalib(evt_t event);
|
||||||
|
|
||||||
static const MenuHandlerFunc menuTabGeneral[] PROGMEM = {
|
extern const MenuHandlerFunc menuTabGeneral[e_TabRadioPagesCount];
|
||||||
menuGeneralSetup,
|
|
||||||
menuGeneralSdManager,
|
|
||||||
menuGeneralCustomFunctions,
|
|
||||||
menuGeneralTrainer,
|
|
||||||
menuGeneralHardware,
|
|
||||||
menuGeneralVersion,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum EnumTabDiag
|
enum EnumTabDiag
|
||||||
{
|
{
|
||||||
@@ -240,6 +224,16 @@ static const MenuHandlerFunc menuTabStats[] PROGMEM = {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum EnumTabChannels
|
||||||
|
{
|
||||||
|
e_Channels1,
|
||||||
|
e_Channels2,
|
||||||
|
e_TabChannelsPagesCount
|
||||||
|
};
|
||||||
|
|
||||||
|
extern const MenuHandlerFunc menuTabChannels[e_TabChannelsPagesCount];
|
||||||
|
extern uint8_t lastChannelsPage;
|
||||||
|
|
||||||
extern const MenuHandlerFunc menuTabScreensSetup[1+MAX_CUSTOM_SCREENS] PROGMEM;
|
extern const MenuHandlerFunc menuTabScreensSetup[1+MAX_CUSTOM_SCREENS] PROGMEM;
|
||||||
|
|
||||||
bool menuFirstCalib(evt_t event);
|
bool menuFirstCalib(evt_t event);
|
||||||
@@ -248,8 +242,6 @@ bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
|||||||
bool menuModelSelect(evt_t event);
|
bool menuModelSelect(evt_t event);
|
||||||
bool menuAboutView(evt_t event);
|
bool menuAboutView(evt_t event);
|
||||||
bool menuMainViewChannelsMonitor(evt_t event);
|
bool menuMainViewChannelsMonitor(evt_t event);
|
||||||
bool menuChannelsView(evt_t event);
|
|
||||||
bool menuChannelsView(evt_t event);
|
|
||||||
bool menuTextView(evt_t event);
|
bool menuTextView(evt_t event);
|
||||||
bool menuScreensTheme(evt_t event);
|
bool menuScreensTheme(evt_t event);
|
||||||
|
|
||||||
|
|||||||
@@ -375,6 +375,12 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u
|
|||||||
{
|
{
|
||||||
uint8_t maxcol = MAXCOL(menuVerticalPosition);
|
uint8_t maxcol = MAXCOL(menuVerticalPosition);
|
||||||
|
|
||||||
|
if (menuTab == menuTabModel && event == EVT_KEY_FIRST(KEY_MODEL)) {
|
||||||
|
killEvents(event);
|
||||||
|
pushMenu(menuTabChannels[lastChannelsPage]);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (menuTab && !calibrationState) {
|
if (menuTab && !calibrationState) {
|
||||||
int cc = curr;
|
int cc = curr;
|
||||||
switch (event) {
|
switch (event) {
|
||||||
@@ -383,7 +389,6 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u
|
|||||||
cc = 0;
|
cc = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case EVT_KEY_FIRST(KEY_PGUP):
|
case EVT_KEY_FIRST(KEY_PGUP):
|
||||||
if (cc-- == 0)
|
if (cc-- == 0)
|
||||||
cc = menuTabSize-1;
|
cc = menuTabSize-1;
|
||||||
|
|||||||
@@ -106,6 +106,9 @@ class DarkblueTheme: public Theme
|
|||||||
loadMenuIcon(ICON_THEME_VIEW4, "mask_theme_view4.png");
|
loadMenuIcon(ICON_THEME_VIEW4, "mask_theme_view4.png");
|
||||||
loadMenuIcon(ICON_THEME_VIEW5, "mask_theme_view5.png");
|
loadMenuIcon(ICON_THEME_VIEW5, "mask_theme_view5.png");
|
||||||
loadMenuIcon(ICON_THEME_ADD_VIEW, "mask_theme_add_view.png");
|
loadMenuIcon(ICON_THEME_ADD_VIEW, "mask_theme_add_view.png");
|
||||||
|
loadMenuIcon(ICON_MONITOR, "mask_monitor.png");
|
||||||
|
loadMenuIcon(ICON_MONITOR_OUTPUTS1, "mask_monitor_outputs1.png");
|
||||||
|
loadMenuIcon(ICON_MONITOR_OUTPUTS2, "mask_monitor_outputs2.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void load() const
|
virtual void load() const
|
||||||
|
|||||||
@@ -122,6 +122,9 @@ class DefaultTheme: public Theme
|
|||||||
loadMenuIcon(ICON_THEME_VIEW5, "mask_theme_view5.png");
|
loadMenuIcon(ICON_THEME_VIEW5, "mask_theme_view5.png");
|
||||||
loadMenuIcon(ICON_THEME_ADD_VIEW, "mask_theme_add_view.png");
|
loadMenuIcon(ICON_THEME_ADD_VIEW, "mask_theme_add_view.png");
|
||||||
loadMenuIcon(ICON_LIBRARY, "mask_library.png");
|
loadMenuIcon(ICON_LIBRARY, "mask_library.png");
|
||||||
|
loadMenuIcon(ICON_MONITOR, "mask_monitor.png");
|
||||||
|
loadMenuIcon(ICON_MONITOR_OUTPUTS1, "mask_monitor_outputs1.png");
|
||||||
|
loadMenuIcon(ICON_MONITOR_OUTPUTS2, "mask_monitor_outputs2.png");
|
||||||
|
|
||||||
BitmapBuffer * background = BitmapBuffer::loadMask(getThemePath("mask_currentmenu_bg.png"));
|
BitmapBuffer * background = BitmapBuffer::loadMask(getThemePath("mask_currentmenu_bg.png"));
|
||||||
BitmapBuffer * shadow = BitmapBuffer::loadMask(getThemePath("mask_currentmenu_shadow.png"));
|
BitmapBuffer * shadow = BitmapBuffer::loadMask(getThemePath("mask_currentmenu_shadow.png"));
|
||||||
|
|||||||
@@ -18,91 +18,122 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../opentx.h"
|
#include "opentx.h"
|
||||||
|
|
||||||
bool isChannelUsed(int channel);
|
#define RECT_OFFSET 80
|
||||||
int getChannelsUsed();
|
#define ROW_HEIGHT 21
|
||||||
|
#define BAR_HEIGHT 10
|
||||||
|
#define COLLUMN_SIZE 180
|
||||||
|
#define X_OFFSET 30
|
||||||
|
#define Y_OFFSET 75
|
||||||
|
|
||||||
bool menuChannelsView(evt_t event)
|
bool menuChannels1(evt_t event);
|
||||||
|
bool menuChannels2(evt_t event);
|
||||||
|
const BitmapBuffer *locked_bmp = NULL;
|
||||||
|
const BitmapBuffer *inver_bmp = NULL;
|
||||||
|
const BitmapBuffer *outL_bmp = NULL;
|
||||||
|
const BitmapBuffer *outR_bmp = NULL;
|
||||||
|
|
||||||
|
const MenuHandlerFunc menuTabChannels[] PROGMEM = {
|
||||||
|
menuChannels1,
|
||||||
|
menuChannels2,
|
||||||
|
};
|
||||||
|
|
||||||
|
uint8_t lastChannelsPage = 0;
|
||||||
|
|
||||||
|
uint16_t posOnBar(int16_t value_to100){
|
||||||
|
return divRoundClosest((value_to100 + (g_model.extendedLimits ? 150 : 100)) * COLLUMN_SIZE, (g_model.extendedLimits ? 150 : 100)*2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void drawSingleOutputBar(uint16_t x, uint16_t y, uint8_t Chan)
|
||||||
{
|
{
|
||||||
const int CHANNEL_MARGIN = 16;
|
char chanString[] = "CH 32";
|
||||||
const int CHANNEL_HEIGHT = 25;
|
uint16_t limits = (g_model.extendedLimits ? 300 : 200);
|
||||||
const int CHANNEL_WIDTH = (LCD_W - 3*CHANNEL_MARGIN) / 2;
|
int16_t chanVal = calcRESXto100(channelOutputs[Chan]);
|
||||||
const int CHANNEL_PADDING_HORZ = 4;
|
LimitData *ld = limitAddress(Chan);
|
||||||
const int CHANNEL_PADDING_VERT = 2;
|
|
||||||
const int BAR_WIDTH = CHANNEL_WIDTH-2*CHANNEL_PADDING_HORZ;
|
|
||||||
|
|
||||||
static int view = 0;
|
if (!locked_bmp) locked_bmp = BitmapBuffer::load(getThemePath("mask_monitor_lockch.png"));
|
||||||
int x=CHANNEL_MARGIN, y=CHANNEL_MARGIN;
|
if (!inver_bmp) inver_bmp = BitmapBuffer::load(getThemePath("mask_monitor_inver.png"));
|
||||||
|
if (!outL_bmp) outL_bmp = BitmapBuffer::load(getThemePath("mask_monitor_outL.png"));
|
||||||
|
if (!outR_bmp) outR_bmp = BitmapBuffer::load(getThemePath("mask_monitor_outR.png"));
|
||||||
|
|
||||||
int viewMax = (getChannelsUsed() - 1) / 8;
|
strAppend(chanString, "Ch ");
|
||||||
if (viewMax <= 0 || view > viewMax) {
|
strAppendSigned(&chanString[3], Chan + 1, 2);
|
||||||
view = 0;
|
lcdDrawText(x + X_OFFSET, y + 1, chanString, TINSIZE | TEXT_COLOR | LEFT);
|
||||||
}
|
|
||||||
else {
|
lcdDrawSizedText(x + X_OFFSET + 50, y + 1, g_model.limitData[Chan].name, sizeof(g_model.limitData[Chan].name), TINSIZE | TEXT_COLOR | LEFT | ZCHAR);
|
||||||
switch (event) {
|
|
||||||
case EVT_KEY_FIRST(KEY_RIGHT):
|
lcdColorTable[CUSTOM_COLOR_INDEX]= RGB(222, 222, 222);
|
||||||
if (++view > viewMax)
|
lcdDrawSolidFilledRect(x + X_OFFSET, y + 11, COLLUMN_SIZE, BAR_HEIGHT, CUSTOM_COLOR);
|
||||||
view = 0;
|
|
||||||
break;
|
lcdColorTable[CUSTOM_COLOR_INDEX]= RGB(180, 180, 180);
|
||||||
case EVT_KEY_FIRST(KEY_LEFT):
|
lcdDrawText(x + X_OFFSET + posOnBar(-100 + ld->min/10)+2, y + 10, "]",TINSIZE| TEXT_COLOR | RIGHT);
|
||||||
if (--view < 0)
|
lcdDrawText(x + X_OFFSET + posOnBar(100 + ld->max/10), y + 10, "[",TINSIZE| TEXT_COLOR);
|
||||||
view = viewMax;
|
|
||||||
break;
|
lcd->drawSolidVerticalLine(x + X_OFFSET + posOnBar(calcRESXto100(ld->offset)), y + 11, BAR_HEIGHT , MAINVIEW_GRAPHICS_COLOR);
|
||||||
}
|
lcd->drawSolidVerticalLine(x + X_OFFSET + posOnBar(chanVal), y + 11, BAR_HEIGHT , HEADER_BGCOLOR);
|
||||||
|
|
||||||
|
strAppendSigned(chanString, chanVal);
|
||||||
|
if (chanVal < -limits / 2) {
|
||||||
|
lcd->drawBitmap(x + X_OFFSET + COLLUMN_SIZE / 2 - 55, y + 8, outL_bmp);
|
||||||
|
chanVal = - limits / 2;
|
||||||
|
lcdDrawText(x + X_OFFSET + COLLUMN_SIZE - 2, y + 1, chanString, TINSIZE | TEXT_COLOR | RIGHT | INVERS);
|
||||||
|
} else if (chanVal > limits / 2){
|
||||||
|
lcd->drawBitmap(x + X_OFFSET + COLLUMN_SIZE / 2 + 55, y + 8, outR_bmp);
|
||||||
|
chanVal = limits / 2;
|
||||||
|
lcdDrawText(x + X_OFFSET + COLLUMN_SIZE - 2, y + 1, chanString, TINSIZE | TEXT_COLOR | RIGHT | INVERS);
|
||||||
|
} else {
|
||||||
|
lcdDrawText(x + X_OFFSET + COLLUMN_SIZE - 2, y + 1, chanString, TINSIZE | TEXT_COLOR | RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
int skipCount = view*8;
|
if(posOnBar(chanVal) > posOnBar(calcRESXto100(ld->offset))){
|
||||||
for (int ch=0, index=0; index<skipCount+8 && ch<NUM_CHNOUT; ++ch) {
|
lcdDrawSolidFilledRect(x + X_OFFSET + posOnBar(calcRESXto100(ld->offset)), y + 11, posOnBar(chanVal) - posOnBar(calcRESXto100(ld->offset)), BAR_HEIGHT, MAINVIEW_GRAPHICS_COLOR);
|
||||||
if (isChannelUsed(ch)) {
|
}
|
||||||
if (++index > skipCount) {
|
else if (posOnBar(chanVal) < posOnBar(calcRESXto100(ld->offset))) {
|
||||||
// The black background
|
uint16_t endpoint = x + X_OFFSET + posOnBar(calcRESXto100(ld->offset));
|
||||||
lcdDrawSolidFilledRect(x, y, CHANNEL_WIDTH, CHANNEL_HEIGHT, TEXT_BGCOLOR);
|
uint16_t size = posOnBar(calcRESXto100(ld->offset)) - posOnBar(chanVal);
|
||||||
|
lcdDrawSolidFilledRect(endpoint - size, y + 11, size, BAR_HEIGHT, MAINVIEW_GRAPHICS_COLOR);
|
||||||
// The label
|
|
||||||
unsigned int lenLabel = ZLEN(g_model.limitData[ch].name);
|
|
||||||
if (lenLabel > 0)
|
|
||||||
lcdDrawSizedText(x+CHANNEL_PADDING_HORZ, y+CHANNEL_PADDING_VERT, g_model.limitData[ch].name, sizeof(g_model.limitData[ch].name), ZCHAR);
|
|
||||||
else
|
|
||||||
putsChn(x+CHANNEL_PADDING_HORZ, y+CHANNEL_PADDING_VERT, ch+1, 0);
|
|
||||||
|
|
||||||
int32_t val = channelOutputs[ch];
|
|
||||||
|
|
||||||
// The bar
|
|
||||||
lcdDrawSolidFilledRect(x+CHANNEL_PADDING_HORZ, y+15, BAR_WIDTH, 6, TEXT_INVERTED_BGCOLOR);
|
|
||||||
unsigned int lim = g_model.extendedLimits ? 640*2 : 512*2;
|
|
||||||
unsigned int len = limit<unsigned int>(1, (abs(val) * BAR_WIDTH/2 + lim/2) / lim, BAR_WIDTH/2);
|
|
||||||
unsigned int x0 = (val>0) ? x+CHANNEL_PADDING_HORZ-1+BAR_WIDTH/2 : x+CHANNEL_PADDING_HORZ+BAR_WIDTH/2+1-len;
|
|
||||||
lcdDrawSolidFilledRect(x0, y+16, len, 4, TEXT_BGCOLOR);
|
|
||||||
|
|
||||||
y += CHANNEL_HEIGHT + CHANNEL_MARGIN;
|
|
||||||
if (y >= 4*(CHANNEL_HEIGHT + CHANNEL_MARGIN)) {
|
|
||||||
x += CHANNEL_WIDTH + CHANNEL_MARGIN;
|
|
||||||
y = CHANNEL_MARGIN;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
if (safetyCh[Chan] != OVERRIDE_CHANNEL_UNDEFINED) lcd->drawBitmap(x + 3, y + 5, locked_bmp);
|
||||||
|
if (ld->revert) lcd->drawBitmap(x + 16, y + 5, inver_bmp);
|
||||||
#if defined(CHANNELS_MONITOR_INV_HIDE)
|
lcd->drawSolidVerticalLine(x + X_OFFSET + COLLUMN_SIZE / 2, y + 11, BAR_HEIGHT , TEXT_COLOR);
|
||||||
//if channel output is inverted, show it with oposite sign
|
}
|
||||||
if (g_model.limitData[ch].revert) val = -val;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Value
|
|
||||||
#if defined(PPM_UNIT_US)
|
|
||||||
uint8_t wbar = (longNames ? 54 : 64);
|
|
||||||
lcdDrawNumber(x+LCD_W/2-3-wbar-ofs, y+1, PPM_CH_CENTER(ch)+val/2, TINSIZE);
|
|
||||||
#elif defined(PPM_UNIT_PERCENT_PREC1)
|
|
||||||
uint8_t wbar = (longNames ? 48 : 58);
|
|
||||||
lcdDrawNumber(x+LCD_W/2-3-wbar-ofs, y+1, calcRESXto1000(val), PREC1|TINSIZE);
|
|
||||||
#else
|
|
||||||
uint8_t wbar = (longNames ? 54 : 64);
|
|
||||||
lcdDrawNumber(x+LCD_W/2-3-wbar-ofs, y+1, calcRESXto1000(val)/10, TINSIZE); // G: Don't like the decimal part*
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
bool menuChannelsMonitor(evt_t event, uint8_t page)
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool menuChannels1(evt_t event)
|
||||||
|
{
|
||||||
|
MENU("Channels monitor 1-16", MONITOR_ICONS, menuTabChannels, e_Channels1, 0, { 0 });
|
||||||
|
lastChannelsPage = e_Channels1;
|
||||||
|
|
||||||
|
int8_t Chan;
|
||||||
|
uint16_t x=0,y=0;
|
||||||
|
for(Chan=0, x=1, y=Y_OFFSET;Chan < 8; Chan++, y+=ROW_HEIGHT){
|
||||||
|
drawSingleOutputBar(x, y, Chan);
|
||||||
|
}
|
||||||
|
for(Chan=8, x=1 + LCD_W/2, y=Y_OFFSET; Chan < 16;Chan++, y+=ROW_HEIGHT){
|
||||||
|
drawSingleOutputBar(x, y, Chan);
|
||||||
|
}
|
||||||
|
return menuChannelsMonitor(event, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool menuChannels2(evt_t event)
|
||||||
|
{
|
||||||
|
MENU("Channels monitor 17-32", MONITOR_ICONS, menuTabChannels, e_Channels2, 0, { 0 });
|
||||||
|
lastChannelsPage = e_Channels2;
|
||||||
|
|
||||||
|
int8_t Chan;
|
||||||
|
uint16_t x,y;
|
||||||
|
for(Chan=16, x=1, y=Y_OFFSET; Chan < 24; Chan++, y+=ROW_HEIGHT){
|
||||||
|
drawSingleOutputBar(x, y, Chan);
|
||||||
|
}
|
||||||
|
for(Chan=24, x=1 + LCD_W/2, y=Y_OFFSET; Chan < 32; Chan++, y+=ROW_HEIGHT){
|
||||||
|
drawSingleOutputBar(x, y, Chan);
|
||||||
|
}
|
||||||
|
|
||||||
|
return menuChannelsMonitor(event, 1);
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
#define MENU_STATS_COLUMN2 (LCD_W/2)
|
#define MENU_STATS_COLUMN2 (LCD_W/2)
|
||||||
#define MENU_STATS_COLUMN3 (LCD_W/2 + 120)
|
#define MENU_STATS_COLUMN3 (LCD_W/2 + 120)
|
||||||
|
|
||||||
|
|
||||||
bool menuStatsGraph(evt_t event)
|
bool menuStatsGraph(evt_t event)
|
||||||
{
|
{
|
||||||
switch(event) {
|
switch(event) {
|
||||||
|
|||||||