[Radio] Adjust value limits for mix sources and update UI for LSs, CFs & telem. (#5445)

* [firmware][ARM] Adjust some value limits for mix sources and update editing UI for LSs, CFs, & telem. bars:
    * Increase timer limits to +/-8:59:59 when used with LSs, CFs, & bars;
    * Increase Lua script output limits to +/-30K;
    * Trim limits based on extended limit model setting;
    * Limit TX voltage to 25.5;
    * Limit TX time comparison value to 29:59m;
    * Use proper GVar limits (user-configured), display precision, & unit in LSs & telem. bars;
    * Display timer values properly with hours (instead of mmm:ss).

* [firmware] getTimerString() would fail with times >= 100min if hours weren't shown.

* Fix builds w/out GVars.
This commit is contained in:
Max Paperno
2017-12-19 12:17:12 +01:00
committed by Bertrand Songis
parent 716a91fc0c
commit b69f36afe4
11 changed files with 134 additions and 101 deletions
@@ -115,9 +115,10 @@ void menuModelLogicalSwitches(event_t event)
// CSW params
unsigned int cstate = lswFamily(cs->func);
int v1_val=cs->v1, v1_min=0, v1_max=MIXSRC_LAST_TELEM;
int v2_min=0, v2_max=MIXSRC_LAST_TELEM;
int v3_min=-1, v3_max=100;
int v1_val = cs->v1;
int16_t v1_min = 0, v1_max = MIXSRC_LAST_TELEM;
int16_t v2_min = 0, v2_max = MIXSRC_LAST_TELEM;
int16_t v3_min =-1, v3_max = 100;
if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY) {
drawSwitch(CSW_2ND_COLUMN, y, cs->v1, attr1);
@@ -168,14 +169,9 @@ void menuModelLogicalSwitches(event_t event)
INCDEC_SET_FLAG(EE_MODEL);
INCDEC_ENABLE_CHECK(NULL);
}
v2_max = getMaximumValue(v1_val);
v2_min = - v2_max;
if (v1_val <= MIXSRC_LAST_CH) {
drawSourceCustomValue(CSW_3RD_COLUMN, y, v1_val, calc100toRESX(cs->v2), LEFT|attr2);
}
else {
drawSourceCustomValue(CSW_3RD_COLUMN, y, v1_val, cs->v2, LEFT|attr2);
}
LcdFlags lf = attr2 | LEFT;
getMixSrcRange(v1_val, v2_min, v2_max, &lf);
drawSourceCustomValue(CSW_3RD_COLUMN, y, v1_val, (v1_val <= MIXSRC_LAST_CH ? calc100toRESX(cs->v2) : cs->v2), lf);
}
// CSW AND switch