Skip to content

Commit af23cf0

Browse files
committed
Closes #112
1 parent ae846db commit af23cf0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1963
-894
lines changed

Doc/ExportScxmlWithMetainformation.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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+
![](../Images/IO_metainfo_preview.png)
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+
![](../Images/IO_metainfo_project_options.png)
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+
![](../Images/IO_metainfo_export_as.png)
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+
| ![](../Images/IO_metainfo_qt_creator_2.png) |
31+
|---|
32+
| Example of Qt Creator metainformation |
33+
34+
| ![](../Images/IO_metainfo_qt_creator.png) |
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+
![](../Images/IO_metainfo_qt_creator_3.png)
40+
41+
> **NOTE:** Use self-transition location at the left side inside of a state
42+
![](../Images/IO_metainfo_qt_creator_4.png)
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+
| ![](../Images/IO_metainfo_vscode_0.png) |
48+
|---|
49+
| Example of VSCode metainformation |
50+
51+
| ![](../Images/IO_metainfo_vscode_2.png) | ![](../Images/IO_metainfo_vscode_3.png) |
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+
| ![](../Images/IO_metainfo_scxmlgui_0.png) |
61+
|---|
62+
| Example of ScxmlGui metainformation |
63+
64+
| ![](../Images/IO_metainfo_scxmlgui_1.png) |
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+
| ![](../Images/IO_metainfo_simple_0.png) |
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+
| ![](../Images/IO_metainfo_qt_virtual_mess_1.png) | ![](../Images/IO_metainfo_qt_virtual_mess.png) |
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+
| ![](../Images/IO_metainfo_qt_virtual_mess_2.png) |
87+
|---|
88+
| Exported name is extended with suffix "_meta" |
89+
90+
| ![](../Images/IO_metainfo_qt_virtual_mess_3.png) | ![](../Images/IO_metainfo_qt_virtual_mess_4.png) |
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+
|---|---|---|---|

Doc/ProjectTree.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ $(AppFilePath) command $(UnitHandle) SaveToSVG $(UnitFileDir)\$(UnitName).svg
6565
| SaveToDotPlusPng | Arg1=FileName | Saves state chart to Graphviz DOT and PNG files |
6666
| SaveToBMP | Arg1=FileName | Saves state chart to BMP file |
6767
| SaveToPNG | Arg1=FileName | Saves state chart to PNG file |
68+
| SaveToQtCreatorScxml | Arg1=FileName | Saves state chart with Qt Creator graphical metainformation |
69+
| SaveToVSCodeScxml | Arg1=FileName | Saves state chart with VSCode graphical metainformation |
70+
| SaveToScxmlGui | Arg1=FileName | Saves state chart with ScxmlGui graphical metainformation |
71+
| SaveToSimpleScxml | Arg1=FileName | Saves state chart with Simple Visual graphical metainformation |
6872

6973
### Post Save Application Commands
7074
Commands that could be executed by ScxmlEditor application
@@ -78,7 +82,7 @@ $(AppFilePath) command [App HWND] [Command] [Arg1|Arg2|Arg3]
7882
**Example:**
7983

8084
```batch
81-
$(AppFilePath) command $(AppHandle) SwitchLog Debug True
85+
$(AppFilePath) command $(AppHandle) SwitchLog Debug False
8286
```
8387

8488
| Command | Arguments | Description |

Images/IO_metainfo_export_as.png

52.2 KB
Loading

Images/IO_metainfo_preview.png

70 KB
Loading
16.2 KB
Loading

Images/IO_metainfo_qt_creator.png

79.3 KB
Loading

Images/IO_metainfo_qt_creator_2.png

25.6 KB
Loading

Images/IO_metainfo_qt_creator_3.png

16 KB
Loading

Images/IO_metainfo_qt_creator_4.png

17 KB
Loading
25.3 KB
Loading

0 commit comments

Comments
 (0)