diff options
Diffstat (limited to 'src/displayapp/screens/WatchFaceDigital.cpp')
| -rw-r--r-- | src/displayapp/screens/WatchFaceDigital.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 8178d22..8176c7b 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -59,10 +59,10 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app, lv_obj_set_style_local_text_font(label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont2); label_temp = lv_label_create(lv_scr_act(), nullptr); - lv_obj_align(label_temp, lv_scr_act(), LV_ALIGN_CENTER, 0, -60); - lv_obj_set_style_local_text_color( label_temp, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999)); + lv_obj_set_style_local_text_color( label_temp, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x222222)); lv_obj_set_style_local_text_font( label_temp, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont15); - lv_label_set_text_fmt(label_temp, "T? [?,?]"); + lv_label_set_text_fmt(label_temp, "??°C"); + lv_obj_align(label_temp, lv_scr_act(), LV_ALIGN_CENTER, 60, -60); label_time = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(label_time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont3); @@ -120,12 +120,18 @@ void WatchFaceDigital::Refresh() { } #ifndef INFINISIM - systemTask.motionSensor.RefreshTemperature(); - lv_label_set_text_fmt(label_temp, "T%d [%d,%d]", - ((int)(systemTask.motionSensor.temperature_last_read_value+23)), - ((int)(systemTask.motionSensor.temperature_last_result)), - ((int)(systemTask.motionSensor.temperature_read_counter)) - ); + temperature = systemTask.motionSensor.getTemperature(); + if (temperature.IsUpdated()) { + lv_obj_set_style_local_text_color( label_temp, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999)); + lv_label_set_text_fmt(label_temp, "%d°C"); +#if 0 + lv_label_set_text_fmt(label_temp, "T%d [%d,%d]", + ((int)(systemTask.motionSensor.temperature_last_read_value+23)), + ((int)(systemTask.motionSensor.temperature_last_result)), + ((int)(systemTask.motionSensor.temperature_read_counter)) + ); +#endif + } #endif currentDateTime = dateTimeController.CurrentDateTime(); |
