Skip to content

Commit aab333c

Browse files
committed
Show alarm controller state in status icons
1 parent eac460f commit aab333c

File tree

14 files changed

+54
-12
lines changed

14 files changed

+54
-12
lines changed

src/displayapp/DisplayApp.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,13 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
403403

404404
switch (app) {
405405
case Apps::Launcher:
406-
currentScreen =
407-
std::make_unique<Screens::ApplicationList>(this, settingsController, batteryController, bleController, dateTimeController, filesystem);
406+
currentScreen = std::make_unique<Screens::ApplicationList>(this,
407+
settingsController,
408+
batteryController,
409+
bleController,
410+
alarmController,
411+
dateTimeController,
412+
filesystem);
408413
break;
409414
case Apps::Motion:
410415
// currentScreen = std::make_unique<Screens::Motion>(motionController);
@@ -414,6 +419,7 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
414419
currentScreen = std::make_unique<Screens::Clock>(dateTimeController,
415420
batteryController,
416421
bleController,
422+
alarmController,
417423
notificationManager,
418424
settingsController,
419425
heartRateController,
@@ -468,7 +474,8 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
468474
brightnessController,
469475
motorController,
470476
settingsController,
471-
bleController);
477+
bleController,
478+
alarmController);
472479
break;
473480
case Apps::Settings:
474481
currentScreen = std::make_unique<Screens::Settings>(this, settingsController);

src/displayapp/screens/ApplicationList.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@ ApplicationList::ApplicationList(Pinetime::Applications::DisplayApp* app,
2020
Pinetime::Controllers::Settings& settingsController,
2121
const Pinetime::Controllers::Battery& batteryController,
2222
const Pinetime::Controllers::Ble& bleController,
23+
const Pinetime::Controllers::AlarmController& alarmController,
2324
Controllers::DateTime& dateTimeController,
2425
Pinetime::Controllers::FS& filesystem)
2526
: app {app},
2627
settingsController {settingsController},
2728
batteryController {batteryController},
2829
bleController {bleController},
30+
alarmController {alarmController},
2931
dateTimeController {dateTimeController},
30-
filesystem{filesystem},
32+
filesystem {filesystem},
3133
screens {app, settingsController.GetAppMenu(), CreateScreenList(), Screens::ScreenListModes::UpDown} {
3234
}
3335

@@ -51,6 +53,7 @@ std::unique_ptr<Screen> ApplicationList::CreateScreen(unsigned int screenNum) co
5153
settingsController,
5254
batteryController,
5355
bleController,
56+
alarmController,
5457
dateTimeController,
5558
apps);
5659
}

