Skip to content

Commit 0854a7e

Browse files
committed
feat: add option to display numerals on clock face
1 parent 958f356 commit 0854a7e

12 files changed

Lines changed: 1118 additions & 11 deletions

File tree

eez-ui/gaggimate.eez-project

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
"objID": "61244af5-fae6-4b75-c201-48a56eb93a44",
187187
"name": "time_container",
188188
"type": "struct:time_struct",
189-
"defaultValue": "{hour : 1, min : 20, sec : 45, analog_numerals : true, time_in_minutes : 120}",
189+
"defaultValue": "{hour : 1, min : 20, sec : 45, analog_numerals : false, time_in_minutes : 120}",
190190
"persistent": false,
191191
"native": false
192192
},
@@ -1126,7 +1126,7 @@
11261126
"conditionalStyles": [],
11271127
"childStyles": []
11281128
},
1129-
"hiddenInEditor": true,
1129+
"hiddenInEditor": false,
11301130
"timeline": [],
11311131
"eventHandlers": [],
11321132
"leftUnit": "px",
@@ -2600,10 +2600,10 @@
26002600
{
26012601
"objID": "dae38c01-474f-419d-d926-11b60701797c",
26022602
"type": "LVGLLabelWidget",
2603-
"left": 18,
2603+
"left": 0,
26042604
"top": 92,
2605-
"width": 241,
2606-
"height": 15,
2605+
"width": 260,
2606+
"height": 14,
26072607
"customInputs": [],
26082608
"customOutputs": [],
26092609
"style": {
@@ -2636,7 +2636,7 @@
26362636
"definition": {
26372637
"MAIN": {
26382638
"DEFAULT": {
2639-
"text_font": "rolblox_18",
2639+
"text_font": "rolblox _16",
26402640
"align": "CENTER",
26412641
"text_color": "NiceWhite"
26422642
}
@@ -2649,7 +2649,7 @@
26492649
"textType": "expression",
26502650
"longMode": "WRAP",
26512651
"recolor": false,
2652-
"previewValue": "MONDAY 17.04.2025"
2652+
"previewValue": "WEDNESDAY 17.04.2025"
26532653
}
26542654
],
26552655
"widgetFlags": "CLICKABLE|PRESS_LOCK|CLICK_FOCUSABLE|GESTURE_BUBBLE|SNAPPABLE|SCROLL_ELASTIC|SCROLL_MOMENTUM|SCROLL_CHAIN_HOR|SCROLL_CHAIN_VER",
@@ -24967,6 +24967,35 @@
2496724967
"symbols": "0123456789 :./-MONDAYTUESWHRFImodayntueswhrfi"
2496824968
},
2496924969
"embeddedFontFileIndex": 1
24970+
},
24971+
{
24972+
"objID": "81740e94-00f5-4795-e22b-087448f28251",
24973+
"name": "rolblox _16",
24974+
"renderingEngine": "LVGL",
24975+
"source": {
24976+
"objID": "278d9662-66fb-4162-d483-bad64b7011f1",
24977+
"filePath": "..\\src\\display\\ui\\default\\RollboxRegular-jE2lv.ttf",
24978+
"size": 16
24979+
},
24980+
"bpp": 8,
24981+
"threshold": 128,
24982+
"height": 14,
24983+
"ascent": 11,
24984+
"descent": 3,
24985+
"glyphs": [],
24986+
"lvglRanges": "",
24987+
"lvglSymbols": "a0123456789 :./-MONDAYTUESWNHRFFImodayntueswnhrffi",
24988+
"lvglAdditionalSources": [],
24989+
"lvglGlyphs": {
24990+
"encodings": [
24991+
{
24992+
"from": 32,
24993+
"to": 127
24994+
}
24995+
],
24996+
"symbols": ""
24997+
},
24998+
"embeddedFontFileIndex": 1
2497024999
}
2497125000
],
2497225001
"bitmaps": [

src/display/core/Settings.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ void Settings::setStandbyBinaryClock(bool standby_binary_clock) {
281281
standbyBinaryClock.set(standby_binary_clock);
282282
}
283283

284+
void Settings::setStandbyAnalogClockNumerals(bool standby_analog_clock_numerals) {
285+
standbyAnalogClockNumerals.set(standby_analog_clock_numerals);
286+
}
287+
284288

285289
void Settings::setDisplayDate(bool display_date){
286290
displayDate.set(display_date);

src/display/core/Settings.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ class Settings {
139139
int getStandbyAnalogClock() const { return standbyAnalogClock.get(); }
140140
int getStandbyDigitalClock() const { return standbyDigitalClock.get(); }
141141
bool getStandbyBinaryClock() const { return standbyBinaryClock.get(); }
142+
bool getAnalogClockNumerals() const { return standbyAnalogClockNumerals.get(); }
142143
int getHistoryIndex() const { return historyIndex.get(); }
143144

144145
[[deprecated]]
@@ -246,6 +247,7 @@ class Settings {
246247
void setStandbyAnalogClock(int standby_analog_clock);
247248
void setStandbyDigitalClock(int standby_digital_clock);
248249
void setStandbyBinaryClock(bool standby_binary_clock);
250+
void setStandbyAnalogClockNumerals(bool standby_analog_clock_numerals);
249251
void setDisplayDate(bool display_date);
250252
void setHistoryIndex(int history_index);
251253
[[deprecated]]
@@ -349,6 +351,7 @@ class Settings {
349351
Property<int> standbyAnalogClock{registry, "standby_analog_clock", 1};
350352
Property<int> standbyDigitalClock{registry, "standby_digital_clock", 1};
351353
Property<bool> standbyBinaryClock{registry, "standby_binary_clock", false};
354+
Property<bool> standbyAnalogClockNumerals{registry, "standby_analog_clock_numerals", false};
352355
Property<bool> displayDate{registry, "display_date", true};
353356
// Sunrise settings (r/g/b/w are legacy load-only values that seed the idle color default)
354357
int sunriseR = 0;

src/display/plugins/WebUIPlugin.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ void WebUIPlugin::handleSettings(AsyncWebServerRequest *request) const {
767767
if(request->hasArg("standbyAnalogClock"))
768768
settings->setStandbyAnalogClock(request->arg("standbyAnalogClock").toInt());
769769
settings->setStandbyBinaryClock(request->hasArg("standbyBinaryClock"));
770+
settings->setStandbyAnalogClockNumerals(request->hasArg("analogClockNumerals"));
770771
if (request->hasArg("sunriseIdle"))
771772
settings->setSunriseIdle(request->arg("sunriseIdle"));
772773
if (request->hasArg("sunriseActive"))
@@ -905,6 +906,7 @@ void WebUIPlugin::handleSettings(AsyncWebServerRequest *request) const {
905906
doc["standbyDigitalClock"] = settings.getStandbyDigitalClock();
906907
doc["standbyAnalogClock"] = settings.getStandbyAnalogClock();
907908
doc["standbyBinaryClock"] = settings.getStandbyBinaryClock();
909+
doc["analogClockNumerals"] = settings.getAnalogClockNumerals();
908910
doc["displayDate"] = settings.getDisplayDate();
909911
doc["sunriseIdle"] = settings.getSunriseIdle();
910912
doc["sunriseActive"] = settings.getSunriseActive();

src/display/ui/default/DefaultUI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ void DefaultUI::updateSystemStatus() {
619619
systemStatus.standby_analog_clock(settings.getStandbyAnalogClock());
620620
systemStatus.standby_digital_clock(settings.getStandbyDigitalClock());
621621
systemStatus.standby_binary_clock(settings.getStandbyBinaryClock());
622-
622+
time_container.analog_numerals(settings.getAnalogClockNumerals());
623623

624624
char timeBuf[40] = "";
625625
struct tm timeinfo;

src/display/ui/default/eez/.eez-project-build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"fonts.h",
77
"fonts/ui_font_montserrat_b_120.c",
88
"fonts/ui_font_rolblox_18.c",
9+
"fonts/ui_font_rolblox__16.c",
910
"fonts/ui_font_rolbox_90.c",
1011
"fonts/ui_font_seg7_80.c",
1112
"images.c",

src/display/ui/default/eez/fonts.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ extern const lv_font_t ui_font_seg7_80;
1111
extern const lv_font_t ui_font_rolbox_90;
1212
extern const lv_font_t ui_font_montserrat_b_120;
1313
extern const lv_font_t ui_font_rolblox_18;
14+
extern const lv_font_t ui_font_rolblox__16;
1415

1516
#ifndef EXT_FONT_DESC_T
1617
#define EXT_FONT_DESC_T

0 commit comments

Comments
 (0)