This class handle a transition between two states (including previous/next buttons). Specific things can happen for CamiTK SCXML transition (e.g., apply the selected action before going to the next, closing components...) More...
#include <ActionTransition.h>
Public Member Functions | |
ActionTransition (QPushButton *sender, const char *signal, QState *sourceState=nullptr, bool applyPreviousAction=true, QTextStream *logStream=nullptr) | |
constructor: takes at least the state and signal considered for the transition More... | |
void | addComponentToClose (QString compName, QString compType, bool force=false) |
add a component's name and type to the list of component to close during the transition. More... | |
void | autoNext () |
programmatically activate the transition (during autoNext), i.e. call "click" on the button More... | |
bool | isNamed (QString) const |
Check the name of the transition (i.e. text of the button) More... | |
void | onTransition (QEvent *e) override |
called during the transition More... | |
Private Attributes | |
bool | applyPreviousAction |
should the action be applied during the transition (default set to true) More... | |
QMap< QString, QString > | componentsToClose |
Map containing all the name/type of the components to be closed during the transition. More... | |
QStringList | componentsToForceClose |
list of the components' name that should be closed even if they are modified More... | |
QTextStream * | logStream |
local pointer to the log stream More... | |
QPushButton * | myButton |
the button that controls this transition More... | |
QTime * | startTime |
Keep track of time (needed for the log) More... | |
This class handle a transition between two states (including previous/next buttons). Specific things can happen for CamiTK SCXML transition (e.g., apply the selected action before going to the next, closing components...)
The transition's name is set as the button's text.
Example:
ActionTransition::ActionTransition | ( | QPushButton * | sender, |
const char * | signal, | ||
QState * | sourceState = nullptr , |
||
bool | applyPreviousAction = true , |
||
QTextStream * | logStream = nullptr |
||
) |
constructor: takes at least the state and signal considered for the transition
References applyPreviousAction, logStream, and myButton.
void ActionTransition::addComponentToClose | ( | QString | compName, |
QString | compType, | ||
bool | force = false |
||
) |
add a component's name and type to the list of component to close during the transition.
Set force to "true" in order to close the component independently of its modified flag.
References componentsToClose, and componentsToForceClose.
Referenced by ActionStateMachine::createTransitions().
void ActionTransition::autoNext | ( | ) |
programmatically activate the transition (during autoNext), i.e. call "click" on the button
References myButton.
Referenced by ActionStateMachine::autoNext().
bool ActionTransition::isNamed | ( | QString | name | ) | const |
Check the name of the transition (i.e. text of the button)
References myButton.
Referenced by ActionStateMachine::autoNext().
|
override |
called during the transition
References ActionState::applyAction(), applyPreviousAction, componentsToClose, componentsToForceClose, ActionState::getName(), logStream, ActionState::setPreviousActionStatus(), and startTime.
|
private |
should the action be applied during the transition (default set to true)
Referenced by ActionTransition(), and onTransition().
|
private |
Map containing all the name/type of the components to be closed during the transition.
Referenced by addComponentToClose(), and onTransition().
|
private |
list of the components' name that should be closed even if they are modified
Referenced by addComponentToClose(), and onTransition().
|
private |
local pointer to the log stream
Referenced by ActionTransition(), and onTransition().
|
private |
the button that controls this transition
Referenced by ActionTransition(), autoNext(), and isNamed().
|
private |
Keep track of time (needed for the log)
Referenced by onTransition().