diff options
Diffstat (limited to 'src/displayapp/screens/WatchFaceInfineat.h')
| -rw-r--r-- | src/displayapp/screens/WatchFaceInfineat.h | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/src/displayapp/screens/WatchFaceInfineat.h b/src/displayapp/screens/WatchFaceInfineat.h index 26973efe..78d020f1 100644 --- a/src/displayapp/screens/WatchFaceInfineat.h +++ b/src/displayapp/screens/WatchFaceInfineat.h @@ -4,8 +4,11 @@ #include <chrono> #include <cstdint> #include <memory> +#include <displayapp/Controllers.h> #include "displayapp/screens/Screen.h" #include "components/datetime/DateTimeController.h" +#include "utility/DirtyValue.h" +#include "displayapp/apps/Apps.h" namespace Pinetime { namespace Controllers { @@ -42,23 +45,18 @@ namespace Pinetime { static bool IsAvailable(Pinetime::Controllers::FS& filesystem); private: - char displayedChar[5] {}; - - uint16_t currentYear = 1970; - Pinetime::Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown; - Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown; - uint8_t currentDay = 0; uint32_t savedTick = 0; uint8_t chargingBatteryPercent = 101; // not a mistake ;) + TickType_t chargingAnimationTick = 0; - DirtyValue<uint8_t> batteryPercentRemaining {}; - DirtyValue<bool> isCharging {}; - DirtyValue<bool> bleState {}; - DirtyValue<bool> bleRadioEnabled {}; - DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime {}; - DirtyValue<bool> motionSensorOk {}; - DirtyValue<uint32_t> stepCount {}; - DirtyValue<bool> notificationState {}; + Utility::DirtyValue<uint8_t> batteryPercentRemaining {}; + Utility::DirtyValue<bool> isCharging {}; + 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<bool> notificationState {}; + Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::days>> currentDate; // Lines making up the side cover lv_obj_t* lineBattery; @@ -102,5 +100,25 @@ namespace Pinetime { lv_font_t* font_bebas = nullptr; }; } + + template <> + struct WatchFaceTraits<WatchFace::Infineat> { + static constexpr WatchFace watchFace = WatchFace::Infineat; + static constexpr const char* name = "Infineat face"; + + static Screens::Screen* Create(AppControllers& controllers) { + return new Screens::WatchFaceInfineat(controllers.dateTimeController, + controllers.batteryController, + controllers.bleController, + controllers.notificationManager, + controllers.settingsController, + controllers.motionController, + controllers.filesystem); + }; + + static bool IsAvailable(Pinetime::Controllers::FS& filesystem) { + return Screens::WatchFaceInfineat::IsAvailable(filesystem); + } + }; } } |
