Computer Assited Medical Intervention Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
ActionState Class Reference

#include <ActionState.h>

+ Inheritance diagram for ActionState:

Public Member Functions

 ActionState (QState *parent, QString name, QString description, QTextStream *logStream=NULL)
ActionTransitionaddActionTransition (QString buttonText, QAbstractState *nextState, bool applyAction=true, QVector< Action::ApplyStatus > disableConditions=QVector< Action::ApplyStatus >())
 Adds a possible transition from this action.
virtual Action::ApplyStatus applyAction ()
QString getDescription ()
 Returns the description of the action state (may be different from the description of the actual action)
QString getName ()
 Returns the name of the action state (may be different from the name of the actual action)
ActionStateWidgetgetWidget ()
void setAction (Action *action, QMap< QString, QVariant > parameters, QMap< QString, QString > inputComponentNames, QMap< QString, QString > outputComponentNames)
void setAleternativeDesc (QString altDescText, QVector< Action::ApplyStatus > statusList)
 May change its description according to the previous action result.
void setFinal ()
void setPreviousActionStatus (Action::ApplyStatus status)

Protected Member Functions

virtual void onEntry (QEvent *event)
 Reimplemented from QState.
virtual void onExit (QEvent *event)

Protected Attributes

QMap< Action::ApplyStatus,
QVector< QPushButton * > > 
conditionalButtons
 Buttons that should be disabled if the previous aciton state did not happen correctly.
QMap< Action::ApplyStatus,
QString > 
conditionalDescriptions
QString description
 Description of the state action may not be the same as the action's description but complementary.
QMap< QString, QString > inputComponentNames
QTextStream * logStream
 Log stream to write report on logFile.
ActionmyAction
 Actual CamiTK action.
ActionStateWidgetmyStateWidget
 Widget containing:
QString name
 Name of the state action (may not be the same as the action's name)
QMap< QString, QString > outputComponentNames
QTime * startTime
 Keep track of time...

Constructor & Destructor Documentation

ActionState::ActionState ( QState *  parent,
QString  name,
QString  description,
QTextStream *  logStream = NULL 
)

Member Function Documentation

ActionTransition * ActionState::addActionTransition ( QString  buttonText,
QAbstractState *  nextState,
bool  applyAction = true,
QVector< Action::ApplyStatus disableConditions = QVector<Action::ApplyStatus>() 
)

Adds a possible transition from this action.

References ActionStateWidget::addTransitionButton(), conditionalButtons, logStream, and myStateWidget.

Referenced by ActionStateMachine::createTransitions().

Action::ApplyStatus ActionState::applyAction ( )
virtual
QString ActionState::getDescription ( )

Returns the description of the action state (may be different from the description of the actual action)

References description.

Referenced by ActionStateWidget::ActionStateWidget().

QString ActionState::getName ( )

Returns the name of the action state (may be different from the name of the actual action)

References name.

Referenced by ActionStateWidget::ActionStateWidget().

ActionStateWidget * ActionState::getWidget ( )
void ActionState::onEntry ( QEvent *  event)
protectedvirtual

Reimplemented from QState.

References logStream, name, and startTime.

void ActionState::onExit ( QEvent *  event)
protectedvirtual

References logStream, and startTime.

void ActionState::setAction ( Action action,
QMap< QString, QVariant >  parameters,
QMap< QString, QString >  inputComponentNames,
QMap< QString, QString >  outputComponentNames 
)
void ActionState::setAleternativeDesc ( QString  altDescText,
QVector< Action::ApplyStatus statusList 
)

May change its description according to the previous action result.

References conditionalDescriptions.

Referenced by ActionStateMachine::createAllActionStates().

void ActionState::setFinal ( )
void ActionState::setPreviousActionStatus ( Action::ApplyStatus  status)

Member Data Documentation

QMap<Action::ApplyStatus, QVector<QPushButton * > > ActionState::conditionalButtons
protected

Buttons that should be disabled if the previous aciton state did not happen correctly.

Referenced by addActionTransition(), and setPreviousActionStatus().

QMap<Action::ApplyStatus, QString> ActionState::conditionalDescriptions
protected
QString ActionState::description
protected

Description of the state action may not be the same as the action's description but complementary.

Referenced by ActionState(), getDescription(), and setPreviousActionStatus().

QMap<QString, QString> ActionState::inputComponentNames
protected

Referenced by applyAction(), and setAction().

QTextStream* ActionState::logStream
protected

Log stream to write report on logFile.

Referenced by ActionState(), addActionTransition(), SaveActionState::applyAction(), applyAction(), onEntry(), and onExit().

Action* ActionState::myAction
protected
ActionStateWidget* ActionState::myStateWidget
protected

Widget containing:

  • the name of the state action
  • the description of the action
  • the action's widget
  • the buttons linking to the transitions

Referenced by ActionState(), addActionTransition(), getWidget(), setAction(), and setPreviousActionStatus().

QString ActionState::name
protected

Name of the state action (may not be the same as the action's name)

Referenced by ActionState(), getName(), and onEntry().

QMap<QString, QString> ActionState::outputComponentNames
protected

Referenced by applyAction(), and setAction().

QTime* ActionState::startTime
protected

Keep track of time...

Referenced by onEntry(), and onExit().


The documentation for this class was generated from the following files: