Telemetry "voltages" and "after flight" screens may be overriden by
telempw.lua and telemaf.lua
This commit is contained in:
@@ -47,22 +47,6 @@
|
|||||||
bar_threshold_t barsThresholds[THLD_MAX];
|
bar_threshold_t barsThresholds[THLD_MAX];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum FrskyViews {
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_1)
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_2)
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_3)
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_4)
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_5)
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_6)
|
|
||||||
CASE_LUA(TELEMETRY_LUA_SCREEN_7)
|
|
||||||
TELEMETRY_CUSTOM_SCREEN_1,
|
|
||||||
TELEMETRY_CUSTOM_SCREEN_2,
|
|
||||||
CASE_CPUARM(TELEMETRY_CUSTOM_SCREEN_3)
|
|
||||||
TELEMETRY_VOLTAGES_SCREEN,
|
|
||||||
TELEMETRY_AFTER_FLIGHT_SCREEN,
|
|
||||||
FRSKY_VIEW_MAX = TELEMETRY_AFTER_FLIGHT_SCREEN
|
|
||||||
};
|
|
||||||
|
|
||||||
uint8_t s_frsky_view = 0;
|
uint8_t s_frsky_view = 0;
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
|
|||||||
+26
-12
@@ -1293,8 +1293,16 @@ void getTelemetryScriptPath(char * path, uint8_t index)
|
|||||||
{
|
{
|
||||||
strcpy(path, SCRIPTS_PATH "/");
|
strcpy(path, SCRIPTS_PATH "/");
|
||||||
char * curs = strcat_modelname(path+sizeof(SCRIPTS_PATH), g_eeGeneral.currModel);
|
char * curs = strcat_modelname(path+sizeof(SCRIPTS_PATH), g_eeGeneral.currModel);
|
||||||
strcpy(curs, "/telemX.lua");
|
if (index == TELEMETRY_VOLTAGES_SCREEN) {
|
||||||
curs[6] = '0' + index;
|
strcpy(curs, "/telempw.lua");
|
||||||
|
}
|
||||||
|
else if (index == TELEMETRY_AFTER_FLIGHT_SCREEN) {
|
||||||
|
strcpy(curs, "/telemaf.lua");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
strcpy(curs, "/telemX.lua");
|
||||||
|
curs[6] = '1' + index;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool luaLoadTelemetryScript(uint8_t index)
|
bool luaLoadTelemetryScript(uint8_t index)
|
||||||
@@ -1319,7 +1327,7 @@ bool isTelemetryScriptAvailable(uint8_t index)
|
|||||||
{
|
{
|
||||||
for (int i=0; i<luaScriptsCount; i++) {
|
for (int i=0; i<luaScriptsCount; i++) {
|
||||||
ScriptInternalData & sid = scriptInternalData[i];
|
ScriptInternalData & sid = scriptInternalData[i];
|
||||||
if (sid.reference == SCRIPT_TELEMETRY_FIRST+index+1) {
|
if (sid.reference == SCRIPT_TELEMETRY_FIRST+index) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1340,18 +1348,26 @@ void luaLoadPermanentScripts()
|
|||||||
// Load custom function scripts
|
// Load custom function scripts
|
||||||
for (int i=0; i<NUM_CFN; i++) {
|
for (int i=0; i<NUM_CFN; i++) {
|
||||||
if (!luaLoadFunctionScript(i)) {
|
if (!luaLoadFunctionScript(i)) {
|
||||||
POPUP_WARNING("Too many Lua scripts!"); // TODO translation
|
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load telemetry scripts
|
// Load custom telemetry scripts
|
||||||
for (int i=0; i<MAX_SCRIPTS+1; i++) {
|
for (int i=0; i<MAX_SCRIPTS; i++) {
|
||||||
if (!luaLoadTelemetryScript(i)) {
|
if (!luaLoadTelemetryScript(i)) {
|
||||||
POPUP_WARNING("Too many Lua scripts!"); // TODO translation
|
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!luaLoadTelemetryScript(TELEMETRY_VOLTAGES_SCREEN)) {
|
||||||
|
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!luaLoadTelemetryScript(TELEMETRY_AFTER_FLIGHT_SCREEN)) {
|
||||||
|
POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char lua_warning_str[WARNING_LINE_LEN+1];
|
char lua_warning_str[WARNING_LINE_LEN+1];
|
||||||
@@ -1405,8 +1421,6 @@ void luaExec(const char *filename)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern uint8_t s_frsky_view;
|
|
||||||
|
|
||||||
void luaTask(uint8_t evt)
|
void luaTask(uint8_t evt)
|
||||||
{
|
{
|
||||||
lcd_locked = false;
|
lcd_locked = false;
|
||||||
@@ -1532,7 +1546,7 @@ void luaTask(uint8_t evt)
|
|||||||
#if defined(SIMU) || defined(DEBUG)
|
#if defined(SIMU) || defined(DEBUG)
|
||||||
filename = "[telem]";
|
filename = "[telem]";
|
||||||
#endif
|
#endif
|
||||||
if (g_menuStack[0]==menuTelemetryFrsky && sid.reference==SCRIPT_TELEMETRY_FIRST+s_frsky_view+1) {
|
if (g_menuStack[0]==menuTelemetryFrsky && sid.reference==SCRIPT_TELEMETRY_FIRST+s_frsky_view) {
|
||||||
lua_rawgeti(L, LUA_REGISTRYINDEX, sid.run);
|
lua_rawgeti(L, LUA_REGISTRYINDEX, sid.run);
|
||||||
lua_pushinteger(L, evt);
|
lua_pushinteger(L, evt);
|
||||||
inputsCount = 1;
|
inputsCount = 1;
|
||||||
|
|||||||
@@ -1654,6 +1654,25 @@ extern const pm_uint8_t bchunit_ar[];
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IS_BARS_SCREEN(screenIndex) (g_model.frsky.screensType & (1<<(screenIndex)))
|
#define IS_BARS_SCREEN(screenIndex) (g_model.frsky.screensType & (1<<(screenIndex)))
|
||||||
|
|
||||||
|
enum FrskyViews {
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_1)
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_2)
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_3)
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_4)
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_5)
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_6)
|
||||||
|
CASE_LUA(TELEMETRY_LUA_SCREEN_7)
|
||||||
|
TELEMETRY_CUSTOM_SCREEN_1,
|
||||||
|
TELEMETRY_CUSTOM_SCREEN_2,
|
||||||
|
CASE_CPUARM(TELEMETRY_CUSTOM_SCREEN_3)
|
||||||
|
TELEMETRY_VOLTAGES_SCREEN,
|
||||||
|
TELEMETRY_AFTER_FLIGHT_SCREEN,
|
||||||
|
FRSKY_VIEW_MAX = TELEMETRY_AFTER_FLIGHT_SCREEN
|
||||||
|
};
|
||||||
|
|
||||||
|
extern uint8_t s_frsky_view;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EARTH_RADIUSKM ((uint32_t)6371)
|
#define EARTH_RADIUSKM ((uint32_t)6371)
|
||||||
|
|||||||
@@ -474,6 +474,7 @@ const pm_char STR_FLASH_BOOTLOADER[] PROGMEM = TR_FLASH_BOOTLOADER;
|
|||||||
const pm_char STR_WRITING[] PROGMEM = TR_WRITING;
|
const pm_char STR_WRITING[] PROGMEM = TR_WRITING;
|
||||||
const pm_char STR_CONFIRM_FORMAT[] PROGMEM = TR_CONFIRM_FORMAT;
|
const pm_char STR_CONFIRM_FORMAT[] PROGMEM = TR_CONFIRM_FORMAT;
|
||||||
const pm_char STR_EEBACKUP[] PROGMEM = TR_EEBACKUP;
|
const pm_char STR_EEBACKUP[] PROGMEM = TR_EEBACKUP;
|
||||||
|
const pm_char STR_TOO_MANY_LUA_SCRIPTS[] PROGMEM = TR_TO_MANY_LUA_SCRIPTS;
|
||||||
const pm_char STR_BLCOLOR[] PROGMEM = TR_BLCOLOR;
|
const pm_char STR_BLCOLOR[] PROGMEM = TR_BLCOLOR;
|
||||||
|
|
||||||
#if LCD_W >= 212
|
#if LCD_W >= 212
|
||||||
|
|||||||
@@ -626,6 +626,7 @@ extern const pm_char STR_FLASH_BOOTLOADER[];
|
|||||||
extern const pm_char STR_WRITING[];
|
extern const pm_char STR_WRITING[];
|
||||||
extern const pm_char STR_CONFIRM_FORMAT[];
|
extern const pm_char STR_CONFIRM_FORMAT[];
|
||||||
extern const pm_char STR_EEBACKUP[];
|
extern const pm_char STR_EEBACKUP[];
|
||||||
|
extern const pm_char STR_TOO_MANY_LUA_SCRIPTS[];
|
||||||
extern const pm_char STR_BLCOLOR[];
|
extern const pm_char STR_BLCOLOR[];
|
||||||
|
|
||||||
#if defined(VOICE) && defined(CPUARM)
|
#if defined(VOICE) && defined(CPUARM)
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Vstupy"
|
#define TR_INPUTS "Vstupy"
|
||||||
#define TR_OUTPUTS "Výstupy"
|
#define TR_OUTPUTS "Výstupy"
|
||||||
#define TR_EEBACKUP "\010[dlouze ENTER] zálohuje EEPROM"
|
#define TR_EEBACKUP "\010[dlouze ENTER] zálohuje EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Inputs"
|
#define TR_INPUTS "Inputs"
|
||||||
#define TR_OUTPUTS "Outputs"
|
#define TR_OUTPUTS "Outputs"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Inputs"
|
#define TR_INPUTS "Inputs"
|
||||||
#define TR_OUTPUTS "Outputs"
|
#define TR_OUTPUTS "Outputs"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Inputs"
|
#define TR_INPUTS "Inputs"
|
||||||
#define TR_OUTPUTS "Outputs"
|
#define TR_OUTPUTS "Outputs"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Inputs"
|
#define TR_INPUTS "Inputs"
|
||||||
#define TR_OUTPUTS "Outputs"
|
#define TR_OUTPUTS "Outputs"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Entrées"
|
#define TR_INPUTS "Entrées"
|
||||||
#define TR_OUTPUTS "Sorties"
|
#define TR_OUTPUTS "Sorties"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long]: Sauvegarder l'EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long]: Sauvegarder l'EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "RSSI Max"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "RSSI Max"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Ingresso"
|
#define TR_INPUTS "Ingresso"
|
||||||
#define TR_OUTPUTS "Uscita"
|
#define TR_OUTPUTS "Uscita"
|
||||||
#define TR_EEBACKUP "\004[ENTER Lungo] per copiare la EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Lungo] per copiare la EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Wejścia"
|
#define TR_INPUTS "Wejścia"
|
||||||
#define TR_OUTPUTS "Wyjścia"
|
#define TR_OUTPUTS "Wyjścia"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "MaksRSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "MaksRSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Inputs"
|
#define TR_INPUTS "Inputs"
|
||||||
#define TR_OUTPUTS "Outputs"
|
#define TR_OUTPUTS "Outputs"
|
||||||
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
@@ -814,6 +814,7 @@
|
|||||||
#define TR_INPUTS "Input"
|
#define TR_INPUTS "Input"
|
||||||
#define TR_OUTPUTS "Outputs"
|
#define TR_OUTPUTS "Outputs"
|
||||||
#define TR_EEBACKUP "\004[ENTER Lång] säkerhetskopiera EEPROM"
|
#define TR_EEBACKUP "\004[ENTER Lång] säkerhetskopiera EEPROM"
|
||||||
|
#define TR_TO_MANY_LUA_SCRIPTS "Too many Lua scripts!"
|
||||||
|
|
||||||
#if defined(MAVLINK)
|
#if defined(MAVLINK)
|
||||||
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
#define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI"
|
||||||
|
|||||||
Reference in New Issue
Block a user