feat: Model templates for color radios (update SD card for bundled templates) (#1569)

* Model templates - select and load after Create Model for color radios

* Model templates - save model as template, only for color radios

* Small fix to drawTextLines(...) to handle consecutive spaces

* Change title of button for empty template folder

* I found out why "no trailing slash = important" in path names!

* Reworked file and path name string manipulation
No longer using chdir, as Lua scripts etc. could be messing with the working dir
Use buffers more and std::string less

* Adjusting the size of buffers
I think that I got it right now. Really hard to figure out the right size constants!
Also added storageDirty(EE_MODEL) after reading the template file and renaming the model

* Added storage checks

* Slight simplification - all template buttons are similar

* Added "Blank Model" button

* Wizard Lua script
If there is a Lua script with the same name as the template file in the folder, then it is run after reading the template.
This commit is contained in:
Jesper Frickmann
2022-03-09 11:00:38 +10:00
committed by GitHub
parent e0e196a6e6
commit dcc5cfb352
22 changed files with 399 additions and 32 deletions
+6
View File
@@ -780,6 +780,12 @@
#define TR_BAUDRATE "蓝牙带宽"
#define LEN_BLUETOOTH_MODES "\004"
#define TR_BLUETOOTH_MODES "---\0" "回传" "教练"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_SD_INFO_TITLE "存储卡详情"
#define TR_SD_TYPE "类型:"
+6 -1
View File
@@ -812,9 +812,14 @@
#define TR_TIME "Čas"
#define TR_MAXBAUDRATE "Max baudů"
#define TR_SAMPLE_MODE "Sample Mode"
#define LEN_SAMPLE_MODES "\006"
#define TR_SAMPLE_MODES "Normal""OneBit"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_BLUETOOTH "Bluetooth"
#define TR_BLUETOOTH_DISC "Hledat"
+6 -1
View File
@@ -814,9 +814,14 @@
#define TR_TIME "Uhrzeit:"
#define TR_MAXBAUDRATE "Max Baud"
#define TR_SAMPLE_MODE "Sample Mode"
#define LEN_SAMPLE_MODES "\006"
#define TR_SAMPLE_MODES "Normal""OneBit"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_BLUETOOTH "Bluetooth"
#define TR_BLUETOOTH_DISC "Discover"
+6 -1
View File
@@ -818,9 +818,14 @@
#define TR_TIME "Time"
#define TR_MAXBAUDRATE "Max bauds"
#define TR_SAMPLE_MODE "Sample Mode"
#define LEN_SAMPLE_MODES "\006"
#define TR_SAMPLE_MODES "Normal""OneBit"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_BLUETOOTH "Bluetooth"
#define TR_BLUETOOTH_DISC "Discover"
+6 -1
View File
@@ -815,10 +815,15 @@
#define TR_TEMP_CALIB "Temp. Calib"
#define TR_TIME "Hora"
#define TR_MAXBAUDRATE "Máx bauds"
#define TR_SAMPLE_MODE "Modo de muestra"
#define LEN_SAMPLE_MODES "\006"
#define TR_SAMPLE_MODES "Normal""OneBit"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_BLUETOOTH "Bluetooth"
#define TR_BLUETOOTH_DISC "Buscar"
+6 -1
View File
@@ -830,9 +830,14 @@
#define TR_TIME "Time"
#define TR_MAXBAUDRATE "Max bauds"
#define TR_SAMPLE_MODE "Sample Mode"
#define LEN_SAMPLE_MODES "\006"
#define TR_SAMPLE_MODES "Normal""OneBit"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_BLUETOOTH "Bluetooth"
#define TR_BLUETOOTH_DISC "Discover"
+7 -2
View File
@@ -835,9 +835,14 @@
#define TR_TIME "Heure"
#define TR_MAXBAUDRATE "Max bauds"
#define TR_SAMPLE_MODE "Sample Mode"
#define LEN_SAMPLE_MODES "\006"
#define LEN_SAMPLE_MODES "\006"
#define TR_SAMPLE_MODES "Normal""OneBit"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_BLUETOOTH "Bluetooth"
#define TR_BLUETOOTH_DISC "Découvrir"
+6 -1
View File
@@ -836,9 +836,14 @@
#define TR_TIME "Ora"
#define TR_MAXBAUDRATE "Max Bauds"
#define TR_SAMPLE_MODE "Sample Mode"
#define LEN_SAMPLE_MODES "\006"
#define TR_SAMPLE_MODES "Normal""OneBit"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_BLUETOOTH "Bluetooth"
#define TR_BLUETOOTH_DISC "Cerca"
+6 -1
View File
@@ -822,9 +822,14 @@
#define TR_TIME "Tijd:"
#define TR_MAXBAUDRATE "Max bauds"
#define TR_SAMPLE_MODE "Sample Mode"
#define LEN_SAMPLE_MODES "\006"
#define TR_SAMPLE_MODES "Normal""OneBit"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_BLUETOOTH "Bluetooth"
#define TR_BLUETOOTH_DISC "Discover"
+6 -1
View File
@@ -833,9 +833,14 @@
#define TR_TIME "Czas"
#define TR_MAXBAUDRATE "Max bauds"
#define TR_SAMPLE_MODE "Sample Mode"
#define LEN_SAMPLE_MODES "\006"
#define TR_SAMPLE_MODES "Normal""OneBit"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_BLUETOOTH "Bluetooth"
#define TR_BLUETOOTH_DISC "Discover"
+6 -1
View File
@@ -841,9 +841,14 @@
#define TR_TIME "Time"
#define TR_MAXBAUDRATE "Max bauds"
#define TR_SAMPLE_MODE "Sample Mode"
#define LEN_SAMPLE_MODES "\006"
#define TR_SAMPLE_MODES "Normal""OneBit"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_BLUETOOTH "Bluetooth"
#define TR_BLUETOOTH_DISC "Discover"
+6 -1
View File
@@ -841,9 +841,14 @@
#define TR_TIME "Tid "
#define TR_MAXBAUDRATE "Max bauds"
#define TR_SAMPLE_MODE "Sample Mode"
#define LEN_SAMPLE_MODES "\006"
#define TR_SAMPLE_MODES "Normal""OneBit"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_BLUETOOTH "Bluetooth"
#define TR_BLUETOOTH_DISC "Discover"
+9 -2
View File
@@ -768,9 +768,16 @@
#define TR_TEMP_CALIB "溫度校準"
#define TR_TIME "時間"
#define TR_MAXBAUDRATE "最大帶寬"
#define TR_SAMPLE_MODE "Sample Mode"
#define TR_SAMPLE_MODE "Sample Mode"
#define LEN_SAMPLE_MODES "\006"
#define TR_SAMPLE_MODES "Normal""OneBit"
#define TR_SAMPLE_MODES "Normal""OneBit"
#define TR_SELECT_TEMPLATE_FOLDER "SELECT A TEMPLATE FOLDER:"
#define TR_SELECT_TEMPLATE "SELECT A MODEL TEMPLATE:"
#define TR_NO_TEMPLATES "No model templates were found in this folder"
#define TR_SAVE_TEMPLATE "Save as template"
#define TR_FILE_EXISTS "FILE ALREADY EXISTS"
#define TR_ASK_OVERWRITE "Do you want to overwrite?"
#define TR_BLUETOOTH "藍牙"
#define TR_BLUETOOTH_DISC "發現"
#define TR_BLUETOOTH_INIT "初始化"