Skip to content

Commit 69e4ab6

Browse files
committed
Manual squash merge of PR #932 (#932) from 13werwolf13 (https://github.com/13werwolf13). This PR adds a new Terminal watchface to InfiniTime!
Squashed commit of the following: commit 23ea840b059c69667c8711265cecaf992791acb6 Author: Jean-François Milants <jf@codingfield.com> Date: Sun Feb 20 13:14:27 2022 +0100 Terminal watch face : fix includes and a few code cleaning. commit 3c244def25e3ad8e1f56d708fb0864c122059948 Merge: 4079086 138a655 Author: Jean-François Milants <jf@codingfield.com> Date: Sun Feb 20 12:45:54 2022 +0100 Merge branch 'develop' of https://github.com/13werwolf13/InfiniTime into 13werwolf13-develop commit 138a655 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:13:00 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.h Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit 3515616 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:12:43 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit 757ca2d Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:12:30 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit 60b6b4e Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:12:20 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit 6959d8c Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:11:46 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit 4d85028 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:11:17 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit af483be Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:10:57 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit 6bc6c1a Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:10:40 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.h Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit 25fdafc Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:06:10 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit 12e1b0f Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:05:44 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit e6c0f32 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:05:22 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.h Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit 342ce8c Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:05:06 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit 265fec5 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:04:06 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit b4669be Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:03:29 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit 471a843 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:03:10 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit 6853166 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Wed Feb 2 09:02:51 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit bba34f6 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Sat Jan 22 12:32:41 2022 +0500 some fixes commit 74eea9f Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Sat Jan 22 12:32:17 2022 +0500 some fixes commit 1e4a676 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Fri Jan 21 08:59:44 2022 +0500 no errors, no warnings, no work.. commit eb8bd4d Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 20 23:50:04 2022 +0500 add ble state text output commit fda1c08 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 20 22:25:35 2022 +0500 add ble state text output commit 68d3d9b Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 20 22:22:20 2022 +0500 add ble state text output commit 0ed45a9 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Tue Jan 18 15:48:15 2022 +0500 typo fix commit 477a3a7 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Tue Jan 18 10:36:19 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit d684988 Author: Марков Дмитрий <13werwolf13@mail.ru> Date: Tue Jan 18 10:36:09 2022 +0500 Update src/displayapp/screens/WatchFaceTerminal.cpp Co-authored-by: NeroBurner <pyro4hell@gmail.com> commit e2f7e31 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Mon Jan 17 13:34:05 2022 +0500 typo fix commit fc246be Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Sat Jan 15 15:26:25 2022 +0500 typo fix commit ebbb31a Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Fri Jan 14 10:08:29 2022 +0500 typo fix commit 3afedca Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 13 12:34:39 2022 +0500 time format commit 471a4c9 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 13 12:27:10 2022 +0500 time format commit d3fd348 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 13 12:26:49 2022 +0500 time format commit e540d10 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Thu Jan 13 11:28:31 2022 +0500 add patch commit 7288301 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Wed Jan 12 22:08:07 2022 +0500 add menue item commit 4c58476 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Wed Jan 12 21:42:22 2022 +0500 typo fix commit 79273fe Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Wed Jan 12 20:48:06 2022 +0500 typo fix commit 1808a78 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Wed Jan 12 20:17:15 2022 +0500 typo fix commit 6dfa141 Author: Дмитрий Марков <markov@promobit.ru> Date: Wed Jan 12 20:12:09 2022 +0500 typo fix commit 88f0190 Author: Дмитрий Марков <13werwolf13@mail.ru> Date: Wed Jan 12 14:50:54 2022 +0500 add terminal watchface
1 parent 4079086 commit 69e4ab6

8 files changed

Lines changed: 303 additions & 9 deletions

File tree

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ list(APPEND SOURCE_FILES
454454
displayapp/icons/bg_clock.c
455455
displayapp/screens/WatchFaceAnalog.cpp
456456
displayapp/screens/WatchFaceDigital.cpp
457+
displayapp/screens/WatchFaceTerminal.cpp
457458
displayapp/screens/PineTimeStyle.cpp
458459

459460
##

src/components/heartrate/Ppg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#pragma once
22

33
#include <array>
4+
#include <cstddef>
5+
#include <cstdint>
46
#include "components/heartrate/Biquad.h"
57
#include "components/heartrate/Ptagc.h"
68

src/displayapp/screens/Clock.cpp

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "components/settings/Settings.h"
1010
#include "displayapp/DisplayApp.h"
1111
#include "displayapp/screens/WatchFaceDigital.h"
12+
#include "displayapp/screens/WatchFaceTerminal.h"
1213
#include "displayapp/screens/WatchFaceAnalog.h"
1314
#include "displayapp/screens/PineTimeStyle.h"
1415

@@ -41,6 +42,9 @@ Clock::Clock(DisplayApp* app,
4142
case 2:
4243
return PineTimeStyleScreen();
4344
break;
45+
case 3:
46+
return WatchFaceTerminalScreen();
47+
break;
4448
}
4549
return WatchFaceDigitalScreen();
4650
}()} {
@@ -76,11 +80,17 @@ std::unique_ptr<Screen> Clock::WatchFaceAnalogScreen() {
7680
}
7781

7882
std::unique_ptr<Screen> Clock::PineTimeStyleScreen() {
79-
return std::make_unique<Screens::PineTimeStyle>(app,
80-
dateTimeController,
81-
batteryController,
82-
bleController,
83-
notificatioManager,
84-
settingsController,
85-
motionController);
83+
return std::make_unique<Screens::PineTimeStyle>(
84+
app, dateTimeController, batteryController, bleController, notificatioManager, settingsController, motionController);
85+
}
86+
87+
std::unique_ptr<Screen> Clock::WatchFaceTerminalScreen() {
88+
return std::make_unique<Screens::WatchFaceTerminal>(app,
89+
dateTimeController,
90+
batteryController,
91+
bleController,
92+
notificatioManager,
93+
settingsController,
94+
heartRateController,
95+
motionController);
8696
}

src/displayapp/screens/Clock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ namespace Pinetime {
4747
std::unique_ptr<Screen> WatchFaceDigitalScreen();
4848
std::unique_ptr<Screen> WatchFaceAnalogScreen();
4949
std::unique_ptr<Screen> PineTimeStyleScreen();
50+
std::unique_ptr<Screen> WatchFaceTerminalScreen();
5051
};
5152
}
5253
}
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
#include <date/date.h>
2+
#include <lvgl/lvgl.h>
3+
#include "displayapp/screens/WatchFaceTerminal.h"
4+
#include "displayapp/screens/BatteryIcon.h"
5+
#include "displayapp/screens/NotificationIcon.h"
6+
#include "displayapp/screens/Symbols.h"
7+
#include "components/battery/BatteryController.h"
8+
#include "components/ble/BleController.h"
9+
#include "components/ble/NotificationManager.h"
10+
#include "components/heartrate/HeartRateController.h"
11+
#include "components/motion/MotionController.h"
12+
#include "components/settings/Settings.h"
13+
14+
using namespace Pinetime::Applications::Screens;
15+
16+
WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app,
17+
Controllers::DateTime& dateTimeController,
18+
Controllers::Battery& batteryController,
19+
Controllers::Ble& bleController,
20+
Controllers::NotificationManager& notificatioManager,
21+
Controllers::Settings& settingsController,
22+
Controllers::HeartRateController& heartRateController,
23+
Controllers::MotionController& motionController)
24+
: Screen(app),
25+
currentDateTime {{}},
26+
dateTimeController {dateTimeController},
27+
batteryController {batteryController},
28+
bleController {bleController},
29+
notificatioManager {notificatioManager},
30+
settingsController {settingsController},
31+
heartRateController {heartRateController},
32+
motionController {motionController} {
33+
settingsController.SetClockFace(3);
34+
35+
batteryIcon = lv_label_create(lv_scr_act(), nullptr);
36+
lv_label_set_text(batteryIcon, Symbols::batteryFull);
37+
lv_obj_align(batteryIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -5, 2);
38+
39+
batteryPlug = lv_label_create(lv_scr_act(), nullptr);
40+
lv_label_set_text(batteryPlug, Symbols::plug);
41+
lv_obj_align(batteryPlug, batteryIcon, LV_ALIGN_OUT_LEFT_MID, -5, 0);
42+
43+
batteryValue = lv_label_create(lv_scr_act(), nullptr);
44+
lv_label_set_recolor(batteryValue, true);
45+
lv_obj_align(batteryValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -20);
46+
47+
connectState = lv_label_create(lv_scr_act(), nullptr);
48+
lv_label_set_recolor(connectState, true);
49+
lv_label_set_text(connectState, "[STAT]#387b54 Disconnected#");
50+
lv_obj_align(connectState, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 40);
51+
52+
notificationIcon = lv_label_create(lv_scr_act(), nullptr);
53+
lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false));
54+
lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_TOP_LEFT, 10, 0);
55+
56+
label_date = lv_label_create(lv_scr_act(), nullptr);
57+
lv_label_set_recolor(label_date, true);
58+
lv_obj_align(label_date, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -40);
59+
60+
label_prompt_1 = lv_label_create(lv_scr_act(), nullptr);
61+
lv_obj_align(label_prompt_1, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -80);
62+
lv_label_set_text(label_prompt_1, "user@watch:~ $ now");
63+
64+
label_prompt_2 = lv_label_create(lv_scr_act(), nullptr);
65+
lv_obj_align(label_prompt_2, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 60);
66+
lv_label_set_text(label_prompt_2, "user@watch:~ $");
67+
68+
label_time = lv_label_create(lv_scr_act(), nullptr);
69+
lv_label_set_recolor(label_time, true);
70+
lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -60);
71+
72+
backgroundLabel = lv_label_create(lv_scr_act(), nullptr);
73+
lv_obj_set_click(backgroundLabel, true);
74+
lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP);
75+
lv_obj_set_size(backgroundLabel, 240, 240);
76+
lv_obj_set_pos(backgroundLabel, 0, 0);
77+
lv_label_set_text(backgroundLabel, "");
78+
79+
heartbeatValue = lv_label_create(lv_scr_act(), nullptr);
80+
lv_label_set_recolor(heartbeatValue, true);
81+
lv_label_set_text(heartbeatValue, "[L_HR]#ee3311 0 bpm#");
82+
lv_obj_align(heartbeatValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 20);
83+
84+
stepValue = lv_label_create(lv_scr_act(), nullptr);
85+
lv_label_set_recolor(stepValue, true);
86+
lv_label_set_text(stepValue, "[STEP]#ee3377 0 steps#");
87+
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 0);
88+
89+
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
90+
Refresh();
91+
}
92+
93+
WatchFaceTerminal::~WatchFaceTerminal() {
94+
lv_task_del(taskRefresh);
95+
lv_obj_clean(lv_scr_act());
96+
}
97+
98+
void WatchFaceTerminal::Refresh() {
99+
powerPresent = batteryController.IsPowerPresent();
100+
if (powerPresent.IsUpdated()) {
101+
lv_label_set_text_static(batteryPlug, BatteryIcon::GetPlugIcon(powerPresent.Get()));
102+
}
103+
104+
batteryPercentRemaining = batteryController.PercentRemaining();
105+
if (batteryPercentRemaining.IsUpdated()) {
106+
auto batteryPercent = batteryPercentRemaining.Get();
107+
if (batteryPercent == 100) {
108+
lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN);
109+
} else {
110+
lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
111+
}
112+
lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent));
113+
lv_label_set_text_fmt(batteryValue, "[BATT]#387b54 %d%\%#", batteryPercent);
114+
}
115+
116+
bleState = bleController.IsConnected();
117+
if (bleState.IsUpdated()) {
118+
if (bleState.Get()) {
119+
lv_label_set_text_static(connectState, "[STAT]#387b54 Connected#");
120+
} else {
121+
lv_label_set_text_static(connectState, "[STAT]#387b54 Disconnected#");
122+
}
123+
}
124+
125+
notificationState = notificatioManager.AreNewNotificationsAvailable();
126+
if (notificationState.IsUpdated()) {
127+
if (notificationState.Get()) {
128+
lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(true));
129+
} else {
130+
lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false));
131+
}
132+
}
133+
134+
currentDateTime = dateTimeController.CurrentDateTime();
135+
136+
if (currentDateTime.IsUpdated()) {
137+
auto newDateTime = currentDateTime.Get();
138+
139+
auto dp = date::floor<date::days>(newDateTime);
140+
auto time = date::make_time(newDateTime - dp);
141+
auto yearMonthDay = date::year_month_day(dp);
142+
143+
auto year = static_cast<int>(yearMonthDay.year());
144+
auto month = static_cast<Pinetime::Controllers::DateTime::Months>(static_cast<unsigned>(yearMonthDay.month()));
145+
auto day = static_cast<unsigned>(yearMonthDay.day());
146+
auto dayOfWeek = static_cast<Pinetime::Controllers::DateTime::Days>(date::weekday(yearMonthDay).iso_encoding());
147+
148+
uint8_t hour = time.hours().count();
149+
uint8_t minute = time.minutes().count();
150+
uint8_t second = time.seconds().count();
151+
152+
if (displayedHour != hour || displayedMinute != minute || displayedSecond != second) {
153+
displayedHour = hour;
154+
displayedMinute = minute;
155+
displayedSecond = second;
156+
157+
if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) {
158+
char ampmChar[3] = "AM";
159+
if (hour == 0) {
160+
hour = 12;
161+
} else if (hour == 12) {
162+
ampmChar[0] = 'P';
163+
} else if (hour > 12) {
164+
hour = hour - 12;
165+
ampmChar[0] = 'P';
166+
}
167+
lv_label_set_text_fmt(label_time, "[TIME]#11cc55 %02d:%02d:%02d %s#", hour, minute, second, ampmChar);
168+
} else {
169+
lv_label_set_text_fmt(label_time, "[TIME]#11cc55 %02d:%02d:%02d", hour, minute, second);
170+
}
171+
}
172+
173+
if ((year != currentYear) || (month != currentMonth) || (dayOfWeek != currentDayOfWeek) || (day != currentDay)) {
174+
lv_label_set_text_fmt(label_date, "[DATE]#007fff %04d.%02d.%02d#", short(year), char(month), char(day));
175+
176+
currentYear = year;
177+
currentMonth = month;
178+
currentDayOfWeek = dayOfWeek;
179+
currentDay = day;
180+
}
181+
}
182+
183+
heartbeat = heartRateController.HeartRate();
184+
heartbeatRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped;
185+
if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) {
186+
if (heartbeatRunning.Get()) {
187+
lv_label_set_text_fmt(heartbeatValue, "[L_HR]#ee3311 %d bpm#", heartbeat.Get());
188+
} else {
189+
lv_label_set_text_static(heartbeatValue, "[L_HR]#ee3311 ---#");
190+
}
191+
}
192+
193+
stepCount = motionController.NbSteps();
194+
motionSensorOk = motionController.IsSensorOk();
195+
if (stepCount.IsUpdated() || motionSensorOk.IsUpdated()) {
196+
lv_label_set_text_fmt(stepValue, "[STEP]#ee3377 %lu steps#", stepCount.Get());
197+
}
198+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#pragma once
2+
3+
#include <lvgl/src/lv_core/lv_obj.h>
4+
#include <chrono>
5+
#include <cstdint>
6+
#include <memory>
7+
#include "displayapp/screens/Screen.h"
8+
#include "components/datetime/DateTimeController.h"
9+
10+
namespace Pinetime {
11+
namespace Controllers {
12+
class Settings;
13+
class Battery;
14+
class Ble;
15+
class NotificationManager;
16+
class HeartRateController;
17+
class MotionController;
18+
}
19+
20+
namespace Applications {
21+
namespace Screens {
22+
23+
class WatchFaceTerminal : public Screen {
24+
public:
25+
WatchFaceTerminal(DisplayApp* app,
26+
Controllers::DateTime& dateTimeController,
27+
Controllers::Battery& batteryController,
28+
Controllers::Ble& bleController,
29+
Controllers::NotificationManager& notificatioManager,
30+
Controllers::Settings& settingsController,
31+
Controllers::HeartRateController& heartRateController,
32+
Controllers::MotionController& motionController);
33+
~WatchFaceTerminal() override;
34+
35+
void Refresh() override;
36+
37+
private:
38+
uint8_t displayedHour = -1;
39+
uint8_t displayedMinute = -1;
40+
uint8_t displayedSecond = -1;
41+
42+
uint16_t currentYear = 1970;
43+
Pinetime::Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown;
44+
Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown;
45+
uint8_t currentDay = 0;
46+
47+
DirtyValue<int> batteryPercentRemaining {};
48+
DirtyValue<bool> powerPresent {};
49+
DirtyValue<bool> bleState {};
50+
DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime {};
51+
DirtyValue<bool> motionSensorOk {};
52+
DirtyValue<uint32_t> stepCount {};
53+
DirtyValue<uint8_t> heartbeat {};
54+
DirtyValue<bool> heartbeatRunning {};
55+
DirtyValue<bool> notificationState {};
56+
57+
lv_obj_t* label_time;
58+
lv_obj_t* label_date;
59+
lv_obj_t* label_prompt_1;
60+
lv_obj_t* label_prompt_2;
61+
lv_obj_t* backgroundLabel;
62+
lv_obj_t* batteryIcon;
63+
lv_obj_t* batteryPlug;
64+
lv_obj_t* batteryValue;
65+
lv_obj_t* heartbeatValue;
66+
lv_obj_t* stepValue;
67+
lv_obj_t* notificationIcon;
68+
lv_obj_t* connectState;
69+
70+
Controllers::DateTime& dateTimeController;
71+
Controllers::Battery& batteryController;
72+
Controllers::Ble& bleController;
73+
Controllers::NotificationManager& notificatioManager;
74+
Controllers::Settings& settingsController;
75+
Controllers::HeartRateController& heartRateController;
76+
Controllers::MotionController& motionController;
77+
78+
lv_task_t* taskRefresh;
79+
};
80+
}
81+
}
82+
}

src/displayapp/screens/settings/SettingWatchFace.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace {
1414
}
1515
}
1616

17-
constexpr std::array<const char*, 3> SettingWatchFace::options;
17+
constexpr std::array<const char*, 4> SettingWatchFace::options;
1818

1919
SettingWatchFace::SettingWatchFace(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController)
2020
: Screen(app), settingsController {settingsController} {

src/displayapp/screens/settings/SettingWatchFace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace Pinetime {
2020
void UpdateSelected(lv_obj_t* object, lv_event_t event);
2121

2222
private:
23-
static constexpr std::array<const char*, 3> options = {" Digital face", " Analog face", " PineTimeStyle"};
23+
static constexpr std::array<const char*, 4> options = {" Digital face", " Analog face", " PineTimeStyle", " Terminal"};
2424
Controllers::Settings& settingsController;
2525

2626
lv_obj_t* cbOption[options.size()];

0 commit comments

Comments
 (0)