Skip to content

Commit

Permalink
Closes #94, Closes #92, Closes #91, Fixes #90, Fixes #89
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzhornyak committed Jun 6, 2023
1 parent cefc472 commit 2488955
Show file tree
Hide file tree
Showing 31 changed files with 1,445 additions and 477 deletions.
62 changes: 62 additions & 0 deletions Doc/ProjectTree.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,67 @@ Right-click a scxml file to display the context menu commands.

![](../Images/ProjectTree_UnitMenu.png)

## Post Save Unit Actions
It is available to execute post save cmd script after the scxml unit file was saved

> NOTE: This option is available only in project mode!
1. Select a unit in Project Tree
2. Call **`Edit Post Save`** menu item

![](../Images/PostSaveUnit.png)

3. Edit post save script

![](../Images/PostSaveUnit_Macro.png)

### Post Save Unit Commands
Commands that could be executed by state machine chart editor

**Format:**

```batch
$(AppFilePath) command [Unit HWND] [Command] [Arg1|Arg2|Arg3]
```

**Example:**

```batch
$(AppFilePath) command $(UnitHandle) SaveToSVG $(UnitFileDir)\$(UnitName).svg
```

| Command | Arguments | Description |
|---|---|---|
| SaveToSVG | Arg1=FileName | Saves state chart to SVG |
| SaveRawScxmlToFile | Arg1=FileName | Saves state chart to scxml without comments and metainformation |
| SaveRawScxmlToHPP | Arg1=FileName | Saves state chart to scxml without comments and metainformation as C++ Header |
| SaveScxmlToPas | Arg1=FileName | Saves state chart to DFM file |
| SaveToDot | Arg1=FileName | Saves state chart to Graphviz DOT file |
| SaveToDotPlusPng | Arg1=FileName | Saves state chart to Graphviz DOT and PNG files |
| SaveToBMP | Arg1=FileName | Saves state chart to BMP file |
| SaveToPNG | Arg1=FileName | Saves state chart to PNG file |

### Post Save Application Commands
Commands that could be executed by ScxmlEditor application

**Format:**

```batch
$(AppFilePath) command [App HWND] [Command] [Arg1|Arg2|Arg3]
```

**Example:**

```batch
$(AppFilePath) command $(AppHandle) SwitchLog Debug True
```

| Command | Arguments | Description |
|---|---|---|
| SwitchLog | Arg1=Debug| Switches Log tab to Debug output |
| | Arg1=CMD | Switches Log tab to CMD output |
| | Arg2=True,False (Bool) | Clear output or not |


| [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) |
|---|---|---|---|
11 changes: 11 additions & 0 deletions Doc/Transitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ Multiple self transitions may be quickly arranged by pressing **'Arrange Self-co

![Transitions_Self_Arrange](../Images/Transitions_Self_Arrange.gif)

### Self Transitions Inside States
It is available since ScxmlEditor 2.4 to arrange self transitions inside of state.

![tr_inside](../Images/Transition_Self_Inside.png)

1. Set option **`SelfConnectionInside`** to **`true`** in the property inspector
2. Execute **`Arrange Self-Connections`** command from IDE Insight or right popup menu
3. (Optionally) Align Self-Transition to left, top, right or bottom side of the state

![tr_align](../Images/Transition_Self_Align.gif)

## Delayed transition
A delayed transition is a transition that happens after a period of time, specifically being in a specific state for a certain amount of time.

Expand Down
Binary file added Images/PostSaveUnit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/PostSaveUnit_Macro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/Transition_Self_Align.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/Transition_Self_Inside.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

