mirror of
https://github.com/opentx/opentx.git
synced 2025-07-17 13:25:20 +03:00
Problem in Failsafe HOLD / NONE strings
This commit is contained in:
parent
cf5cb10d6f
commit
c08417415b
15 changed files with 34 additions and 9 deletions
|
@ -342,8 +342,8 @@ enum TelemetryScreenType {
|
|||
#define TELEMETRY_SCREEN_TYPE(screenIndex) TelemetryScreenType((g_model.screensType >> (2*(screenIndex))) & 0x03)
|
||||
#define IS_BARS_SCREEN(screenIndex) (TELEMETRY_SCREEN_TYPE(screenIndex) == TELEMETRY_SCREEN_TYPE_GAUGES)
|
||||
|
||||
#define FAILSAFE_CHANNEL_HOLD 2000
|
||||
#define FAILSAFE_CHANNEL_NOPULSE 2001
|
||||
constexpr int16_t FAILSAFE_CHANNEL_HOLD = 2000;
|
||||
constexpr int16_t FAILSAFE_CHANNEL_NOPULSE = 2001;
|
||||
|
||||
#define LEN_SCRIPT_FILENAME 6
|
||||
#define LEN_SCRIPT_NAME 6
|
||||
|
|
|
@ -64,7 +64,7 @@ void menuModelFailsafe(event_t event)
|
|||
wbar -= 6;
|
||||
#endif
|
||||
|
||||
if (sub==k && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
|
||||
if (sub == k && !READ_ONLY() && event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
killEvents(event);
|
||||
POPUP_MENU_ADD_ITEM(STR_NONE);
|
||||
POPUP_MENU_ADD_ITEM(STR_HOLD);
|
||||
|
@ -73,9 +73,6 @@ void menuModelFailsafe(event_t event)
|
|||
POPUP_MENU_START(onFailsafeMenu);
|
||||
}
|
||||
|
||||
const int32_t channelValue = channelOutputs[k];
|
||||
int32_t failsafeValue = g_model.failsafeChannels[k];
|
||||
|
||||
// Channel
|
||||
putsChn(0, y, k + 1, SMLSIZE);
|
||||
|
||||
|
@ -85,20 +82,22 @@ void menuModelFailsafe(event_t event)
|
|||
flags |= INVERS;
|
||||
if (s_editMode > 0) {
|
||||
flags |= BLINK;
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.failsafeChannels[k], -lim, +lim);
|
||||
if (g_model.failsafeChannels[k] > +lim && g_model.failsafeChannels[k] < FAILSAFE_CHANNEL_HOLD) {
|
||||
g_model.failsafeChannels[k] = 0; // switching from HOLD/NOPULSE to value edit
|
||||
}
|
||||
CHECK_INCDEC_MODELVAR(event, g_model.failsafeChannels[k], -lim, +lim);
|
||||
}
|
||||
}
|
||||
|
||||
const int32_t channelValue = channelOutputs[k];
|
||||
int32_t failsafeValue = g_model.failsafeChannels[k];
|
||||
const coord_t xValue = x+LCD_W-4-wbar;
|
||||
if (failsafeValue == FAILSAFE_CHANNEL_HOLD) {
|
||||
lcdDrawText(xValue, y, STR_HOLD, RIGHT|flags);
|
||||
lcdDrawText(xValue, y, STR_HOLD_UPPERCASE, RIGHT|flags);
|
||||
failsafeValue = 0;
|
||||
}
|
||||
else if (failsafeValue == FAILSAFE_CHANNEL_NOPULSE) {
|
||||
lcdDrawText(xValue, y, STR_NONE, RIGHT|flags);
|
||||
lcdDrawText(xValue, y, STR_NONE_UPPERCASE, RIGHT|flags);
|
||||
failsafeValue = 0;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -262,7 +262,9 @@ const char STR_FAILSAFESET[] = TR_FAILSAFESET;
|
|||
const char STR_REG_ID[] = TR_REG_ID;
|
||||
const char STR_OWNER_ID[] = TR_OWNER_ID;
|
||||
const char STR_HOLD[] = TR_HOLD;
|
||||
const char STR_HOLD_UPPERCASE[] = TR_HOLD_UPPERCASE;
|
||||
const char STR_NONE[] = TR_NONE;
|
||||
const char STR_NONE_UPPERCASE[] = TR_NONE_UPPERCASE;
|
||||
const char STR_MENUSENSOR[] = TR_MENUSENSOR;
|
||||
const char STR_POWERMETER_PEAK[] = TR_POWERMETER_PEAK;
|
||||
const char STR_POWERMETER_POWER[] = TR_POWERMETER_POWER;
|
||||
|
|
|
@ -420,7 +420,9 @@ extern const char STR_RECEIVER[];
|
|||
extern const char STR_REG_ID[];
|
||||
extern const char STR_OWNER_ID[];
|
||||
extern const char STR_HOLD[];
|
||||
extern const char STR_HOLD_UPPERCASE[];
|
||||
extern const char STR_NONE[];
|
||||
extern const char STR_NONE_UPPERCASE[];
|
||||
extern const char STR_MENUSENSOR[];
|
||||
extern const char STR_POWERMETER_PEAK[];
|
||||
extern const char STR_POWERMETER_POWER[];
|
||||
|
|
|
@ -906,7 +906,9 @@
|
|||
#define TR_OWNER_ID "ID vlastníka"
|
||||
#define TR_PINMAPSET "PINMAP"
|
||||
#define TR_HOLD "DRŽET"
|
||||
#define TR_HOLD_UPPERCASE "HOLD"
|
||||
#define TR_NONE "NIC"
|
||||
#define TR_NONE_UPPERCASE "NONE"
|
||||
#define TR_MENUSENSOR "SENZOR"
|
||||
#define TR_POWERMETER_PEAK "Špička"
|
||||
#define TR_POWERMETER_POWER "Výkon"
|
||||
|
|
|
@ -913,7 +913,9 @@
|
|||
#define TR_OWNER_ID "Owner ID"
|
||||
#define TR_PINMAPSET "PINMAP"
|
||||
#define TR_HOLD "Hold"
|
||||
#define TR_HOLD_UPPERCASE "HOLD"
|
||||
#define TR_NONE "None"
|
||||
#define TR_NONE_UPPERCASE "NONE"
|
||||
#define TR_MENUSENSOR "SENSOR"
|
||||
#define TR_POWERMETER_PEAK "Peak"
|
||||
#define TR_POWERMETER_POWER "Power"
|
||||
|
|
|
@ -908,7 +908,9 @@
|
|||
#define TR_OWNER_ID "Owner ID"
|
||||
#define TR_PINMAPSET "PINMAP"
|
||||
#define TR_HOLD "Hold"
|
||||
#define TR_HOLD_UPPERCASE "HOLD"
|
||||
#define TR_NONE "None"
|
||||
#define TR_NONE_UPPERCASE "NONE"
|
||||
#define TR_MENUSENSOR "SENSOR"
|
||||
#define TR_POWERMETER_PEAK "Peak"
|
||||
#define TR_POWERMETER_POWER "Power"
|
||||
|
|
|
@ -917,7 +917,9 @@
|
|||
#define TR_OWNER_ID "Owner ID"
|
||||
#define TR_PINMAPSET "PINMAP"
|
||||
#define TR_HOLD "Hold"
|
||||
#define TR_HOLD_UPPERCASE "HOLD"
|
||||
#define TR_NONE "None"
|
||||
#define TR_NONE_UPPERCASE "NONE"
|
||||
#define TR_MENUSENSOR "SENSOR"
|
||||
#define TR_POWERMETER_PEAK "Peak"
|
||||
#define TR_POWERMETER_POWER "Power"
|
||||
|
|
|
@ -910,7 +910,9 @@
|
|||
#define TR_OWNER_ID "Owner ID"
|
||||
#define TR_PINMAPSET "PINMAP"
|
||||
#define TR_HOLD "Hold"
|
||||
#define TR_HOLD_UPPERCASE "HOLD"
|
||||
#define TR_NONE "None"
|
||||
#define TR_NONE_UPPERCASE "NONE"
|
||||
#define TR_MENUSENSOR "SENSOR"
|
||||
#define TR_POWERMETER_PEAK "Peak"
|
||||
#define TR_POWERMETER_POWER "Power"
|
||||
|
|
|
@ -923,7 +923,9 @@
|
|||
#define TR_OWNER_ID "ID Radio"
|
||||
#define TR_PINMAPSET "PINMAP"
|
||||
#define TR_HOLD "Hold"
|
||||
#define TR_HOLD_UPPERCASE "HOLD"
|
||||
#define TR_NONE "None"
|
||||
#define TR_NONE_UPPERCASE "NONE"
|
||||
#define TR_MENUSENSOR "CAPTEUR"
|
||||
#define TR_POWERMETER_PEAK "Pic"
|
||||
#define TR_POWERMETER_POWER "Puiss"
|
||||
|
|
|
@ -911,7 +911,9 @@
|
|||
#define TR_OWNER_ID "Owner ID"
|
||||
#define TR_PINMAPSET "PINMAP"
|
||||
#define TR_HOLD "Hold"
|
||||
#define TR_HOLD_UPPERCASE "HOLD"
|
||||
#define TR_NONE "None"
|
||||
#define TR_NONE_UPPERCASE "NONE"
|
||||
#define TR_MENUSENSOR "SENSOR"
|
||||
#define TR_POWERMETER_PEAK "Peak"
|
||||
#define TR_POWERMETER_POWER "Power"
|
||||
|
|
|
@ -911,7 +911,9 @@ TR_GYR_VSRCRAW
|
|||
#define TR_OWNER_ID "Owner ID"
|
||||
#define TR_PINMAPSET "PINMAP"
|
||||
#define TR_HOLD "Hold"
|
||||
#define TR_HOLD_UPPERCASE "HOLD"
|
||||
#define TR_NONE "None"
|
||||
#define TR_NONE_UPPERCASE "NONE"
|
||||
#define TR_MENUSENSOR "SENSOR"
|
||||
#define TR_POWERMETER_PEAK "Peak"
|
||||
#define TR_POWERMETER_POWER "Power"
|
||||
|
|
|
@ -911,7 +911,9 @@
|
|||
#define TR_OWNER_ID "Owner ID"
|
||||
#define TR_PINMAPSET "PINMAP"
|
||||
#define TR_HOLD "Hold"
|
||||
#define TR_HOLD_UPPERCASE "HOLD"
|
||||
#define TR_NONE "None"
|
||||
#define TR_NONE_UPPERCASE "NONE"
|
||||
#define TR_MENUSENSOR "CZUJNIK"
|
||||
#define TR_POWERMETER_PEAK "Peak"
|
||||
#define TR_POWERMETER_POWER "Power"
|
||||
|
|
|
@ -915,7 +915,9 @@
|
|||
#define TR_OWNER_ID "Owner ID"
|
||||
#define TR_PINMAPSET "PINMAP"
|
||||
#define TR_HOLD "Hold"
|
||||
#define TR_HOLD_UPPERCASE "HOLD"
|
||||
#define TR_NONE "None"
|
||||
#define TR_NONE_UPPERCASE "NONE"
|
||||
#define TR_MENUSENSOR "SENSOR"
|
||||
#define TR_POWERMETER_PEAK "Peak"
|
||||
#define TR_POWERMETER_POWER "Power"
|
||||
|
|
|
@ -922,7 +922,9 @@
|
|||
#define TR_OWNER_ID "Owner ID"
|
||||
#define TR_PINMAPSET "PINMAP"
|
||||
#define TR_HOLD "Hold"
|
||||
#define TR_HOLD_UPPERCASE "HOLD"
|
||||
#define TR_NONE "None"
|
||||
#define TR_NONE_UPPERCASE "NONE"
|
||||
#define TR_MENUSENSOR "SENSOR"
|
||||
#define TR_POWERMETER_PEAK "Peak"
|
||||
#define TR_POWERMETER_POWER "Power"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue