StateSmith / StateSmith

A state machine code generation tool suitable for bare metal, embedded and more.
Apache License 2.0
470 stars 44 forks source link

One-click generation of code from models #280

Open emmby opened 1 month ago

emmby commented 1 month ago

As a user, I would like to be able to generate code from a model in a single step. For example, if I have a model Model.drawio.svg, I would like to be able to (exact syntax TBD):

This is probably dependent on the "interim solution" in https://github.com/StateSmith/StateSmith/issues/264

adamfk commented 1 month ago

Lots of good ideas in here! I'll start breaking some of them out into related tickets this weekend.

I've been wondering about a similar idea. Using the CLI without .CSX. right now the CLI can recursively find relevant CSX files and run them. We should be able to do the same with draw.io files although slower because the XML is sometimes base 64 encoded and compressed in the SVG. We have to decode and uncompress each SVG to see if it is a ss file.

Perhaps a user could use fileName.ss.extension or some other pattern to make it easier to auto find diagram files. Look for ".ss.".

Or they could use the ss.cli manifest or specify exactly the diagram as shown above.

It would be really nice to have "ss.cli watch" work for multiple diagrams concurrently. Not needing a watch for every sm.

adamfk commented 1 month ago

I forgot that the SVG will contain XML text with $STATEMACHINE : MySm. We can quickly and easily scan for that. No need to uncompress embedded diagram.