352 lines
11 KiB
Plaintext
Raw Normal View History

2017-05-17 13:15:09 -04:00
<?xml version="1.0" encoding="UTF-8"?>
2023-01-06 12:56:50 -05:00
<model version="5.2.4" links="1">
2019-03-28 11:59:31 -04:00
<documentation>QMsmTst is a test for the QMsm state machine implementation strategy of the state machine design from Chapter 2 of the PSiCC2 book.</documentation>
2019-12-31 15:56:23 -05:00
<!--${qpcpp}-->
2022-11-17 14:13:33 -05:00
<framework name="qpcpp"/>
2019-12-31 15:56:23 -05:00
<!--${SMs}-->
2017-05-17 13:15:09 -04:00
<package name="SMs" stereotype="0x02">
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst}-->
2017-05-17 13:15:09 -04:00
<class name="QMsmTst" superclass="qpcpp::QMsm">
<documentation>Test active object</documentation>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::m_foo}-->
2017-05-17 13:15:09 -04:00
<attribute name="m_foo" type="bool" visibility="0x02" properties="0x00"/>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::QMsmTst}-->
2017-05-17 13:15:09 -04:00
<operation name="QMsmTst" type="" visibility="0x00" properties="0x02">
2019-03-28 11:59:31 -04:00
<code> : QMsm(&amp;initial)</code>
2017-05-17 13:15:09 -04:00
</operation>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM}-->
2019-03-28 11:59:31 -04:00
<statechart properties="0x02">
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::initial}-->
2017-05-17 13:15:09 -04:00
<initial target="../1/5">
<action>(void)e; // avoid compiler warning
2019-03-28 11:59:31 -04:00
m_foo = 0U;
2017-05-17 13:15:09 -04:00
BSP_display(&quot;top-INIT;&quot;);
2019-03-28 11:59:31 -04:00
QS_SIG_DICTIONARY(A_SIG, this);
QS_SIG_DICTIONARY(B_SIG, this);
QS_SIG_DICTIONARY(C_SIG, this);
QS_SIG_DICTIONARY(D_SIG, this);
QS_SIG_DICTIONARY(E_SIG, this);
QS_SIG_DICTIONARY(F_SIG, this);
QS_SIG_DICTIONARY(G_SIG, this);
QS_SIG_DICTIONARY(H_SIG, this);
QS_SIG_DICTIONARY(I_SIG, this);
QS_SIG_DICTIONARY(TERMINATE_SIG, this);
QS_SIG_DICTIONARY(IGNORE_SIG, this);</action>
2017-05-17 13:15:09 -04:00
<initial_glyph conn="76,2,4,1,6,-8">
<action box="-7,6,13,4"/>
</initial_glyph>
</initial>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s}-->
2017-05-17 13:15:09 -04:00
<state name="s">
<entry>BSP_display(&quot;s-ENTRY;&quot;);</entry>
<exit>BSP_display(&quot;s-EXIT;&quot;);</exit>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::initial}-->
2017-05-17 13:15:09 -04:00
<initial target="../4/7">
<action>BSP_display(&quot;s-INIT;&quot;);</action>
<initial_glyph conn="31,7,5,0,-6,20">
<action box="-6,0,6,2"/>
</initial_glyph>
</initial>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::I}-->
2017-05-17 13:15:09 -04:00
<tran trig="I">
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::I::[m_foo]}-->
2017-05-17 13:15:09 -04:00
<choice>
2019-03-28 11:59:31 -04:00
<guard>m_foo</guard>
<action>m_foo = 0U;
2017-05-17 13:15:09 -04:00
BSP_display(&quot;s-I;&quot;);</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>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::E}-->
2017-05-17 13:15:09 -04:00
<tran trig="E" target="../4/7">
<action>BSP_display(&quot;s-E;&quot;);</action>
<tran_glyph conn="28,39,2,2,-6">
<action box="1,-2,6,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::TERMINATE}-->
2017-05-17 13:15:09 -04:00
<tran trig="TERMINATE">
<action>BSP_terminate(0);</action>
<tran_glyph conn="71,19,1,-1,4,17">
<action box="0,-2,9,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1}-->
2017-05-17 13:15:09 -04:00
<state name="s1">
<entry>BSP_display(&quot;s1-ENTRY;&quot;);</entry>
<exit>BSP_display(&quot;s1-EXIT;&quot;);</exit>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1::initial}-->
2017-05-17 13:15:09 -04:00
<initial target="../7">
<action>BSP_display(&quot;s1-INIT;&quot;);</action>
<initial_glyph conn="32,19,5,0,-5,8">
<action box="-4,0,6,2"/>
</initial_glyph>
</initial>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1::I}-->
2017-05-17 13:15:09 -04:00
<tran trig="I">
<action>BSP_display(&quot;s1-I;&quot;);</action>
<tran_glyph conn="13,23,3,-1,6">
<action box="1,-2,6,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1::D}-->
2017-05-17 13:15:09 -04:00
<tran trig="D">
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1::D::[!m_foo]}-->
2017-05-17 13:15:09 -04:00
<choice target="../../..">
2019-03-28 11:59:31 -04:00
<guard>!m_foo</guard>
<action>m_foo = true;
2017-05-17 13:15:09 -04:00
BSP_display(&quot;s1-D;&quot;);</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>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1::A}-->
2017-05-17 13:15:09 -04:00
<tran trig="A" target="..">
<action>BSP_display(&quot;s1-A;&quot;);</action>
<tran_glyph conn="27,15,0,0,-3,4,3">
<action box="1,-2,6,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1::B}-->
2017-05-17 13:15:09 -04:00
<tran trig="B" target="../7">
<action>BSP_display(&quot;s1-B;&quot;);</action>
<tran_glyph conn="13,29,3,3,6">
<action box="1,-2,6,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1::F}-->
2017-05-17 13:15:09 -04:00
<tran trig="F" target="../../5/4/4">
<action>BSP_display(&quot;s1-F;&quot;);</action>
<tran_glyph conn="34,31,1,3,17">
<action box="0,-2,6,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1::C}-->
2017-05-17 13:15:09 -04:00
<tran trig="C" target="../../5">
<action>BSP_display(&quot;s1-C;&quot;);</action>
<tran_glyph conn="34,17,1,3,5">
<action box="0,-2,6,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1::s11}-->
2017-05-17 13:15:09 -04:00
<state name="s11">
<entry>BSP_display(&quot;s11-ENTRY;&quot;);</entry>
<exit>BSP_display(&quot;s11-EXIT;&quot;);</exit>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1::s11::H}-->
2017-05-17 13:15:09 -04:00
<tran trig="H" target="../../..">
<action>BSP_display(&quot;s11-H;&quot;);</action>
<tran_glyph conn="24,33,2,2,6">
<action box="1,0,6,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1::s11::D}-->
2017-05-17 13:15:09 -04:00
<tran trig="D">
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1::s11::D::[m_foo]}-->
2017-05-17 13:15:09 -04:00
<choice target="../../..">
2019-03-28 11:59:31 -04:00
<guard>m_foo</guard>
<action>m_foo = false;
2017-05-17 13:15:09 -04:00
BSP_display(&quot;s11-D;&quot;);</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>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s1::s11::G}-->
2017-05-17 13:15:09 -04:00
<tran trig="G" target="../../../5/4/4">
<action>BSP_display(&quot;s11-G;&quot;);</action>
<tran_glyph conn="31,29,1,3,20">
<action box="0,-2,6,2"/>
</tran_glyph>
</tran>
<state_glyph node="19,27,12,6">
<entry box="1,2,6,2"/>
<exit box="1,4,6,2"/>
</state_glyph>
</state>
<state_glyph node="13,15,21,21">
<entry box="1,2,6,2"/>
<exit box="1,4,6,2"/>
</state_glyph>
</state>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2}-->
2017-05-17 13:15:09 -04:00
<state name="s2">
<entry>BSP_display(&quot;s2-ENTRY;&quot;);</entry>
<exit>BSP_display(&quot;s2-EXIT;&quot;);</exit>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2::initial}-->
2017-05-17 13:15:09 -04:00
<initial target="../4/4">
<action>BSP_display(&quot;s2-INIT;&quot;);</action>
<initial_glyph conn="65,10,5,0,-8,15">
<action box="-4,0,6,2"/>
</initial_glyph>
</initial>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2::I}-->
2017-05-17 13:15:09 -04:00
<tran trig="I">
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2::I::[!m_foo]}-->
2017-05-17 13:15:09 -04:00
<choice>
2019-03-28 11:59:31 -04:00
<guard>!m_foo</guard>
<action>m_foo = true;
2017-05-17 13:15:09 -04:00
BSP_display(&quot;s2-I;&quot;);</action>
<choice_glyph conn="45,14,5,-1,8">
<action box="1,0,10,4"/>
</choice_glyph>
</choice>
<tran_glyph conn="39,14,3,-1,6">
<action box="1,-2,6,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2::F}-->
2017-05-17 13:15:09 -04:00
<tran trig="F" target="../../4/7">
<action>BSP_display(&quot;s2-F;&quot;);</action>
<tran_glyph conn="39,24,3,0,-9,3">
<action box="-4,-2,6,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2::C}-->
2017-05-17 13:15:09 -04:00
<tran trig="C" target="../../4">
<action>BSP_display(&quot;s2-C;&quot;);</action>
<tran_glyph conn="39,19,3,1,-5">
<action box="-3,-2,6,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2::s21}-->
2017-05-17 13:15:09 -04:00
<state name="s21">
<entry>BSP_display(&quot;s21-ENTRY;&quot;);</entry>
<exit>BSP_display(&quot;s21-EXIT;&quot;);</exit>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2::s21::initial}-->
2017-05-17 13:15:09 -04:00
<initial target="../4">
<action>BSP_display(&quot;s21-INIT;&quot;);</action>
<initial_glyph conn="64,23,5,0,-4,2">
<action box="-2,0,5,2"/>
</initial_glyph>
</initial>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2::s21::G}-->
2017-05-17 13:15:09 -04:00
<tran trig="G" target="../../../4">
<action>BSP_display(&quot;s21-G;&quot;);</action>
<tran_glyph conn="45,21,3,1,-11">
<action box="-3,-2,8,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2::s21::A}-->
2017-05-17 13:15:09 -04:00
<tran trig="A" target="..">
<action>BSP_display(&quot;s21-A;&quot;);</action>
<tran_glyph conn="59,19,0,0,-3,4,3">
<action box="1,-2,6,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2::s21::B}-->
2017-05-17 13:15:09 -04:00
<tran trig="B" target="../4">
<action>BSP_display(&quot;s21-B;&quot;);</action>
<tran_glyph conn="66,27,1,1,-4">
<action box="-2,-2,5,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2::s21::s211}-->
2017-05-17 13:15:09 -04:00
<state name="s211">
<entry>BSP_display(&quot;s211-ENTRY;&quot;);</entry>
<exit>BSP_display(&quot;s211-EXIT;&quot;);</exit>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2::s21::s211::H}-->
2017-05-17 13:15:09 -04:00
<tran trig="H" target="../../../..">
<action>BSP_display(&quot;s211-H;&quot;);</action>
<tran_glyph conn="57,32,2,2,7">
<action box="1,0,6,2"/>
</tran_glyph>
</tran>
2019-12-31 15:56:23 -05:00
<!--${SMs::QMsmTst::SM::s::s2::s21::s211::D}-->
2017-05-17 13:15:09 -04:00
<tran trig="D" target="../..">
<action>BSP_display(&quot;s211-D;&quot;);</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,7,2"/>
<exit box="1,4,6,2"/>
</state_glyph>
</state>
<state_glyph node="45,19,21,15">
<entry box="1,2,7,2"/>
<exit box="1,4,6,2"/>
</state_glyph>
</state>
<state_glyph node="39,6,29,30">
<entry box="1,2,7,2"/>
<exit box="1,4,6,2"/>
</state_glyph>
</state>
<state_glyph node="2,2,69,37">
<entry box="1,2,5,2"/>
<exit box="1,4,6,2"/>
</state_glyph>
</state>
<state_diagram size="79,41"/>
</statechart>
</class>
</package>
2019-12-31 15:56:23 -05:00
<!--${src}-->
2019-03-28 11:59:31 -04:00
<directory name="src">
2019-12-31 15:56:23 -05:00
<!--${src::qmsmtst.hpp}-->
<file name="qmsmtst.hpp">
<text>#ifndef QMSMTST_HPP
#define QMSMTST_HPP
2017-05-17 13:15:09 -04:00
namespace QMSMTST {
enum QMsmTstSignals {
A_SIG = QP::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
};
extern QP::QMsm * const the_msm; // opaque pointer to the test MSM
// BSP functions to dispaly a message and exit
2022-08-11 15:36:19 -04:00
void BSP_display(char const *msg);
2017-05-17 13:15:09 -04:00
void BSP_terminate(int16_t const result);
} // namespace QMSMTST
2019-12-31 15:56:23 -05:00
#endif // QMSMTST_HPP</text>
2017-05-17 13:15:09 -04:00
</file>
2019-12-31 15:56:23 -05:00
<!--${src::qmsmtst.cpp}-->
2017-05-17 13:15:09 -04:00
<file name="qmsmtst.cpp">
2019-10-27 12:26:31 -04:00
<text>#include &quot;qpcpp.hpp&quot;
2019-12-31 15:56:23 -05:00
#include &quot;qmsmtst.hpp&quot;
2017-05-17 13:15:09 -04:00
namespace QMSMTST {
$declare(SMs::QMsmTst)
static QMsmTst l_msmtst; // the only instance of the QMsmTst class
// global-scope definitions -----------------------------------------
QP::QMsm * const the_msm = &amp;l_msmtst; // the opaque pointer
$define(SMs::QMsmTst)
} // namespace QMSMTST</text>
</file>
</directory>
</model>