-
-
Notifications
You must be signed in to change notification settings - Fork 691
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
11 changed files
with
43 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 4 additions & 21 deletions
25
source/Core/Threads/OperatingModes/utils/DrawTipTemperature.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,14 @@ | ||
#include "OperatingModeUtilities.h" | ||
#include "OperatingModes.h" | ||
#include "TipThermoModel.h" | ||
|
||
void gui_drawTipTemp(bool symbol, const FontStyle font) { | ||
// Draw tip temp handling unit conversion & tolerance near setpoint | ||
uint32_t Temp = 0; | ||
if (getSettingValue(SettingsOptions::TemperatureInF)) { | ||
Temp = TipThermoModel::getTipInF(); | ||
} else { | ||
Temp = TipThermoModel::getTipInC(); | ||
} | ||
uint16_t Temp = getTipTemp(); | ||
|
||
OLED::printNumber(Temp, 3, font); // Draw the tip temp out | ||
if (symbol) { | ||
if (font == FontStyle::LARGE) { | ||
// Big font, can draw nice symbols | ||
if (getSettingValue(SettingsOptions::TemperatureInF)) { | ||
OLED::drawSymbol(0); | ||
} else { | ||
OLED::drawSymbol(1); | ||
} | ||
} else { | ||
// Otherwise fall back to chars | ||
if (getSettingValue(SettingsOptions::TemperatureInF)) { | ||
OLED::print(SmallSymbolDegF, FontStyle::SMALL); | ||
} else { | ||
OLED::print(SmallSymbolDegC, FontStyle::SMALL); | ||
} | ||
} | ||
// For big font, can draw nice symbols, otherwise fall back to chars | ||
OLED::printSymbolDeg(font == FontStyle::LARGE ? FontStyle::EXTRAS : font); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters