Revise state machine code gen

Add comments
This commit is contained in:
Rob Bocchino 2024-11-20 14:43:21 -08:00
parent 855fbbb2ea
commit ab44e7ffc4
36 changed files with 229 additions and 6 deletions

View File

@ -165,6 +165,12 @@ case class StateMachineCppWriter(
val actionSymbols = transition.actions.map(sma.getActionSymbol)
val targetSymbol = sma.useDefMap(transition.target.id)
val signal = s"Signal::$initialTransitionName"
val actionComment =
line("// Do the actions for the state machine initial transition")
val actionLines =
actionSymbols.flatMap(writeActionCall (signal) (None))
val enterComment = line("// Enter the initial target of the state machine")
val enterLines = writeEnterCall (signal) (None) (targetSymbol)
functionClassMember(
Some("Initialize the state machine"),
"initBase",
@ -177,8 +183,8 @@ case class StateMachineCppWriter(
),
CppDoc.Type("void"),
line("this->m_id = id;") :: List.concat(
actionSymbols.flatMap(writeActionCall (signal) (None)),
writeEnterCall (signal) (None) (targetSymbol)
Line.addPrefixLine (actionComment) (actionLines),
Line.addPrefixLine (enterComment) (enterLines)
)
)
}

View File

@ -207,15 +207,20 @@ abstract class StateMachineCppWriterUtils(
(valueArgOpt: Option[String])
(transition: Transition): List[Line] =
{
val actionComment = line("// Do the actions for the transition")
val actionLines = transition.getActions.flatMap(
writeActionCall (signalArg) (valueArgOpt)
)
val entryComment = line("// Enter the target")
val entryLines = transition.getTargetOpt match {
case Some(target) =>
writeEnterCall (signalArg) (valueArgOpt) (target.getSymbol)
case None => Nil
}
List.concat(actionLines, entryLines)
List.concat(
Line.addPrefixLine (actionComment) (actionLines),
Line.addPrefixLine (entryComment) (entryLines)
)
}
}

View File

