Skip to content

Commit

Permalink
update eez-flow and fix roller when editing with encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Oct 8, 2024
1 parent ffe1519 commit 5731b65
Show file tree
Hide file tree
Showing 11 changed files with 406 additions and 264 deletions.
2 changes: 1 addition & 1 deletion packages/project-editor/flow/runtime/cpp/eez-framework
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ struct ScpiComponentExecutionState : public ComponenentExecutionState {

bool getLatestScpiResult(FlowState *flowState, unsigned componentIndex, const char **resultText, size_t *resultTextLen, bool *resultIsBlob) {
if (errorMessage) {
throwError(flowState, componentIndex, errorMessage);
throwError(flowState, componentIndex, FlowError::Plain(errorMessage));
return false;
}

Expand Down Expand Up @@ -203,19 +203,19 @@ void executeScpiComponent(FlowState *flowState, unsigned componentIndex) {
auto component = (ScpiActionComponent *)flowState->flow->components[componentIndex];

Value instrumentValue;
if (!evalProperty(flowState, componentIndex, defs_v3::SCPI_ACTION_COMPONENT_PROPERTY_INSTRUMENT, instrumentValue, "Failed to evaluate Instrument in SCPI")) {
if (!evalProperty(flowState, componentIndex, defs_v3::SCPI_ACTION_COMPONENT_PROPERTY_INSTRUMENT, instrumentValue, FlowError::Property("SCPI", "Instrument"))) {
return;
}
if (!instrumentValue.isArray()) {
throwError(flowState, componentIndex, "Invalid Instrument value in SCPI\n");
throwError(flowState, componentIndex, FlowError::Plain("Invalid Instrument value in SCPI"));
return;
}
auto instrumentArrayValue = instrumentValue.getArray();

int err;

Value timeoutValue;
if (!evalProperty(flowState, componentIndex, defs_v3::SCPI_ACTION_COMPONENT_PROPERTY_TIMEOUT, timeoutValue, "Failed to evaluate Timeout in SCPI")) {
if (!evalProperty(flowState, componentIndex, defs_v3::SCPI_ACTION_COMPONENT_PROPERTY_TIMEOUT, timeoutValue, FlowError::Property("SCPI", "Timeout"))) {
return;
}
int timeout = timeoutValue.toInt32(&err);
Expand All @@ -224,7 +224,7 @@ void executeScpiComponent(FlowState *flowState, unsigned componentIndex) {
}

Value delayValue;
if (!evalProperty(flowState, componentIndex, defs_v3::SCPI_ACTION_COMPONENT_PROPERTY_DELAY, delayValue, "Failed to evaluate Delay in SCPI")) {
if (!evalProperty(flowState, componentIndex, defs_v3::SCPI_ACTION_COMPONENT_PROPERTY_DELAY, delayValue, FlowError::Property("SCPI", "Delay"))) {
return;
}
int delay = delayValue.toInt32(&err);
Expand Down Expand Up @@ -263,7 +263,7 @@ void executeScpiComponent(FlowState *flowState, unsigned componentIndex) {
} else if (scpiComponentExecutionState->op == SCPI_PART_EXPR) {
Value value;
int numInstructionBytes;
if (!evalExpression(flowState, componentIndex, instructions + scpiComponentExecutionState->instructionIndex, value, "Failed to evaluate assignable expression in SCPI", &numInstructionBytes)) {
if (!evalExpression(flowState, componentIndex, instructions + scpiComponentExecutionState->instructionIndex, value, FlowError::Property("SCPI", "Assignable expression"), &numInstructionBytes)) {
deallocateComponentExecutionState(flowState, componentIndex);
return;
}
Expand Down Expand Up @@ -300,7 +300,7 @@ void executeScpiComponent(FlowState *flowState, unsigned componentIndex) {

Value dstValue;
int numInstructionBytes;
if (!evalAssignableExpression(flowState, componentIndex, instructions + scpiComponentExecutionState->instructionIndex, dstValue, "Failed to evaluate assignable expression in SCPI", &numInstructionBytes)) {
if (!evalAssignableExpression(flowState, componentIndex, instructions + scpiComponentExecutionState->instructionIndex, dstValue, FlowError::Property("SCPI", "Assignable expression"), &numInstructionBytes)) {
deallocateComponentExecutionState(flowState, componentIndex);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -695,9 +695,11 @@ void doUpdateTasks() {
lv_roller_set_options(updateTask.obj, new_val, (lv_roller_mode_t)updateTask.param);
}
} else if (updateTask.updateTaskType == UPDATE_TASK_TYPE_ROLLER_SELECTED) {
uint16_t new_val = (uint16_t)evalIntegerProperty(updateTask.flow_state, updateTask.component_index, updateTask.property_index, "Failed to evaluate Selected in Roller widget");
uint16_t cur_val = lv_roller_get_selected(updateTask.obj);
if (new_val != cur_val) lv_roller_set_selected(updateTask.obj, new_val, LV_ANIM_OFF);
if (!(lv_obj_get_state(updateTask.obj) & LV_STATE_EDITED)) {
uint16_t new_val = (uint16_t)evalIntegerProperty(updateTask.flow_state, updateTask.component_index, updateTask.property_index, "Failed to evaluate Selected in Roller widget");
uint16_t cur_val = lv_roller_get_selected(updateTask.obj);
if (new_val != cur_val) lv_roller_set_selected(updateTask.obj, new_val, LV_ANIM_OFF);
}
} else if (updateTask.updateTaskType == UPDATE_TASK_TYPE_SLIDER_VALUE) {
int32_t new_val = evalIntegerProperty(updateTask.flow_state, updateTask.component_index, updateTask.property_index, "Failed to evaluate Value in Slider widget");
int32_t cur_val = lv_slider_get_value(updateTask.obj);
Expand Down
2 changes: 1 addition & 1 deletion packages/project-editor/flow/runtime/eez_runtime.js

Large diffs are not rendered by default.

Binary file modified packages/project-editor/flow/runtime/eez_runtime.wasm
Binary file not shown.
36 changes: 18 additions & 18 deletions packages/project-editor/flow/runtime/lvgl_runtime_v8.3.js
Original file line number Diff line number Diff line change
Expand Up @@ -969,24 +969,24 @@ function dbg(text) {
// === Body ===

var ASM_CONSTS = {
1039000: ($0) => { startToDebuggerMessage($0); },
1039032: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
1039107: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
1039182: ($0) => { finishToDebuggerMessage($0); },
1039215: ($0, $1) => { return getLvglScreenByName($0, UTF8ToString($1)); },
1039269: ($0, $1) => { return getLvglObjectByName($0, UTF8ToString($1)); },
1039323: ($0, $1) => { return getLvglGroupByName($0, UTF8ToString($1)); },
1039376: ($0, $1) => { return getLvglStyleByName($0, UTF8ToString($1)); },
1039429: ($0, $1) => { return getLvglImageByName($0, UTF8ToString($1)); },
1039482: ($0, $1, $2) => { lvglObjAddStyle($0, $1, $2); },
1039515: ($0, $1, $2) => { lvglObjRemoveStyle($0, $1, $2); },
1039551: ($0, $1, $2, $3, $4, $5) => { return eez_mqtt_init($0, UTF8ToString($1), UTF8ToString($2), $3, UTF8ToString($4), UTF8ToString($5)); },
1039657: ($0, $1) => { return eez_mqtt_deinit($0, $1); },
1039693: ($0, $1) => { return eez_mqtt_connect($0, $1); },
1039730: ($0, $1) => { return eez_mqtt_disconnect($0, $1); },
1039770: ($0, $1, $2) => { return eez_mqtt_subscribe($0, $1, UTF8ToString($2)); },
1039827: ($0, $1, $2) => { return eez_mqtt_unsubscribe($0, $1, UTF8ToString($2)); },
1039886: ($0, $1, $2, $3) => { return eez_mqtt_publish($0, $1, UTF8ToString($2), UTF8ToString($3)); }
1036776: ($0) => { startToDebuggerMessage($0); },
1036808: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
1036883: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
1036958: ($0) => { finishToDebuggerMessage($0); },
1036991: ($0, $1) => { return getLvglScreenByName($0, UTF8ToString($1)); },
1037045: ($0, $1) => { return getLvglObjectByName($0, UTF8ToString($1)); },
1037099: ($0, $1) => { return getLvglGroupByName($0, UTF8ToString($1)); },
1037152: ($0, $1) => { return getLvglStyleByName($0, UTF8ToString($1)); },
1037205: ($0, $1) => { return getLvglImageByName($0, UTF8ToString($1)); },
1037258: ($0, $1, $2) => { lvglObjAddStyle($0, $1, $2); },
1037291: ($0, $1, $2) => { lvglObjRemoveStyle($0, $1, $2); },
1037327: ($0, $1, $2, $3, $4, $5) => { return eez_mqtt_init($0, UTF8ToString($1), UTF8ToString($2), $3, UTF8ToString($4), UTF8ToString($5)); },
1037433: ($0, $1) => { return eez_mqtt_deinit($0, $1); },
1037469: ($0, $1) => { return eez_mqtt_connect($0, $1); },
1037506: ($0, $1) => { return eez_mqtt_disconnect($0, $1); },
1037546: ($0, $1, $2) => { return eez_mqtt_subscribe($0, $1, UTF8ToString($2)); },
1037603: ($0, $1, $2) => { return eez_mqtt_unsubscribe($0, $1, UTF8ToString($2)); },
1037662: ($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.
36 changes: 18 additions & 18 deletions packages/project-editor/flow/runtime/lvgl_runtime_v9.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -969,24 +969,24 @@ function dbg(text) {
// === Body ===

var ASM_CONSTS = {
1033864: ($0) => { startToDebuggerMessage($0); },
1033896: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
1033971: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
1034046: ($0) => { finishToDebuggerMessage($0); },
1034079: ($0, $1) => { return getLvglScreenByName($0, UTF8ToString($1)); },
1034133: ($0, $1) => { return getLvglObjectByName($0, UTF8ToString($1)); },
1034187: ($0, $1) => { return getLvglGroupByName($0, UTF8ToString($1)); },
1034240: ($0, $1) => { return getLvglStyleByName($0, UTF8ToString($1)); },
1034293: ($0, $1) => { return getLvglImageByName($0, UTF8ToString($1)); },
1034346: ($0, $1, $2) => { lvglObjAddStyle($0, $1, $2); },
1034379: ($0, $1, $2) => { lvglObjRemoveStyle($0, $1, $2); },
1034415: ($0, $1, $2, $3, $4, $5) => { return eez_mqtt_init($0, UTF8ToString($1), UTF8ToString($2), $3, UTF8ToString($4), UTF8ToString($5)); },
1034521: ($0, $1) => { return eez_mqtt_deinit($0, $1); },
1034557: ($0, $1) => { return eez_mqtt_connect($0, $1); },
1034594: ($0, $1) => { return eez_mqtt_disconnect($0, $1); },
1034634: ($0, $1, $2) => { return eez_mqtt_subscribe($0, $1, UTF8ToString($2)); },
1034691: ($0, $1, $2) => { return eez_mqtt_unsubscribe($0, $1, UTF8ToString($2)); },
1034750: ($0, $1, $2, $3) => { return eez_mqtt_publish($0, $1, UTF8ToString($2), UTF8ToString($3)); }
1031624: ($0) => { startToDebuggerMessage($0); },
1031656: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
1031731: ($0, $1, $2) => { writeDebuggerBuffer($0, new Uint8Array(Module.HEAPU8.buffer, $1, $2)); },
1031806: ($0) => { finishToDebuggerMessage($0); },
1031839: ($0, $1) => { return getLvglScreenByName($0, UTF8ToString($1)); },
1031893: ($0, $1) => { return getLvglObjectByName($0, UTF8ToString($1)); },
1031947: ($0, $1) => { return getLvglGroupByName($0, UTF8ToString($1)); },
1032000: ($0, $1) => { return getLvglStyleByName($0, UTF8ToString($1)); },
1032053: ($0, $1) => { return getLvglImageByName($0, UTF8ToString($1)); },
1032106: ($0, $1, $2) => { lvglObjAddStyle($0, $1, $2); },
1032139: ($0, $1, $2) => { lvglObjRemoveStyle($0, $1, $2); },
1032175: ($0, $1, $2, $3, $4, $5) => { return eez_mqtt_init($0, UTF8ToString($1), UTF8ToString($2), $3, UTF8ToString($4), UTF8ToString($5)); },
1032281: ($0, $1) => { return eez_mqtt_deinit($0, $1); },
1032317: ($0, $1) => { return eez_mqtt_connect($0, $1); },
1032354: ($0, $1) => { return eez_mqtt_disconnect($0, $1); },
1032394: ($0, $1, $2) => { return eez_mqtt_subscribe($0, $1, UTF8ToString($2)); },
1032451: ($0, $1, $2) => { return eez_mqtt_unsubscribe($0, $1, UTF8ToString($2)); },
1032510: ($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_v9.0.wasm
Binary file not shown.
Loading

0 comments on commit 5731b65

Please sign in to comment.