在多个xml文件上拆分SCXML
我正在创建不同的SCXML文件,然后由Qt应用程序使用。为了更好地构造我的状态机,我想将一台机器的公共部分与其他每台机器的自定义状态分开。所以我想把我的状态机分成两个文件 父文件:parentStateMachine.scxml在多个xml文件上拆分SCXML,xml,qt,qt5,scxml,qxmlstreamreader,Xml,Qt,Qt5,Scxml,Qxmlstreamreader,我正在创建不同的SCXML文件,然后由Qt应用程序使用。为了更好地构造我的状态机,我想将一台机器的公共部分与其他每台机器的自定义状态分开。所以我想把我的状态机分成两个文件 父文件:parentStateMachine.scxml <?xml version="1.0" encoding="UTF-8"?> <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" binding="ear
<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml"
version="1.0"
binding="early"
xmlns:qt="http://www.qt.io/2015/02/scxml-ext"
name="MyStatemachine.scxml"
qt:editorversion="4.2.2"
datamodel="ecmascript"
initial="s1"
xmlns:xi="http://www.w3.org/2001/XInclude">
<state id="init">
<transition type="external" event="prepare" target="configure"/>
</state>
<state id="configure">
<transition type="external" event="start" target="run"/>
</state>
<parallel id="run">
<!-- include here application specific states-->
<transition type="external" event="stop" target="end"/>
</parallel>
<final id="end">
</final>
</scxml>
<state id="applicationSpecificState1"/>
<state id="applicationSpecificState2"/>
<state id="applicationSpecificState3"/>
特定于应用程序:applicationSpecific1.scxml
<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml"
version="1.0"
binding="early"
xmlns:qt="http://www.qt.io/2015/02/scxml-ext"
name="MyStatemachine.scxml"
qt:editorversion="4.2.2"
datamodel="ecmascript"
initial="s1"
xmlns:xi="http://www.w3.org/2001/XInclude">
<state id="init">
<transition type="external" event="prepare" target="configure"/>
</state>
<state id="configure">
<transition type="external" event="start" target="run"/>
</state>
<parallel id="run">
<!-- include here application specific states-->
<transition type="external" event="stop" target="end"/>
</parallel>
<final id="end">
</final>
</scxml>
<state id="applicationSpecificState1"/>
<state id="applicationSpecificState2"/>
<state id="applicationSpecificState3"/>
我已尝试通过两种方式将特定于应用程序的内容包含在父应用程序中:
而不是注释xml
标记之后添加
,然后添加&innerFile代码>而不是注释
我可以用Qt 5.10验证相同的行为。SCXML规范给出了一个如何执行此操作的示例:。但不幸的是,Qt似乎还不支持这一点。