Skip to content

Commit d964558

Browse files
committed
ready examples for release and #161 dialog fix
1 parent f00b62d commit d964558

File tree

7 files changed

+41
-23
lines changed

7 files changed

+41
-23
lines changed

examples/mbed/stm32EncoderLcdI2c/stm32EncoderLcdI2c.emf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,17 @@
170170
},
171171
{
172172
"name": "ENCODER_PIN_A",
173-
"latestValue": "PE_2",
173+
"latestValue": "PC_8",
174174
"subsystem": "INPUT"
175175
},
176176
{
177177
"name": "ENCODER_PIN_B",
178-
"latestValue": "PE_5",
178+
"latestValue": "PC_10",
179179
"subsystem": "INPUT"
180180
},
181181
{
182182
"name": "ENCODER_PIN_OK",
183-
"latestValue": "PE_4",
183+
"latestValue": "PC_9",
184184
"subsystem": "INPUT"
185185
},
186186
{

examples/mbed/stm32EncoderLcdI2c/stm32EncoderLcdI2c_menu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ void setupMenu() {
5454
lcd.configureBacklightPin(3);
5555
lcd.backlight();
5656
switches.init(internalDigitalIo(), SWITCHES_NO_POLLING, true);
57-
menuMgr.initForEncoder(&renderer, &menuStatus, PE_2, PE_5, PE_4);
57+
menuMgr.initForEncoder(&renderer, &menuStatus, PC_8, PC_10, PC_9);
5858
}
5959

examples/mbed/stm32OledEncoder/stm32OledEncoder.emf

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{
77
"parentId": 0,
88
"type": "textItem",
9+
"defaultValue": "",
910
"item": {
1011
"textLength": 5,
1112
"itemType": "GREGORIAN_DATE",
@@ -20,6 +21,7 @@
2021
{
2122
"parentId": 0,
2223
"type": "textItem",
24+
"defaultValue": "",
2325
"item": {
2426
"textLength": 5,
2527
"itemType": "TIME_12H",
@@ -47,11 +49,13 @@
4749
{
4850
"parentId": 3,
4951
"type": "analogItem",
52+
"defaultValue": "0",
5053
"item": {
5154
"maxValue": 1000,
5255
"offset": 0,
5356
"divisor": 10,
5457
"unitName": "tn",
58+
"step": 1,
5559
"name": "Tenths",
5660
"id": 4,
5761
"eepromAddress": 2,
@@ -64,6 +68,7 @@
6468
{
6569
"parentId": 3,
6670
"type": "enumItem",
71+
"defaultValue": "0",
6772
"item": {
6873
"enumEntries": [
6974
"Salad",
@@ -84,6 +89,7 @@
8489
{
8590
"parentId": 3,
8691
"type": "boolItem",
92+
"defaultValue": "false",
8793
"item": {
8894
"naming": "ON_OFF",
8995
"name": "Power",
@@ -97,6 +103,7 @@
97103
{
98104
"parentId": 3,
99105
"type": "largeNumItem",
106+
"defaultValue": "0",
100107
"item": {
101108
"digitsAllowed": 8,
102109
"decimalPlaces": 0,
@@ -113,6 +120,7 @@
113120
{
114121
"parentId": 3,
115122
"type": "rgbItem",
123+
"defaultValue": "#000000FF",
116124
"item": {
117125
"includeAlphaChannel": true,
118126
"name": "RGB",
@@ -140,6 +148,7 @@
140148
{
141149
"parentId": 9,
142150
"type": "scrollItem",
151+
"defaultValue": "0-",
143152
"item": {
144153
"itemWidth": 10,
145154
"eepromOffset": 0,
@@ -171,6 +180,7 @@
171180
{
172181
"parentId": 9,
173182
"type": "floatItem",
183+
"defaultValue": "0.0",
174184
"item": {
175185
"numDecimalPlaces": 1,
176186
"name": "Avg Temp",
@@ -211,6 +221,7 @@
211221
{
212222
"parentId": 13,
213223
"type": "textItem",
224+
"defaultValue": "",
214225
"item": {
215226
"textLength": 5,
216227
"itemType": "IP_ADDRESS",
@@ -253,11 +264,13 @@
253264
{
254265
"parentId": 0,
255266
"type": "analogItem",
267+
"defaultValue": "0",
256268
"item": {
257269
"maxValue": 32767,
258270
"offset": 0,
259271
"divisor": 0,
260272
"unitName": "",
273+
"step": 1,
261274
"name": "Commits",
262275
"id": 15,
263276
"eepromAddress": -1,
@@ -269,6 +282,7 @@
269282
{
270283
"parentId": 0,
271284
"type": "textItem",
285+
"defaultValue": "",
272286
"item": {
273287
"textLength": 16,
274288
"itemType": "PLAIN_TEXT",
@@ -349,13 +363,8 @@
349363
"subsystem": "DISPLAY"
350364
},
351365
{
352-
"name": "PULLUP_LOGIC",
353-
"latestValue": "true",
354-
"subsystem": "INPUT"
355-
},
356-
{
357-
"name": "INTERRUPT_SWITCHES",
358-
"latestValue": "false",
366+
"name": "SW_POLLING_MODE",
367+
"latestValue": "SWITCHES_POLL_EVERYTHING",
359368
"subsystem": "INPUT"
360369
},
361370
{
@@ -388,6 +397,11 @@
388397
"latestValue": "-1",
389398
"subsystem": "INPUT"
390399
},
400+
{
401+
"name": "PULLUP_LOGIC",
402+
"latestValue": "true",
403+
"subsystem": "INPUT"
404+
},
391405
{
392406
"name": "ENCODER_IS_QUARTER_CYCLE",
393407
"latestValue": "false",
@@ -446,6 +460,11 @@
446460
"authenticatorDefinition": "rom:100:6",
447461
"projectIoExpanders": [
448462
"deviceIO:"
449-
]
463+
],
464+
"menuInMenuCollection": {
465+
"menuDefinitions": []
466+
},
467+
"packageNamespace": "",
468+
"appIsModular": false
450469
}
451470
}

examples/mbed/stm32OledEncoder/stm32OledEncoder_menu.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ TagValueRemoteServerConnection ethernetConnection(ethernetTransport, mbedEthInit
2626

2727
// Global Menu Item declarations
2828
RENDERING_CALLBACK_NAME_INVOKE(fnEditRtCall, textItemRenderFn, "Edit", -1, NO_CALLBACK)
29-
TextMenuItem menuEdit(fnEditRtCall, 16, 16, NULL);
29+
TextMenuItem menuEdit(fnEditRtCall, "", 16, 16, NULL);
3030
const AnalogMenuInfo minfoCommits = { "Commits", 15, 0xffff, 32767, NO_CALLBACK, 0, 1, "" };
3131
AnalogMenuItem menuCommits(&minfoCommits, 0, &menuEdit);
3232
const char pgmStrAuthenticatorText[] = { "Authenticator" };
3333
EepromAuthenticationInfoMenuItem menuAuthenticator(pgmStrAuthenticatorText, NO_CALLBACK, 19, NULL);
3434
const char pgmStrIoTMonitorText[] = { "IoT Monitor" };
3535
RemoteMenuItem menuIoTMonitor(pgmStrIoTMonitorText, 18, &menuAuthenticator);
3636
RENDERING_CALLBACK_NAME_INVOKE(fnIPRtCall, ipAddressRenderFn, "IP", -1, NO_CALLBACK)
37-
IpAddressMenuItem menuIP(fnIPRtCall, 14, &menuIoTMonitor);
37+
IpAddressMenuItem menuIP(fnIPRtCall, IpAddressStorage(127, 0, 0, 1), 14, &menuIoTMonitor);
3838
RENDERING_CALLBACK_NAME_INVOKE(fnConnectivityRtCall, backSubItemRenderFn, "Connectivity", -1, NO_CALLBACK)
3939
const SubMenuInfo minfoConnectivity = { "Connectivity", 13, 0xffff, 0, NO_CALLBACK };
4040
BackMenuItem menuBackConnectivity(fnConnectivityRtCall, &menuIP);
@@ -52,7 +52,7 @@ const SubMenuInfo minfoOther = { "Other", 9, 0xffff, 0, NO_CALLBACK };
5252
BackMenuItem menuBackOther(fnOtherRtCall, &menuChoices);
5353
SubMenuItem menuOther(&minfoOther, &menuBackOther, &menuConnectivity);
5454
RENDERING_CALLBACK_NAME_INVOKE(fnRGBRtCall, rgbAlphaItemRenderFn, "RGB", 15, NO_CALLBACK)
55-
Rgb32MenuItem menuRGB(8, fnRGBRtCall, true, RgbColor32(0, 0, 0, 255), NULL);
55+
Rgb32MenuItem menuRGB(fnRGBRtCall, RgbColor32(0, 0, 0, 255), 8, true, NULL);
5656
RENDERING_CALLBACK_NAME_INVOKE(fnFrequencyRtCall, largeNumItemRenderFn, "Frequency", 7, onFrequencyChanged)
5757
EditableLargeNumberMenuItem menuFrequency(fnFrequencyRtCall, 7, 8, 0, true, LargeFixedNumber(0U, 0U, false), &menuRGB);
5858
const BooleanMenuInfo minfoPower = { "Power", 6, 6, 1, NO_CALLBACK, NAMING_ON_OFF };
@@ -72,9 +72,9 @@ const SubMenuInfo minfoEditing = { "Editing", 3, 0xffff, 0, NO_CALLBACK };
7272
BackMenuItem menuBackEditing(fnEditingRtCall, &menuTenths);
7373
SubMenuItem menuEditing(&minfoEditing, &menuBackEditing, &menuOther);
7474
RENDERING_CALLBACK_NAME_INVOKE(fnRTCTimeRtCall, timeItemRenderFn, "RTCTime", -1, NO_CALLBACK)
75-
TimeFormattedMenuItem menuRTCTime(fnRTCTimeRtCall, 2, (MultiEditWireType)3, &menuEditing);
75+
TimeFormattedMenuItem menuRTCTime(fnRTCTimeRtCall, TimeStorage(0, 0, 0, 0), 2, (MultiEditWireType)3, &menuEditing);
7676
RENDERING_CALLBACK_NAME_INVOKE(fnRTCDateRtCall, dateItemRenderFn, "RTCDate", -1, NO_CALLBACK)
77-
DateFormattedMenuItem menuRTCDate(fnRTCDateRtCall, 1, &menuRTCTime);
77+
DateFormattedMenuItem menuRTCDate(fnRTCDateRtCall, DateStorage(2020, 1, 1), 1, &menuRTCTime);
7878

7979
void setupMenu() {
8080
// First we set up eeprom and authentication (if needed).

examples/mbed/stm32f429FrameBuffer/stm32f429FrameBuffer.emf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
{
255255
"parentId": 0,
256256
"type": "actionMenu",
257-
"defaultValue": "false",
258257
"item": {
259258
"name": "Dialogs",
260259
"variableName": "Dialogs",

examples/mbed/stm32f429FrameBuffer/stm32f429FrameBuffer_menu.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ ActionMenuItem menuDialogs(&minfoDialogs, NULL);
2727
RENDERING_CALLBACK_NAME_INVOKE(fnSamplesLgePosRtCall, largeNumItemRenderFn, "LgePos", -1, NO_CALLBACK)
2828
EditableLargeNumberMenuItem menuSamplesLgePos(fnSamplesLgePosRtCall, 17, 7, 0, false, LargeFixedNumber(12456U, 0U, false), NULL);
2929
RENDERING_CALLBACK_NAME_INVOKE(fnSamplesRGBRtCall, rgbAlphaItemRenderFn, "RGB", -1, NO_CALLBACK)
30-
Rgb32MenuItem menuSamplesRGB(16, fnSamplesRGBRtCall, false, RgbColor32(255, 170, 187), &menuSamplesLgePos);
30+
Rgb32MenuItem menuSamplesRGB(fnSamplesRGBRtCall, RgbColor32(255, 170, 187), 16, false, &menuSamplesLgePos);
3131
RENDERING_CALLBACK_NAME_INVOKE(fnSamplesTimeRtCall, timeItemRenderFn, "Time", -1, NO_CALLBACK)
32-
TimeFormattedMenuItem menuSamplesTime(fnSamplesTimeRtCall, 15, (MultiEditWireType)2, &menuSamplesRGB);
32+
TimeFormattedMenuItem menuSamplesTime(fnSamplesTimeRtCall, TimeStorage(0, 0, 0, 0), 15, (MultiEditWireType)2, &menuSamplesRGB);
3333
RENDERING_CALLBACK_NAME_INVOKE(fnSamplesTextRtCall, textItemRenderFn, "Text", -1, NO_CALLBACK)
34-
TextMenuItem menuSamplesText(fnSamplesTextRtCall, 14, 10, &menuSamplesTime);
34+
TextMenuItem menuSamplesText(fnSamplesTextRtCall, "", 14, 10, &menuSamplesTime);
3535
const AnalogMenuInfo minfoBeltSpeed = { "Belt Speed", 13, 0xffff, 200, NO_CALLBACK, 0, 100, "mS" };
3636
AnalogMenuItem menuBeltSpeed(&minfoBeltSpeed, 200, &menuSamplesText);
3737
const char enumStrBeltStatus_0[] = "Running";
@@ -51,7 +51,7 @@ const SubMenuInfo minfoConnectivity = { "Connectivity", 9, 0xffff, 0, NO_CALLBAC
5151
BackMenuItem menuBackConnectivity(fnConnectivityRtCall, &menuConnectivityEnableUSB);
5252
SubMenuItem menuConnectivity(&minfoConnectivity, &menuBackConnectivity, &menuSamples);
5353
RENDERING_CALLBACK_NAME_INVOKE(fnSettingsRunDurationRtCall, timeItemRenderFn, "Run duration", 4, NO_CALLBACK)
54-
TimeFormattedMenuItem menuSettingsRunDuration(fnSettingsRunDurationRtCall, 8, (MultiEditWireType)6, NULL);
54+
TimeFormattedMenuItem menuSettingsRunDuration(fnSettingsRunDurationRtCall, TimeStorage(0, 0, 0, 0), 8, (MultiEditWireType)6, NULL);
5555
const AnalogMenuInfo minfoSettingsTargetSpeed = { "Target speed", 7, 2, 200, onTargetChanged, 0, 100, "mS" };
5656
AnalogMenuItem menuSettingsTargetSpeed(&minfoSettingsTargetSpeed, 0, &menuSettingsRunDuration);
5757
RENDERING_CALLBACK_NAME_INVOKE(fnSettingsRtCall, backSubItemRenderFn, "Settings", -1, NO_CALLBACK)

src/BaseDialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ void MenuBasedDialog::internalSetVisible(bool visible) {
275275
BaseDialog::internalSetVisible(visible);
276276

277277
bitWrite(flags, DLG_FLAG_NEEDS_RENDERING, false);
278-
resetDialogFields();
279278

280279
if(visible) {
281280
auto* renderer = reinterpret_cast<BaseGraphicalRenderer*>(MenuRenderer::getInstance());
@@ -293,6 +292,7 @@ void MenuBasedDialog::internalSetVisible(bool visible) {
293292
menuMgr.navigateToMenu(&backItem, toMakeActive, true);
294293
}
295294
else {
295+
resetDialogFields();
296296
menuMgr.resetMenu(false);
297297
}
298298
}

0 commit comments

Comments
 (0)