|
| 1 | +<a name="top-anchor"/> |
| 2 | + |
| 3 | +| [Contents](../README.md#table-of-contents) | [SCXML Wiki](https://alexzhornyak.github.io/SCXML-tutorial/) | [Forum](https://github.com/alexzhornyak/ScxmlEditor-Tutorial/discussions) | |
| 4 | +|---|---|---| |
| 5 | + |
| 6 | +# Export SCXML charts with layout metainformation |
| 7 | +ScxmlEditor has its own binary layout metainformation that can not be easily parsed. There were a multiple requests to be able to store a chart graphical layout as readable text format. Graphical metainformation can be added in the next formats: |
| 8 | +- [Qt Creator](#qt-creator) |
| 9 | +- [ScxmlGui](#scxmlgui) |
| 10 | +- [VSCode](#vscode) |
| 11 | +- [Simple Visual](#simple-visual-metainformation-format) |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +## Metainformation modes |
| 16 | +### Project Mode (Permanent metainformation using project options) |
| 17 | +There is an ability to add layout metainformation every time when you are saving scxml files. This is available in Project mode if the corresponding type of metainformation option is set. |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +### Export Mode (Export file with metainformation by calling an action) |
| 22 | +If you do not want to change your current file, you can export it with different file name and add metainformation there. |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +## Metainformation types |
| 27 | +### [Qt Creator](https://doc.qt.io/qtcreator/creator-scxml.html) |
| 28 | +State charts will be saved with [Qt Creator](https://doc.qt.io/qtcreator/creator-scxml.html) graphical metainformation |
| 29 | + |
| 30 | +|  | |
| 31 | +|---| |
| 32 | +| Example of Qt Creator metainformation | |
| 33 | + |
| 34 | +|  | |
| 35 | +|---| |
| 36 | +| Comparison of Qt Creator and ScxmlEditor layouts | |
| 37 | + |
| 38 | +> **WARNING:** If self-transition is present in state, it is displayed inside of a state and state width is increased! |
| 39 | + |
| 40 | + |
| 41 | +> **NOTE:** Use self-transition location at the left side inside of a state |
| 42 | + |
| 43 | + |
| 44 | +### [VSCode](https://marketplace.visualstudio.com/items?itemName=Phrogz.visual-scxml-editor) |
| 45 | +State charts will be saved with [VSCode](https://marketplace.visualstudio.com/items?itemName=Phrogz.visual-scxml-editor) graphical metainformation |
| 46 | + |
| 47 | +|  | |
| 48 | +|---| |
| 49 | +| Example of VSCode metainformation | |
| 50 | + |
| 51 | +|  |  | |
| 52 | +|---|---| |
| 53 | +| VSCode target layout | ScxmlEditor source layout | |
| 54 | + |
| 55 | +> **WARNING:** Invoked state machines could be wrongly represented by VSCode side! |
| 56 | +
|
| 57 | +### [ScxmlGui](https://github.com/fmorbini/scxmlgui) |
| 58 | +State charts will be saved with [ScxmlGui](https://github.com/fmorbini/scxmlgui) graphical metainformation |
| 59 | + |
| 60 | +|  | |
| 61 | +|---| |
| 62 | +| Example of ScxmlGui metainformation | |
| 63 | + |
| 64 | +|  | |
| 65 | +|---| |
| 66 | +| Comparison of VSCode and ScxmlEditor layouts | |
| 67 | + |
| 68 | +> **WARNING:** ScxmlGui does not recognize UTF8-with-BOM encoding. So use only "Export as ScxmlGui" option, because scxml project files are written with BOM! |
| 69 | +
|
| 70 | +### Simple Visual metainformation format |
| 71 | +This is custom very simple graphical metainformation format. All points are written in absolute chart coordinates. |
| 72 | + |
| 73 | +|  | |
| 74 | +|---| |
| 75 | +| Example of Simple Visual metainformation | |
| 76 | + |
| 77 | +## How to handle [virtual sub states](VisualStateChartSplitting.md) |
| 78 | +If your state chart contains [virtual sub states](VisualStateChartSplitting.md) then [Project Mode](#project-mode-permanent-metainformation-using-project-options) may be unacceptable because it can create a mess in the resulting state chart. |
| 79 | + |
| 80 | +|  |  | |
| 81 | +|---|---| |
| 82 | +| Example of virtual sub state | Virtual sub state layout is messed up | |
| 83 | + |
| 84 | +In this case you can use [post-save](ProjectTree.md#post-save-unit-actions) option to save state chart in [Export Mode](#export-mode-export-file-with-metainformation-by-calling-an-action) |
| 85 | + |
| 86 | +|  | |
| 87 | +|---| |
| 88 | +| Exported name is extended with suffix "_meta" | |
| 89 | + |
| 90 | +|  |  | |
| 91 | +|---|---| |
| 92 | +| Virtual sub state will be only presented as single state | There will be a comment with the virtual source unit | |
| 93 | + |
| 94 | +--- |
| 95 | +| [TOP](#top-anchor) | [Contents](../README.md#table-of-contents) | [SCXML Wiki](https://alexzhornyak.github.io/SCXML-tutorial/) | [Forum](https://github.com/alexzhornyak/ScxmlEditor-Tutorial/discussions) | |
| 96 | +|---|---|---|---| |
0 commit comments