1 #ifndef _ots_ARTDAQSupervisor_h
2 #define _ots_ARTDAQSupervisor_h
4 #if __cplusplus > 201402L
5 #pragma GCC diagnostic push
6 #pragma GCC diagnostic ignored "-Wregister"
8 #pragma GCC diagnostic pop
16 #include "artdaq/ExternalComms/CommanderInterface.hh"
17 #include "otsdaq/CoreSupervisors/CoreSupervisorBase.h"
18 #include "otsdaq/TablePlugins/ARTDAQTableBase/ARTDAQTableBase.h"
45 virtual void transitionConfiguring(toolbox::Event::Reference event)
override;
48 virtual void transitionPausing(toolbox::Event::Reference event)
override;
49 virtual void transitionResuming(toolbox::Event::Reference event)
override;
50 virtual void transitionStarting(toolbox::Event::Reference event)
override;
51 virtual void transitionStopping(toolbox::Event::Reference event)
override;
52 virtual void enteringError(toolbox::Event::Reference event)
override;
53 virtual std::vector<SupervisorInfo::SubappInfo> getSubappInfo(
void)
override;
56 if(!theStateMachine_.isInTransition() &&
57 (theStateMachine_.getCurrentStateName() ==
58 RunControlStateMachine::HALTED_STATE_NAME ||
59 theStateMachine_.getCurrentStateName() ==
60 RunControlStateMachine::INITIAL_STATE_NAME))
63 std::lock_guard<std::mutex> lk(thread_mutex_);
65 return thread_progress_message_;
69 std::pair<DAQInterfaceProcessInfo, std::unique_ptr<artdaq::CommanderInterface>>>
70 makeCommandersFromProcessInfo();
72 static std::list<std::string> tokenize_(std::string
const& input);
75 void configuringThread(
void);
76 void startingThread(
void);
78 PyObject* daqinterface_ptr_;
79 std::recursive_mutex daqinterface_mutex_;
81 std::string daqinterface_state_;
82 std::unique_ptr<std::thread> runner_thread_;
83 std::atomic<bool> runner_running_;
85 std::mutex thread_mutex_;
87 std::string thread_progress_message_;
88 std::string thread_error_message_;
89 int last_thread_progress_read_;
90 time_t last_thread_progress_update_;
91 std::map<std::string, std::string> label_to_proc_type_map_;
93 void getDAQState_(
void);
94 std::string getProcessInfo_(
void);
95 std::string artdaqStateToOtsState(std::string state);
96 std::string labelToProcType_(std::string label);
97 std::list<DAQInterfaceProcessInfo> getAndParseProcessInfo_(
void);
98 void daqinterfaceRunner_(
void);
99 void stop_runner_(
void);
100 void start_runner_(
void);
101 void set_thread_message_(std::string msg)
103 std::lock_guard<std::mutex> lk(thread_mutex_);
104 thread_progress_message_ = msg;
virtual void transitionHalting(toolbox::Event::Reference event) override
virtual void transitionInitializing(toolbox::Event::Reference event) override
virtual std::string getStatusProgressDetail(void) override
virtual std::string getStatusProgressDetail(void)