Use size encoded symbols

Update make_translation.py
This commit is contained in:
Ben V. Brown
2022-12-04 21:29:08 +11:00
parent 800f2ba9e6
commit fdc31467aa
14 changed files with 101 additions and 99 deletions

View File

@@ -543,6 +543,9 @@ def get_forced_first_symbols() -> List[str]:
"d",
"e",
"f",
" ",# We lock these to ease printing functions; and they are always included due to constants
"-",
"+"
]
return forced_first_symbols
@@ -1031,7 +1034,7 @@ def get_translation_common_text(
if x[0].startswith("Small"):
translation_common_text += f'const char* {x[0]} = "{convert_string(small_symbol_conversion_table, x[1])}";//{x[1]} \n'
elif x[0].startswith("Large"):
str = "\n"+x[1]
str = x[1]
translation_common_text += f'const char* {x[0]} = "{convert_string(large_symbol_conversion_table, str)}";//{x[1]} \n'
else:
raise ValueError(f"Constant {x} is not size encoded")
@@ -1115,14 +1118,15 @@ def get_translation_strings_and_indices_text(
record = TranslatedStringLocation(len(byte_encoded_strings) - 1, 0)
translated_string_lookups[translation_id] = record
def encode_string_and_add(message: str, translation_id: str):
def encode_string_and_add(message: str, translation_id: str,force_large_text:bool=False):
encoded_data: bytes
if test_is_small_font(message):
if force_large_text is False and test_is_small_font(message):
encoded_data = convert_string_bytes(
small_font_symbol_conversion_table, message
)
else:
message = "\n" + message
if force_large_text is False:
message = "\n" + message
encoded_data = convert_string_bytes(
large_font_symbol_conversion_table, message
)
@@ -1132,7 +1136,7 @@ def get_translation_strings_and_indices_text(
lang_data = lang["menuOptions"][record["id"]]
# Add to translations the menu text and the description
encode_string_and_add(
lang_data["description"], "menuOptions" + record["id"] + "description"
lang_data["description"], "menuOptions" + record["id"] + "description",True
)
encode_string_and_add(
lang_data["displayText"], "menuOptions" + record["id"] + "displayText"
@@ -1142,7 +1146,7 @@ def get_translation_strings_and_indices_text(
lang_data = lang["menuGroups"][record["id"]]
# Add to translations the menu text and the description
encode_string_and_add(
lang_data["description"], "menuGroups" + record["id"] + "description"
lang_data["description"], "menuGroups" + record["id"] + "description",True
)
encode_string_and_add(
lang_data["displayText"], "menuGroups" + record["id"] + "displayText"
@@ -1152,13 +1156,13 @@ def get_translation_strings_and_indices_text(
lang_data = lang["messagesWarn"][record["id"]]
# Add to translations the menu text and the description
encode_string_and_add(
lang_data["message"], "messagesWarn" + record["id"] + "Message"
lang_data["message"], "messagesWarn" + record["id"] + "Message",True
)
for index, record in enumerate(defs["characters"]):
lang_data = lang["characters"][record["id"]]
# Add to translations the menu text and the description
encode_string_and_add(lang_data, "characters" + record["id"] + "Message")
encode_string_and_add(lang_data, "characters" + record["id"] + "Message",True)
# ----- Write the string table:
offset = 0
@@ -1187,7 +1191,7 @@ def get_translation_strings_and_indices_text(
position = 0
for string in byte_encoded_strings:
string_index_commulative_lengths.append(position)
position += len(string)
position += len(string)+1
translation_indices_text = " .indices = {\n"

View File

@@ -178,14 +178,9 @@ void OLED::drawChar(const uint16_t charCode, const FontStyle fontStyle) {
fontWidth = 12;
break;
}
for (uint32_t i = 0; i < FontSectionsCount; i++) {
const auto &section = FontSections[i];
if (charCode >= section.symbol_start && charCode < section.symbol_end) {
currentFont = fontStyle == FontStyle::SMALL ? section.font06_start_ptr : section.font12_start_ptr;
index = charCode - section.symbol_start;
break;
}
}
currentFont = fontStyle == FontStyle::SMALL ? FontSectionsData.font06_start_ptr : FontSectionsData.font12_start_ptr;
index = charCode - 2;
break;
}
const uint8_t *charPointer = currentFont + ((fontWidth * (fontHeight / 8)) * index);
@@ -368,8 +363,8 @@ void OLED::setRotation(bool leftHanded) {
// mode as driver ram is 128 wide
screenBuffer[7] = inLeftHandedMode ? 95 : 0x7F; // End address of the ram segment we are writing to (96 wide)
screenBuffer[9] = inLeftHandedMode ? 0xC8 : 0xC0;
//Force a screen refresh
const int len = FRAMEBUFFER_START + (OLED_WIDTH * 2);
// Force a screen refresh
const int len = FRAMEBUFFER_START + (OLED_WIDTH * 2);
I2C_CLASS::Transmit(DEVICEADDR_OLED, screenBuffer, len);
osDelay(TICKS_10MS);
}
@@ -388,6 +383,9 @@ void OLED::setInverseDisplay(bool inverse) {
// print a string to the current cursor location
void OLED::print(const char *const str, FontStyle fontStyle) {
const uint8_t *next = reinterpret_cast<const uint8_t *>(str);
if (next[0] == 0x01) {
fontStyle = FontStyle::LARGE;
}
while (next[0]) {
uint16_t index;
if (next[0] <= 0xF0) {
@@ -429,7 +427,7 @@ inline void stripLeaderZeros(char *buffer, uint8_t places) {
// Stop 1 short so that we dont blank entire number if its zero
for (int i = 0; i < (places - 1); i++) {
if (buffer[i] == 2) {
buffer[i] = SymbolSpace[0];
buffer[i] = LargeSymbolSpace[0];
} else {
return;
}
@@ -478,14 +476,14 @@ void OLED::printNumber(uint16_t number, uint8_t places, FontStyle fontStyle, boo
void OLED::debugNumber(int32_t val, FontStyle fontStyle) {
if (abs(val) > 99999) {
OLED::print(SymbolSpace, fontStyle); // out of bounds
OLED::print(LargeSymbolSpace, fontStyle); // out of bounds
return;
}
if (val >= 0) {
OLED::print(SymbolSpace, fontStyle);
OLED::print(LargeSymbolSpace, fontStyle);
OLED::printNumber(val, 5, fontStyle);
} else {
OLED::print(SymbolMinus, fontStyle);
OLED::print(LargeSymbolMinus, fontStyle);
OLED::printNumber(-val, 5, fontStyle);
}
}

View File

@@ -161,12 +161,12 @@ const menuitem rootSettingsMenu[] {
#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD)
const menuitem powerMenu[] = {
/*
* Power Source
* -Minimum Voltage
* QC Voltage
* PD Timeout
*/
/*
* Power Source
* -Minimum Voltage
* QC Voltage
* PD Timeout
*/
#ifdef POW_DC
{SETTINGS_DESC(SettingsItemIndex::DCInCutoff), nullptr, displayInputVRange, nullptr, SettingsOptions::MinDCVoltageCells, SettingsItemIndex::DCInCutoff, 6}, /*Voltage input*/
{SETTINGS_DESC(SettingsItemIndex::MinVolCell), nullptr, displayInputMinVRange, showInputVOptions, SettingsOptions::MinVoltageCells, SettingsItemIndex::MinVolCell, 5}, /*Minimum voltage input*/
@@ -264,7 +264,7 @@ const menuitem advancedMenu[] = {
* -Power Pulse Duration
* Factory Reset
*/
{SETTINGS_DESC(SettingsItemIndex::PowerLimit), nullptr, displayPowerLimit, nullptr, SettingsOptions::PowerLimit, SettingsItemIndex::PowerLimit, 5}, /*Power limit*/
{SETTINGS_DESC(SettingsItemIndex::PowerLimit), nullptr, displayPowerLimit, nullptr, SettingsOptions::PowerLimit, SettingsItemIndex::PowerLimit, 5}, /*Power limit*/
{SETTINGS_DESC(SettingsItemIndex::CalibrateCJC), setCalibrate, displayCalibrate, nullptr, SettingsOptions::SettingsOptionsLength, SettingsItemIndex::CalibrateCJC,
7}, /*Calibrate Cold Junktion Compensation at next boot*/
{SETTINGS_DESC(SettingsItemIndex::VoltageCalibration), setCalibrateVIN, displayCalibrateVIN, nullptr, SettingsOptions::SettingsOptionsLength, SettingsItemIndex::VoltageCalibration,
@@ -273,7 +273,7 @@ const menuitem advancedMenu[] = {
{SETTINGS_DESC(SettingsItemIndex::PowerPulseWait), nullptr, displayPowerPulseWait, showPowerPulseOptions, SettingsOptions::KeepAwakePulseWait, SettingsItemIndex::PowerPulseWait,
7}, /*Power Pulse Wait adjustment*/
{SETTINGS_DESC(SettingsItemIndex::PowerPulseDuration), nullptr, displayPowerPulseDuration, showPowerPulseOptions, SettingsOptions::KeepAwakePulseDuration, SettingsItemIndex::PowerPulseDuration,
7}, /*Power Pulse Duration adjustment*/
7}, /*Power Pulse Duration adjustment*/
{SETTINGS_DESC(SettingsItemIndex::SettingsReset), setResetSettings, displayResetSettings, nullptr, SettingsOptions::SettingsOptionsLength, SettingsItemIndex::SettingsReset, 7}, /*Resets settings*/
{0, nullptr, nullptr, nullptr, SettingsOptions::SettingsOptionsLength, SettingsItemIndex::NUM_ITEMS, 0} // end of menu marker. DO NOT REMOVE
};
@@ -330,9 +330,9 @@ static void displayInputVRange(void) {
if (getSettingValue(SettingsOptions::MinDCVoltageCells)) {
OLED::printNumber(2 + getSettingValue(SettingsOptions::MinDCVoltageCells), 1, FontStyle::LARGE);
OLED::print(SymbolCellCount, FontStyle::LARGE);
OLED::print(LargeSymbolCellCount, FontStyle::LARGE);
} else {
OLED::print(SymbolDC, FontStyle::LARGE);
OLED::print(LargeSymbolDC, FontStyle::LARGE);
}
}
@@ -340,7 +340,7 @@ static bool showInputVOptions(void) { return getSettingValue(SettingsOptions::Mi
static void displayInputMinVRange(void) {
OLED::printNumber(getSettingValue(SettingsOptions::MinVoltageCells) / 10, 1, FontStyle::LARGE);
OLED::print(SymbolDot, FontStyle::LARGE);
OLED::print(LargeSymbolDot, FontStyle::LARGE);
OLED::printNumber(getSettingValue(SettingsOptions::MinVoltageCells) % 10, 1, FontStyle::LARGE);
}
#endif
@@ -352,7 +352,7 @@ static void displayQCInputV(void) {
// Allows setting the voltage negotiated for QC
auto voltage = getSettingValue(SettingsOptions::QCIdealVoltage);
OLED::printNumber(voltage / 10, 2, FontStyle::LARGE);
OLED::print(SymbolDot, FontStyle::LARGE);
OLED::print(LargeSymbolDot, FontStyle::LARGE);
OLED::printNumber(voltage % 10, 1, FontStyle::LARGE);
}
@@ -481,10 +481,10 @@ static void displaySleepTime(void) {
OLED::print(translatedString(Tr->OffString), FontStyle::LARGE);
} else if (getSettingValue(SettingsOptions::SleepTime) < 6) {
OLED::printNumber(getSettingValue(SettingsOptions::SleepTime) * 10, 2, FontStyle::LARGE);
OLED::print(SymbolSeconds, FontStyle::LARGE);
OLED::print(LargeSymbolSeconds, FontStyle::LARGE);
} else {
OLED::printNumber(getSettingValue(SettingsOptions::SleepTime) - 5, 2, FontStyle::LARGE);
OLED::print(SymbolMinutes, FontStyle::LARGE);
OLED::print(LargeSymbolMinutes, FontStyle::LARGE);
}
}
#endif
@@ -495,7 +495,7 @@ static void displayShutdownTime(void) {
OLED::print(translatedString(Tr->OffString), FontStyle::LARGE);
} else {
OLED::printNumber(getSettingValue(SettingsOptions::ShutdownTime), 2, FontStyle::LARGE);
OLED::print(SymbolMinutes, FontStyle::LARGE);
OLED::print(LargeSymbolMinutes, FontStyle::LARGE);
}
}
@@ -537,7 +537,7 @@ static bool setTempF(void) {
return res;
}
static void displayTempF(void) { OLED::print((getSettingValue(SettingsOptions::TemperatureInF)) ? SymbolDegF : SymbolDegC, FontStyle::LARGE); }
static void displayTempF(void) { OLED::print((getSettingValue(SettingsOptions::TemperatureInF)) ? LargeSymbolDegF : LargeSymbolDegC, FontStyle::LARGE); }
#ifndef NO_DISPLAY_ROTATE
static bool setDisplayRotation(void) {
@@ -626,7 +626,7 @@ static void displayLogoTime(void) {
OLED::drawArea(OLED_WIDTH - 24 - 2, 0, 24, 16, infinityIcon);
} else {
OLED::printNumber(getSettingValue(SettingsOptions::LOGOTime), 2, FontStyle::LARGE);
OLED::print(SymbolSeconds, FontStyle::LARGE);
OLED::print(LargeSymbolSeconds, FontStyle::LARGE);
}
}
@@ -640,7 +640,7 @@ static void displayPowerLimit(void) {
OLED::print(translatedString(Tr->OffString), FontStyle::LARGE);
} else {
OLED::printNumber(getSettingValue(SettingsOptions::PowerLimit), 2, FontStyle::LARGE);
OLED::print(SymbolWatts, FontStyle::LARGE);
OLED::print(LargeSymbolWatts, FontStyle::LARGE);
}
}
@@ -649,7 +649,7 @@ static bool setCalibrate(void) {
if (userConfirmation(translatedString(Tr->SettingsCalibrationWarning))) {
// User confirmed
// So we now set the tick
setSettingValue(SettingsOptions::CalibrateCJC, 1);
setSettingValue(SettingsOptions::CalibrateCJC, 1);
}
} else {
setSettingValue(SettingsOptions::CalibrateCJC, 0);
@@ -667,9 +667,9 @@ static bool setCalibrateVIN(void) {
OLED::setCursor(0, 0);
uint16_t voltage = getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 0);
OLED::printNumber(voltage / 10, 2, FontStyle::LARGE);
OLED::print(SymbolDot, FontStyle::LARGE);
OLED::print(LargeSymbolDot, FontStyle::LARGE);
OLED::printNumber(voltage % 10, 1, FontStyle::LARGE, false);
OLED::print(SymbolVolts, FontStyle::LARGE);
OLED::print(LargeSymbolVolts, FontStyle::LARGE);
switch (getButtonState()) {
case BUTTON_F_SHORT:
@@ -704,7 +704,7 @@ static void displayPowerPulse(void) {
if (getSettingValue(SettingsOptions::KeepAwakePulse)) {
OLED::printNumber(getSettingValue(SettingsOptions::KeepAwakePulse) / 10, 1, FontStyle::LARGE);
OLED::print(SymbolDot, FontStyle::LARGE);
OLED::print(LargeSymbolDot, FontStyle::LARGE);
OLED::printNumber(getSettingValue(SettingsOptions::KeepAwakePulse) % 10, 1, FontStyle::LARGE);
} else {
OLED::print(translatedString(Tr->OffString), FontStyle::LARGE);

View File

@@ -19,9 +19,9 @@ void performCJCC(void) {
OLED::setCursor(0, 0);
OLED::print(translatedString(Tr->CJCCalibrating), FontStyle::SMALL);
OLED::setCursor(0, 8);
OLED::print(SymbolDot, FontStyle::SMALL);
OLED::print(SmallSymbolDot, FontStyle::SMALL);
for (uint8_t x = 0; x < (i / 4); x++)
OLED::print(SymbolDot, FontStyle::SMALL);
OLED::print(SmallSymbolDot, FontStyle::SMALL);
OLED::refresh();
osDelay(100);
}

View File

@@ -7,10 +7,10 @@ void showDebugMenu(void) {
uint8_t screen = 0;
ButtonState b;
for (;;) {
OLED::clearScreen(); // Ensure the buffer starts clean
OLED::setCursor(0, 0); // Position the cursor at the 0,0 (top left)
OLED::print(SymbolVersionNumber, FontStyle::SMALL); // Print version number
OLED::setCursor(0, 8); // second line
OLED::clearScreen(); // Ensure the buffer starts clean
OLED::setCursor(0, 0); // Position the cursor at the 0,0 (top left)
OLED::print(SmallSymbolVersionNumber, FontStyle::SMALL); // Print version number
OLED::setCursor(0, 8); // second line
OLED::print(DebugMenu[screen], FontStyle::SMALL);
switch (screen) {
case 0: // Build Date
@@ -74,7 +74,7 @@ void showDebugMenu(void) {
break;
case 6: // Handle Temp in °C
OLED::printNumber(getHandleTemperature(0) / 10, 6, FontStyle::SMALL);
OLED::print(SymbolDot, FontStyle::SMALL);
OLED::print(SmallSymbolDot, FontStyle::SMALL);
OLED::printNumber(getHandleTemperature(0) % 10, 1, FontStyle::SMALL);
break;
case 7: // Max Temp Limit in °C
@@ -88,7 +88,7 @@ void showDebugMenu(void) {
break;
case 10: // Tip Resistance in Ω
OLED::printNumber(getTipResistanceX10() / 10, 6, FontStyle::SMALL); // large to pad over so that we cover ID left overs
OLED::print(SymbolDot, FontStyle::SMALL);
OLED::print(SmallSymbolDot, FontStyle::SMALL);
OLED::printNumber(getTipResistanceX10() % 10, 1, FontStyle::SMALL);
break;
case 11: // Raw Tip in µV

View File

@@ -118,14 +118,14 @@ void drawHomeScreen(bool buttonLockout) {
}
uint32_t Vlt = getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 0);
OLED::printNumber(Vlt / 10, 2, FontStyle::LARGE);
OLED::print(SymbolDot, FontStyle::LARGE);
OLED::print(LargeSymbolDot, FontStyle::LARGE);
OLED::printNumber(Vlt % 10, 1, FontStyle::LARGE);
if (OLED::getRotation()) {
OLED::setCursor(48, 8);
} else {
OLED::setCursor(91, 8);
}
OLED::print(SymbolVolts, FontStyle::SMALL);
OLED::print(SmallSymbolVolts, FontStyle::SMALL);
} else {
if (!(getSettingValue(SettingsOptions::CoolingTempBlink) && (tipTemp > 55) && (xTaskGetTickCount() % 1000 < 300)))
// Blink temp if setting enable and temp < 55°
@@ -139,16 +139,16 @@ void drawHomeScreen(bool buttonLockout) {
}
OLED::printNumber(getSettingValue(SettingsOptions::SolderingTemp), 3, FontStyle::SMALL); // draw set temp
if (getSettingValue(SettingsOptions::TemperatureInF))
OLED::print(SymbolDegF, FontStyle::SMALL);
OLED::print(SmallSymbolDegF, FontStyle::SMALL);
else
OLED::print(SymbolDegC, FontStyle::SMALL);
OLED::print(SmallSymbolDegC, FontStyle::SMALL);
if (OLED::getRotation()) {
OLED::setCursor(0, 8);
} else {
OLED::setCursor(67, 8); // bottom right
}
printVoltage(); // draw voltage then symbol (v)
OLED::print(SymbolVolts, FontStyle::SMALL);
OLED::print(SmallSymbolVolts, FontStyle::SMALL);
}
} else {

View File

@@ -32,14 +32,14 @@ int gui_SolderingSleepingMode(bool stayOff, bool autoStarted) {
OLED::print(translatedString(Tr->SleepingTipAdvancedString), FontStyle::SMALL);
OLED::printNumber(tipTemp, 3, FontStyle::SMALL);
if (getSettingValue(SettingsOptions::TemperatureInF))
OLED::print(SymbolDegF, FontStyle::SMALL);
OLED::print(SmallSymbolDegF, FontStyle::SMALL);
else {
OLED::print(SymbolDegC, FontStyle::SMALL);
OLED::print(SmallSymbolDegC, FontStyle::SMALL);
}
OLED::print(SymbolSpace, FontStyle::SMALL);
OLED::print(SmallSymbolSpace, FontStyle::SMALL);
printVoltage();
OLED::print(SymbolVolts, FontStyle::SMALL);
OLED::print(SmallSymbolVolts, FontStyle::SMALL);
} else {
OLED::print(translatedString(Tr->SleepingSimpleString), FontStyle::LARGE);
OLED::printNumber(tipTemp, 3, FontStyle::LARGE);

View File

@@ -119,7 +119,7 @@ void gui_solderingMode(uint8_t jumpToSleep) {
} else {
OLED::setCursor(55, 8);
}
OLED::print(SymbolPlus, FontStyle::SMALL);
OLED::print(SmallSymbolPlus, FontStyle::SMALL);
}
if (OLED::getRotation()) {
@@ -128,9 +128,9 @@ void gui_solderingMode(uint8_t jumpToSleep) {
OLED::setCursor(67, 0);
}
OLED::printNumber(x10WattHistory.average() / 10, 2, FontStyle::SMALL);
OLED::print(SymbolDot, FontStyle::SMALL);
OLED::print(SmallSymbolDot, FontStyle::SMALL);
OLED::printNumber(x10WattHistory.average() % 10, 1, FontStyle::SMALL);
OLED::print(SymbolWatts, FontStyle::SMALL);
OLED::print(SmallSymbolWatts, FontStyle::SMALL);
if (OLED::getRotation()) {
OLED::setCursor(0, 8);
@@ -138,22 +138,22 @@ void gui_solderingMode(uint8_t jumpToSleep) {
OLED::setCursor(67, 8);
}
printVoltage();
OLED::print(SymbolVolts, FontStyle::SMALL);
OLED::print(SmallSymbolVolts, FontStyle::SMALL);
} else {
OLED::setCursor(0, 0);
// We switch the layout direction depending on the orientation of the oled
if (OLED::getRotation()) {
// battery
gui_drawBatteryIcon();
OLED::print(SymbolSpace, FontStyle::LARGE); // Space out gap between battery <-> temp
gui_drawTipTemp(true, FontStyle::LARGE); // Draw current tip temp
OLED::print(LargeSymbolSpace, FontStyle::LARGE); // Space out gap between battery <-> temp
gui_drawTipTemp(true, FontStyle::LARGE); // Draw current tip temp
// We draw boost arrow if boosting, or else gap temp <-> heat
// indicator
if (boostModeOn)
OLED::drawSymbol(2);
else
OLED::print(SymbolSpace, FontStyle::LARGE);
OLED::print(LargeSymbolSpace, FontStyle::LARGE);
// Draw heating/cooling symbols
OLED::drawHeatSymbol(X10WattsToPWM(x10WattHistory.average()));
@@ -165,10 +165,10 @@ void gui_solderingMode(uint8_t jumpToSleep) {
if (boostModeOn)
OLED::drawSymbol(2);
else
OLED::print(SymbolSpace, FontStyle::LARGE);
OLED::print(LargeSymbolSpace, FontStyle::LARGE);
gui_drawTipTemp(true, FontStyle::LARGE); // Draw current tip temp
OLED::print(SymbolSpace, FontStyle::LARGE); // Space out gap between battery <-> temp
OLED::print(LargeSymbolSpace, FontStyle::LARGE); // Space out gap between battery <-> temp
gui_drawBatteryIcon();
}

View File

@@ -87,23 +87,23 @@ void gui_solderingTempAdjust(void) {
return; // exit if user just doesn't press anything for a bit
if (OLED::getRotation()) {
OLED::print(getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled) ? SymbolPlus : SymbolMinus, FontStyle::LARGE);
OLED::print(getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled) ? LargeSymbolPlus : LargeSymbolMinus, FontStyle::LARGE);
} else {
OLED::print(getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled) ? SymbolMinus : SymbolPlus, FontStyle::LARGE);
OLED::print(getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled) ? LargeSymbolMinus : LargeSymbolPlus, FontStyle::LARGE);
}
OLED::print(SymbolSpace, FontStyle::LARGE);
OLED::print(LargeSymbolSpace, FontStyle::LARGE);
OLED::printNumber(getSettingValue(SettingsOptions::SolderingTemp), 3, FontStyle::LARGE);
if (getSettingValue(SettingsOptions::TemperatureInF))
OLED::drawSymbol(0);
else {
OLED::drawSymbol(1);
}
OLED::print(SymbolSpace, FontStyle::LARGE);
OLED::print(LargeSymbolSpace, FontStyle::LARGE);
if (OLED::getRotation()) {
OLED::print(getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled) ? SymbolMinus : SymbolPlus, FontStyle::LARGE);
OLED::print(getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled) ? LargeSymbolMinus : LargeSymbolPlus, FontStyle::LARGE);
} else {
OLED::print(getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled) ? SymbolPlus : SymbolMinus, FontStyle::LARGE);
OLED::print(getSettingValue(SettingsOptions::ReverseButtonTempChangeEnabled) ? LargeSymbolPlus : LargeSymbolMinus, FontStyle::LARGE);
}
OLED::refresh();
GUIDelay();

View File

@@ -8,23 +8,23 @@ void showPDDebug(void) {
uint8_t screen = 0;
ButtonState b;
for (;;) {
OLED::clearScreen(); // Ensure the buffer starts clean
OLED::setCursor(0, 0); // Position the cursor at the 0,0 (top left)
OLED::print(SymbolPDDebug, FontStyle::SMALL); // Print Title
OLED::setCursor(0, 8); // second line
OLED::clearScreen(); // Ensure the buffer starts clean
OLED::setCursor(0, 0); // Position the cursor at the 0,0 (top left)
OLED::print(SmallSymbolPDDebug, FontStyle::SMALL); // Print Title
OLED::setCursor(0, 8); // second line
if (screen == 0) {
// Print the PD state machine
OLED::print(SymbolState, FontStyle::SMALL);
OLED::print(SymbolSpace, FontStyle::SMALL);
OLED::print(SmallSymbolState, FontStyle::SMALL);
OLED::print(SmallSymbolSpace, FontStyle::SMALL);
OLED::printNumber(USBPowerDelivery::getStateNumber(), 2, FontStyle::SMALL, true);
OLED::print(SymbolSpace, FontStyle::SMALL);
OLED::print(SmallSymbolSpace, FontStyle::SMALL);
// Also print vbus mod status
if (USBPowerDelivery::fusbPresent()) {
if (USBPowerDelivery::negotiationComplete() || (xTaskGetTickCount() > (TICKS_SECOND * 10))) {
if (!USBPowerDelivery::isVBUSConnected()) {
OLED::print(SymbolNoVBus, FontStyle::SMALL);
OLED::print(SmallSymbolNoVBus, FontStyle::SMALL);
} else {
OLED::print(SymbolVBus, FontStyle::SMALL);
OLED::print(SmallSymbolVBus, FontStyle::SMALL);
}
}
}
@@ -56,22 +56,22 @@ void showPDDebug(void) {
} else {
// print out this entry of the proposal
OLED::printNumber(screen, 2, FontStyle::SMALL, true); // print the entry number
OLED::print(SymbolSpace, FontStyle::SMALL);
OLED::print(SmallSymbolSpace, FontStyle::SMALL);
if (min_voltage > 0) {
OLED::printNumber(min_voltage / 1000, 2, FontStyle::SMALL, true); // print the voltage
OLED::print(SymbolMinus, FontStyle::SMALL);
OLED::print(SmallSymbolMinus, FontStyle::SMALL);
}
OLED::printNumber(voltage_mv / 1000, 2, FontStyle::SMALL, true); // print the voltage
OLED::print(SymbolVolts, FontStyle::SMALL);
OLED::print(SymbolSpace, FontStyle::SMALL);
OLED::print(SmallSymbolVolts, FontStyle::SMALL);
OLED::print(SmallSymbolSpace, FontStyle::SMALL);
if (wattage) {
OLED::printNumber(wattage, 3, FontStyle::SMALL, true); // print the current in 0.1A res
OLED::print(SymbolWatts, FontStyle::SMALL);
OLED::print(SmallSymbolWatts, FontStyle::SMALL);
} else {
OLED::printNumber(current_a_x100 / 100, 2, FontStyle::SMALL, true); // print the current in 0.1A res
OLED::print(SymbolDot, FontStyle::SMALL);
OLED::print(SmallSymbolDot, FontStyle::SMALL);
OLED::printNumber(current_a_x100 % 100, 2, FontStyle::SMALL, true); // print the current in 0.1A res
OLED::print(SymbolAmps, FontStyle::SMALL);
OLED::print(SmallSymbolAmps, FontStyle::SMALL);
}
}
} else {

View File

@@ -21,9 +21,9 @@ void gui_drawTipTemp(bool symbol, const FontStyle font) {
} else {
// Otherwise fall back to chars
if (getSettingValue(SettingsOptions::TemperatureInF))
OLED::print(SymbolDegF, FontStyle::SMALL);
OLED::print(SmallSymbolDegF, FontStyle::SMALL);
else
OLED::print(SymbolDegC, FontStyle::SMALL);
OLED::print(SmallSymbolDegC, FontStyle::SMALL);
}
}
}

View File

@@ -3,6 +3,6 @@
void printVoltage(void) {
uint32_t volt = getInputVoltageX10(getSettingValue(SettingsOptions::VoltageDiv), 0);
OLED::printNumber(volt / 10, 2, FontStyle::SMALL);
OLED::print(SymbolDot, FontStyle::SMALL);
OLED::print(SmallSymbolDot, FontStyle::SMALL);
OLED::printNumber(volt % 10, 1, FontStyle::SMALL);
}

View File

@@ -22,7 +22,7 @@ bool checkForUnderVoltage(void) {
OLED::setCursor(0, 8);
OLED::print(translatedString(Tr->InputVoltageString), FontStyle::SMALL);
printVoltage();
OLED::print(SymbolVolts, FontStyle::SMALL);
OLED::print(SmallSymbolVolts, FontStyle::SMALL);
} else {
OLED::print(translatedString(Tr->UVLOWarningString), FontStyle::LARGE);
}

View File

@@ -11,10 +11,10 @@ void printCountdownUntilSleep(int sleepThres) {
TickType_t downCount = sleepThres - xTaskGetTickCount() + lastEventTime;
if (downCount > (99 * TICKS_SECOND)) {
OLED::printNumber(downCount / 60000 + 1, 2, FontStyle::SMALL);
OLED::print(SymbolMinutes, FontStyle::SMALL);
OLED::print(SmallSymbolMinutes, FontStyle::SMALL);
} else {
OLED::printNumber(downCount / 1000 + 1, 2, FontStyle::SMALL);
OLED::print(SymbolSeconds, FontStyle::SMALL);
OLED::print(SmallSymbolSeconds, FontStyle::SMALL);
}
}
#endif