 |
Computer Assited Medical Intervention Tool Kit
version 4.1
|
Go to the documentation of this file.
27 #ifndef ACTIONSTATEMACHINE_H
28 #define ACTIONSTATEMACHINE_H
32 #include <QTextStream>
33 #include <QStateMachine>
35 #include <QFinalState>
39 #include <QtXml/QDomDocument>
40 #include <QtXml/QDomNodeList>
146 QVector<camitk::Action::ApplyStatus>
stringToStatus(QString listOfStatus);
153 #endif // ACTIONSTATEMACHINE_H
static char ** argv
argv given from command line
Definition: Application.h:371
QString type
Definition: SaveActionState.h:85
void finished()
finish everything properly when the state machine entered the final state and quit
Definition: ActionStateMachine.cpp:250
void createAllActionStates(QDomNodeList nodeList)
This method may throw an AbortException if a problem occurs.
Definition: ActionStateMachine.cpp:260
void setAction(camitk::Action *action, QMap< QString, QVariant > parameters, QMap< QString, QString > inputComponentNames, QMap< QString, QString > outputComponentNames)
Definition: ActionState.cpp:53
#define CAMITK_WARNING(MSG)
Log for warning verbosity (the most common one) Will appear by default.
Definition: Log.h:261
virtual void redirectToConsole(bool)
use or not the application console (redirect or not standard out/err streams)
Definition: MainWindow.cpp:323
Definition: RendererWidget.h:177
void autoNext()
Automatically loop to apply to next state for all states.
Definition: ActionStateMachine.cpp:122
void setMainWindow(MainWindow *mw)
set the main window.
Definition: Application.cpp:245
The state (in a state machine point of view) corresponding to the current processed action.
Definition: ActionState.h:47
void checkSCXMLFile(QString filename)
check that the file is a SCXML file (simple checking, no XML Schema validation yet) This method may t...
Definition: ActionStateMachine.cpp:175
QString name
Application's name.
Definition: ActionStateMachine.h:120
virtual ~ActionStateMachine()=default
destructor
bool isNamed(QString) const
Check the name of the transition (i.e. text of the button)
Definition: ActionTransition.cpp:147
QDomDocument scxmlDoc
XML tree containing infos.
Definition: ActionStateMachine.h:129
static ActionStateViewer * getActionStateViewer()
returns the unique instance oh ActionStateViewer
Definition: ActionStateViewer.cpp:40
void setState(ActionState *actionState)
Definition: ActionStateViewer.cpp:88
QVector< camitk::Action::ApplyStatus > stringToStatus(QString listOfStatus)
Definition: ActionStateMachine.cpp:416
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.
Definition: ActionTransition.cpp:152
Action class is an abstract class that enables you to build a action (generally on a component)....
Definition: Action.h:228
ActionTransition * addActionTransition(QString transitionName, QAbstractState *nextState, bool applyAction=true, QVector< camitk::Action::ApplyStatus > disableConditions=QVector< camitk::Action::ApplyStatus >())
Adds a possible transition from this action.
Definition: ActionState.cpp:81
The generic/default application. Once this class is intanciated in the main, everything is setup....
Definition: Application.h:62
QString getName()
Returns the name of the action state (may be different from the name of the actual action)
Definition: ActionState.cpp:66
void setCamiTKAction(ActionState *actionState, QDomElement actionElement)
This method may throw an AbortException if a problem occurs.
Definition: ActionStateMachine.cpp:443
Exception class to handle abortion in component instantiation. Particularly useful to handle construc...
Definition: AbortException.h:64
#define CAMITK_ERROR(MSG)
Log for error verbosity (the minimum verbosity) Will always appear.
Definition: Log.h:271
This Class describes ActionStateMachine MainWindow extension. This application use a modified version...
Definition: ActionStateMachine.h:57
QString getDomNodeLocation(QDomNode)
build a specific error message containing the line and column if available
Definition: ActionStateMachine.cpp:566
QStateMachine machine
Actual state machine.
Definition: ActionStateMachine.h:123
void setInput(QVector< saveComponentsInfo > inputComponentsInfo)
Definition: SaveActionState.cpp:46
void setCamiTKSaveAction(SaveActionState *actionState, QDomElement actionElement)
This method may throw an AbortException if a problem occurs.
Definition: ActionStateMachine.cpp:530
QTime * startTime
To get track of the Action State Machine the duration.
Definition: ActionStateMachine.h:141
virtual void setCentralViewer(Viewer *)
set the central Viewer of the application.
Definition: MainWindow.cpp:283
QFile * logFile
Log file.
Definition: ActionStateMachine.h:147
QString name
Definition: SaveActionState.h:84
QString extension
Definition: SaveActionState.h:86
QDir saveDirectory
Where to save all files.
Definition: ActionStateMachine.h:138
ActionStateMachine(int &argc, char **argv, QString inputFileName="", QString outputDirectory="")
construtor.
Definition: ActionStateMachine.cpp:50
This class handle a transition between two states (including previous/next buttons)....
Definition: ActionTransition.h:58
void showStatusBar(bool)
show the status bar (by default it is hidden)
Definition: MainWindow.cpp:312
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: MainWindow.h:83
QString directory
Definition: SaveActionState.h:87
void createTransitions(QDomNodeList nodeList)
This method may throw an AbortException if a problem occurs.
Definition: ActionStateMachine.cpp:347
QString parseSCXMLTree()
parse the XML file (using Qt DOM API) This method may throw an AbortException if a problem occurs.
Definition: ActionStateMachine.cpp:209
void autoNext()
programmatically activate the transition (during autoNext), i.e. call "click" on the button
Definition: ActionTransition.cpp:160
QString getSaveDirectory()
where to save the files
Definition: ActionStateMachine.cpp:561
QMap< QString, ActionState * > * statesMap
Map of action state to build transitions.
Definition: ActionStateMachine.h:132
void initMainWindow()
initialized main window
Definition: ActionStateMachine.cpp:154
virtual void addDockViewer(Qt::DockWidgetArea, Viewer *)
add a Viewer to the application as a docking widget and specify where it has to be docked Note that M...
Definition: MainWindow.cpp:259
void setAlternativeDesc(QString altDescText, QVector< camitk::Action::ApplyStatus > statusList)
May change its description according to the previous action result.
Definition: ActionState.cpp:155
void setWindowSubtitle(QString)
The subtitle is situated at the end of the title, on the title bar, is helps for example showing whic...
Definition: MainWindow.cpp:202
QFinalState * finalState
Final State.
Definition: ActionStateMachine.h:135
static int argc
argc given from command line
Definition: Application.h:368
camitk::MainWindow * mainWindow
main window
Definition: ActionStateMachine.h:126
The asm application uses a state machine. This class implements the state of action save.
Definition: SaveActionState.h:36
Definition: SaveActionState.h:61
Definition: Action.cpp:36
QTextStream * logStream
Log stream to write report on logFile.
Definition: ActionStateMachine.h:144