Change status to 'In Control' when in control

This commit is contained in:
suchmememanyskill
2024-03-11 21:55:33 +01:00
parent fb1e264df7
commit 8d6d22c38a
2 changed files with 8 additions and 4 deletions

View File

@@ -34,7 +34,14 @@ static void update_printer_status_text(lv_event_t * e)
int index = config - global_config.printer_config; int index = config - global_config.printer_config;
PrinterMinimal * printer = &printer_minimal[index]; PrinterMinimal * printer = &printer_minimal[index];
if (!printer->online){ if (config == get_current_printer_config())
{
lv_label_set_text(label, "In Control");
return;
}
if (!printer->online)
{
lv_label_set_text(label, "Offline"); lv_label_set_text(label, "Offline");
return; return;
} }

View File

@@ -209,19 +209,16 @@ void on_timer_destroy(lv_event_t * e)
{ {
lv_timer_del(timer); lv_timer_del(timer);
timer = NULL; timer = NULL;
Serial.println("Timer destroy");
} }
void timer_callback(lv_timer_t *timer) void timer_callback(lv_timer_t *timer)
{ {
lv_obj_t * panel = (lv_obj_t *)timer->user_data; lv_obj_t * panel = (lv_obj_t *)timer->user_data;
lv_obj_del(panel); lv_obj_del(panel);
Serial.println("Timer callback");
} }
void lv_create_popup_message(const char* message, uint16_t timeout_ms) void lv_create_popup_message(const char* message, uint16_t timeout_ms)
{ {
Serial.println("Hello");
if (message == nullptr || timer != NULL) if (message == nullptr || timer != NULL)
{ {
return; return;