eez-open / studio

Cross-platform low-code GUI and automation
https://www.envox.eu/studio/studio-introduction/
GNU General Public License v3.0
363 stars 73 forks source link

[LVGL] If flow support is turned off then the generated files still contain flow usages #377

Open RE2012 opened 3 months ago

RE2012 commented 3 months ago

Describe the bug If flow support is turned off then the generated files still contain flow usages.

To Reproduce

  1. in studio go to "Home" page, select "examples" and select project "eez_lvgl_demo"
  2. click "edit project"
  3. click on "build" button
  4. go to project settings and switch off "flow support"
  5. click on "build" button
  6. check the output folder and see that many files contain flow data, e.g.:
    • flow_def.c and flow_def.h exist
    • ui.c uses eez_flow_init and eez_flow_tick
    • ui.h: #include <eez/flow/lvgl_api.h>

Expected behavior If flow support is removed from a project (unchecked) nad project is build again then build files should not contain flow data in any code anymore.

Desktop (please complete the following information)

LVGL version (if used)

Additional context

mvladic commented 3 months ago

When you turn off flow support, the template files, for now, are not changed/updated. "LVGL" and "LVGL with EEZ Flow" have different set of template files. This is already reported (see #366) and will be addressed in the next release. For now, you will need to manually delete all the template files and copy-paste from a new project created with the "LVGL" template.

RE2012 commented 2 months ago

Thank you. I have tried it with 0.13.1 and copied all files from sample LVGL no flow project. However in screens.c I still see getFlowState usages. For example: void create_screen_main() { ... lv_obj_set_local_style_prop(obj, LV_STYLE_BG_OPA, value, LV_PART_MAIN); lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_WIDTH, value, LV_PART_MAIN); create_user_widget_header(obj, getFlowState(flowState, 0), 33);

and: void tick_screen_main() { tick_user_widget_header(getFlowState(flowState, 0), 33);

Looking for next version. Best Regards

mvladic commented 2 months ago

Thank you. I have tried it with 0.13.1 and copied all files from sample LVGL no flow project. However in screens.c I still see getFlowState usages.

This is already fixed in master branch, see #373. Will be in 0.14.0 release, due by June 10, but you can always build a Studio from master branch.

tylercamp commented 2 months ago

A similar problem happens in the reverse case - when I enable Flow in a project which did not originally have it, the relevant files + content updates don't seem to be applied. Tried latest release and latest on master.

Would it be appropriate to copy/paste the relevant JSON from an LVGL+Flow project file into my originally-LVGL-only project file as a workaround?

mvladic commented 2 months ago

Yes, you can copy and paste, but you don't need to go into JSON, you can do it inside Studio.

image

image

image