TcMenu / tcMenu

Menu library for Arduino, mbed and ESP with designer UI and remote control capabilities.
https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/
Apache License 2.0
293 stars 24 forks source link

Embedded Java/Raspberry PI code generator improvements to reduce complexity #538

Open davetcc opened 4 hours ago

davetcc commented 4 hours ago

Is your feature request related to a problem? Please describe.

Note this is for Embedded Java cases only, no changes here are for the existing C++/Arduino generator.

Now the Embedded Java code generator for RaspberryPI is too complicated, and inflexible. It would be far better to provide the starting point application and then have tcMenu Designer able to alter the MenuDef menu tree file including with menu in menu definitions, and the file containing callbacks. All other files should be managed outside of tcMenu by the developer. This is similar to the C++ Arduino workflow.

Describe the solution you'd like

To have a simplified flow for the Embedded Java use cases that do not risk breaking Java code each run.

Additional context

All Embedded Java code generation should be based on the starter project, following the following pattern.

  1. To get started the user would take the Java embedded device example from the starters project. Example links needed on TcMenu Documentation site and in tcMenu Designer.
  2. They would copy this code into their own project and get the project running.
  3. We should search for the classes in the package structure using the some known keys in the class, if we don't find those key elements, fail immediately
  4. We should then regenerate the menudef file containing the menu tree.
  5. We should check if there are menu in menu definitions and put them into the menudef file
  6. Lastly, check that all callbacks that are in the menu tree have an entry in the controller file, create new entries at the bottom for any that are missing.
vzahradnik commented 4 hours ago

OK, I have a question. If we require users to copy the starter project and we assume the project is there, otherwise the code fails, why can't we just adopt the starter project as a template?

TcMenu generator can fetch the starter project zip file or get it through other means, then generate the menu tree and we have a workable project without the need to do the manual steps.