Declutter driver view

This commit is contained in:
2023-05-24 01:28:41 +02:00
parent 36ef42acb2
commit 67b19368b0
18 changed files with 213 additions and 585 deletions

View File

@ -54,6 +54,7 @@ private:
DataFieldType fieldTypes[NUM_FIELDS];
touchgfx::Unicode::UnicodeChar r2dProgBuffer[16];
touchgfx::Unicode::UnicodeChar socBuffer[4];
};
#endif // DRIVERVIEWVIEW_HPP

View File

@ -43,15 +43,6 @@ void DriverViewView::setupScreen() {
brakeTempRL.setTempThresholds(brakeThresholds);
brakeTempRR.setSmallText(true);
brakeTempRR.setTempThresholds(brakeThresholds);
int invThresholds[4] = {30, 40, 50, 60};
invTempL.setTempThresholds(invThresholds);
invTempR.setTempThresholds(invThresholds);
int motorThresholds[4] = {30, 45, 60, 80};
motorTempL.setTempThresholds(motorThresholds);
motorTempR.setTempThresholds(motorThresholds);
int batThresholds[4] = {30, 40, 50, 55};
batTempL.setTempThresholds(batThresholds);
batTempR.setTempThresholds(batThresholds);
}
void DriverViewView::tearDownScreen() { DriverViewViewBase::tearDownScreen(); }
@ -94,17 +85,15 @@ void DriverViewView::setTemps(const Temperatures &temps) {
brakeTempFR.setTemp(std::round(temps.brake_fr));
brakeTempRL.setTemp(std::round(temps.brake_rl));
brakeTempRR.setTemp(std::round(temps.brake_rr));
invTempL.setTemp(std::round(temps.inv_l));
invTempR.setTemp(std::round(temps.inv_r));
motorTempL.setTemp(std::round(temps.mot_l));
motorTempR.setTemp(std::round(temps.mot_r));
batTempL.setTemp(std::round(temps.bat_l));
batTempR.setTemp(std::round(temps.bat_r));
}
void DriverViewView::setTSSoC(uint8_t soc) {
tsSoC.setValue(soc);
tsSoC.invalidate();
void DriverViewView::setTSSoC(uint8_t value) {
soc.setValue(value);
soc.invalidate();
touchgfx::Unicode::itoa(value, socBuffer,
sizeof(socBuffer) / sizeof(*socBuffer), 10);
socLabel.setWildcard(socBuffer);
socLabel.invalidate();
}
void DriverViewView::setProgress(bool active, DriverViewProgressType type,