Skip to content

Commit

Permalink
merged from main, fixed WatchFaceCasio after merge mess, fix my Infi…
Browse files Browse the repository at this point in the history
…neat modifications according to new alarmcontroller
  • Loading branch information
Eve1374 committed Oct 16, 2024
1 parent c71d643 commit de119b5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 45 deletions.
37 changes: 0 additions & 37 deletions src/displayapp/screens/WatchFaceCasioStyleG7710.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,43 +331,6 @@ void WatchFaceCasioStyleG7710::Refresh() {
lv_obj_realign(stepValue);
lv_obj_realign(stepIcon);
}
alarmState = alarmController.State()==Pinetime::Controllers::AlarmController::AlarmState::Set;
// sets the icon as bell or barred bell
lv_label_set_text_static(alarmIcon, AlarmIcon::GetIcon(alarmState));
//displays the time of the alarm or nothing if the alarm is not set
if (alarmState) {
uint8_t alarmHours = alarmController.Hours();
uint8_t alarmMinutes = alarmController.Minutes();
//handles the am pm format.
if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) {
char ampmChar[3] = "AM";
if (alarmHours == 0) {
alarmHours = 12;
} else if (alarmHours == 12) {
ampmChar[0]='P';
} else if (alarmHours > 12) {
alarmHours = alarmHours - 12;
ampmChar[0]='P';
}
lv_label_set_text(labelTimeAmPmAlarm, ampmChar);
// lv_obj_set_style_local_text_font(labelTimeAmPmAlarm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_teko);
lv_obj_align(labelTimeAmPmAlarm, labelAlarm, LV_ALIGN_OUT_RIGHT_MID, 3, 0);
}

lv_label_set_text_fmt(labelAlarm, "%02d:%02d", alarmHours, alarmMinutes);

lv_obj_align(alarmIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 5, -2);
lv_obj_align(labelAlarm, alarmIcon, LV_ALIGN_OUT_RIGHT_MID, 3, 0);

}
else {
lv_label_set_text_static(labelAlarm, Symbols::none);
lv_obj_align(alarmIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 5, -2);
lv_obj_align(labelAlarm, alarmIcon, LV_ALIGN_OUT_RIGHT_MID, 3, 0);
}

}

bool WatchFaceCasioStyleG7710::IsAvailable(Pinetime::Controllers::FS& filesystem) {
lfs_file file = {};

Expand Down
7 changes: 0 additions & 7 deletions src/displayapp/screens/WatchFaceCasioStyleG7710.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ namespace Pinetime {
WatchFaceCasioStyleG7710(Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
const Controllers::Ble& bleController,
Controllers::AlarmController& alarmController,
Controllers::NotificationManager& notificatioManager,
Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController,
Expand All @@ -47,7 +46,6 @@ namespace Pinetime {
Utility::DirtyValue<bool> powerPresent {};
Utility::DirtyValue<bool> bleState {};
Utility::DirtyValue<bool> bleRadioEnabled {};
bool alarmState {};
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::minutes>> currentDateTime {};
Utility::DirtyValue<uint32_t> stepCount {};
Utility::DirtyValue<uint8_t> heartbeat {};
Expand Down Expand Up @@ -78,9 +76,6 @@ namespace Pinetime {
lv_obj_t* line_day_of_year;
lv_obj_t* backgroundLabel;
lv_obj_t* bleIcon;
lv_obj_t* labelAlarm;
lv_obj_t* labelTimeAmPmAlarm;
lv_obj_t* alarmIcon;
lv_obj_t* batteryPlug;
lv_obj_t* label_battery_value;
lv_obj_t* heartbeatIcon;
Expand All @@ -95,7 +90,6 @@ namespace Pinetime {
Controllers::DateTime& dateTimeController;
const Controllers::Battery& batteryController;
const Controllers::Ble& bleController;
Controllers::AlarmController& alarmController;
Controllers::NotificationManager& notificatioManager;
Controllers::Settings& settingsController;
Controllers::HeartRateController& heartRateController;
Expand All @@ -117,7 +111,6 @@ namespace Pinetime {
return new Screens::WatchFaceCasioStyleG7710(controllers.dateTimeController,
controllers.batteryController,
controllers.bleController,
controllers.alarmController,
controllers.notificationManager,
controllers.settingsController,
controllers.heartRateController,
Expand Down
2 changes: 1 addition & 1 deletion src/displayapp/screens/WatchFaceInfineat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ void WatchFaceInfineat::Refresh() {
}

if (settingsController.GetInfineatShowAlarmStatus()) {
isAlarmSet = alarmController.State()==Pinetime::Controllers::AlarmController::AlarmState::Set;
isAlarmSet = alarmController.IsEnabled()==true;
// sets the icon as bell or barred bell
lv_label_set_text_static(alarmIcon, AlarmIcon::GetIcon(isAlarmSet.Get()));
//displays the time of the alarm or nothing if the alarm is not set
Expand Down

0 comments on commit de119b5

Please sign in to comment.