day_night_percentage_face: Use PM indicator instead of DA/NI.
This allows for use of the weekday digits for displaying the weekday.
This commit is contained in:
parent
2e8ee9965e
commit
26f63dcaeb
@ -92,8 +92,14 @@ bool day_night_percentage_face_loop(movement_event_t event, movement_settings_t
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* weekday = watch_utility_get_weekday(date_time);
|
||||||
if (state->result != 0) {
|
if (state->result != 0) {
|
||||||
sprintf(buf, "%s%2dEtrnal", state->result == 1 ? "DA" : "NI", date_time.unit.day);
|
if (state->result == 1) {
|
||||||
|
watch_clear_indicator(WATCH_INDICATOR_PM);
|
||||||
|
} else {
|
||||||
|
watch_set_indicator(WATCH_INDICATOR_PM);
|
||||||
|
}
|
||||||
|
sprintf(buf, "%s%2dEtrnal", weekday, date_time.unit.day);
|
||||||
watch_display_string(buf, 0);
|
watch_display_string(buf, 0);
|
||||||
} else {
|
} else {
|
||||||
double day_hours_decimal = utc_now.unit.hour + (utc_now.unit.minute + (utc_now.unit.second / 60.0)) / 60.0;
|
double day_hours_decimal = utc_now.unit.hour + (utc_now.unit.minute + (utc_now.unit.second / 60.0)) / 60.0;
|
||||||
@ -102,19 +108,18 @@ bool day_night_percentage_face_loop(movement_event_t event, movement_settings_t
|
|||||||
double night_percentage = (24.0 - better_fmod(state->set - day_hours_decimal, 24.0)) / (24 - state->daylen);
|
double night_percentage = (24.0 - better_fmod(state->set - day_hours_decimal, 24.0)) / (24 - state->daylen);
|
||||||
|
|
||||||
uint16_t percentage;
|
uint16_t percentage;
|
||||||
char day_night[3];
|
|
||||||
if (day_percentage > 0.0 && day_percentage < 1.0) {
|
if (day_percentage > 0.0 && day_percentage < 1.0) {
|
||||||
percentage = day_percentage * 10000;
|
percentage = day_percentage * 10000;
|
||||||
sprintf(day_night, "%s", "DA");
|
watch_clear_indicator(WATCH_INDICATOR_PM);
|
||||||
} else {
|
} else {
|
||||||
percentage = night_percentage * 10000;
|
percentage = night_percentage * 10000;
|
||||||
sprintf(day_night, "%s", "NI");
|
watch_set_indicator(WATCH_INDICATOR_PM);
|
||||||
}
|
}
|
||||||
if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
|
if (event.event_type == EVENT_LOW_ENERGY_UPDATE) {
|
||||||
if (!watch_tick_animation_is_running()) watch_start_tick_animation(500);
|
if (!watch_tick_animation_is_running()) watch_start_tick_animation(500);
|
||||||
sprintf(buf, "%s%2d %02d", day_night, date_time.unit.day, percentage / 100);
|
sprintf(buf, "%s%2d %02d", weekday, date_time.unit.day, percentage / 100);
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "%s%2d %04d", day_night, date_time.unit.day, percentage);
|
sprintf(buf, "%s%2d %04d", weekday, date_time.unit.day, percentage);
|
||||||
}
|
}
|
||||||
watch_display_string(buf, 0);
|
watch_display_string(buf, 0);
|
||||||
}
|
}
|
||||||
|
@ -32,11 +32,11 @@
|
|||||||
*
|
*
|
||||||
* Shows the percentage of the way through the day/night the current time is.
|
* Shows the percentage of the way through the day/night the current time is.
|
||||||
*
|
*
|
||||||
* The weekday digits show "DA" or "NI" depending on whether it's currently day
|
* The time digits show the percentage of the way through the day/night it is,
|
||||||
* or night. The day digits show what the current day of the month is. The time
|
* with decimals in the smaller seconds digits. If the day or night will last
|
||||||
* digits show the percentage of the way through the day/night it is, with
|
* for a full 24 hours, the text "Etrnal" is displayed instead of a percentage.
|
||||||
* decimals in the smaller seconds digits. If the day or night will last for a
|
* The "PM" indicator is set when it is currently nighttime. The weekday and
|
||||||
* full 24 hours, the text "Etrnal" is displayed instead of a percentage.
|
* day digits display the weekday and day, as one would expect.
|
||||||
*
|
*
|
||||||
* This face does not currently offer any configuration. You must set the
|
* This face does not currently offer any configuration. You must set the
|
||||||
* location register with some other face.
|
* location register with some other face.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user