diff --git a/packages/project-editor/flow/runtime/cpp/eez-framework b/packages/project-editor/flow/runtime/cpp/eez-framework index a2986ecc..2273db7f 160000 --- a/packages/project-editor/flow/runtime/cpp/eez-framework +++ b/packages/project-editor/flow/runtime/cpp/eez-framework @@ -1 +1 @@ -Subproject commit a2986ecc8ed4605a49ed9224c6817a5c6a4d8295 +Subproject commit 2273db7f97347325b2f167c07e538de90c6b93d0 diff --git a/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.js b/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.js index 06f89332..4c546cac 100644 --- a/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.js +++ b/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.js @@ -969,25 +969,25 @@ function dbg(text) { // === Body === var ASM_CONSTS = { - 1036736: ($0) => { startToDebuggerMessage($0); }, - 1036768: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); }, - 1036843: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); }, - 1036918: ($0) => { finishToDebuggerMessage($0); }, - 1036951: ($0, $1) => { return getLvglScreenByName($0, UTF8ToString($1)); }, - 1037005: ($0, $1) => { return getLvglObjectByName($0, UTF8ToString($1)); }, - 1037059: ($0, $1) => { return getLvglGroupByName($0, UTF8ToString($1)); }, - 1037112: ($0, $1) => { return getLvglStyleByName($0, UTF8ToString($1)); }, - 1037165: ($0, $1) => { return getLvglImageByName($0, UTF8ToString($1)); }, - 1037218: ($0, $1, $2) => { lvglObjAddStyle($0, $1, $2); }, - 1037251: ($0, $1, $2) => { lvglObjRemoveStyle($0, $1, $2); }, - 1037287: ($0, $1) => { lvglSetColorTheme($0, UTF8ToString($1)); }, - 1037332: ($0, $1, $2, $3, $4, $5) => { return eez_mqtt_init($0, UTF8ToString($1), UTF8ToString($2), $3, UTF8ToString($4), UTF8ToString($5)); }, - 1037438: ($0, $1) => { return eez_mqtt_deinit($0, $1); }, - 1037474: ($0, $1) => { return eez_mqtt_connect($0, $1); }, - 1037511: ($0, $1) => { return eez_mqtt_disconnect($0, $1); }, - 1037551: ($0, $1, $2) => { return eez_mqtt_subscribe($0, $1, UTF8ToString($2)); }, - 1037608: ($0, $1, $2) => { return eez_mqtt_unsubscribe($0, $1, UTF8ToString($2)); }, - 1037667: ($0, $1, $2, $3) => { return eez_mqtt_publish($0, $1, UTF8ToString($2), UTF8ToString($3)); } + 1036816: ($0) => { startToDebuggerMessage($0); }, + 1036848: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); }, + 1036923: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); }, + 1036998: ($0) => { finishToDebuggerMessage($0); }, + 1037031: ($0, $1) => { return getLvglScreenByName($0, UTF8ToString($1)); }, + 1037085: ($0, $1) => { return getLvglObjectByName($0, UTF8ToString($1)); }, + 1037139: ($0, $1) => { return getLvglGroupByName($0, UTF8ToString($1)); }, + 1037192: ($0, $1) => { return getLvglStyleByName($0, UTF8ToString($1)); }, + 1037245: ($0, $1) => { return getLvglImageByName($0, UTF8ToString($1)); }, + 1037298: ($0, $1, $2) => { lvglObjAddStyle($0, $1, $2); }, + 1037331: ($0, $1, $2) => { lvglObjRemoveStyle($0, $1, $2); }, + 1037367: ($0, $1) => { lvglSetColorTheme($0, UTF8ToString($1)); }, + 1037412: ($0, $1, $2, $3, $4, $5) => { return eez_mqtt_init($0, UTF8ToString($1), UTF8ToString($2), $3, UTF8ToString($4), UTF8ToString($5)); }, + 1037518: ($0, $1) => { return eez_mqtt_deinit($0, $1); }, + 1037554: ($0, $1) => { return eez_mqtt_connect($0, $1); }, + 1037591: ($0, $1) => { return eez_mqtt_disconnect($0, $1); }, + 1037631: ($0, $1, $2) => { return eez_mqtt_subscribe($0, $1, UTF8ToString($2)); }, + 1037688: ($0, $1, $2) => { return eez_mqtt_unsubscribe($0, $1, UTF8ToString($2)); }, + 1037747: ($0, $1, $2, $3) => { return eez_mqtt_publish($0, $1, UTF8ToString($2), UTF8ToString($3)); } }; diff --git a/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.wasm b/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.wasm index 38d6b21b..dc931ae4 100644 Binary files a/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.wasm and b/packages/project-editor/flow/runtime/lvgl_runtime_v8.3.wasm differ diff --git a/packages/project-editor/flow/runtime/lvgl_runtime_v9.0.wasm b/packages/project-editor/flow/runtime/lvgl_runtime_v9.0.wasm index c0a61c20..f67456e8 100644 Binary files a/packages/project-editor/flow/runtime/lvgl_runtime_v9.0.wasm and b/packages/project-editor/flow/runtime/lvgl_runtime_v9.0.wasm differ diff --git a/packages/project-editor/lvgl/actions.tsx b/packages/project-editor/lvgl/actions.tsx index 967be787..39712876 100644 --- a/packages/project-editor/lvgl/actions.tsx +++ b/packages/project-editor/lvgl/actions.tsx @@ -192,7 +192,7 @@ export function registerAction(actionDefinition: IActionDefinition) { referencedObjectCollectionPath = "userPages"; } else if (actionProperty.type.startsWith("widget")) { enumItems = (actionType: LVGLActionType) => { - const lvglIdentifiers = ProjectEditor.getProjectStore( + let lvglIdentifiers = ProjectEditor.getProjectStore( actionType ).lvglIdentifiers.getIdentifiersVisibleFromFlow( ProjectEditor.getFlow(actionType) @@ -202,37 +202,40 @@ export function registerAction(actionDefinition: IActionDefinition) { "widget:".length ); - return lvglIdentifiers - .filter(lvglIdentifier => { - if (lvglIdentifier.widgets.length > 1) { - return false; - } + lvglIdentifiers = lvglIdentifiers.filter(lvglIdentifier => { + if (lvglIdentifier.widgets.length > 1) { + return false; + } - const widget = lvglIdentifier.widgets[0]; + const widget = lvglIdentifier.widgets[0]; - if (!widgetType) { - return ( - widget instanceof - ProjectEditor.LVGLWidgetClass - ); - } else { - const lvglWidgetClassName = `LVGL${widgetType}Widget`; + if (!widgetType) { + return ( + widget instanceof ProjectEditor.LVGLWidgetClass + ); + } else { + const lvglWidgetClassName = `LVGL${widgetType}Widget`; - const projectStore = - ProjectEditor.getProjectStore(actionType); + const projectStore = + ProjectEditor.getProjectStore(actionType); - const lvglWidgetClass = getClassByName( - projectStore, - lvglWidgetClassName - )!; + const lvglWidgetClass = getClassByName( + projectStore, + lvglWidgetClassName + )!; - return widget instanceof lvglWidgetClass; - } - }) - .map(lvglIdentifier => ({ - id: lvglIdentifier.identifier, - label: lvglIdentifier.identifier - })); + return widget instanceof lvglWidgetClass; + } + }); + + lvglIdentifiers.sort((a, b) => + a.identifier.localeCompare(b.identifier) + ); + + return lvglIdentifiers.map(lvglIdentifier => ({ + id: lvglIdentifier.identifier, + label: lvglIdentifier.identifier + })); }; referencedObjectCollectionPath = ""; } else if (actionProperty.type == "style") { diff --git a/packages/project-editor/lvgl/identifiers.ts b/packages/project-editor/lvgl/identifiers.ts index acc04f94..87748b30 100644 --- a/packages/project-editor/lvgl/identifiers.ts +++ b/packages/project-editor/lvgl/identifiers.ts @@ -98,7 +98,11 @@ export class LVGLIdentifiers { let identifierName; if (widget instanceof ProjectEditor.LVGLScreenWidgetClass) { - identifierName = page.name; + identifierName = getName( + "", + page.name, + NamingConvention.UnderscoreLowerCase + ); } else { if (!widget.identifier) { return;