Implement printSymbolDeg() helper function as method for OLED class (#1743)
* implement printSymbolDeg() helper function as method for OLED class * Remove extra line added by mistake * OLED::printSymbolDeg - add drawSymbol calls * OLED: make comments more clear for implemented method * OLED::printSymbolDeg(): attempt to improve read-ability replacing if/else by switch/case * OLED::printSymbolDeg() - add comment for drawSymbol to clarify its underhood * get tipTemp using ?/: instead of if/else * Implement getTipTemp() helper * Add missing header --------- Co-authored-by: Ben V. Brown <5425387+Ralim@users.noreply.github.com>
This commit is contained in:
@@ -25,7 +25,7 @@ int gui_SolderingSleepingMode(bool stayOff, bool autoStarted) {
|
||||
}
|
||||
|
||||
// draw the lcd
|
||||
uint16_t tipTemp = getSettingValue(SettingsOptions::TemperatureInF) ? TipThermoModel::getTipInF() : TipThermoModel::getTipInC();
|
||||
uint16_t tipTemp = getTipTemp();
|
||||
|
||||
OLED::clearScreen();
|
||||
OLED::setCursor(0, 0);
|
||||
@@ -34,25 +34,14 @@ int gui_SolderingSleepingMode(bool stayOff, bool autoStarted) {
|
||||
OLED::setCursor(0, 8);
|
||||
OLED::print(translatedString(Tr->SleepingTipAdvancedString), FontStyle::SMALL);
|
||||
OLED::printNumber(tipTemp, 3, FontStyle::SMALL);
|
||||
|
||||
if (getSettingValue(SettingsOptions::TemperatureInF)) {
|
||||
OLED::print(SmallSymbolDegF, FontStyle::SMALL);
|
||||
} else {
|
||||
OLED::print(SmallSymbolDegC, FontStyle::SMALL);
|
||||
}
|
||||
|
||||
OLED::printSymbolDeg(FontStyle::SMALL);
|
||||
OLED::print(SmallSymbolSpace, FontStyle::SMALL);
|
||||
printVoltage();
|
||||
OLED::print(SmallSymbolVolts, FontStyle::SMALL);
|
||||
} else {
|
||||
OLED::print(translatedString(Tr->SleepingSimpleString), FontStyle::LARGE);
|
||||
OLED::printNumber(tipTemp, 3, FontStyle::LARGE);
|
||||
|
||||
if (getSettingValue(SettingsOptions::TemperatureInF)) {
|
||||
OLED::drawSymbol(0);
|
||||
} else {
|
||||
OLED::drawSymbol(1);
|
||||
}
|
||||
OLED::printSymbolDeg(FontStyle::EXTRAS);
|
||||
}
|
||||
|
||||
OLED::refresh();
|
||||
|
||||
Reference in New Issue
Block a user