src/displayapp/screens/ApplicationList.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ namespace Pinetime {
2121
Pinetime::Controllers::Settings& settingsController,
2222
const Pinetime::Controllers::Battery& batteryController,
2323
const Pinetime::Controllers::Ble& bleController,
24+
const Pinetime::Controllers::AlarmController& alarmController,
2425
Controllers::DateTime& dateTimeController,
2526
Pinetime::Controllers::FS& filesystem);
2627
~ApplicationList() override;
@@ -34,6 +35,7 @@ namespace Pinetime {
3435
Controllers::Settings& settingsController;
3536
const Pinetime::Controllers::Battery& batteryController;
3637
const Pinetime::Controllers::Ble& bleController;
38+
const Pinetime::Controllers::AlarmController& alarmController;
3739
Controllers::DateTime& dateTimeController;
3840
Pinetime::Controllers::FS& filesystem;
3941

src/displayapp/screens/Clock.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ using namespace Pinetime::Applications;
2020
Clock::Clock(Controllers::DateTime& dateTimeController,
2121
const Controllers::Battery& batteryController,
2222
const Controllers::Ble& bleController,
23+
const Controllers::AlarmController& alarmController,
2324
Controllers::NotificationManager& notificationManager,
2425
Controllers::Settings& settingsController,
2526
Controllers::HeartRateController& heartRateController,
@@ -29,6 +30,7 @@ Clock::Clock(Controllers::DateTime& dateTimeController,
2930
: dateTimeController {dateTimeController},
3031
batteryController {batteryController},
3132
bleController {bleController},
33+
alarmController {alarmController},
3234
notificationManager {notificationManager},
3335
settingsController {settingsController},
3436
heartRateController {heartRateController},
@@ -77,6 +79,7 @@ std::unique_ptr<Screen> Clock::WatchFaceDigitalScreen() {
7779
return std::make_unique<Screens::WatchFaceDigital>(dateTimeController,
7880
batteryController,
7981
bleController,
82+
alarmController,
8083
notificationManager,
8184
settingsController,
8285
heartRateController,

src/displayapp/screens/Clock.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace Pinetime {
1414
class Settings;
1515
class Battery;
1616
class Ble;
17+
class AlarmController;
1718
class NotificationManager;
1819
class MotionController;
1920
}
@@ -25,6 +26,7 @@ namespace Pinetime {
2526
Clock(Controllers::DateTime& dateTimeController,
2627
const Controllers::Battery& batteryController,
2728
const Controllers::Ble& bleController,
29+
const Controllers::AlarmController& alarmController,
2830
Controllers::NotificationManager& notificationManager,
2931
Controllers::Settings& settingsController,
3032
Controllers::HeartRateController& heartRateController,
@@ -40,6 +42,7 @@ namespace Pinetime {
4042
Controllers::DateTime& dateTimeController;
4143
const Controllers::Battery& batteryController;
4244
const Controllers::Ble& bleController;
45+
const Controllers::AlarmController& alarmController;
4346
Controllers::NotificationManager& notificationManager;
4447
Controllers::Settings& settingsController;
4548
Controllers::HeartRateController& heartRateController;

src/displayapp/screens/SystemInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen2() {
179179

180180
extern int mallocFailedCount;
181181
extern int stackOverflowCount;
182+
182183
std::unique_ptr<Screen> SystemInfo::CreateScreen3() {
183184
lv_mem_monitor_t mon;
184185
lv_mem_monitor(&mon);

src/displayapp/screens/Tile.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ Tile::Tile(uint8_t screenID,
3030
Controllers::Settings& settingsController,
3131
const Controllers::Battery& batteryController,
3232
const Controllers::Ble& bleController,
33+
const Controllers::AlarmController& alarmController,
3334
Controllers::DateTime& dateTimeController,
3435
std::array<Applications, 6>& applications)
35-
: app {app}, dateTimeController {dateTimeController}, pageIndicator(screenID, numScreens), statusIcons(batteryController, bleController) {
36+
: app {app},
37+
dateTimeController {dateTimeController},
38+
pageIndicator(screenID, numScreens),
39+
statusIcons(batteryController, bleController, alarmController) {
3640

3741
settingsController.SetAppMenu(screenID);
3842

src/displayapp/screens/Tile.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace Pinetime {
2828
Controllers::Settings& settingsController,
2929
const Controllers::Battery& batteryController,
3030
const Controllers::Ble& bleController,
31+
const Controllers::AlarmController& alarmController,
3132
Controllers::DateTime& dateTimeController,
3233
std::array<Applications, 6>& applications);
3334

src/displayapp/screens/WatchFaceDigital.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ using namespace Pinetime::Applications::Screens;
1616
WatchFaceDigital::WatchFaceDigital(Controllers::DateTime& dateTimeController,
1717
const Controllers::Battery& batteryController,
1818
const Controllers::Ble& bleController,
19+
const Controllers::AlarmController& alarmController,
1920
Controllers::NotificationManager& notificationManager,
2021
Controllers::Settings& settingsController,
2122
Controllers::HeartRateController& heartRateController,
@@ -26,7 +27,7 @@ WatchFaceDigital::WatchFaceDigital(Controllers::DateTime& dateTimeController,
2627
settingsController {settingsController},
2728
heartRateController {heartRateController},
2829
motionController {motionController},
29-
statusIcons(batteryController, bleController) {
30+
statusIcons(batteryController, bleController, alarmController) {
3031

3132
statusIcons.Create();
3233

src/displayapp/screens/WatchFaceDigital.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ namespace Pinetime {
1515
class Settings;
1616
class Battery;
1717
class Ble;
18+
class AlarmController;
1819
class NotificationManager;
1920
class HeartRateController;
2021
class MotionController;
@@ -28,6 +29,7 @@ namespace Pinetime {
2829
WatchFaceDigital(Controllers::DateTime& dateTimeController,
2930
const Controllers::Battery& batteryController,
3031
const Controllers::Ble& bleController,
32+
const Controllers::AlarmController& alarmController,
3133
Controllers::NotificationManager& notificationManager,
3234
Controllers::Settings& settingsController,
3335
Controllers::HeartRateController& heartRateController,

0 commit comments

Comments
 (0)