mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Fix Debug menu translation
This commit is contained in:
@@ -4,6 +4,7 @@ from __future__ import print_function
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import io
|
import io
|
||||||
|
from datetime import datetime
|
||||||
import sys
|
import sys
|
||||||
import fontTables
|
import fontTables
|
||||||
TRANSLATION_CPP = "Translation.cpp"
|
TRANSLATION_CPP = "Translation.cpp"
|
||||||
@@ -115,6 +116,21 @@ def getTipModelEnumTS100():
|
|||||||
constants.append("User")
|
constants.append("User")
|
||||||
return constants
|
return constants
|
||||||
|
|
||||||
|
def getDebugMenu():
|
||||||
|
constants = []
|
||||||
|
constants.append(datetime.today().strftime('%d-%m-%y'))
|
||||||
|
constants.append("HW G ")
|
||||||
|
constants.append("HW M ")
|
||||||
|
constants.append("HW P ")
|
||||||
|
constants.append("Time ")
|
||||||
|
constants.append("Move ")
|
||||||
|
constants.append("RTip ")
|
||||||
|
constants.append("CTip ")
|
||||||
|
constants.append("CHan ")
|
||||||
|
constants.append("Vin ")
|
||||||
|
constants.append("PCB ") # PCB Version AKA IMU version
|
||||||
|
return constants
|
||||||
|
|
||||||
|
|
||||||
def getLetterCounts(defs, lang):
|
def getLetterCounts(defs, lang):
|
||||||
textList = []
|
textList = []
|
||||||
@@ -162,6 +178,7 @@ def getLetterCounts(defs, lang):
|
|||||||
textList.append(x[1])
|
textList.append(x[1])
|
||||||
textList.extend(getTipModelEnumTS100())
|
textList.extend(getTipModelEnumTS100())
|
||||||
textList.extend(getTipModelEnumTS80())
|
textList.extend(getTipModelEnumTS80())
|
||||||
|
textList.extend(getDebugMenu())
|
||||||
|
|
||||||
# collapse all strings down into the composite letters and store totals for these
|
# collapse all strings down into the composite letters and store totals for these
|
||||||
|
|
||||||
@@ -343,6 +360,13 @@ def writeLanguage(languageCode, defs, f):
|
|||||||
|
|
||||||
f.write(to_unicode("};\n\n"))
|
f.write(to_unicode("};\n\n"))
|
||||||
|
|
||||||
|
# Debug Menu
|
||||||
|
f.write(to_unicode("const char* DebugMenu[] = {\n"))
|
||||||
|
|
||||||
|
for c in getDebugMenu():
|
||||||
|
f.write(to_unicode("\t \"" + convStr(symbolConversionTable, c) + "\","+ "//{} \n".format(c)))
|
||||||
|
f.write(to_unicode("};\n\n"))
|
||||||
|
|
||||||
# ----- Menu Options
|
# ----- Menu Options
|
||||||
|
|
||||||
# Menu type
|
# Menu type
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ extern const char* SettingAutoChar;
|
|||||||
extern const char* SettingFastChar;
|
extern const char* SettingFastChar;
|
||||||
extern const char* SettingSlowChar;
|
extern const char* SettingSlowChar;
|
||||||
extern const char* TipModelStrings[];
|
extern const char* TipModelStrings[];
|
||||||
|
extern const char* DebugMenu[];
|
||||||
extern const char* SymbolPlus;
|
extern const char* SymbolPlus;
|
||||||
extern const char* SymbolMinus;
|
extern const char* SymbolMinus;
|
||||||
extern const char* SymbolSpace;
|
extern const char* SymbolSpace;
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ static void gui_solderingTempAdjust() {
|
|||||||
break;
|
break;
|
||||||
case BUTTON_B_LONG:
|
case BUTTON_B_LONG:
|
||||||
if (xTaskGetTickCount() - autoRepeatTimer
|
if (xTaskGetTickCount() - autoRepeatTimer
|
||||||
+ autoRepeatAcceleration > PRESS_ACCEL_INTERVAL_MAX) {
|
+ autoRepeatAcceleration> PRESS_ACCEL_INTERVAL_MAX) {
|
||||||
systemSettings.SolderingTemp -= 10; // sub 10
|
systemSettings.SolderingTemp -= 10; // sub 10
|
||||||
autoRepeatTimer = xTaskGetTickCount();
|
autoRepeatTimer = xTaskGetTickCount();
|
||||||
autoRepeatAcceleration += PRESS_ACCEL_STEP;
|
autoRepeatAcceleration += PRESS_ACCEL_STEP;
|
||||||
@@ -272,7 +272,7 @@ static void gui_solderingTempAdjust() {
|
|||||||
break;
|
break;
|
||||||
case BUTTON_F_LONG:
|
case BUTTON_F_LONG:
|
||||||
if (xTaskGetTickCount() - autoRepeatTimer
|
if (xTaskGetTickCount() - autoRepeatTimer
|
||||||
+ autoRepeatAcceleration > PRESS_ACCEL_INTERVAL_MAX) {
|
+ autoRepeatAcceleration> PRESS_ACCEL_INTERVAL_MAX) {
|
||||||
systemSettings.SolderingTemp += 10;
|
systemSettings.SolderingTemp += 10;
|
||||||
autoRepeatTimer = xTaskGetTickCount();
|
autoRepeatTimer = xTaskGetTickCount();
|
||||||
autoRepeatAcceleration += PRESS_ACCEL_STEP;
|
autoRepeatAcceleration += PRESS_ACCEL_STEP;
|
||||||
@@ -607,75 +607,58 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *HEADERS[] = {
|
void showDebugMenu(void) {
|
||||||
__DATE__, "Heap: ", "HWMG: ", "HWMP: ", "HWMM: ", "Time: ", "Move: ", "RTip: ",
|
|
||||||
"CTip: ", "Vin :", "THan: ", "Model: ",
|
|
||||||
#ifdef MODEL_TS80
|
|
||||||
"QCV: ", "Tr ",
|
|
||||||
#else
|
|
||||||
"Tm ", "Ralim-",
|
|
||||||
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
void showVersion(void) {
|
|
||||||
uint8_t screen = 0;
|
uint8_t screen = 0;
|
||||||
ButtonState b;
|
ButtonState b;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
OLED::clearScreen(); // Ensure the buffer starts clean
|
OLED::clearScreen(); // Ensure the buffer starts clean
|
||||||
OLED::setCursor(0, 0); // Position the cursor at the 0,0 (top left)
|
OLED::setCursor(0, 0); // Position the cursor at the 0,0 (top left)
|
||||||
OLED::setFont(1); // small font
|
OLED::setFont(1); // small font
|
||||||
#ifdef MODEL_TS100
|
|
||||||
OLED::print(SymbolVersionNumber); // Print version number
|
|
||||||
#else
|
|
||||||
OLED::print(SymbolVersionNumber); // Print version number
|
OLED::print(SymbolVersionNumber); // Print version number
|
||||||
#endif
|
|
||||||
OLED::setCursor(0, 8); // second line
|
OLED::setCursor(0, 8); // second line
|
||||||
OLED::print(HEADERS[screen]);
|
OLED::print(DebugMenu[screen]);
|
||||||
switch (screen) {
|
switch (screen) {
|
||||||
case 2:
|
case 0: //Just prints date
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
//High water mark for GUI
|
||||||
OLED::printNumber(uxTaskGetStackHighWaterMark(GUITaskHandle), 5);
|
OLED::printNumber(uxTaskGetStackHighWaterMark(GUITaskHandle), 5);
|
||||||
break;
|
break;
|
||||||
|
case 2:
|
||||||
|
//High water mark for the Movement task
|
||||||
|
OLED::printNumber(uxTaskGetStackHighWaterMark(MOVTaskHandle), 5);
|
||||||
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
//High water mark for the PID task
|
||||||
OLED::printNumber(uxTaskGetStackHighWaterMark(PIDTaskHandle), 5);
|
OLED::printNumber(uxTaskGetStackHighWaterMark(PIDTaskHandle), 5);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
OLED::printNumber(uxTaskGetStackHighWaterMark(MOVTaskHandle), 5);
|
//system up time stamp
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
OLED::printNumber(xTaskGetTickCount() / 100, 5);
|
OLED::printNumber(xTaskGetTickCount() / 100, 5);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 5:
|
||||||
|
//Movement time stamp
|
||||||
OLED::printNumber(lastMovementTime / 100, 5);
|
OLED::printNumber(lastMovementTime / 100, 5);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 6:
|
||||||
|
//Raw Tip
|
||||||
OLED::printNumber(getTipRawTemp(0), 6);
|
OLED::printNumber(getTipRawTemp(0), 6);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 7:
|
||||||
|
//Temp in C
|
||||||
OLED::printNumber(tipMeasurementToC(getTipRawTemp(0)), 5);
|
OLED::printNumber(tipMeasurementToC(getTipRawTemp(0)), 5);
|
||||||
break;
|
break;
|
||||||
|
case 8:
|
||||||
|
//Handle Temp
|
||||||
|
OLED::printNumber(getHandleTemperature(), 3);
|
||||||
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
//Voltage input
|
||||||
printVoltage();
|
printVoltage();
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
OLED::printNumber(getHandleTemperature(), 3);
|
// Print PCB ID number
|
||||||
break;
|
OLED::printNumber(PCBVersion, 1);
|
||||||
case 11:
|
|
||||||
OLED::printNumber(PCBVersion, 1); // Print PCB ID number
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
#ifdef MODEL_TS80
|
|
||||||
OLED::printNumber(idealQCVoltage, 3);
|
|
||||||
#else
|
|
||||||
OLED::printNumber(systemSettings.tipType, 3);
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
#ifdef MODEL_TS80
|
|
||||||
OLED::printNumber(calculateTipR(), 5);
|
|
||||||
#else
|
|
||||||
OLED::print("Tek.com");
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -687,7 +670,7 @@ void showVersion(void) {
|
|||||||
return;
|
return;
|
||||||
else if (b == BUTTON_F_SHORT) {
|
else if (b == BUTTON_F_SHORT) {
|
||||||
screen++;
|
screen++;
|
||||||
screen = screen % 14;
|
screen = screen % 11;
|
||||||
}
|
}
|
||||||
GUIDelay();
|
GUIDelay();
|
||||||
}
|
}
|
||||||
@@ -753,7 +736,7 @@ void startGUITask(void const *argument __unused) {
|
|||||||
|
|
||||||
case BUTTON_B_LONG:
|
case BUTTON_B_LONG:
|
||||||
// Show the version information
|
// Show the version information
|
||||||
showVersion();
|
showDebugMenu();
|
||||||
break;
|
break;
|
||||||
case BUTTON_F_LONG:
|
case BUTTON_F_LONG:
|
||||||
gui_solderingTempAdjust();
|
gui_solderingTempAdjust();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user