mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-10-22 15:11:51 +02:00
merged from main, fixed WatchFaceCasio after merge mess, fix my Infineat modifications according to new alarmcontroller
This commit is contained in:
parent
c71d64393b
commit
de119b569e
|
@ -331,43 +331,6 @@ void WatchFaceCasioStyleG7710::Refresh() {
|
||||||
lv_obj_realign(stepValue);
|
lv_obj_realign(stepValue);
|
||||||
lv_obj_realign(stepIcon);
|
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) {
|
bool WatchFaceCasioStyleG7710::IsAvailable(Pinetime::Controllers::FS& filesystem) {
|
||||||
lfs_file file = {};
|
lfs_file file = {};
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ namespace Pinetime {
|
||||||
WatchFaceCasioStyleG7710(Controllers::DateTime& dateTimeController,
|
WatchFaceCasioStyleG7710(Controllers::DateTime& dateTimeController,
|
||||||
const Controllers::Battery& batteryController,
|
const Controllers::Battery& batteryController,
|
||||||
const Controllers::Ble& bleController,
|
const Controllers::Ble& bleController,
|
||||||
Controllers::AlarmController& alarmController,
|
|
||||||
Controllers::NotificationManager& notificatioManager,
|
Controllers::NotificationManager& notificatioManager,
|
||||||
Controllers::Settings& settingsController,
|
Controllers::Settings& settingsController,
|
||||||
Controllers::HeartRateController& heartRateController,
|
Controllers::HeartRateController& heartRateController,
|
||||||
|
@ -47,7 +46,6 @@ namespace Pinetime {
|
||||||
Utility::DirtyValue<bool> powerPresent {};
|
Utility::DirtyValue<bool> powerPresent {};
|
||||||
Utility::DirtyValue<bool> bleState {};
|
Utility::DirtyValue<bool> bleState {};
|
||||||
Utility::DirtyValue<bool> bleRadioEnabled {};
|
Utility::DirtyValue<bool> bleRadioEnabled {};
|
||||||
bool alarmState {};
|
|
||||||
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::minutes>> currentDateTime {};
|
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::minutes>> currentDateTime {};
|
||||||
Utility::DirtyValue<uint32_t> stepCount {};
|
Utility::DirtyValue<uint32_t> stepCount {};
|
||||||
Utility::DirtyValue<uint8_t> heartbeat {};
|
Utility::DirtyValue<uint8_t> heartbeat {};
|
||||||
|
@ -78,9 +76,6 @@ namespace Pinetime {
|
||||||
lv_obj_t* line_day_of_year;
|
lv_obj_t* line_day_of_year;
|
||||||
lv_obj_t* backgroundLabel;
|
lv_obj_t* backgroundLabel;
|
||||||
lv_obj_t* bleIcon;
|
lv_obj_t* bleIcon;
|
||||||
lv_obj_t* labelAlarm;
|
|
||||||
lv_obj_t* labelTimeAmPmAlarm;
|
|
||||||
lv_obj_t* alarmIcon;
|
|
||||||
lv_obj_t* batteryPlug;
|
lv_obj_t* batteryPlug;
|
||||||
lv_obj_t* label_battery_value;
|
lv_obj_t* label_battery_value;
|
||||||
lv_obj_t* heartbeatIcon;
|
lv_obj_t* heartbeatIcon;
|
||||||
|
@ -95,7 +90,6 @@ namespace Pinetime {
|
||||||
Controllers::DateTime& dateTimeController;
|
Controllers::DateTime& dateTimeController;
|
||||||
const Controllers::Battery& batteryController;
|
const Controllers::Battery& batteryController;
|
||||||
const Controllers::Ble& bleController;
|
const Controllers::Ble& bleController;
|
||||||
Controllers::AlarmController& alarmController;
|
|
||||||
Controllers::NotificationManager& notificatioManager;
|
Controllers::NotificationManager& notificatioManager;
|
||||||
Controllers::Settings& settingsController;
|
Controllers::Settings& settingsController;
|
||||||
Controllers::HeartRateController& heartRateController;
|
Controllers::HeartRateController& heartRateController;
|
||||||
|
@ -117,7 +111,6 @@ namespace Pinetime {
|
||||||
return new Screens::WatchFaceCasioStyleG7710(controllers.dateTimeController,
|
return new Screens::WatchFaceCasioStyleG7710(controllers.dateTimeController,
|
||||||
controllers.batteryController,
|
controllers.batteryController,
|
||||||
controllers.bleController,
|
controllers.bleController,
|
||||||
controllers.alarmController,
|
|
||||||
controllers.notificationManager,
|
controllers.notificationManager,
|
||||||
controllers.settingsController,
|
controllers.settingsController,
|
||||||
controllers.heartRateController,
|
controllers.heartRateController,
|
||||||
|
|
|
@ -509,7 +509,7 @@ void WatchFaceInfineat::Refresh() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settingsController.GetInfineatShowAlarmStatus()) {
|
if (settingsController.GetInfineatShowAlarmStatus()) {
|
||||||
isAlarmSet = alarmController.State()==Pinetime::Controllers::AlarmController::AlarmState::Set;
|
isAlarmSet = alarmController.IsEnabled()==true;
|
||||||
// sets the icon as bell or barred bell
|
// sets the icon as bell or barred bell
|
||||||
lv_label_set_text_static(alarmIcon, AlarmIcon::GetIcon(isAlarmSet.Get()));
|
lv_label_set_text_static(alarmIcon, AlarmIcon::GetIcon(isAlarmSet.Get()));
|
||||||
//displays the time of the alarm or nothing if the alarm is not set
|
//displays the time of the alarm or nothing if the alarm is not set
|
||||||
|
|
Loading…
Reference in a new issue