-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathWatchFaceRailway.h
More file actions
72 lines (55 loc) · 1.86 KB
/
WatchFaceRailway.h
File metadata and controls
72 lines (55 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#pragma once
#include <lvgl/src/lv_core/lv_obj.h>
#include <chrono>
#include <cstdint>
#include "displayapp/screens/Screen.h"
#include "components/datetime/DateTimeController.h"
#include "utility/DirtyValue.h"
#include "displayapp/apps/Apps.h"
#include "displayapp/Controllers.h"
namespace Pinetime {
namespace Applications {
namespace Screens {
class WatchFaceDigital;
class WatchFaceRailway : public Screen {
public:
WatchFaceRailway(AppControllers& controllers);
~WatchFaceRailway() override;
void Refresh() override;
bool OnTouchEvent(TouchEvents event) override;
private:
uint8_t sHour, sMinute;
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime;
// 12 hour notch marks (linemeter)
lv_obj_t* hourNotchMeter;
lv_obj_t* cardinalNotchMeter;
// Hands (linemeter, rotated via angle_offset)
lv_obj_t* hourHandMeter;
lv_obj_t* minuteHandMeter;
// Center dot
lv_obj_t* centerDot;
// Digital overlay
WatchFaceDigital* digitalOverlay;
lv_task_t* overlayDismissTask;
AppControllers& controllers;
void CreateAnalogFace();
void UpdateClock();
void ShowOverlay();
void HideOverlay();
static void DismissOverlayCallback(lv_task_t* task);
lv_task_t* taskRefresh;
};
}
template <>
struct WatchFaceTraits<WatchFace::Railway> {
static constexpr WatchFace watchFace = WatchFace::Railway;
static constexpr const char* name = "Railway";
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::WatchFaceRailway(controllers);
};
static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) {
return true;
}
};
}
}