eez-open / studio

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

EEZ-Flow: Add SCPI processing code generation with UI #261

Open fietser28 opened 1 year ago

fietser28 commented 1 year ago

In embedded EEZ-Flow projects I would like to be able to easily generate code that processes SCPI commands. For this a UI interface is needed to specify the SCPI commands (probably a panel derived from existing SCPI panel in studio) and the SCPI errors. In the UI the defined SCPI commands will have some properties, mainly the action (and parameters) the SCPI command will trigger.

Additionally it would be nice if the EEZ-Flow project also generated the definition (IEXT file) to have studio as a control interface via SCPI for the device. During development it would be nice to point to the changing project instead of an IEXT file that needs reloading each time.

SCPI command processing might be done in a different task as the UI processing. I think it would be most flexible to implement a eez_scpi_init() and eez_scpi_tick() functions and give the user freedom to incorporate it in ui_init and ui_tick functions or separately.

fietser28 commented 4 months ago

After manually implementing a SCPI commands set using the nice scpi-parser library I have a new insight on this request, that will probably make the implementation also easier:

Add a SCPI option (specifing the command and maybe arguments) to actions and global variables. This generates the SCPI structure (const scpi_command_t scpi_commands[]) and the wrappers for SCPI commands. This will not cover every possible SCPI command but will do the (boring to implement) bulk of commands.

More specific:

Regarding parameters:

A separate SCPI task maybe not trivial in this case because execution of commands and queries will take place during the ui_tick()?