otsdaq  3.11.00
ots::RunControlStateMachine Class Reference

#include <otsdaq/FiniteStateMachine/RunControlStateMachine.h>

+ Inheritance diagram for ots::RunControlStateMachine:
+ Collaboration diagram for ots::RunControlStateMachine:

Public Member Functions

 RunControlStateMachine (const std::string &name="Undefined Name")
 
void reset (void)
 
void setStateMachineName (const std::string &name)
 
const std::string & getErrorMessage (void) const
 
void setAsyncPauseExceptionMessage (const std::string &error)
 
void setAsyncStopExceptionMessage (const std::string &error)
 
template<class OBJECT >
void addStateTransition (toolbox::fsm::State from, toolbox::fsm::State to, const std::string &input, const std::string &transitionName, OBJECT *obj, void(OBJECT::*func)(toolbox::Event::Reference))
 
template<class OBJECT >
void addStateTransition (toolbox::fsm::State from, toolbox::fsm::State to, const std::string &input, const std::string &transitionName, const std::string &transitionParameter, OBJECT *obj, void(OBJECT::*func)(toolbox::Event::Reference))
 
virtual void stateInitial (toolbox::fsm::FiniteStateMachine &)
 
virtual void statePaused (toolbox::fsm::FiniteStateMachine &)
 
virtual void stateRunning (toolbox::fsm::FiniteStateMachine &)
 
virtual void stateHalted (toolbox::fsm::FiniteStateMachine &)
 
virtual void stateShutdown (toolbox::fsm::FiniteStateMachine &)
 
virtual void stateConfigured (toolbox::fsm::FiniteStateMachine &)
 
virtual void inError (toolbox::fsm::FiniteStateMachine &)
 
virtual void transitionConfiguring (toolbox::Event::Reference)
 
virtual void transitionHalting (toolbox::Event::Reference)
 
virtual void transitionShuttingDown (toolbox::Event::Reference)
 
virtual void transitionStartingUp (toolbox::Event::Reference)
 
virtual void transitionInitializing (toolbox::Event::Reference)
 
virtual void transitionPausing (toolbox::Event::Reference)
 
virtual void transitionResuming (toolbox::Event::Reference)
 
virtual void transitionStarting (toolbox::Event::Reference)
 
virtual void transitionStopping (toolbox::Event::Reference)
 
virtual void enteringError (toolbox::Event::Reference)
 
xoap::MessageReference runControlMessageHandler (xoap::MessageReference message)
 Run Control Messages. More...
 
unsigned int getSubsystemIterationIndex (void) const
 
bool isStandaloneSubsystem (void) const
 
bool isFirstIteration (void) const
 true on the very first call of a transition (all indices at their starting value)
 
unsigned int getSubsystemSyncStepIndex (void) const
 
void indicateSubsystemSyncStepWork (void)
 
void indicateSubsystemIterationWork (void)
 
void clearSubsystemIterationWork (void)
 
bool getSubsystemIterationWork (void)
 
unsigned int getIterationIndex (void)
 
unsigned int getSubIterationIndex (void)
 
unsigned int getMinReadyForEventGenerationStartIteration (void)
 
void indicateIterationWork (void)
 
void clearIterationWork (void)
 
bool getIterationWork (void)
 
void indicateSubIterationWork (void)
 
void clearSubIterationWork (void)
 
bool getSubIterationWork (void)
 
const std::string & getLastCommand (void)
 
const std::string & getLastAttemptedConfigureGroup (void)
 

Static Public Attributes

static const std::string FAILED_STATE_NAME = FiniteStateMachine::FAILED_STATE_NAME
 
static const std::string INITIAL_STATE_NAME = FiniteStateMachine::INITIAL_STATE_NAME
 
static const std::string HALTED_STATE_NAME = "Halted"
 
static const std::string PAUSED_STATE_NAME = "Paused"
 
static const std::string RUNNING_STATE_NAME = "Running"
 
static const std::string SHUTDOWN_STATE_NAME = "Shutdown"
 
static const std::string CONFIGURED_STATE_NAME = "Configured"
 
static const std::string SHUTDOWN_TRANSITION_NAME = "Shutdown"
 
static const std::string STARTUP_TRANSITION_NAME = "Startup"
 
static const std::string INIT_TRANSITION_NAME = "Initialize"
 
static const std::string ERROR_TRANSITION_NAME = FiniteStateMachine::ERROR_TRANSITION_NAME
 
static const std::string FAIL_TRANSITION_NAME = "Fail"
 
static const std::string CONFIGURE_TRANSITION_NAME = FiniteStateMachine::CONFIGURE_TRANSITION_NAME
 
static const std::string HALT_TRANSITION_NAME = "Halt"
 
static const std::string ABORT_TRANSITION_NAME = "Abort"
 
static const std::string PAUSE_TRANSITION_NAME = "Pause"
 
static const std::string RESUME_TRANSITION_NAME = "Resume"
 
static const std::string START_TRANSITION_NAME = "Start"
 
static const std::string STOP_TRANSITION_NAME = "Stop"
 

