Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Oct 18, 2024
1 parent 461cc16 commit 97c5222
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 48 deletions.
2 changes: 1 addition & 1 deletion packages/project-editor/flow/runtime/cpp/eez-framework
38 changes: 19 additions & 19 deletions packages/project-editor/flow/runtime/lvgl_runtime_v8.3.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)); }
};


Expand Down
Binary file modified packages/project-editor/flow/runtime/lvgl_runtime_v8.3.wasm
Binary file not shown.
Binary file modified packages/project-editor/flow/runtime/lvgl_runtime_v9.0.wasm
Binary file not shown.
57 changes: 30 additions & 27 deletions packages/project-editor/lvgl/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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") {
Expand Down
6 changes: 5 additions & 1 deletion packages/project-editor/lvgl/identifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 97c5222

Please sign in to comment.