**[Video overview - v.2.2](https://youtu.be/30dyXAs-m1A)**

# Scxml Editor 2.3
# Scxml Editor 2.4
Powerful tool for creating, editing and debugging SCXML charts.

![MainExample](Images/Inheritance_TV_example.gif)
Expand All @@ -24,18 +24,19 @@ Powerful tool for creating, editing and debugging SCXML charts.
[![Discord](Images/Discord.svg)](https://discord.gg/5XWDsbEXzn)

### Changelog
**2.4:** [Post Save Commands](Doc/ProjectTree.md#post-save-unit-actions), [Self-Transitions Inside](Doc/Transitions.md#self-transitions-inside-states) <br>
**2.3:** Highlight Transitions <br>
**2.2.4:** [Import QtCreator state charts](Doc/ImportStateCharts.md) <br/>
**2.2.3:** [Transition indexes bugfix](https://github.com/alexzhornyak/ScxmlEditor-Tutorial/issues/66) <br/>
**2.2.2:** [Option to override SmartTransitions](Doc/SmartSwitchTransitions.md#option-to-override-inverted-condition-since-scxmleditor-222) <br/>
**2.2.1:** [Qt SVG Monitors Released](https://github.com/alexzhornyak/QtScxmlMonitor/blob/main/README.md) <br/>
**2.2:** [Invoke ID is sending by testing apps](Doc/DebugScxmlStateCharts.md#how-to-debug-multiple-invoked-state-machines) <br/>
**2.1.10:** [New breakpoints interface](Doc/DebugScxmlStateCharts.md#breakpoints) <br/>
**2.1.9:** [Better handling of virtual states](Doc/VisualStateChartSplitting.md#adding-onentry-onexit-datamodel-and-invoke-to-virtual-states) <br/>
**2.1.8:** [Support of custom console testing applications](Doc/DebugScxmlStateCharts.md#custom-testing-application-setup) like [SCION command-line tool](https://gitlab.com/scion-scxml/cli) <br/>
**2.1.7:** [SVG Export Settings](Doc/ExportScxmlToSVG.md#svg-export-settings) <br/>
**2.1.6:** UScxmlTester with EcmaScript, In() predicate autocomplete, QtScxmlTester 5.9.1->5.15 <br/>
**2.1.5:** [Refactored Qt external debugger](https://github.com/alexzhornyak/QtScxmlMonitor/blob/main/README.md#qt-scxml-external-debugging-monitor) <br/>
**2.2.4:** [Import QtCreator state charts](Doc/ImportStateCharts.md) <br>
**2.2.3:** [Transition indexes bugfix](https://github.com/alexzhornyak/ScxmlEditor-Tutorial/issues/66) <br>
**2.2.2:** [Option to override SmartTransitions](Doc/SmartSwitchTransitions.md#option-to-override-inverted-condition-since-scxmleditor-222) <br>
**2.2.1:** [Qt SVG Monitors Released](https://github.com/alexzhornyak/QtScxmlMonitor/blob/main/README.md) <br>
**2.2:** [Invoke ID is sending by testing apps](Doc/DebugScxmlStateCharts.md#how-to-debug-multiple-invoked-state-machines) <br>
**2.1.10:** [New breakpoints interface](Doc/DebugScxmlStateCharts.md#breakpoints) <br>
**2.1.9:** [Better handling of virtual states](Doc/VisualStateChartSplitting.md#adding-onentry-onexit-datamodel-and-invoke-to-virtual-states) <br>
**2.1.8:** [Support of custom console testing applications](Doc/DebugScxmlStateCharts.md#custom-testing-application-setup) like [SCION command-line tool](https://gitlab.com/scion-scxml/cli) <br>
**2.1.7:** [SVG Export Settings](Doc/ExportScxmlToSVG.md#svg-export-settings) <br>
**2.1.6:** UScxmlTester with EcmaScript, In() predicate autocomplete, QtScxmlTester 5.9.1->5.15 <br>
**2.1.5:** [Refactored Qt external debugger](https://github.com/alexzhornyak/QtScxmlMonitor/blob/main/README.md#qt-scxml-external-debugging-monitor) <br>
**2.1.4:** [Export SCXML to SVG](Doc/ExportScxmlToSVG.md), [Structure View](Doc/ScxmlStructureView.md)

## System requirements
Expand All @@ -47,15 +48,15 @@ Powerful tool for creating, editing and debugging SCXML charts.
## Installation
You can find portable version as attached Zip in ScxmlEditor Github Release page

Latest version: **[2.3.1.1712]**
Latest version: **[2.4.0.1734]**

### Windows Installation
#### First Install
1. Download from latest Release page and unpack it in any target location
2. Install **ScxmlEditor\vcredist_x86.exe** for **UscxmlTester**, **Graphviz**
3. Install **ScxmlEditor\vcredist_x64.exe** for **QtScxmlTester** <br/>
3. Install **ScxmlEditor\vcredist_x64.exe** for **QtScxmlTester** <br>
(_You may skip steps 2 and 3 if you have previously installed MSVC 2015 Update 3 redistributable_)
4. Install **ScxmlEditor\UScxmlTester\vcredist_x86_vc10.exe** for **UscxmlTester** with **EcmaScript** datamodel <br/>
4. Install **ScxmlEditor\UScxmlTester\vcredist_x86_vc10.exe** for **UscxmlTester** with **EcmaScript** datamodel <br>
(_You may skip step 4 if you have previously installed MSVC 2010 redistributable_)

#### Update
Expand Down Expand Up @@ -123,6 +124,7 @@ Current binaries are compiled with single development licensies registered by th
- Main menu
- Main toolbar
- [Project tree](Doc/ProjectTree.md)
- [Post Save Unit](Doc/ProjectTree.md#post-save-unit-actions)
- [Property inspector](Doc/PropertyInspector.md)
- [SCXML source code view and live editing](Doc/LiveScxmlEdit.md)
- Projects
Expand All @@ -138,6 +140,7 @@ Current binaries are compiled with single development licensies registered by th
- [Chart design panel](Doc/ChartDesignPanel.md)
- States and children (Shapes)
- [Transitions (Connections)](Doc/Transitions.md)
- [Self-Transitions](Doc/Transitions.md#self-transitions-connections)
- [Smart Switch Transitions](Doc/SmartSwitchTransitions.md)
- [Inheritance](Doc/Inheritance.md)
- [DOT-based autolayout](Doc/DotBasedAutoLayout.md#dot-based-auto-layout)
Expand Down Expand Up @@ -193,14 +196,14 @@ Press **'Ctrl+.'** to call **IDE Insight dialog** where you may search for all a
![StructureViewSearch](Images/StructureView_Search.png)

## [Debugging](Doc/DebugScxmlStateCharts.md)
**ScxmlEditor** has an ability to receive and send string UDP commands: <br/>
**ScxmlEditor** has an ability to receive and send string UDP commands: <br>
### Receive API:
- `@@@` - clear highlighted states in all statecharts
- `@@@ScxmlName` - clear highlighted states in statechart where [\<scxml\>](https://alexzhornyak.github.io/SCXML-tutorial/Doc/scxml.html) 'name' is equal `ScxmlName`
- `Type@ScxmlName@Msg@Id` - commands to highlight state or display message in **CallStack** panel <br/>
- `Type@ScxmlName@Msg@Id` - commands to highlight state or display message in **CallStack** panel <br>
**Description:**
`Type` - integer type of command: `1 - AfterEnter, 2 - BeforeEnter, 3 - AfterExit, 4 - BeforeExit, 5 - Step, 6 - BeforeExecContent, 7 - AfterExecContent, 8 - BeforeInvoke, 9 - AfterInvoke, 10 - BeforeUnInvoke, 11 - AfterUnInvoke, 12 - BeforeTakingTransition, 13 - AfterTakingTransition, 14 - StableConfiguration, 15 - BeforeProcessingEvent` <br/>
`ScxmlName` - name of [\<scxml\>](https://alexzhornyak.github.io/SCXML-tutorial/Doc/scxml.html) <br/>
`Type` - integer type of command: `1 - AfterEnter, 2 - BeforeEnter, 3 - AfterExit, 4 - BeforeExit, 5 - Step, 6 - BeforeExecContent, 7 - AfterExecContent, 8 - BeforeInvoke, 9 - AfterInvoke, 10 - BeforeUnInvoke, 11 - AfterUnInvoke, 12 - BeforeTakingTransition, 13 - AfterTakingTransition, 14 - StableConfiguration, 15 - BeforeProcessingEvent` <br>
`ScxmlName` - name of [\<scxml\>](https://alexzhornyak.github.io/SCXML-tutorial/Doc/scxml.html) <br>
`Msg` - message which depends on type of command. For example: for **BeforeEnter** or **BeforeExit** - it is the id(name) of states, for **BeforeInvoke** or **BeforeUnInvoke** it is the name of invoked element, etc. </br>
`Id` - [identifier of the invoked](https://alexzhornyak.github.io/SCXML-tutorial/Doc/invoke.html#id) state machine (Since ScxmlEditor 2.2). Can be empty for root machines
> **BeforeEnter** graphically highlight and **BeforeExit** unhighlight the corresponding states, other commands are displayed in **CallStack** panel
Expand All @@ -209,10 +212,10 @@ Press **'Ctrl+.'** to call **IDE Insight dialog** where you may search for all a
> Message format: `FromState|TransitionIndex` where `TransitionIndex` is transition xml child index
#### Example of commands:
- `2@CalculatorStateMachine@operand1` - highlight state `operand1` in statechart **CalculatorStateMachine** <br/>
- `4@CalculatorStateMachine@operand1` - unhighlight state `operand1` in statechart **CalculatorStateMachine** <br/>
- `2@ScxmlSub1@isSub1@ID_SUB_1` - highlight state `isSub1` in statechart **ScxmlSub1** when [invoke Id](Doc/DebugScxmlStateCharts.md#how-to-debug-multiple-invoked-state-machines) is `ID_SUB_1` <br/>
- `12@CalculatorStateMachine@operand1|0` - highlight the first transition from **operand1** state in statechart **CalculatorStateMachine** <br/>
- `2@CalculatorStateMachine@operand1` - highlight state `operand1` in statechart **CalculatorStateMachine** <br>
- `4@CalculatorStateMachine@operand1` - unhighlight state `operand1` in statechart **CalculatorStateMachine** <br>
- `2@ScxmlSub1@isSub1@ID_SUB_1` - highlight state `isSub1` in statechart **ScxmlSub1** when [invoke Id](Doc/DebugScxmlStateCharts.md#how-to-debug-multiple-invoked-state-machines) is `ID_SUB_1` <br>
- `12@CalculatorStateMachine@operand1|0` - highlight the first transition from **operand1** state in statechart **CalculatorStateMachine** <br>

You can also [trace the execution of the chart](Doc/DebugScxmlStateCharts.md#trace-mode) and use [breakpoints](Doc/DebugScxmlStateCharts.md#breakpoints).

Expand Down
11 changes: 11 additions & 0 deletions Src/CommonConsts.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,15 @@ struct TMatchFind {
}
};

#define SCXML_INTERPROCESS_COMMAND L"command"
#define SCXML_INTERPROCESS_BUFFER_SIZE 4096

struct INTERPROCESS_COPYDATA
{
wchar_t wchCommand[SCXML_INTERPROCESS_BUFFER_SIZE];
wchar_t wchArg1[SCXML_INTERPROCESS_BUFFER_SIZE];
wchar_t wchArg2[SCXML_INTERPROCESS_BUFFER_SIZE];
wchar_t wchArg3[SCXML_INTERPROCESS_BUFFER_SIZE];
};

#endif
8 changes: 4 additions & 4 deletions Src/ScxmlEditor.cbproj
Original file line number Diff line number Diff line change
Expand Up @@ -1000,9 +1000,9 @@ IF "%_VAR_ALL_DEFINES_%" == "%_VAR_NOT_DEBUG_%" ( copy /y $(OUTPUTPATH) $(PROJEC
<VersionInfo Name="IncludeVerInfo">True</VersionInfo>
<VersionInfo Name="AutoIncBuild">True</VersionInfo>
<VersionInfo Name="MajorVer">2</VersionInfo>
<VersionInfo Name="MinorVer">3</VersionInfo>
<VersionInfo Name="Release">1</VersionInfo>
<VersionInfo Name="Build">1712</VersionInfo>
<VersionInfo Name="MinorVer">4</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">1734</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
Expand All @@ -1014,7 +1014,7 @@ IF "%_VAR_ALL_DEFINES_%" == "%_VAR_NOT_DEBUG_%" ( copy /y $(OUTPUTPATH) $(PROJEC
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName">[email protected]</VersionInfoKeys>
<VersionInfoKeys Name="FileDescription">Scxml State Charts Editor</VersionInfoKeys>
<VersionInfoKeys Name="FileVersion">2.3.1.1712</VersionInfoKeys>
<VersionInfoKeys Name="FileVersion">2.4.0.1734</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright">[email protected]</VersionInfoKeys>
<VersionInfoKeys Name="LegalTrademarks"/>
Expand Down
Loading

0 comments on commit 2488955

Please sign in to comment.