-
-
Notifications
You must be signed in to change notification settings - Fork 922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add terminal watchface #932
Changes from 18 commits
88f0190
6dfa141
1808a78
79273fe
4c58476
7288301
e540d10
d3fd348
471a4c9
3afedca
ebbb31a
fc246be
e2f7e31
d684988
477a3a7
0ed45a9
68d3d9b
fda1c08
eb8bd4d
1e4a676
74eea9f
bba34f6
6853166
471a843
b4669be
265fec5
342ce8c
e6c0f32
12e1b0f
25fdafc
6bc6c1a
af483be
4d85028
6959d8c
60b6b4e
757ca2d
3515616
138a655
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,239 @@ | ||||||||||||||||||||||||||||
#include "WatchFaceTerminal.h" | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
#include <date/date.h> | ||||||||||||||||||||||||||||
#include <lvgl/lvgl.h> | ||||||||||||||||||||||||||||
#include <cstdio> | ||||||||||||||||||||||||||||
#include "displayapp/screens/BatteryIcon.h" | ||||||||||||||||||||||||||||
#include "displayapp/screens/BleIcon.h" | ||||||||||||||||||||||||||||
#include "displayapp/screens/NotificationIcon.h" | ||||||||||||||||||||||||||||
#include "displayapp/screens/Symbols.h" | ||||||||||||||||||||||||||||
#include "components/battery/BatteryController.h" | ||||||||||||||||||||||||||||
#include "components/ble/BleController.h" | ||||||||||||||||||||||||||||
#include "components/ble/NotificationManager.h" | ||||||||||||||||||||||||||||
#include "components/heartrate/HeartRateController.h" | ||||||||||||||||||||||||||||
#include "components/motion/MotionController.h" | ||||||||||||||||||||||||||||
#include "components/settings/Settings.h" | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
using namespace Pinetime::Applications::Screens; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app, | ||||||||||||||||||||||||||||
Controllers::DateTime& dateTimeController, | ||||||||||||||||||||||||||||
Controllers::Battery& batteryController, | ||||||||||||||||||||||||||||
Controllers::Ble& bleController, | ||||||||||||||||||||||||||||
Controllers::NotificationManager& notificatioManager, | ||||||||||||||||||||||||||||
Controllers::Settings& settingsController, | ||||||||||||||||||||||||||||
Controllers::HeartRateController& heartRateController, | ||||||||||||||||||||||||||||
Controllers::MotionController& motionController) | ||||||||||||||||||||||||||||
: Screen(app), | ||||||||||||||||||||||||||||
currentDateTime {{}}, | ||||||||||||||||||||||||||||
dateTimeController {dateTimeController}, | ||||||||||||||||||||||||||||
batteryController {batteryController}, | ||||||||||||||||||||||||||||
bleController {bleController}, | ||||||||||||||||||||||||||||
notificatioManager {notificatioManager}, | ||||||||||||||||||||||||||||
settingsController {settingsController}, | ||||||||||||||||||||||||||||
heartRateController {heartRateController}, | ||||||||||||||||||||||||||||
motionController {motionController} { | ||||||||||||||||||||||||||||
settingsController.SetClockFace(3); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
displayedChar[0] = 0; | ||||||||||||||||||||||||||||
displayedChar[1] = 0; | ||||||||||||||||||||||||||||
displayedChar[2] = 0; | ||||||||||||||||||||||||||||
displayedChar[3] = 0; | ||||||||||||||||||||||||||||
displayedChar[4] = 0; | ||||||||||||||||||||||||||||
displayedChar[5] = 0; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
13werwolf13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
batteryIcon = lv_label_create(lv_scr_act(), nullptr); | ||||||||||||||||||||||||||||
lv_label_set_text(batteryIcon, Symbols::batteryFull); | ||||||||||||||||||||||||||||
lv_obj_align(batteryIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -5, 2); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
batteryPlug = lv_label_create(lv_scr_act(), nullptr); | ||||||||||||||||||||||||||||
lv_label_set_text(batteryPlug, Symbols::plug); | ||||||||||||||||||||||||||||
lv_obj_align(batteryPlug, batteryIcon, LV_ALIGN_OUT_LEFT_MID, -5, 0); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
batteryPercent = lv_label_create(lv_scr_act(), nullptr); | ||||||||||||||||||||||||||||
lv_label_set_recolor(batteryPercent, true); | ||||||||||||||||||||||||||||
lv_obj_align(batteryPercent, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -20); | ||||||||||||||||||||||||||||
13werwolf13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
connectState = lv_label_create(lv_scr_act(), nullptr); | ||||||||||||||||||||||||||||
lv_label_set_recolor(connectState, true); | ||||||||||||||||||||||||||||
lv_obj_align(connectState, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 40); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
bleIcon = lv_label_create(lv_scr_act(), nullptr); | ||||||||||||||||||||||||||||
lv_label_set_text(bleIcon, Symbols::bluetooth); | ||||||||||||||||||||||||||||
lv_obj_align(bleIcon, batteryPlug, LV_ALIGN_OUT_LEFT_MID, -5, 0); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
notificationIcon = lv_label_create(lv_scr_act(), NULL); | ||||||||||||||||||||||||||||
lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false)); | ||||||||||||||||||||||||||||
lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_TOP_LEFT, 10, 0); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
label_date = lv_label_create(lv_scr_act(), nullptr); | ||||||||||||||||||||||||||||
lv_label_set_recolor(label_date, true); | ||||||||||||||||||||||||||||
lv_obj_align(label_date, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -40); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
label_prompt_1 = lv_label_create(lv_scr_act(), nullptr); | ||||||||||||||||||||||||||||
lv_obj_align(label_prompt_1, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -80); | ||||||||||||||||||||||||||||
lv_label_set_text(label_prompt_1, "user@watch:~ $ now"); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
label_prompt_2 = lv_label_create(lv_scr_act(), nullptr); | ||||||||||||||||||||||||||||
lv_obj_align(label_prompt_2, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 60); | ||||||||||||||||||||||||||||
lv_label_set_text(label_prompt_2, "user@watch:~ $"); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
label_time = lv_label_create(lv_scr_act(), nullptr); | ||||||||||||||||||||||||||||
lv_label_set_recolor(label_time, true); | ||||||||||||||||||||||||||||
lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -60); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
backgroundLabel = lv_label_create(lv_scr_act(), nullptr); | ||||||||||||||||||||||||||||
lv_obj_set_click(backgroundLabel, true); | ||||||||||||||||||||||||||||
lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP); | ||||||||||||||||||||||||||||
lv_obj_set_size(backgroundLabel, 240, 240); | ||||||||||||||||||||||||||||
lv_obj_set_pos(backgroundLabel, 0, 0); | ||||||||||||||||||||||||||||
lv_label_set_text(backgroundLabel, ""); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
heartbeatValue = lv_label_create(lv_scr_act(), nullptr); | ||||||||||||||||||||||||||||
lv_label_set_recolor(heartbeatValue, true); | ||||||||||||||||||||||||||||
lv_label_set_text(heartbeatValue, "[L_HR]#ee3311 0 bpm#"); | ||||||||||||||||||||||||||||
lv_obj_align(heartbeatValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 20); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
stepValue = lv_label_create(lv_scr_act(), nullptr); | ||||||||||||||||||||||||||||
lv_label_set_recolor(stepValue, true); | ||||||||||||||||||||||||||||
lv_label_set_text(stepValue, "[STEP]#ee3377 0 steps#"); | ||||||||||||||||||||||||||||
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 0); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); | ||||||||||||||||||||||||||||
Refresh(); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
WatchFaceTerminal::~WatchFaceTerminal() { | ||||||||||||||||||||||||||||
lv_task_del(taskRefresh); | ||||||||||||||||||||||||||||
lv_obj_clean(lv_scr_act()); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
void WatchFaceTerminal::Refresh() { | ||||||||||||||||||||||||||||
batteryPercentRemaining = batteryController.PercentRemaining(); | ||||||||||||||||||||||||||||
if (batteryPercentRemaining.IsUpdated()) { | ||||||||||||||||||||||||||||
auto batteryPercent = batteryPercentRemaining.Get(); | ||||||||||||||||||||||||||||
lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); | ||||||||||||||||||||||||||||
auto isCharging = batteryController.IsCharging() || batteryController.IsPowerPresent(); | ||||||||||||||||||||||||||||
lv_label_set_text(batteryPlug, BatteryIcon::GetPlugIcon(isCharging)); | ||||||||||||||||||||||||||||
13werwolf13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The other battery label should be set here, also called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry i don't understand |
||||||||||||||||||||||||||||
char* bleValue; | ||||||||||||||||||||||||||||
bleState = bleController.IsConnected(); | ||||||||||||||||||||||||||||
if (bleState.IsUpdated()) { | ||||||||||||||||||||||||||||
if (bleState.Get() == true) { | ||||||||||||||||||||||||||||
lv_label_set_text(bleIcon, BleIcon::GetIcon(true)); | ||||||||||||||||||||||||||||
bleValue = "Connected"; | ||||||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||||||
lv_label_set_text(bleIcon, BleIcon::GetIcon(false)); | ||||||||||||||||||||||||||||
bleValue = "Disconnected"; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Of course! |
||||||||||||||||||||||||||||
lv_obj_align(batteryIcon, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, -5, 5); | ||||||||||||||||||||||||||||
lv_obj_align(batteryPlug, batteryIcon, LV_ALIGN_OUT_LEFT_MID, -5, 0); | ||||||||||||||||||||||||||||
lv_obj_align(bleIcon, batteryPlug, LV_ALIGN_OUT_LEFT_MID, -5, 0); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
notificationState = notificatioManager.AreNewNotificationsAvailable(); | ||||||||||||||||||||||||||||
if (notificationState.IsUpdated()) { | ||||||||||||||||||||||||||||
if (notificationState.Get() == true) | ||||||||||||||||||||||||||||
lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(true)); | ||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||
lv_label_set_text(notificationIcon, NotificationIcon::GetIcon(false)); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Braces should be used everywhere. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry i don't understand There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this one, curly brackets should be added like so. This should be done everywhere where applicable.
Suggested change
|
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
currentDateTime = dateTimeController.CurrentDateTime(); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if (currentDateTime.IsUpdated()) { | ||||||||||||||||||||||||||||
auto newDateTime = currentDateTime.Get(); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
auto dp = date::floor<date::days>(newDateTime); | ||||||||||||||||||||||||||||
auto time = date::make_time(newDateTime - dp); | ||||||||||||||||||||||||||||
auto yearMonthDay = date::year_month_day(dp); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
auto year = (int) yearMonthDay.year(); | ||||||||||||||||||||||||||||
auto month = static_cast<Pinetime::Controllers::DateTime::Months>((unsigned) yearMonthDay.month()); | ||||||||||||||||||||||||||||
auto day = (unsigned) yearMonthDay.day(); | ||||||||||||||||||||||||||||
13werwolf13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
auto dayOfWeek = static_cast<Pinetime::Controllers::DateTime::Days>(date::weekday(yearMonthDay).iso_encoding()); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
int hour = time.hours().count(); | ||||||||||||||||||||||||||||
auto minute = time.minutes().count(); | ||||||||||||||||||||||||||||
auto second = time.seconds().count(); | ||||||||||||||||||||||||||||
13werwolf13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
char minutesChar[6]; | ||||||||||||||||||||||||||||
sprintf(minutesChar, "%02d", static_cast<int>(minute)); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
char hoursChar[8]; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
char secondsChar[5]; | ||||||||||||||||||||||||||||
sprintf(secondsChar, "%02d", static_cast<int>(second)); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
auto batteryValue = static_cast<uint8_t>(batteryController.PercentRemaining()); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
char battStr[24]; | ||||||||||||||||||||||||||||
sprintf(battStr, "[BATT]#387b54 %d%\%#", batteryValue); | ||||||||||||||||||||||||||||
lv_label_set_text(batteryPercent, battStr); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be moved up to where I left the other comment. Inside
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried, so not going. |
||||||||||||||||||||||||||||
char bleStr[24]; | ||||||||||||||||||||||||||||
sprintf(bleStr, "[STAT]#387b54 %s#", bleValue); | ||||||||||||||||||||||||||||
lv_label_set_text(connectState, bleStr); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of |
||||||||||||||||||||||||||||
if (hoursChar[0] != displayedChar[0] || hoursChar[1] != displayedChar[1] || minutesChar[0] != displayedChar[2] || | ||||||||||||||||||||||||||||
minutesChar[1] != displayedChar[3] || secondsChar[0] != displayedChar[4] || secondsChar[1] != displayedChar[5]) { | ||||||||||||||||||||||||||||
displayedChar[0] = hoursChar[0]; | ||||||||||||||||||||||||||||
displayedChar[1] = hoursChar[1]; | ||||||||||||||||||||||||||||
displayedChar[2] = minutesChar[0]; | ||||||||||||||||||||||||||||
displayedChar[3] = minutesChar[1]; | ||||||||||||||||||||||||||||
displayedChar[4] = secondsChar[0]; | ||||||||||||||||||||||||||||
displayedChar[5] = secondsChar[1]; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { | ||||||||||||||||||||||||||||
if (hoursChar[0] == '0') { | ||||||||||||||||||||||||||||
hoursChar[0] = ' '; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
char timeStr[42]; | ||||||||||||||||||||||||||||
sprintf(timeStr, | ||||||||||||||||||||||||||||
"[TIME]#11cc55 %c%c:%c%c:%c%c#", | ||||||||||||||||||||||||||||
hoursChar[0], | ||||||||||||||||||||||||||||
hoursChar[1], | ||||||||||||||||||||||||||||
minutesChar[0], | ||||||||||||||||||||||||||||
minutesChar[1], | ||||||||||||||||||||||||||||
secondsChar[0], | ||||||||||||||||||||||||||||
secondsChar[1]); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
lv_label_set_text(label_time, timeStr); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
if ((year != currentYear) || (month != currentMonth) || (dayOfWeek != currentDayOfWeek) || (day != currentDay)) { | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
char dateStr[38]; | ||||||||||||||||||||||||||||
sprintf(dateStr, "[DATE]#007fff %04d.%02d.%02d#", short(year), char(month), char(day)); | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggesting to use
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, please, no... |
||||||||||||||||||||||||||||
lv_label_set_text(label_date, dateStr); | ||||||||||||||||||||||||||||
13werwolf13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
currentYear = year; | ||||||||||||||||||||||||||||
currentMonth = month; | ||||||||||||||||||||||||||||
currentDayOfWeek = dayOfWeek; | ||||||||||||||||||||||||||||
currentDay = day; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
heartbeat = heartRateController.HeartRate(); | ||||||||||||||||||||||||||||
heartbeatRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped; | ||||||||||||||||||||||||||||
if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) { | ||||||||||||||||||||||||||||
char heartbeatBuffer[28]; | ||||||||||||||||||||||||||||
if (heartbeatRunning.Get()) | ||||||||||||||||||||||||||||
sprintf(heartbeatBuffer, "[L_HR]#ee3311 %d bpm#", heartbeat.Get()); | ||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||
sprintf(heartbeatBuffer, "[L_HR]#ee3311 ---#"); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
lv_label_set_text(heartbeatValue, heartbeatBuffer); | ||||||||||||||||||||||||||||
13werwolf13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
stepCount = motionController.NbSteps(); | ||||||||||||||||||||||||||||
motionSensorOk = motionController.IsSensorOk(); | ||||||||||||||||||||||||||||
char stepString[34]; | ||||||||||||||||||||||||||||
if (stepCount.IsUpdated() || motionSensorOk.IsUpdated()) { | ||||||||||||||||||||||||||||
sprintf(stepString, "[STEP]#ee3377 %lu steps#", stepCount.Get()); | ||||||||||||||||||||||||||||
lv_label_set_text(stepValue, stepString); | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
13werwolf13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#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" | ||
|
||
namespace Pinetime { | ||
namespace Controllers { | ||
class Settings; | ||
class Battery; | ||
class Ble; | ||
class NotificationManager; | ||
class HeartRateController; | ||
class MotionController; | ||
} | ||
|
||
namespace Applications { | ||
namespace Screens { | ||
|
||
class WatchFaceTerminal : public Screen { | ||
public: | ||
WatchFaceTerminal(DisplayApp* app, | ||
Controllers::DateTime& dateTimeController, | ||
Controllers::Battery& batteryController, | ||
Controllers::Ble& bleController, | ||
Controllers::NotificationManager& notificatioManager, | ||
Controllers::Settings& settingsController, | ||
Controllers::HeartRateController& heartRateController, | ||
Controllers::MotionController& motionController); | ||
~WatchFaceTerminal() override; | ||
|
||
void Refresh() override; | ||
|
||
void OnObjectEvent(lv_obj_t* pObj, lv_event_t i); | ||
|
||
private: | ||
char displayedChar[8]; | ||
13werwolf13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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; | ||
|
||
DirtyValue<int> batteryPercentRemaining {}; | ||
13werwolf13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
DirtyValue<bool> bleState {}; | ||
DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime {}; | ||
DirtyValue<bool> motionSensorOk {}; | ||
DirtyValue<uint32_t> stepCount {}; | ||
DirtyValue<uint8_t> heartbeat {}; | ||
DirtyValue<bool> heartbeatRunning {}; | ||
DirtyValue<bool> notificationState {}; | ||
|
||
lv_obj_t* label_time; | ||
lv_obj_t* label_date; | ||
lv_obj_t* label_prompt_1; | ||
lv_obj_t* label_prompt_2; | ||
lv_obj_t* backgroundLabel; | ||
lv_obj_t* batteryIcon; | ||
lv_obj_t* bleIcon; | ||
lv_obj_t* batteryPlug; | ||
lv_obj_t* batteryPercent; | ||
13werwolf13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
lv_obj_t* heartbeatIcon; | ||
lv_obj_t* heartbeatValue; | ||
lv_obj_t* heartbeatBpm; | ||
lv_obj_t* stepValue; | ||
lv_obj_t* notificationIcon; | ||
lv_obj_t* connectState; | ||
|
||
Controllers::DateTime& dateTimeController; | ||
Controllers::Battery& batteryController; | ||
Controllers::Ble& bleController; | ||
Controllers::NotificationManager& notificatioManager; | ||
Controllers::Settings& settingsController; | ||
Controllers::HeartRateController& heartRateController; | ||
Controllers::MotionController& motionController; | ||
|
||
lv_task_t* taskRefresh; | ||
}; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use includes relative to the src directory, helps me greatly with the simulator