3djc/x7 outputs (#4273)

[128x64] Rework Outputs screen
[X7] Fix for min/max limits bug
[X7/X9] UI fixes
This commit is contained in:
Andre Bernet
2017-01-24 07:36:40 +01:00
committed by Bertrand Songis
parent 824317c477
commit bf15410bf1
16 changed files with 451 additions and 145 deletions
+21 -10
View File
@@ -108,31 +108,42 @@ void menuModelCurvesAll(event_t event)
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlags flags)
{
coord_t x1 = x;
LcdFlags flags1 = flags;
if (flags & RIGHT) {
x1 -= 6*FW;
flags -= RIGHT;
x1 -= 9*FW;
flags1 -= RIGHT;
}
else {
x += 6*FW;
x += 5*FW;
}
lcdDrawTextAtIndex(x1, y, "\004DiffExpoFuncCstm", curve.type, menuHorizontalPosition==0 ? flags : 0);
if (flags && menuHorizontalPosition==0) {
uint8_t active = (flags & INVERS);
if (menuHorizontalPosition == 0) {
flags = flags & RIGHT;
}
else {
flags1 = 0;
}
lcdDrawTextAtIndex(x1, y, "\004DiffExpoFuncCstm", curve.type, flags1);
if (active && menuHorizontalPosition==0) {
CHECK_INCDEC_MODELVAR_ZERO(event, curve.type, CURVE_REF_CUSTOM);
if (checkIncDec_Ret) curve.value = 0;
}
switch (curve.type) {
case CURVE_REF_DIFF:
case CURVE_REF_EXPO:
curve.value = GVAR_MENU_ITEM(x, y, curve.value, -100, 100, LEFT | (menuHorizontalPosition==1 ? flags : 0), 0, event);
curve.value = GVAR_MENU_ITEM(x, y, curve.value, -100, 100, LEFT | flags, 0, event);
break;
case CURVE_REF_FUNC:
lcdDrawTextAtIndex(x+2*FW, y, STR_VCURVEFUNC, curve.value, RIGHT | (menuHorizontalPosition==1 ? flags : 0));
if (flags && menuHorizontalPosition==1) CHECK_INCDEC_MODELVAR_ZERO(event, curve.value, CURVE_BASE-1);
lcdDrawTextAtIndex(x, y, STR_VCURVEFUNC, curve.value, flags);
if (active && menuHorizontalPosition==1) CHECK_INCDEC_MODELVAR_ZERO(event, curve.value, CURVE_BASE-1);
break;
case CURVE_REF_CUSTOM:
drawCurveName(x+2*FW, y, curve.value, RIGHT | (menuHorizontalPosition==1 ? flags : 0));
if (flags && menuHorizontalPosition==1) {
drawCurveName(x, y, curve.value, flags);
if (active && menuHorizontalPosition==1) {
if (event==EVT_KEY_LONG(KEY_ENTER) && curve.value!=0) {
s_curveChan = (curve.value<0 ? -curve.value-1 : curve.value-1);
pushMenu(menuModelCurveOne);
+3 -3
View File
@@ -158,8 +158,8 @@ void onExposMenu(const char * result)
#define EXPO_LINE_WEIGHT_POS 8*FW+8
#define EXPO_LINE_SRC_POS 9*FW+3
#define EXPO_LINE_CURVE_POS 12*FW+11
#define EXPO_LINE_TRIM_POS 19*FW-4
#define EXPO_LINE_SWITCH_POS 20*FW-1
#define EXPO_LINE_TRIM_POS 19*FW-2
#define EXPO_LINE_SWITCH_POS 20*FW
#define EXPO_LINE_SIDE_POS 25*FW
#define EXPO_LINE_FM_POS 12*FW+11
#define EXPO_LINE_SELECT_POS 5*FW+2
@@ -221,7 +221,7 @@ void displayExpoLine(coord_t y, ExpoData * ed)
else if (!ed->flightModes || ((ed->curve.value || ed->swtch) && ((get_tmr10ms() / 200) & 1)))
displayExpoInfos(y, ed);
else
displayFlightModes(EXPO_LINE_INFOS_POS, y, ed->flightModes);
displayFlightModes(EXPO_LINE_INFOS_POS+9*FWNUM, y, ed->flightModes);
}
#endif
+10 -1
View File
@@ -24,7 +24,7 @@ void drawStringWithIndex(coord_t x, coord_t y, const pm_char * str, uint8_t idx,
{
if (flags & RIGHT) {
lcdDrawNumber(x, y, idx, flags);
lcdDrawText(x-FW, y, str, flags & ~LEADING0);
lcdDrawText(x-FWNUM, y, str, flags & ~LEADING0);
}
else {
lcdDrawText(x, y, str, flags & ~LEADING0);
@@ -180,3 +180,12 @@ void gvarWeightItem(coord_t x, coord_t y, MixData * md, LcdFlags attr, event_t e
weight.word = GVAR_MENU_ITEM(x, y, weight.word, GV_RANGELARGE_WEIGHT_NEG, GV_RANGELARGE_WEIGHT, attr, 0, event);
MD_UNION_TO_WEIGHT(weight, md);
}
#if defined(CPUARM)
void drawGVarName(coord_t x, coord_t y, int8_t idx, LcdFlags flags)
{
char s[8];
getGVarString(s, idx);
lcdDrawText(x, y, s, flags);
}
#endif