You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
359 lines
12 KiB
Plaintext
359 lines
12 KiB
Plaintext
|
5 years ago
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
2 years ago
|
<model version="5.3.0" links="1">
|
||
|
5 years ago
|
<documentation>QHsmTst is a contrived state machine from Chapter 2 of the PSiCC2 book for testing all possible transition topologies with up to 4-levels of state nesting.</documentation>
|
||
|
|
<!--${qpc}-->
|
||
|
|
<framework name="qpc"/>
|
||
|
2 years ago
|
<!--${Shared}-->
|
||
|
|
<package name="Shared" stereotype="0x02">
|
||
|
|
<!--${Shared::QHsmTstSignals}-->
|
||
|
|
<attribute name="QHsmTstSignals" type="enum" visibility="0x04" properties="0x00">
|
||
|
|
<code>{
|
||
|
|
A_SIG = Q_USER_SIG,
|
||
|
|
B_SIG,
|
||
|
|
C_SIG,
|
||
|
|
D_SIG,
|
||
|
|
E_SIG,
|
||
|
|
F_SIG,
|
||
|
|
G_SIG,
|
||
|
|
H_SIG,
|
||
|
|
I_SIG,
|
||
|
|
TERMINATE_SIG,
|
||
|
|
IGNORE_SIG,
|
||
|
|
MAX_SIG
|
||
|
|
};</code>
|
||
|
|
</attribute>
|
||
|
|
<!--${Shared::the_sm}-->
|
||
|
|
<attribute name="the_sm" type="QAsm * const" visibility="0x00" properties="0x00">
|
||
|
|
<documentation>opaque pointer to the test SM</documentation>
|
||
|
|
<code>= &QHsmTst_inst.super.super;</code>
|
||
|
|
</attribute>
|
||
|
|
<!--${Shared::QHsmTst_ctor}-->
|
||
|
|
<operation name="QHsmTst_ctor" type="void" visibility="0x00" properties="0x00">
|
||
|
|
<code>QHsmTst *me = &QHsmTst_inst;
|
||
|
|
QHsm_ctor(&me->super, Q_STATE_CAST(&QHsmTst_initial));</code>
|
||
|
|
</operation>
|
||
|
|
<!--${Shared::BSP_display}-->
|
||
|
|
<operation name="BSP_display" type="void" visibility="0x00" properties="0x00">
|
||
|
|
<!--${Shared::BSP_display::msg}-->
|
||
|
|
<parameter name="msg" type="char const *"/>
|
||
|
|
</operation>
|
||
|
|
<!--${Shared::BSP_terminate}-->
|
||
|
|
<operation name="BSP_terminate" type="void" visibility="0x00" properties="0x00">
|
||
|
|
<!--${Shared::BSP_terminate::result}-->
|
||
|
|
<parameter name="result" type="int16_t const"/>
|
||
|
|
</operation>
|
||
|
|
</package>
|
||
|
|
<!--${SMs}-->
|
||
|
|
<package name="SMs" stereotype="0x02">
|
||
|
|
<!--${SMs::QHsmTst}-->
|
||
|
5 years ago
|
<class name="QHsmTst" superclass="qpc::QHsm">
|
||
|
|
<documentation>Test active object</documentation>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::foo}-->
|
||
|
5 years ago
|
<attribute name="foo" type="uint8_t" visibility="0x02" properties="0x00"/>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::inst}-->
|
||
|
|
<attribute name="inst" type="QHsmTst" visibility="0x00" properties="0x01"/>
|
||
|
|
<!--${SMs::QHsmTst::SM}-->
|
||
|
5 years ago
|
<statechart properties="0x03">
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::initial}-->
|
||
|
5 years ago
|
<initial target="../1/5">
|
||
|
2 years ago
|
<action>Q_UNUSED_PAR(par);
|
||
|
5 years ago
|
me->foo = 0U;
|
||
|
2 years ago
|
BSP_display("top-INIT;");
|
||
|
|
|
||
|
|
QS_SIG_DICTIONARY(A_SIG, (void *)0);
|
||
|
|
QS_SIG_DICTIONARY(B_SIG, (void *)0);
|
||
|
|
QS_SIG_DICTIONARY(C_SIG, (void *)0);
|
||
|
|
QS_SIG_DICTIONARY(D_SIG, (void *)0);
|
||
|
|
QS_SIG_DICTIONARY(E_SIG, (void *)0);
|
||
|
|
QS_SIG_DICTIONARY(F_SIG, (void *)0);
|
||
|
|
QS_SIG_DICTIONARY(G_SIG, (void *)0);
|
||
|
|
QS_SIG_DICTIONARY(H_SIG, (void *)0);
|
||
|
|
QS_SIG_DICTIONARY(I_SIG, (void *)0);
|
||
|
|
QS_SIG_DICTIONARY(IGNORE_SIG, (void *)0);
|
||
|
|
QS_SIG_DICTIONARY(TERMINATE_SIG, (void *)0);</action>
|
||
|
5 years ago
|
<initial_glyph conn="76,2,4,1,6,-8">
|
||
|
|
<action box="-7,6,13,4"/>
|
||
|
|
</initial_glyph>
|
||
|
|
</initial>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s}-->
|
||
|
5 years ago
|
<state name="s">
|
||
|
|
<entry>BSP_display("s-ENTRY;");</entry>
|
||
|
|
<exit>BSP_display("s-EXIT;");</exit>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::initial}-->
|
||
|
5 years ago
|
<initial target="../4/7">
|
||
|
|
<action>BSP_display("s-INIT;");</action>
|
||
|
|
<initial_glyph conn="31,7,5,0,-9,19">
|
||
|
|
<action box="-6,0,6,2"/>
|
||
|
|
</initial_glyph>
|
||
|
|
</initial>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::I}-->
|
||
|
5 years ago
|
<tran trig="I">
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::I::[me->foo]}-->
|
||
|
5 years ago
|
<choice>
|
||
|
|
<guard>me->foo</guard>
|
||
|
|
<action>me->foo = 0U;
|
||
|
|
BSP_display("s-I;");</action>
|
||
|
|
<choice_glyph conn="7,10,5,-1,8">
|
||
|
|
<action box="1,0,12,4"/>
|
||
|
|
</choice_glyph>
|
||
|
|
</choice>
|
||
|
|
<tran_glyph conn="2,10,3,-1,5">
|
||
|
|
<action box="1,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::E}-->
|
||
|
5 years ago
|
<tran trig="E" target="../4/7">
|
||
|
|
<action>BSP_display("s-E;");</action>
|
||
|
|
<tran_glyph conn="28,39,2,2,-6">
|
||
|
|
<action box="1,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::TERMINATE}-->
|
||
|
|
<tran trig="TERMINATE">
|
||
|
|
<action>BSP_terminate(0);</action>
|
||
|
|
<tran_glyph conn="71,19,1,-1,4,17">
|
||
|
5 years ago
|
<action box="0,-2,9,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1}-->
|
||
|
5 years ago
|
<state name="s1">
|
||
|
|
<entry>BSP_display("s1-ENTRY;");</entry>
|
||
|
|
<exit>BSP_display("s1-EXIT;");</exit>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1::initial}-->
|
||
|
5 years ago
|
<initial target="../7">
|
||
|
|
<action>BSP_display("s1-INIT;");</action>
|
||
|
|
<initial_glyph conn="26,19,5,0,-2,7">
|
||
|
|
<action box="-4,0,6,2"/>
|
||
|
|
</initial_glyph>
|
||
|
|
</initial>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1::I}-->
|
||
|
5 years ago
|
<tran trig="I">
|
||
|
|
<action>BSP_display("s1-I;");</action>
|
||
|
|
<tran_glyph conn="13,23,3,-1,6">
|
||
|
|
<action box="1,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1::D}-->
|
||
|
5 years ago
|
<tran trig="D">
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1::D::[!me->foo]}-->
|
||
|
5 years ago
|
<choice target="../../..">
|
||
|
|
<guard>!me->foo</guard>
|
||
|
|
<action>me->foo = 1U;
|
||
|
|
BSP_display("s1-D;");</action>
|
||
|
|
<choice_glyph conn="7,17,4,3,6,-5">
|
||
|
|
<action box="-4,2,11,4"/>
|
||
|
|
</choice_glyph>
|
||
|
|
</choice>
|
||
|
|
<tran_glyph conn="13,17,3,-1,-6">
|
||
|
|
<action box="-2,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1::A}-->
|
||
|
5 years ago
|
<tran trig="A" target="..">
|
||
|
|
<action>BSP_display("s1-A;");</action>
|
||
|
|
<tran_glyph conn="27,15,0,0,-3,4,3">
|
||
|
|
<action box="1,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1::B}-->
|
||
|
5 years ago
|
<tran trig="B" target="../7">
|
||
|
|
<action>BSP_display("s1-B;");</action>
|
||
|
|
<tran_glyph conn="13,27,3,3,6">
|
||
|
|
<action box="1,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1::F}-->
|
||
|
5 years ago
|
<tran trig="F" target="../../5/4/4">
|
||
|
|
<action>BSP_display("s1-F;");</action>
|
||
|
|
<tran_glyph conn="34,31,1,3,17">
|
||
|
|
<action box="0,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1::C}-->
|
||
|
5 years ago
|
<tran trig="C" target="../../5">
|
||
|
|
<action>BSP_display("s1-C;");</action>
|
||
|
|
<tran_glyph conn="34,17,1,3,6">
|
||
|
|
<action box="0,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1::s11}-->
|
||
|
5 years ago
|
<state name="s11">
|
||
|
|
<entry>BSP_display("s11-ENTRY;");</entry>
|
||
|
|
<exit>BSP_display("s11-EXIT;");</exit>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1::s11::H}-->
|
||
|
5 years ago
|
<tran trig="H" target="../../..">
|
||
|
|
<action>BSP_display("s11-H;");</action>
|
||
|
|
<tran_glyph conn="24,33,2,2,6">
|
||
|
|
<action box="1,0,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1::s11::D}-->
|
||
|
5 years ago
|
<tran trig="D">
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1::s11::D::[me->foo]}-->
|
||
|
5 years ago
|
<choice target="../../..">
|
||
|
|
<guard>me->foo</guard>
|
||
|
|
<action>me->foo = 0U;
|
||
|
|
BSP_display("s11-D;");</action>
|
||
|
|
<choice_glyph conn="7,31,4,3,-6,6">
|
||
|
|
<action box="-4,-5,11,4"/>
|
||
|
|
</choice_glyph>
|
||
|
|
</choice>
|
||
|
|
<tran_glyph conn="19,31,3,-1,-12">
|
||
|
|
<action box="-2,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s1::s11::G}-->
|
||
|
5 years ago
|
<tran trig="G" target="../../../5/4/4">
|
||
|
|
<action>BSP_display("s11-G;");</action>
|
||
|
|
<tran_glyph conn="31,27,1,3,20">
|
||
|
|
<action box="0,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
|
<state_glyph node="19,26,12,7">
|
||
|
|
<entry box="1,2,5,2"/>
|
||
|
|
<exit box="1,4,5,2"/>
|
||
|
|
</state_glyph>
|
||
|
|
</state>
|
||
|
|
<state_glyph node="13,15,21,21">
|
||
|
|
<entry box="1,2,5,2"/>
|
||
|
|
<exit box="1,4,5,2"/>
|
||
|
|
</state_glyph>
|
||
|
|
</state>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2}-->
|
||
|
5 years ago
|
<state name="s2">
|
||
|
|
<entry>BSP_display("s2-ENTRY;");</entry>
|
||
|
|
<exit>BSP_display("s2-EXIT;");</exit>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2::initial}-->
|
||
|
5 years ago
|
<initial target="../4/4">
|
||
|
|
<action>BSP_display("s2-INIT;");</action>
|
||
|
|
<initial_glyph conn="65,10,5,0,-8,15">
|
||
|
|
<action box="-4,0,6,2"/>
|
||
|
|
</initial_glyph>
|
||
|
|
</initial>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2::I}-->
|
||
|
5 years ago
|
<tran trig="I">
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2::I::[!me->foo]}-->
|
||
|
5 years ago
|
<choice>
|
||
|
|
<guard>!me->foo</guard>
|
||
|
|
<action>me->foo = 1U;
|
||
|
|
BSP_display("s2-I;");</action>
|
||
|
|
<choice_glyph conn="45,14,5,-1,8">
|
||
|
|
<action box="1,0,10,4"/>
|
||
|
|
</choice_glyph>
|
||
|
|
</choice>
|
||
|
|
<tran_glyph conn="40,14,3,-1,5">
|
||
|
|
<action box="1,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2::F}-->
|
||
|
5 years ago
|
<tran trig="F" target="../../4/7">
|
||
|
|
<action>BSP_display("s2-F;");</action>
|
||
|
|
<tran_glyph conn="40,24,3,0,-12,2">
|
||
|
|
<action box="-4,0,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2::C}-->
|
||
|
5 years ago
|
<tran trig="C" target="../../4">
|
||
|
|
<action>BSP_display("s2-C;");</action>
|
||
|
|
<tran_glyph conn="40,20,3,1,-6">
|
||
|
|
<action box="-3,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2::s21}-->
|
||
|
5 years ago
|
<state name="s21">
|
||
|
|
<entry>BSP_display("s21-ENTRY;");</entry>
|
||
|
|
<exit>BSP_display("s21-EXIT;");</exit>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2::s21::initial}-->
|
||
|
5 years ago
|
<initial target="../4">
|
||
|
|
<action>BSP_display("s21-INIT;");</action>
|
||
|
|
<initial_glyph conn="64,23,5,0,-4,2">
|
||
|
|
<action box="-2,0,5,2"/>
|
||
|
|
</initial_glyph>
|
||
|
|
</initial>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2::s21::G}-->
|
||
|
5 years ago
|
<tran trig="G" target="../../../4">
|
||
|
|
<action>BSP_display("s21-G;");</action>
|
||
|
|
<tran_glyph conn="45,22,3,1,-11">
|
||
|
|
<action box="-3,-2,8,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2::s21::A}-->
|
||
|
5 years ago
|
<tran trig="A" target="..">
|
||
|
|
<action>BSP_display("s21-A;");</action>
|
||
|
|
<tran_glyph conn="59,19,0,0,-3,4,3">
|
||
|
|
<action box="1,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2::s21::B}-->
|
||
|
5 years ago
|
<tran trig="B" target="../4">
|
||
|
|
<action>BSP_display("s21-B;");</action>
|
||
|
|
<tran_glyph conn="66,27,1,1,-4">
|
||
|
|
<action box="-2,-2,5,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2::s21::s211}-->
|
||
|
5 years ago
|
<state name="s211">
|
||
|
|
<entry>BSP_display("s211-ENTRY;");</entry>
|
||
|
|
<exit>BSP_display("s211-EXIT;");</exit>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2::s21::s211::H}-->
|
||
|
5 years ago
|
<tran trig="H" target="../../../..">
|
||
|
|
<action>BSP_display("s211-H;");</action>
|
||
|
|
<tran_glyph conn="57,32,2,2,7">
|
||
|
|
<action box="1,0,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
2 years ago
|
<!--${SMs::QHsmTst::SM::s::s2::s21::s211::D}-->
|
||
|
5 years ago
|
<tran trig="D" target="../..">
|
||
|
|
<action>BSP_display("s211-D;");</action>
|
||
|
|
<tran_glyph conn="62,30,1,1,4">
|
||
|
|
<action box="0,-2,6,2"/>
|
||
|
|
</tran_glyph>
|
||
|
|
</tran>
|
||
|
|
<state_glyph node="51,25,11,7">
|
||
|
|
<entry box="1,2,5,2"/>
|
||
|
|
<exit box="1,4,5,2"/>
|
||
|
|
</state_glyph>
|
||
|
|
</state>
|
||
|
|
<state_glyph node="45,19,21,15">
|
||
|
|
<entry box="1,2,5,2"/>
|
||
|
|
<exit box="1,4,5,2"/>
|
||
|
|
</state_glyph>
|
||
|
|
</state>
|
||
|
|
<state_glyph node="40,6,28,30">
|
||
|
|
<entry box="1,2,5,2"/>
|
||
|
|
<exit box="1,4,5,2"/>
|
||
|
|
</state_glyph>
|
||
|
|
</state>
|
||
|
|
<state_glyph node="2,2,69,37">
|
||
|
|
<entry box="1,2,5,2"/>
|
||
|
|
<exit box="1,4,5,2"/>
|
||
|
|
</state_glyph>
|
||
|
|
</state>
|
||
|
|
<state_diagram size="79,41"/>
|
||
|
|
</statechart>
|
||
|
|
</class>
|
||
|
|
</package>
|
||
|
|
<!--${.}-->
|
||
|
|
<directory name=".">
|
||
|
|
<!--${.::qhsmtst.h}-->
|
||
|
|
<file name="qhsmtst.h">
|
||
|
2 years ago
|
<text>#ifndef QHSMTST_H_
|
||
|
|
#define QHSMTST_H_
|
||
|
5 years ago
|
|
||
|
2 years ago
|
$declare ${Shared}
|
||
|
5 years ago
|
|
||
|
2 years ago
|
#endif // QHSMTST_H_</text>
|
||
|
5 years ago
|
</file>
|
||
|
|
<!--${.::qhsmtst.c}-->
|
||
|
|
<file name="qhsmtst.c">
|
||
|
2 years ago
|
<text>#include "qpc.h" // QP/C framework
|
||
|
|
#include "qhsmtst.h" // this application
|
||
|
5 years ago
|
|
||
|
2 years ago
|
$declare ${SMs::QHsmTst}
|
||
|
|
$define ${Shared::the_sm}
|
||
|
|
$define ${Shared::QHsmTst_ctor}
|
||
|
|
$define ${SMs::QHsmTst}</text>
|
||
|
5 years ago
|
</file>
|
||
|
|
</directory>
|
||
|
|
</model>
|