Protected Attributes

FiniteStateMachine theStateMachine_
 
ProgressBar theProgressBar_
 
std::atomic< bool > asyncFailureReceived_ {false}
 
std::atomic< bool > asyncPauseExceptionReceived_ {false}
 
std::atomic< bool > asyncStopExceptionReceived_ {false}
 
unsigned int subsystemIterationIndex_ = 0
 
unsigned int iterationIndex_ = 0
 
unsigned int subIterationIndex_ = 0
 
bool subsystemIterationWorkFlag_
 
bool iterationWorkFlag_
 
bool subIterationWorkFlag_
 
unsigned int minReadyForEventGenerationStartIteration_ = 0
 
toolbox::fsm::State lastIterationState_
 
std::string lastIterationCommand_
 
std::string lastAttemptedConfigureGroup_
 
std::string lastIterationResult_
 
unsigned int lastSubsystemIterationIndex_
 
unsigned int lastIterationIndex_
 
unsigned int lastSubIterationIndex_
 
std::map< toolbox::fsm::State, std::map< std::string, void(RunControlStateMachine::*)(toolbox::Event::Reference), std::less< std::string > > > stateTransitionFunctionTable_
 

Detailed Description

CoreSupervisorBase This class provides finite state machine functionality for otsdaq supervisors.

Definition at line 16 of file RunControlStateMachine.h.

Member Function Documentation

◆ getSubsystemSyncStepIndex()

unsigned int ots::RunControlStateMachine::getSubsystemSyncStepIndex ( void  ) const
inline

For steps that must be ordered across subsystems: the subsystem-iteration index under a top-level, or the plain iteration index when standalone (see VStateMachine).

Definition at line 156 of file RunControlStateMachine.h.

◆ runControlMessageHandler()

xoap::MessageReference RunControlStateMachine::runControlMessageHandler ( xoap::MessageReference  message)

Run Control Messages.

============================================================================== (RunControlStateMachine::stateMachineFunction_t) RunControlStateMachine::getTransitionName( const toolbox::fsm::State from, const std::string& transition) runControlMessageHandler Handles the command broadcast message from the Gateway Supervisor and maps the command to a transition function, allowing for multiple iteration passes through the transition function.

Definition at line 331 of file RunControlStateMachine.cc.

◆ stateConfigured()

virtual void ots::RunControlStateMachine::stateConfigured ( toolbox::fsm::FiniteStateMachine &  )
inlinevirtual
  1. XDAQ applications are configured.
  2. Run parameters have been distributed.
  3. Hardware is configured.
  4. I2O connections are established, no data is sent or read out.
  5. Triggers are not sent.

Reimplemented in ots::GatewaySupervisor, and ots::CoreSupervisorBase.

Definition at line 106 of file RunControlStateMachine.h.

◆ stateHalted()

virtual void ots::RunControlStateMachine::stateHalted ( toolbox::fsm::FiniteStateMachine &  )
inlinevirtual
  1. Control hierarchy is instantiated.
  2. XDAQ executives are running and configured.
  3. XDAQ applications are loaded and instantiated.
  4. DCS nodes are allocated.

Reimplemented in ots::GatewaySupervisor, and ots::CoreSupervisorBase.

Definition at line 96 of file RunControlStateMachine.h.

◆ stateInitial()

virtual void ots::RunControlStateMachine::stateInitial ( toolbox::fsm::FiniteStateMachine &  )
inlinevirtual

using stateMachineFunction_t = void (ots::RunControlStateMachine::* )(toolbox::Event::Reference); stateMachineFunction_t getTransitionFunction (const toolbox::fsm::State from, const std::string &transition);

Finite State Machine States

  1. Control Configuration and Function Manager are loaded.

Reimplemented in ots::GatewaySupervisor, and ots::CoreSupervisorBase.

Definition at line 76 of file RunControlStateMachine.h.

◆ statePaused()

virtual void ots::RunControlStateMachine::statePaused ( toolbox::fsm::FiniteStateMachine &  )
inlinevirtual
  1. XDAQ applications are running.
  2. Hardware is running.
  3. Triggers are accepted.
  4. Triggers are not sent.
  5. Data is sent / read out.

Reimplemented in ots::GatewaySupervisor, and ots::CoreSupervisorBase.

Definition at line 83 of file RunControlStateMachine.h.

◆ stateRunning()

virtual void ots::RunControlStateMachine::stateRunning ( toolbox::fsm::FiniteStateMachine &  )
inlinevirtual
  1. XDAQ applications are running.
  2. Hardware is running.
  3. Triggers are accepted.
  4. Triggers are sent.
  5. Data is sent / read out.

Reimplemented in ots::GatewaySupervisor, and ots::CoreSupervisorBase.

Definition at line 90 of file RunControlStateMachine.h.

◆ stateShutdown()

virtual void ots::RunControlStateMachine::stateShutdown ( toolbox::fsm::FiniteStateMachine &  )
inlinevirtual
  1. Power supplies are turned off.

Definition at line 99 of file RunControlStateMachine.h.


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