Hide cycles until 0 error resolved (#2367)

This commit is contained in:
Totoo 2024-11-19 11:23:33 +01:00 committed by GitHub
parent d31857c21e
commit 1fc84e7eac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 12 deletions

View File

@ -50,7 +50,7 @@ void BattinfoView::update_result() {
text_voltage.set("UNKNOWN"); text_voltage.set("UNKNOWN");
text_current.set("-"); text_current.set("-");
text_charge.set("-"); text_charge.set("-");
text_cycles.set("-"); // text_cycles.set("-");
text_ttef.set("-"); text_ttef.set("-");
text_method.set("-"); text_method.set("-");
text_warn.set(""); text_warn.set("");
@ -96,20 +96,20 @@ void BattinfoView::update_result() {
labels_opt.hidden(true); labels_opt.hidden(true);
text_current.hidden(true); text_current.hidden(true);
text_charge.hidden(true); text_charge.hidden(true);
text_cycles.hidden(true); // text_cycles.hidden(true);
text_ttef.hidden(true); text_ttef.hidden(true);
text_warn.set(""); text_warn.set("");
} }
if ((valid_mask & battery::BatteryManagement::BATT_VALID_CYCLES) == battery::BatteryManagement::BATT_VALID_CYCLES) { if ((valid_mask & battery::BatteryManagement::BATT_VALID_CYCLES) == battery::BatteryManagement::BATT_VALID_CYCLES) {
text_cycles.hidden(false); // text_cycles.hidden(false);
uint16_t cycles = battery::BatteryManagement::get_cycles(); uint16_t cycles = 0; // battery::BatteryManagement::get_cycles();
if (cycles < 2) if (cycles < 2)
text_warn.set("SoC improves after 2 cycles"); text_warn.set("SoC improves after each cycles");
else else
text_warn.set(""); text_warn.set("");
text_cycles.set(to_string_dec_uint(cycles)); // text_cycles.set(to_string_dec_uint(cycles));
} else { } else {
text_cycles.hidden(true); // text_cycles.hidden(true);
text_warn.set(""); text_warn.set("");
} }
if ((valid_mask & battery::BatteryManagement::BATT_VALID_TTEF) == battery::BatteryManagement::BATT_VALID_TTEF) { if ((valid_mask & battery::BatteryManagement::BATT_VALID_TTEF) == battery::BatteryManagement::BATT_VALID_TTEF) {
@ -160,7 +160,7 @@ BattinfoView::BattinfoView(NavigationView& nav)
&text_method, &text_method,
&button_mode, &button_mode,
&button_exit, &button_exit,
&text_cycles, // &text_cycles,
&text_warn, &text_warn,
&text_ttef}); &text_ttef});

View File

@ -63,7 +63,7 @@ class BattinfoView : public View {
{{2 * 8, 4 * 16}, "Current:", Theme::getInstance()->fg_light->foreground}, {{2 * 8, 4 * 16}, "Current:", Theme::getInstance()->fg_light->foreground},
{{2 * 8, 5 * 16}, "Charge:", Theme::getInstance()->fg_light->foreground}, {{2 * 8, 5 * 16}, "Charge:", Theme::getInstance()->fg_light->foreground},
{{2 * 8, 6 * 16}, "TTF/E:", Theme::getInstance()->fg_light->foreground}, {{2 * 8, 6 * 16}, "TTF/E:", Theme::getInstance()->fg_light->foreground},
{{2 * 8, 7 * 16}, "Cycles:", Theme::getInstance()->fg_light->foreground}, // {{2 * 8, 7 * 16}, "Cycles:", Theme::getInstance()->fg_light->foreground},
{{2 * 8, 10 * 16}, "Change method:", Theme::getInstance()->fg_light->foreground}, {{2 * 8, 10 * 16}, "Change method:", Theme::getInstance()->fg_light->foreground},
}; };
@ -85,12 +85,12 @@ class BattinfoView : public View {
Text text_ttef{ Text text_ttef{
{13 * 8, 6 * 16, 10 * 16, 16}, {13 * 8, 6 * 16, 10 * 16, 16},
"-"}; "-"};
Text text_cycles{ /* Text text_cycles{
{13 * 8, 7 * 16, 10 * 16, 16}, {13 * 8, 7 * 16, 10 * 16, 16},
"-"}; "-"}; */
Text text_warn{ Text text_warn{
{2 * 8, 8 * 16, 30 * 8, 2 * 16}, {1 * 8, 8 * 16, 30 * 8, 2 * 16},
""}; ""};
Button button_mode{ Button button_mode{