2021-02-24 19:40:24 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <lvgl/src/lv_core/lv_obj.h>
|
|
|
|
#include <chrono>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <memory>
|
2021-10-13 22:08:35 +02:00
|
|
|
#include "displayapp/screens/Screen.h"
|
2021-02-24 19:40:24 +00:00
|
|
|
#include "components/datetime/DateTimeController.h"
|
2021-12-23 20:30:14 -06:00
|
|
|
#include "components/ble/BleController.h"
|
2022-07-21 19:27:52 +03:00
|
|
|
#include "displayapp/widgets/StatusIcons.h"
|
2023-03-16 22:08:51 +01:00
|
|
|
#include "utility/DirtyValue.h"
|
2021-02-24 19:40:24 +00:00
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Controllers {
|
|
|
|
class Settings;
|
|
|
|
class Battery;
|
|
|
|
class Ble;
|
|
|
|
class NotificationManager;
|
|
|
|
class HeartRateController;
|
2021-03-31 19:47:27 +02:00
|
|
|
class MotionController;
|
2021-02-24 19:40:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace Applications {
|
|
|
|
namespace Screens {
|
|
|
|
|
|
|
|
class WatchFaceDigital : public Screen {
|
2021-04-24 12:00:45 +03:00
|
|
|
public:
|
2023-02-22 22:36:38 +02:00
|
|
|
WatchFaceDigital(Controllers::DateTime& dateTimeController,
|
2023-02-23 22:16:44 +02:00
|
|
|
const Controllers::Battery& batteryController,
|
2023-02-23 22:24:07 +02:00
|
|
|
const Controllers::Ble& bleController,
|
2022-09-22 13:43:00 +02:00
|
|
|
Controllers::NotificationManager& notificationManager,
|
2021-04-18 20:28:14 +03:00
|
|
|
Controllers::Settings& settingsController,
|
|
|
|
Controllers::HeartRateController& heartRateController,
|
|
|
|
Controllers::MotionController& motionController);
|
|
|
|
~WatchFaceDigital() override;
|
2021-02-24 19:40:24 +00:00
|
|
|
|
2021-07-19 16:26:12 +03:00
|
|
|
void Refresh() override;
|
2021-02-24 19:40:24 +00:00
|
|
|
|
2021-04-24 12:00:45 +03:00
|
|
|
private:
|
2022-01-20 16:04:26 +02:00
|
|
|
uint8_t displayedHour = -1;
|
|
|
|
uint8_t displayedMinute = -1;
|
2021-02-24 19:40:24 +00:00
|
|
|
|
2023-03-16 22:08:51 +01:00
|
|
|
Utility::DirtyValue<uint8_t> batteryPercentRemaining {};
|
|
|
|
Utility::DirtyValue<bool> powerPresent {};
|
|
|
|
Utility::DirtyValue<bool> bleState {};
|
|
|
|
Utility::DirtyValue<bool> bleRadioEnabled {};
|
2023-03-03 12:51:17 +02:00
|
|
|
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::minutes>> currentDateTime {};
|
2023-03-16 22:08:51 +01:00
|
|
|
Utility::DirtyValue<uint32_t> stepCount {};
|
|
|
|
Utility::DirtyValue<uint8_t> heartbeat {};
|
|
|
|
Utility::DirtyValue<bool> heartbeatRunning {};
|
|
|
|
Utility::DirtyValue<bool> notificationState {};
|
2023-03-03 12:51:17 +02:00
|
|
|
using days = std::chrono::duration<int32_t, std::ratio<86400>>; // TODO: days is standard in c++20
|
|
|
|
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, days>> currentDate;
|
2021-02-24 19:40:24 +00:00
|
|
|
|
2021-04-18 20:28:14 +03:00
|
|
|
lv_obj_t* label_time;
|
|
|
|
lv_obj_t* label_time_ampm;
|
|
|
|
lv_obj_t* label_date;
|
|
|
|
lv_obj_t* heartbeatIcon;
|
|
|
|
lv_obj_t* heartbeatValue;
|
|
|
|
lv_obj_t* stepIcon;
|
|
|
|
lv_obj_t* stepValue;
|
|
|
|
lv_obj_t* notificationIcon;
|
2021-02-24 19:40:24 +00:00
|
|
|
|
2021-04-18 20:28:14 +03:00
|
|
|
Controllers::DateTime& dateTimeController;
|
2022-09-22 13:43:00 +02:00
|
|
|
Controllers::NotificationManager& notificationManager;
|
2021-04-18 20:28:14 +03:00
|
|
|
Controllers::Settings& settingsController;
|
|
|
|
Controllers::HeartRateController& heartRateController;
|
|
|
|
Controllers::MotionController& motionController;
|
2021-07-19 16:26:12 +03:00
|
|
|
|
|
|
|
lv_task_t* taskRefresh;
|
2022-07-21 19:27:52 +03:00
|
|
|
Widgets::StatusIcons statusIcons;
|
2021-02-24 19:40:24 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|