tdaq-develop-2025-02-12
ots::RunControlStateMachine Class Reference

#include <otsdaq/FiniteStateMachine/RunControlStateMachine.h>

Inheritance diagram for ots::RunControlStateMachine:
ots::CoreSupervisorBase ots::GatewaySupervisor ots::ARTDAQDataManagerSupervisor ots::ARTDAQOnlineMonitorSupervisor ots::ARTDAQSupervisor ots::CodeEditorSupervisor ots::DataManagerSupervisor ots::FESupervisor ots::FEDataManagerSupervisor ots::ARTDAQFEDataManagerSupervisor

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 getIterationIndex (void)
 
unsigned int getSubIterationIndex (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 = "Initial"
 
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 = "Configure"
 
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_
 
volatile bool asyncFailureReceived_
 
volatile bool asyncPauseExceptionReceived_
 
volatile bool asyncStopExceptionReceived_
 
unsigned int iterationIndex_ = 0
 
unsigned int subIterationIndex_ = 0
 
bool iterationWorkFlag_
 
bool subIterationWorkFlag_
 
toolbox::fsm::State lastIterationState_
 
std::string lastIterationCommand_
 
std::string lastAttemptedConfigureGroup_
 
std::string lastIterationResult_
 
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 14 of file RunControlStateMachine.h.

Member Function Documentation

◆ 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 333 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 104 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 94 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 74 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 81 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 88 of file RunControlStateMachine.h.

◆ stateShutdown()

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

Definition at line 97 of file RunControlStateMachine.h.


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