diff --git a/packages/project-editor/flow/runtime/cpp/eez-framework b/packages/project-editor/flow/runtime/cpp/eez-framework index b9f6a088..20567d18 160000 --- a/packages/project-editor/flow/runtime/cpp/eez-framework +++ b/packages/project-editor/flow/runtime/cpp/eez-framework @@ -1 +1 @@ -Subproject commit b9f6a088bb5b661c7c1f12674818b1bf10629907 +Subproject commit 20567d18ee9cf9571eed6954b52170f2b920b7b1 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 aea804bb..d001501d 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 36468515..578d8361 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/resources/eez-framework-amalgamation/eez-flow.cpp b/resources/eez-framework-amalgamation/eez-flow.cpp index 07764336..67108f61 100644 --- a/resources/eez-framework-amalgamation/eez-flow.cpp +++ b/resources/eez-framework-amalgamation/eez-flow.cpp @@ -1,4 +1,4 @@ -/* Autogenerated on December 3, 2024 1:49:44 PM from eez-framework commit 4d56ee77aa136e9b1b8bdb4c66ce286aece09938 */ +/* Autogenerated on December 5, 2024 1:54:23 PM from eez-framework commit b9f6a088bb5b661c7c1f12674818b1bf10629907 */ /* * eez-framework * @@ -7374,8 +7374,9 @@ static const void *getLvglImageByName(const char *name) { } return 0; } +static lv_event_t *g_currentLVGLEvent; static void executeLvglAction(int actionIndex) { - g_actions[actionIndex](0); + g_actions[actionIndex](g_currentLVGLEvent); } void eez_flow_init_themes(const char **themeNames, size_t numThemes, void (*changeColorTheme)(uint32_t themeIndex)) { g_themeNames = themeNames; @@ -7497,50 +7498,57 @@ extern "C" void flowPropagateValueUint32(void *flowState, unsigned componentInde eez::flow::propagateValue((eez::flow::FlowState *)flowState, componentIndex, outputIndex, eez::Value(value, eez::VALUE_TYPE_UINT32)); } extern "C" void flowPropagateValueLVGLEvent(void *flowState, unsigned componentIndex, unsigned outputIndex, lv_event_t *event) { - lv_event_code_t event_code = lv_event_get_code(event); - uint32_t code = (uint32_t)event_code; - void *currentTarget = (void *)lv_event_get_current_target(event); - void *target = (void *)lv_event_get_target(event); - void *userDataPointer = lv_event_get_user_data(event); - int32_t userData = *((int32_t*)(&userDataPointer)); - uint32_t key = 0; - if (event_code == LV_EVENT_KEY || (event_code == LV_EVENT_VALUE_CHANGED && -#if LVGL_VERSION_MAJOR >= 9 - lv_obj_check_type((lv_obj_t*)target, &lv_buttonmatrix_class) -#else - lv_obj_check_type((lv_obj_t*)target, &lv_btnmatrix_class) -#endif - )) { - uint32_t *param = (uint32_t *)lv_event_get_param(event); - key = param ? *param : 0; - } - int32_t gestureDir = (int32_t)LV_DIR_NONE; - if (event_code == LV_EVENT_GESTURE) { -#if LVGL_VERSION_MAJOR >= 9 - lv_indev_wait_release(lv_indev_active()); -#else - lv_indev_wait_release(lv_indev_get_act()); -#endif - gestureDir = (int32_t)lv_indev_get_gesture_dir( -#if LVGL_VERSION_MAJOR >= 9 - lv_indev_active() -#else - lv_indev_get_act() -#endif + if (eez::flow::hasAnyDataConnection((eez::flow::FlowState *)flowState, componentIndex, outputIndex)) { + lv_event_code_t event_code = lv_event_get_code(event); + uint32_t code = (uint32_t)event_code; + void *currentTarget = (void *)lv_event_get_current_target(event); + void *target = (void *)lv_event_get_target(event); + void *userDataPointer = lv_event_get_user_data(event); + int32_t userData = *((int32_t*)(&userDataPointer)); + uint32_t key = 0; + if (event_code == LV_EVENT_KEY || (event_code == LV_EVENT_VALUE_CHANGED && + #if LVGL_VERSION_MAJOR >= 9 + lv_obj_check_type((lv_obj_t*)target, &lv_buttonmatrix_class) + #else + lv_obj_check_type((lv_obj_t*)target, &lv_btnmatrix_class) + #endif + )) { + uint32_t *param = (uint32_t *)lv_event_get_param(event); + key = param ? *param : 0; + } + int32_t gestureDir = (int32_t)LV_DIR_NONE; + if (event_code == LV_EVENT_GESTURE) { + #if LVGL_VERSION_MAJOR >= 9 + lv_indev_wait_release(lv_indev_active()); + #else + lv_indev_wait_release(lv_indev_get_act()); + #endif + gestureDir = (int32_t)lv_indev_get_gesture_dir( + #if LVGL_VERSION_MAJOR >= 9 + lv_indev_active() + #else + lv_indev_get_act() + #endif + ); + } + int32_t rotaryDiff = 0; + #if LVGL_VERSION_MAJOR >= 9 + if (event_code == LV_EVENT_ROTARY) { + rotaryDiff = lv_event_get_rotary_diff(event); + } + #endif + eez::flow::propagateValue( + (eez::flow::FlowState *)flowState, componentIndex, outputIndex, + eez::Value::makeLVGLEventRef( + code, currentTarget, target, userData, key, gestureDir, rotaryDiff, 0xe7f23624 + ) ); + } else { + eez::flow::propagateValue((eez::flow::FlowState *)flowState, componentIndex, outputIndex); } - int32_t rotaryDiff = 0; -#if LVGL_VERSION_MAJOR >= 9 - if (event_code == LV_EVENT_ROTARY) { - rotaryDiff = lv_event_get_rotary_diff(event); - } -#endif - eez::flow::propagateValue( - (eez::flow::FlowState *)flowState, componentIndex, outputIndex, - eez::Value::makeLVGLEventRef( - code, currentTarget, target, userData, key, gestureDir, rotaryDiff, 0xe7f23624 - ) - ); + g_currentLVGLEvent = event; + eez::flow::tick(); + g_currentLVGLEvent = 0; } #ifndef EEZ_LVGL_TEMP_STRING_BUFFER_SIZE #define EEZ_LVGL_TEMP_STRING_BUFFER_SIZE 1024 @@ -10308,6 +10316,21 @@ void propagateValueThroughSeqout(FlowState *flowState, unsigned componentIndex) } } } +bool hasAnyDataConnection(FlowState *flowState, unsigned componentIndex, unsigned outputIndex) { + if ((int)componentIndex == -1) { + return false; + } + auto component = flowState->flow->components[componentIndex]; + auto componentOutput = component->outputs[outputIndex]; + for (unsigned connectionIndex = 0; connectionIndex < componentOutput->connections.count; connectionIndex++) { + auto connection = componentOutput->connections[connectionIndex]; + auto isDataInput = !(flowState->flow->componentInputs[connection->targetInputIndex] & COMPONENT_INPUT_FLAG_IS_SEQ_INPUT); + if (isDataInput) { + return true; + } + } + return false; +} #if EEZ_OPTION_GUI void getValue(uint16_t dataId, DataOperationEnum operation, const WidgetCursor &widgetCursor, Value &value) { if (!isFlowStopped()) { diff --git a/resources/eez-framework-amalgamation/eez-flow.h b/resources/eez-framework-amalgamation/eez-flow.h index 8d4b0dd1..7062c886 100644 --- a/resources/eez-framework-amalgamation/eez-flow.h +++ b/resources/eez-framework-amalgamation/eez-flow.h @@ -1,4 +1,4 @@ -/* Autogenerated on December 3, 2024 1:49:44 PM from eez-framework commit 4d56ee77aa136e9b1b8bdb4c66ce286aece09938 */ +/* Autogenerated on December 5, 2024 1:54:23 PM from eez-framework commit b9f6a088bb5b661c7c1f12674818b1bf10629907 */ /* * eez-framework * @@ -2359,6 +2359,7 @@ void resetSequenceInputs(FlowState *flowState); void propagateValue(FlowState *flowState, unsigned componentIndex, unsigned outputIndex, const Value &value); void propagateValue(FlowState *flowState, unsigned componentIndex, unsigned outputIndex); void propagateValueThroughSeqout(FlowState *flowState, unsigned componentIndex); +bool hasAnyDataConnection(FlowState *flowState, unsigned componentIndex, unsigned outputIndex); #if EEZ_OPTION_GUI void getValue(uint16_t dataId, DataOperationEnum operation, const WidgetCursor &widgetCursor, Value &value); void setValue(uint16_t dataId, const WidgetCursor &widgetCursor, const Value& value);