00001 #ifndef _ots_RunControlStateMachine_h_
00002 #define _ots_RunControlStateMachine_h_
00003
00004 #include "otsdaq-core/FiniteStateMachine/FiniteStateMachine.h"
00005 #include "otsdaq-core/ProgressBar/ProgressBar.h"
00006
00007 #include "toolbox/lang/Class.h"
00008 #include <string>
00009
00010
00011 namespace ots
00012 {
00013
00014 class RunControlStateMachine : public virtual toolbox::lang::Class
00015 {
00016
00017 public:
00018
00019 RunControlStateMachine(std::string name="Undefined Name");
00020 virtual ~RunControlStateMachine(void);
00021
00022 void reset(void);
00023 void setStateMachineName(std::string name){stateMachineName_ = name;}
00024
00025
00026
00027 virtual void stateInitial (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception){;}
00028
00029
00030
00031
00032
00033
00034 virtual void statePaused (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception){;}
00035
00036
00037
00038
00039
00040
00041 virtual void stateRunning (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception){;}
00042
00043
00044
00045
00046
00047 virtual void stateHalted (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception){;}
00048
00049
00050
00051
00052
00053
00054 virtual void stateConfigured (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception){;}
00055
00056 virtual void inError (toolbox::fsm::FiniteStateMachine& fsm) throw (toolbox::fsm::exception::Exception){;}
00057
00058 virtual void transitionConfiguring (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00059 virtual void transitionHalting (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00060 virtual void transitionInitializing(toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00061 virtual void transitionPausing (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00062 virtual void transitionResuming (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00063 virtual void transitionStarting (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00064 virtual void transitionStopping (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00065 virtual void enteringError (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception){;}
00066
00067
00068 xoap::MessageReference runControlMessageHandler(xoap::MessageReference message) throw (xoap::exception::Exception);
00069
00070 protected:
00071 FiniteStateMachine theStateMachine_;
00072 ProgressBar theProgressBar_;
00073 std::string stateMachineName_;
00074 };
00075
00076 }
00077
00078 #endif
00079