79 lines
2.6 KiB
C++
79 lines
2.6 KiB
C++
#pragma once
|
|
|
|
#include <lvgl/src/lv_core/lv_obj.h>
|
|
#include <chrono>
|
|
#include <cstdint>
|
|
#include <memory>
|
|
#include "displayapp/screens/Screen.h"
|
|
#include "components/datetime/DateTimeController.h"
|
|
#include "components/ble/BleController.h"
|
|
#include "displayapp/widgets/StatusIcons.h"
|
|
#include "utility/DirtyValue.h"
|
|
|
|
namespace Pinetime {
|
|
namespace Controllers {
|
|
class Battery;
|
|
class Ble;
|
|
class NotificationManager;
|
|
class HeartRateController;
|
|
class MotionController;
|
|
}
|
|
|
|
namespace Applications {
|
|
namespace Screens {
|
|
|
|
class WatchFaceFuzzy : public Screen {
|
|
public:
|
|
WatchFaceFuzzy(Controllers::DateTime& dateTimeController,
|
|
const Controllers::Battery& batteryController,
|
|
const Controllers::Ble& bleController,
|
|
Controllers::NotificationManager& notificationManager,
|
|
Controllers::HeartRateController& heartRateController,
|
|
Controllers::MotionController& motionController);
|
|
~WatchFaceFuzzy() override;
|
|
|
|
void Refresh() override;
|
|
|
|
private:
|
|
uint8_t displayedHour = -1;
|
|
uint8_t displayedMinute = -1;
|
|
|
|
static char const *nums[];
|
|
static char const *mods[];
|
|
|
|
char timeStr[64];
|
|
|
|
Utility::DirtyValue<uint8_t> batteryPercentRemaining {};
|
|
Utility::DirtyValue<bool> powerPresent {};
|
|
Utility::DirtyValue<bool> bleState {};
|
|
Utility::DirtyValue<bool> bleRadioEnabled {};
|
|
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::minutes>> currentDateTime {};
|
|
Utility::DirtyValue<uint32_t> stepCount {};
|
|
Utility::DirtyValue<uint8_t> heartbeat {};
|
|
Utility::DirtyValue<bool> heartbeatRunning {};
|
|
Utility::DirtyValue<bool> notificationState {};
|
|
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;
|
|
|
|
lv_obj_t* label_time;
|
|
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;
|
|
|
|
Controllers::DateTime& dateTimeController;
|
|
Controllers::NotificationManager& notificationManager;
|
|
Controllers::HeartRateController& heartRateController;
|
|
Controllers::MotionController& motionController;
|
|
|
|
lv_task_t* taskRefresh;
|
|
Widgets::StatusIcons statusIcons;
|
|
|
|
void printTimeWords(int h, int m);
|
|
};
|
|
}
|
|
}
|
|
}
|