Skip to content

Scxml converter #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,15 @@ Normally a state machine is predefined by users. But advanced machine intelligen
* By using NSM and DAR the transition logic of a state machine is totally decoupled from user action logic of an application; and by decoupling the transition logic from the user action logic, the framework improves the flexibility and reusability of a state machine.
* With the State Machine Runtime Dynamic feature, the framework constructs a fundamental basis for the advanced machine learning and machine intelligence.

# Build
# Main Features
## Dynamic State Machine
Support create/change state machine at runtime.
## Dynamic Sub State Machine
Support attach sub state machine at runtime.
## Parallel State Machine
To be supported in future.

# Build
* Go to project root directory
* Run ./build.sh
* After build is successfully done:
Expand All @@ -55,5 +62,26 @@ Normally a state machine is predefined by users. But advanced machine intelligen
* Run ./build-ut.sh
* After build is successfully done, the ut applicatioin will be generated at ./ut_build/bin/imachine_ut, and can run it to check the UT result.



# SCXML Converter
By using the scxml-to-cpp converter, the standard SCXML state machine representation can be converted to C++ classes, which can then fit into the IMachine framework.
##### Tags supported according to the SCXML standard:
###### Core Constructs:
- <scxml>
- <state>
- <transiton> (targetless transition not supported)
- <event>
- <initial>
- <final> (Only one final not supported)

##### Tags **NOT** supported according to the SCXML standard:
###### Core Constructs:
- <parallel> (to be supported in future)
- <history> (to be supported in future)
- <onentry> (intentionally not to be supported based on design)
- <onexit> (intentionally not to be supported based on design)

###### Executable Content (intentionally not to be supported based on design)
###### Data Model and Data Manipulation (intentionally not to be supported based on design)
###### External Communications (Not considered for now)
#### How to use
python <repo_root>/tools/scxml_converter/scxml2cpp.py -h
19 changes: 19 additions & 0 deletions tools/scxml_converter/car.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0">
<state id="stopped">
<transition event="start" target="running"/>
</state>
<state id="running">
<state id="lowSpeed">
<transition event="speedUp" target="highSpeed"/>
</state>
<state id="highSpeed">
<transition event="speedLow" target="lowSpeed"/>
<transition event="error" target="final_2"/>
</state>
<transition event="stop" target="stopped"/>
<transition event="error" target="final_1"/>
<final id="final_2"></final>
</state>
<final id="final_1"></final>
</scxml>
Loading