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"
47 virtual void transitionConfiguring(toolbox::Event::Reference event)
override;
48 virtual void transitionHalting(toolbox::Event::Reference event)
override;
49 virtual void transitionInitializing(toolbox::Event::Reference event)
override;
50 virtual void transitionPausing(toolbox::Event::Reference event)
override;
51 virtual void transitionResuming(toolbox::Event::Reference event)
override;
52 virtual void transitionStarting(toolbox::Event::Reference event)
override;
53 virtual void transitionStopping(toolbox::Event::Reference event)
override;
54 virtual void enteringError(toolbox::Event::Reference event)
override;
56 std::list<std::pair<DAQInterfaceProcessInfo, std::unique_ptr<artdaq::CommanderInterface>>> makeCommandersFromProcessInfo();
58 static std::list<std::string> tokenize_(std::string
const& input);
60 void configuringThread(
void);
62 PyObject* daqinterface_ptr_;
63 std::recursive_mutex daqinterface_mutex_;
65 std::string daqinterface_state_;
66 std::unique_ptr<std::thread> runner_thread_;
67 std::atomic<bool> runner_running_;
70 std::mutex thread_mutex_;
72 std::string thread_error_message_;
73 int last_thread_progress_read_;
74 time_t last_thread_progress_update_;
77 void getDAQState_(
void);
78 std::string getProcessInfo_(
void);
79 std::list<DAQInterfaceProcessInfo> getAndParseProcessInfo_(
void);
80 void daqinterfaceRunner_(
void);
81 void stop_runner_(
void);
82 void start_runner_(
void);