State diagram mappings - event action block (C++ code)
For each Event Action Block on a State Diagram that is being generated, ACS generates code depending on the Trigger Type of the Event Action Block.
Call trigger type
ACS adds code to the operation that triggers the Event Action Block.
Change trigger type
ACS adds code to the run to completion operation that is created for the Class that owns the State Diagram through a State Machine. The run to completion operation is called each time an event is injected into the state machine.
Create trigger type
ACS adds code to the constructor operation that is created for the Class that owns the State Diagram through a State Machine.
Destroy trigger type
ACS generates a private operation that destroys the Class that owns the State Diagram through a State Machine. The name of the destructor is as follows:
~<class name>
Entry trigger type
ACS adds code to the enter state operation that is generated for the parent state.
Exit trigger type
ACS adds code to the exit state operation that is generated for the parent state.
Signal trigger type
ACS generates a public event handler operation for the event that triggers the Event Action Block. The name of each event handler operation is as follows:
Rts<event name>
Time trigger type
For each Event Action Block that is triggered by a Time trigger type, ACS generates the following code elements:
• Timer Attribute - stores the handle for a timer.
• Timer Event Handler Operation - handles a Transition that is triggered by a Time event.
• Timer Event Handler Callback Operation - handles a Transition that is triggered by a Time event.
In addition, code is added to the source state's enter state operation and exit state operation. On entering a state that has a time triggered transition, the enter state operation starts a timer object, and specifies the time that must elapse in milliseconds. When the specified time has elapsed, the timer object uses the callback operation to run the necessary code.
Note that for your system, you must implement time events for your environment through the RTSSMTGT.H file.
• Timer attribute
A private attribute that is a handler to the appropriate time object.
The name of each timer attribute is as follows:
RtsAtt_<parent state name>_Timer<unique identifier>
Where <unique identifier> is the lowest integer value that results in a unique Attribute name.
• Timer event handler operation
A private operation that handles a transition that is triggered by a time event.
The name of each timer event handler operation is as follows:
Rts<parent state name>_Timer<unique identifier>
Where <unique identifier> is the lowest integer value (starting at 1) that results in a unique operation name.
|
ACS creates a timer event handler callback operation for each timer event handler operation it generates.
|
• Timer event handler callback operation
A private operation that handles a transition that is triggered by a time event.
The name of each timer event handler callback operation is as follows:
Rts<parent state name>_Timer<unique identifier>_Callback
Where <unique identifier> is that of the associated timer event handler operation.