@ -49,9 +49,13 @@ case class StateMachineEntryFns(
val transition = initSpecifier.transition.data
val actionSymbols = transition.actions.map(sma.getActionSymbol)
val targetSymbol = sma.useDefMap(transition.target.id)
val actionPrefix = line("// Do the actions for the initial transition")
val actionLines = actionSymbols.flatMap(writeActionCall (signalParamName) (None))
val enterPrefix = line("// Enter the target of the initial transition")
val enterLines = writeEnterCall (signalParamName) (None) (targetSymbol)
val initial = List.concat(
actionSymbols.flatMap(writeActionCall (signalParamName) (None)),
writeEnterCall (signalParamName) (None) (targetSymbol)
Line.addPrefixLine (actionPrefix) (actionLines),
Line.addPrefixLine (enterPrefix) (enterLines)
)
val member = getStateEnterFn(aNode, initial)
member :: members
@ -76,13 +80,16 @@ case class StateMachineEntryFns(
val stateName = writeSmSymbolName(stateSym)
val entryActionSymbols =
State.getEntryActions(aNode._2.data).map(sma.getActionSymbol)
val entryActionComment = line("// Do the entry actions")
val entryActionLines =
entryActionSymbols.flatMap(writeActionCall (signalParamName) (None))
functionClassMember(
Some(s"Enter state $stateName"),
getEnterFunctionName(stateSym),
List(signalParam),
CppDoc.Type("void"),
List.concat(
entryActionSymbols.flatMap(writeActionCall (signalParamName) (None)),
Line.addPrefixLine (entryActionComment) (entryActionLines),
initialOrUpdate
)
)

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S1(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,6 +58,7 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1:
// Enter the target
this->enter_C(Signal::s);
break;
case State::S2:
@ -89,11 +91,15 @@ namespace FppTest {
enter_C(Signal signal)
{
if (this->guard_g(signal)) {
// Do the actions for the transition
this->action_a(signal);
// Enter the target
this->enter_S2(signal);
}
else {
// Do the actions for the transition
this->action_b(signal);
// Enter the target
this->enter_S3(signal);
}
}

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S1(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,6 +58,7 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1:
// Enter the target
this->enter_C(Signal::s, value);
break;
case State::S2:
@ -92,11 +94,15 @@ namespace FppTest {
)
{
if (this->guard_g(signal, value)) {
// Do the actions for the transition
this->action_a(signal, value);
// Enter the target
this->enter_S2(signal);
}
else {
// Do the actions for the transition
this->action_b(signal);
// Enter the target
this->enter_S3(signal);
}
}

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S1(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,6 +58,7 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1:
// Enter the target
this->enter_S1_C1(Signal::s);
break;
case State::S2_S3:
@ -76,7 +78,9 @@ namespace FppTest {
void ChoiceToChoiceStateMachineBase ::
enter_S2(Signal signal)
{
// Do the entry actions
this->action_enterS2(signal);
// Enter the target of the initial transition
this->enter_S2_S3(signal);
}
@ -84,9 +88,11 @@ namespace FppTest {
enter_S2_C2(Signal signal)
{
if (this->guard_g2(signal)) {
// Enter the target
this->enter_S2_S3(signal);
}
else {
// Enter the target
this->enter_S2_S4(signal);
}
}
@ -113,14 +119,18 @@ namespace FppTest {
enter_S1_C1(Signal signal)
{
if (this->guard_g1(signal)) {
// Do the actions for the transition
this->action_exitS1(signal);
this->action_a(signal);
// Enter the target
this->enter_S2(signal);
}
else {
// Do the actions for the transition
this->action_exitS1(signal);
this->action_a(signal);
this->action_enterS2(signal);
// Enter the target
this->enter_S2_C2(signal);
}
}

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S1(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,6 +58,7 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1:
// Enter the target
this->enter_S1_C(Signal::s);
break;
case State::S2_S3:
@ -74,14 +76,18 @@ namespace FppTest {
void ChoiceToStateStateMachineBase ::
enter_S2(Signal signal)
{
// Do the entry actions
this->action_enterS2(signal);
// Do the actions for the initial transition
this->action_a(signal);
// Enter the target of the initial transition
this->enter_S2_S3(signal);
}
void ChoiceToStateStateMachineBase ::
enter_S2_S3(Signal signal)
{
// Do the entry actions
this->action_enterS3(signal);
this->m_state = State::S2_S3;
}
@ -96,14 +102,18 @@ namespace FppTest {
enter_S1_C(Signal signal)
{
if (this->guard_g(signal)) {
// Do the actions for the transition
this->action_exitS1(signal);
this->action_a(signal);
// Enter the target
this->enter_S2(signal);
}
else {
// Do the actions for the transition
this->action_exitS1(signal);
this->action_a(signal);
this->action_enterS2(signal);
// Enter the target
this->enter_S2_S3(signal);
}
}

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S1(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,6 +58,7 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1:
// Enter the target
this->enter_C(Signal::s1, value);
break;
case State::S2:
@ -74,6 +76,7 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1:
// Enter the target
this->enter_C(Signal::s2, value);
break;
case State::S2:
@ -109,11 +112,15 @@ namespace FppTest {
)
{
if (this->guard_g(signal, value)) {
// Do the actions for the transition
this->action_a(signal, value);
// Enter the target
this->enter_S2(signal);
}
else {
// Do the actions for the transition
this->action_a(signal, value);
// Enter the target
this->enter_S3(signal);
}
}

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S1(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,6 +58,7 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1:
// Enter the target
this->enter_C1(Signal::s);
break;
case State::S2:
@ -97,11 +99,15 @@ namespace FppTest {
enter_C2(Signal signal)
{
if (this->guard_g2(signal)) {
// Do the actions for the transition
this->action_a(signal);
// Enter the target
this->enter_S3(signal);
}
else {
// Do the actions for the transition
this->action_b(signal);
// Enter the target
this->enter_S4(signal);
}
}
@ -110,9 +116,11 @@ namespace FppTest {
enter_C1(Signal signal)
{
if (this->guard_g1(signal)) {
// Enter the target
this->enter_S2(signal);
}
else {
// Enter the target
this->enter_C2(signal);
}
}

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S1(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,6 +58,7 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1:
// Enter the target
this->enter_C1(Signal::s, value);
break;
case State::S2:
@ -100,11 +102,15 @@ namespace FppTest {
)
{
if (this->guard_g2(signal, value)) {
// Do the actions for the transition
this->action_a(signal, value);
// Enter the target
this->enter_S3(signal);
}
else {
// Do the actions for the transition
this->action_b(signal);
// Enter the target
this->enter_S4(signal);
}
}
@ -116,9 +122,11 @@ namespace FppTest {
)
{
if (this->guard_g1(signal)) {
// Enter the target
this->enter_S2(signal);
}
else {
// Enter the target
this->enter_C2(signal, value);
}
}

View File

@ -35,7 +35,9 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Do the actions for the state machine initial transition
this->action_a(Signal::__FPRIME_AC_INITIAL_TRANSITION);
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -56,6 +58,7 @@ namespace FppTest {
void BasicStateMachineBase ::
enter_S(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
this->m_state = State::S;

View File

@ -35,7 +35,9 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Do the actions for the state machine initial transition
this->action_a(Signal::__FPRIME_AC_INITIAL_TRANSITION);
// Enter the initial target of the state machine
this->enter_C(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -56,6 +58,7 @@ namespace FppTest {
void ChoiceStateMachineBase ::
enter_T(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
this->m_state = State::T;
@ -64,6 +67,7 @@ namespace FppTest {
void ChoiceStateMachineBase ::
enter_S(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->m_state = State::S;
}
@ -72,12 +76,16 @@ namespace FppTest {
enter_C(Signal signal)
{
if (this->guard_g(signal)) {
// Do the actions for the transition
this->action_a(signal);
// Enter the target
this->enter_S(signal);
}
else {
// Do the actions for the transition
this->action_a(signal);
this->action_a(signal);
// Enter the target
this->enter_T(signal);
}
}

View File

@ -35,7 +35,9 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Do the actions for the state machine initial transition
this->action_a(Signal::__FPRIME_AC_INITIAL_TRANSITION);
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -56,14 +58,17 @@ namespace FppTest {
void NestedStateMachineBase ::
enter_S(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
// Enter the target of the initial transition
this->enter_S_T(signal);
}
void NestedStateMachineBase ::
enter_S_T(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
this->action_a(signal);

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -58,9 +59,11 @@ namespace FppTest {
switch (this->m_state) {
case State::S:
if (this->guard_g(Signal::s)) {
// Do the actions for the transition
this->action_a(Signal::s);
this->action_a(Signal::s);
this->action_a(Signal::s);
// Enter the target
this->enter_T(Signal::s);
}
break;
@ -79,6 +82,7 @@ namespace FppTest {
void BasicGuardStateMachineBase ::
enter_T(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
this->action_a(signal);

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -58,7 +59,9 @@ namespace FppTest {
switch (this->m_state) {
case State::S:
if (this->guard_g(Signal::s, value)) {
// Do the actions for the transition
this->action_a(Signal::s, value);
// Enter the target
this->enter_T(Signal::s);
}
break;

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -58,7 +59,9 @@ namespace FppTest {
switch (this->m_state) {
case State::S:
if (this->guard_g(Signal::s, value)) {
// Do the actions for the transition
this->action_a(Signal::s, value);
// Enter the target
this->enter_T(Signal::s);
}
break;

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -58,7 +59,9 @@ namespace FppTest {
switch (this->m_state) {
case State::S:
if (this->guard_g(Signal::s, value)) {
// Do the actions for the transition
this->action_a(Signal::s, value);
// Enter the target
this->enter_T(Signal::s);
}
break;

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -58,7 +59,9 @@ namespace FppTest {
switch (this->m_state) {
case State::S:
if (this->guard_g(Signal::s, value)) {
// Do the actions for the transition
this->action_a(Signal::s, value);
// Enter the target
this->enter_T(Signal::s);
}
break;

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -58,7 +59,9 @@ namespace FppTest {
switch (this->m_state) {
case State::S:
if (this->guard_g(Signal::s, value)) {
// Do the actions for the transition
this->action_a(Signal::s, value);
// Enter the target
this->enter_T(Signal::s);
}
break;

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -58,7 +59,9 @@ namespace FppTest {
switch (this->m_state) {
case State::S:
if (this->guard_g(Signal::s, value)) {
// Do the actions for the transition
this->action_a(Signal::s, value);
// Enter the target
this->enter_T(Signal::s);
}
break;

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,6 +58,7 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S:
// Do the actions for the transition
this->action_a(Signal::s);
break;
default:
@ -72,6 +74,7 @@ namespace FppTest {
void BasicInternalStateMachineBase ::
enter_S(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->m_state = State::S;
}

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,11 +58,13 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S:
// Do the actions for the transition
this->action_a(Signal::s);
this->action_a(Signal::s);
this->action_a(Signal::s);
this->action_a(Signal::s);
this->action_a(Signal::s);
// Enter the target
this->enter_S(Signal::s);
break;
default:
@ -77,6 +80,7 @@ namespace FppTest {
void BasicSelfStateMachineBase ::
enter_S(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->m_state = State::S;
}

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,9 +58,11 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S:
// Do the actions for the transition
this->action_a(Signal::s);
this->action_a(Signal::s);
this->action_a(Signal::s);
// Enter the target
this->enter_T(Signal::s);
break;
case State::T:
@ -77,6 +80,7 @@ namespace FppTest {
void BasicStateMachineBase ::
enter_T(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
this->action_a(signal);

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,9 +58,11 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S:
// Do the actions for the transition
this->action_a(Signal::s);
this->action_a(Signal::s);
this->action_b(Signal::s, value);
// Enter the target
this->enter_T(Signal::s);
break;
case State::T:
@ -77,6 +80,7 @@ namespace FppTest {
void BasicStringStateMachineBase ::
enter_T(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
this->action_a(signal);

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,9 +58,11 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S:
// Do the actions for the transition
this->action_a(Signal::s);
this->action_a(Signal::s);
this->action_b(Signal::s, value);
// Enter the target
this->enter_T(Signal::s);
break;
case State::T:
@ -77,6 +80,7 @@ namespace FppTest {
void BasicTestAbsTypeStateMachineBase ::
enter_T(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
this->action_a(signal);

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,9 +58,11 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S:
// Do the actions for the transition
this->action_a(Signal::s);
this->action_a(Signal::s);
this->action_b(Signal::s, value);
// Enter the target
this->enter_T(Signal::s);
break;
case State::T:
@ -77,6 +80,7 @@ namespace FppTest {
void BasicTestArrayStateMachineBase ::
enter_T(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
this->action_a(signal);

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,9 +58,11 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S:
// Do the actions for the transition
this->action_a(Signal::s);
this->action_a(Signal::s);
this->action_b(Signal::s, value);
// Enter the target
this->enter_T(Signal::s);
break;
case State::T:
@ -77,6 +80,7 @@ namespace FppTest {
void BasicTestEnumStateMachineBase ::
enter_T(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
this->action_a(signal);

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,9 +58,11 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S:
// Do the actions for the transition
this->action_a(Signal::s);
this->action_a(Signal::s);
this->action_b(Signal::s, value);
// Enter the target
this->enter_T(Signal::s);
break;
case State::T:
@ -77,6 +80,7 @@ namespace FppTest {
void BasicTestStructStateMachineBase ::
enter_T(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
this->action_a(signal);

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,9 +58,11 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S:
// Do the actions for the transition
this->action_a(Signal::s);
this->action_a(Signal::s);
this->action_b(Signal::s, value);
// Enter the target
this->enter_T(Signal::s);
break;
case State::T:
@ -77,6 +80,7 @@ namespace FppTest {
void BasicU32StateMachineBase ::
enter_T(Signal signal)
{
// Do the entry actions
this->action_a(signal);
this->action_a(signal);
this->action_a(signal);

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S1(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,9 +58,11 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Do the actions for the transition
this->action_a(Signal::S1_internal);
break;
case State::S1_S3:
// Do the actions for the transition
this->action_a(Signal::S1_internal);
break;
default:
@ -73,6 +76,7 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Enter the target
this->enter_S1_S3(Signal::S2_to_S3);
break;
case State::S1_S3:
@ -90,6 +94,7 @@ namespace FppTest {
void InternalStateMachineBase ::
enter_S1(Signal signal)
{
// Enter the target of the initial transition
this->enter_S1_S2(signal);
}

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S1(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,9 +58,11 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Enter the target
this->enter_S4(Signal::poly);
break;
case State::S1_S3:
// Enter the target
this->enter_S5(Signal::poly);
break;
case State::S4:
@ -77,6 +80,7 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Enter the target
this->enter_S1_S3(Signal::S2_to_S3);
break;
case State::S1_S3:
@ -110,6 +114,7 @@ namespace FppTest {
void PolymorphismStateMachineBase ::
enter_S1(Signal signal)
{
// Enter the target of the initial transition
this->enter_S1_S2(signal);
}

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S1(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,13 +58,17 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Do the actions for the transition
this->action_exitS2(Signal::S1_to_S2);
this->action_a(Signal::S1_to_S2);
// Enter the target
this->enter_S1_S2(Signal::S1_to_S2);
break;
case State::S1_S3:
// Do the actions for the transition
this->action_exitS3(Signal::S1_to_S2);
this->action_a(Signal::S1_to_S2);
// Enter the target
this->enter_S1_S2(Signal::S1_to_S2);
break;
default:
@ -77,7 +82,9 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Do the actions for the transition
this->action_exitS2(Signal::S2_to_S3);
// Enter the target
this->enter_S1_S3(Signal::S2_to_S3);
break;
case State::S1_S3:
@ -95,12 +102,14 @@ namespace FppTest {
void StateToChildStateMachineBase ::
enter_S1(Signal signal)
{
// Enter the target of the initial transition
this->enter_S1_S2(signal);
}
void StateToChildStateMachineBase ::
enter_S1_S2(Signal signal)
{
// Do the entry actions
this->action_enterS2(signal);
this->m_state = State::S1_S2;
}
@ -108,6 +117,7 @@ namespace FppTest {
void StateToChildStateMachineBase ::
enter_S1_S3(Signal signal)
{
// Do the entry actions
this->action_enterS3(signal);
this->m_state = State::S1_S3;
}

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S1(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,15 +58,19 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Do the actions for the transition
this->action_exitS2(Signal::S1_to_S4);
this->action_exitS1(Signal::S1_to_S4);
this->action_a(Signal::S1_to_S4);
// Enter the target
this->enter_S4(Signal::S1_to_S4);
break;
case State::S1_S3:
// Do the actions for the transition
this->action_exitS3(Signal::S1_to_S4);
this->action_exitS1(Signal::S1_to_S4);
this->action_a(Signal::S1_to_S4);
// Enter the target
this->enter_S4(Signal::S1_to_S4);
break;
case State::S4_S5:
@ -83,17 +88,21 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Do the actions for the transition
this->action_exitS2(Signal::S1_to_C);
this->action_exitS1(Signal::S1_to_C);
this->action_a(Signal::S1_to_C);
this->action_enterS4(Signal::S1_to_C);
// Enter the target
this->enter_S4_C(Signal::S1_to_C);
break;
case State::S1_S3:
// Do the actions for the transition
this->action_exitS3(Signal::S1_to_C);
this->action_exitS1(Signal::S1_to_C);
this->action_a(Signal::S1_to_C);
this->action_enterS4(Signal::S1_to_C);
// Enter the target
this->enter_S4_C(Signal::S1_to_C);
break;
case State::S4_S5:
@ -111,7 +120,9 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Do the actions for the transition
this->action_exitS2(Signal::S2_to_S3);
// Enter the target
this->enter_S1_S3(Signal::S2_to_S3);
break;
case State::S1_S3:
@ -133,7 +144,9 @@ namespace FppTest {
void StateToChoiceStateMachineBase ::
enter_S4(Signal signal)
{
// Do the entry actions
this->action_enterS4(signal);
// Enter the target of the initial transition
this->enter_S4_C(signal);
}
@ -141,9 +154,11 @@ namespace FppTest {
enter_S4_C(Signal signal)
{
if (this->guard_g(signal)) {
// Enter the target
this->enter_S4_S5(signal);
}
else {
// Enter the target
this->enter_S4_S6(signal);
}
}
@ -163,13 +178,16 @@ namespace FppTest {
void StateToChoiceStateMachineBase ::
enter_S1(Signal signal)
{
// Do the entry actions
this->action_enterS1(signal);
// Enter the target of the initial transition
this->enter_S1_S2(signal);
}
void StateToChoiceStateMachineBase ::
enter_S1_S2(Signal signal)
{
// Do the entry actions
this->action_enterS2(signal);
this->m_state = State::S1_S2;
}
@ -177,6 +195,7 @@ namespace FppTest {
void StateToChoiceStateMachineBase ::
enter_S1_S3(Signal signal)
{
// Do the entry actions
this->action_enterS3(signal);
this->m_state = State::S1_S3;
}

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S1(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,15 +58,19 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Do the actions for the transition
this->action_exitS2(Signal::S1_to_S1);
this->action_exitS1(Signal::S1_to_S1);
this->action_a(Signal::S1_to_S1);
// Enter the target
this->enter_S1(Signal::S1_to_S1);
break;
case State::S1_S3:
// Do the actions for the transition
this->action_exitS3(Signal::S1_to_S1);
this->action_exitS1(Signal::S1_to_S1);
this->action_a(Signal::S1_to_S1);
// Enter the target
this->enter_S1(Signal::S1_to_S1);
break;
default:
@ -79,7 +84,9 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Do the actions for the transition
this->action_exitS2(Signal::S2_to_S3);
// Enter the target
this->enter_S1_S3(Signal::S2_to_S3);
break;
case State::S1_S3:
@ -97,13 +104,16 @@ namespace FppTest {
void StateToSelfStateMachineBase ::
enter_S1(Signal signal)
{
// Do the entry actions
this->action_enterS1(signal);
// Enter the target of the initial transition
this->enter_S1_S2(signal);
}
void StateToSelfStateMachineBase ::
enter_S1_S2(Signal signal)
{
// Do the entry actions
this->action_enterS2(signal);
this->m_state = State::S1_S2;
}
@ -111,6 +121,7 @@ namespace FppTest {
void StateToSelfStateMachineBase ::
enter_S1_S3(Signal signal)
{
// Do the entry actions
this->action_enterS3(signal);
this->m_state = State::S1_S3;
}

View File

@ -35,6 +35,7 @@ namespace FppTest {
initBase(const FwEnumStoreType id)
{
this->m_id = id;
// Enter the initial target of the state machine
this->enter_S1(Signal::__FPRIME_AC_INITIAL_TRANSITION);
}
@ -57,15 +58,19 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Do the actions for the transition
this->action_exitS2(Signal::S1_to_S4);
this->action_exitS1(Signal::S1_to_S4);
this->action_a(Signal::S1_to_S4);
// Enter the target
this->enter_S4(Signal::S1_to_S4);
break;
case State::S1_S3:
// Do the actions for the transition
this->action_exitS3(Signal::S1_to_S4);
this->action_exitS1(Signal::S1_to_S4);
this->action_a(Signal::S1_to_S4);
// Enter the target
this->enter_S4(Signal::S1_to_S4);
break;
case State::S4_S5:
@ -81,17 +86,21 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Do the actions for the transition
this->action_exitS2(Signal::S1_to_S5);
this->action_exitS1(Signal::S1_to_S5);
this->action_a(Signal::S1_to_S5);
this->action_enterS4(Signal::S1_to_S5);
// Enter the target
this->enter_S4_S5(Signal::S1_to_S5);
break;
case State::S1_S3:
// Do the actions for the transition
this->action_exitS3(Signal::S1_to_S5);
this->action_exitS1(Signal::S1_to_S5);
this->action_a(Signal::S1_to_S5);
this->action_enterS4(Signal::S1_to_S5);
// Enter the target
this->enter_S4_S5(Signal::S1_to_S5);
break;
case State::S4_S5:
@ -107,7 +116,9 @@ namespace FppTest {
{
switch (this->m_state) {
case State::S1_S2:
// Do the actions for the transition
this->action_exitS2(Signal::S2_to_S3);
// Enter the target
this->enter_S1_S3(Signal::S2_to_S3);
break;
case State::S1_S3:
@ -127,13 +138,16 @@ namespace FppTest {
void StateToStateStateMachineBase ::
enter_S4(Signal signal)
{
// Do the entry actions
this->action_enterS4(signal);
// Enter the target of the initial transition
this->enter_S4_S5(signal);
}
void StateToStateStateMachineBase ::
enter_S4_S5(Signal signal)
{
// Do the entry actions
this->action_enterS5(signal);
this->m_state = State::S4_S5;
}
@ -141,13 +155,16 @@ namespace FppTest {
void StateToStateStateMachineBase ::
enter_S1(Signal signal)
{
// Do the entry actions
this->action_enterS1(signal);
// Enter the target of the initial transition
this->enter_S1_S2(signal);
}
void StateToStateStateMachineBase ::
enter_S1_S2(Signal signal)
{
// Do the entry actions
this->action_enterS2(signal);
this->m_state = State::S1_S2;
}
@ -155,6 +172,7 @@ namespace FppTest {
void StateToStateStateMachineBase ::
enter_S1_S3(Signal signal)
{
// Do the entry actions
this->action_enterS3(signal);
this->m_state = State::S1_S3;
}

View File

@ -0,0 +1,9 @@
#!/bin/sh -e
for file in `find . -mindepth 2 -maxdepth 2 -name update-ref`
do
dir=`dirname $file`
echo "[ $dir ]"
base=`basename $file`
(cd $dir; ./$base)
done