-
-
Notifications
You must be signed in to change notification settings - Fork 952
/
HeartRate.h
53 lines (43 loc) · 1.38 KB
/
HeartRate.h
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
#pragma once
#include <cstdint>
#include <chrono>
#include "displayapp/screens/Screen.h"
#include "systemtask/SystemTask.h"
#include "systemtask/WakeLock.h"
#include "Symbols.h"
#include <lvgl/src/lv_core/lv_style.h>
#include <lvgl/src/lv_core/lv_obj.h>
namespace Pinetime {
namespace Controllers {
class HeartRateController;
}
namespace Applications {
namespace Screens {
class HeartRate : public Screen {
public:
HeartRate(Controllers::HeartRateController& HeartRateController, System::SystemTask& systemTask);
~HeartRate() override;
void Refresh() override;
void OnStartStopEvent(lv_event_t event);
private:
Controllers::HeartRateController& heartRateController;
Pinetime::System::WakeLock wakeLock;
void UpdateStartStopButton(bool isRunning);
lv_obj_t* label_hr;
lv_obj_t* label_bpm;
lv_obj_t* label_status;
lv_obj_t* btn_startStop;
lv_obj_t* label_startStop;
lv_task_t* taskRefresh;
};
}
template <>
struct AppTraits<Apps::HeartRate> {
static constexpr Apps app = Apps::HeartRate;
static constexpr const char* icon = Screens::Symbols::heartBeat;
static Screens::Screen* Create(AppControllers& controllers) {
return new Screens::HeartRate(controllers.heartRateController, *controllers.systemTask);
};
};
}
}