diff options
| author | Michele Bini <michele.bini@gmail.com> | 2022-03-27 10:11:34 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-03-27 10:30:47 (GMT) |
| commit | 06fc04bcb3b0993c0b1ff2a13848e62b0eaeb529 (patch) | |
| tree | b26e33d78cd25d48b0a75c5de763f1790c7b0ff4 /src/displayapp/screens/WatchFaceDigital.cpp | |
| parent | c8694c78c6cc05ae09e862e7ecd09407c7a3c3b7 (diff) | |
Show temperature reading
Diffstat (limited to 'src/displayapp/screens/WatchFaceDigital.cpp')
| -rw-r--r-- | src/displayapp/screens/WatchFaceDigital.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index e33a403..0bb2bf6 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -21,8 +21,10 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app, Controllers::Ble& bleController, Controllers::NotificationManager& notificatioManager, Controllers::Settings& settingsController, - Controllers::MotionController& motionController) + Controllers::MotionController& motionController, + System::SystemTask& systemTask) : Screen(app), + systemTask {systemTask}, currentDateTime {{}}, dateTimeController {dateTimeController}, batteryController {batteryController}, @@ -56,6 +58,12 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app, lv_obj_set_style_local_text_color(label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999)); 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_font( label_temp, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont1); + lv_label_set_text_fmt(label_temp, "T? [?,?]"); + 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); @@ -111,6 +119,13 @@ void WatchFaceDigital::Refresh() { lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(notificationState.Get())); } + // 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)) + ); + currentDateTime = dateTimeController.CurrentDateTime(); if (currentDateTime.IsUpdated()) { |
