Skip to content

Commit 8475967

Browse files
committed
Adjust alert UI alignment and CPU temp thresholds
Updated the CPU temperature warning high threshold from 50 to 60 in monitor_config.h. Refined the alignment logic for warning and critical alert circles in lvgl_alerts.cpp to improve UI positioning.
1 parent 41a9446 commit 8475967

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

inc/sp140/monitor_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ static const Thresholds bmsVoltageDifferentialThresholds = {.warnLow = -1.0, .wa
2424
static const Thresholds baroTempThresholds = {.warnLow = 0, .warnHigh = 50, .critLow = -10, .critHigh = 80};
2525

2626
// -- Internal Thresholds --
27-
static const Thresholds cpuTempThresholds = {.warnLow = 0, .warnHigh = 50, .critLow = -10, .critHigh = 80};
27+
static const Thresholds cpuTempThresholds = {.warnLow = 0, .warnHigh = 60, .critLow = -10, .critHigh = 80};
2828

2929
#endif // INC_SP140_MONITOR_CONFIG_H_

src/sp140/lvgl/lvgl_alerts.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ void setupAlertCounterUI(bool darkMode) {
3939
lv_obj_set_size(warning_counter_circle, CIRCLE_SIZE, CIRCLE_SIZE);
4040
// Align relative to altitude area (using first altitude character as reference)
4141
if (altitude_char_labels[0]) {
42-
lv_obj_align_to(warning_counter_circle, altitude_char_labels[0], LV_ALIGN_OUT_TOP_LEFT, 0, -2);
42+
lv_obj_align_to(warning_counter_circle, altitude_char_labels[0], LV_ALIGN_OUT_TOP_LEFT, 1, -2);
4343
} else {
44-
lv_obj_align(warning_counter_circle, LV_ALIGN_TOP_LEFT, 5, 75);
44+
lv_obj_align(warning_counter_circle, LV_ALIGN_TOP_LEFT, 6, 75);
4545
}
4646
lv_led_set_color(warning_counter_circle, LVGL_ORANGE);
4747
lv_led_on(warning_counter_circle);
@@ -63,7 +63,7 @@ void setupAlertCounterUI(bool darkMode) {
6363
critical_counter_circle = lv_led_create(main_screen);
6464
lv_obj_set_size(critical_counter_circle, CIRCLE_SIZE, CIRCLE_SIZE);
6565
if (warning_counter_circle) {
66-
lv_obj_align_to(critical_counter_circle, warning_counter_circle, LV_ALIGN_OUT_RIGHT_MID, 4, 0);
66+
lv_obj_align_to(critical_counter_circle, warning_counter_circle, LV_ALIGN_OUT_RIGHT_BOTTOM, 4, 0);
6767
} else {
6868
lv_obj_align(critical_counter_circle, LV_ALIGN_TOP_LEFT, 35, 75);
6969
}
@@ -131,8 +131,10 @@ void updateAlertCounterDisplay(const AlertCounts& counts) {
131131
// No warnings: position to align with alert text (avoid red border)
132132
lv_obj_align(critical_counter_circle, LV_ALIGN_TOP_LEFT, 10, 75);
133133
} else {
134-
// With warnings: position to right of warning circle
135-
lv_obj_align(critical_counter_circle, LV_ALIGN_TOP_LEFT, 35, 75);
134+
// With warnings: position to the right of the warning circle, align bottoms
135+
if (warning_counter_circle) {
136+
lv_obj_align_to(critical_counter_circle, warning_counter_circle, LV_ALIGN_OUT_RIGHT_BOTTOM, 4, 0);
137+
}
136138
}
137139
} else {
138140
lv_obj_add_flag(critical_counter_circle, LV_OBJ_FLAG_HIDDEN);

0 commit comments

Comments
 (0)