1 #ifndef _ots_SlowControlsVInterface_h_
2 #define _ots_SlowControlsVInterface_h_
4 #include "otsdaq/Configurable/Configurable.h"
5 #include "otsdaq/FiniteStateMachine/VStateMachine.h"
17 const std::string& interfaceUID,
19 const std::string& configurationPath)
20 :
Configurable(theXDAQContextConfigTree, configurationPath)
22 , interfaceUID_(interfaceUID)
23 , interfaceType_(interfaceType)
24 , mfSubject_(
"controls-" + interfaceType_ +
"-" + interfaceUID_)
25 , newAlarmCallback_(
nullptr)
29 __GEN_COUT__ << __E__;
30 __GEN_COUTV__(interfaceUID_);
31 __GEN_COUTV__(mfSubject_);
36 virtual void initialize() = 0;
39 virtual void subscribe(
const std::string& Name) = 0;
40 virtual void subscribeJSON(
const std::string& JSONNameString) = 0;
41 virtual void unsubscribe(
const std::string& Name)= 0;
42 virtual std::vector<std::string > getChannelList(
void) = 0;
43 virtual std::string getList(
const std::string& format) = 0;
44 virtual std::array<std::string, 4> getCurrentValue(
const std::string& Name) = 0;
45 virtual std::vector<std::vector<std::string>> getChannelHistory(
const std::string& Name,
int startTime,
int endTime) = 0;
46 virtual std::vector<std::vector<std::string>> getLastAlarms(
const std::string& pvName) = 0;
47 virtual std::vector<std::vector<std::string>> getAlarmsLog(
const std::string& pvName) = 0;
48 virtual std::vector<std::vector<std::string>> checkAlarmNotifications (
void) = 0;
50 virtual std::array<std::string, 9> getSettings(
const std::string& Name) = 0;
55 virtual void halt(
void)
override {;}
56 virtual void pause(
void)
override {;}
57 virtual void resume(
void)
override {;}
58 virtual void start(std::string )
override {;}
59 virtual void stop(
void)
override {;}
62 virtual bool running(
void)
override {
return false; }
64 void setNewAlarmCallback(std::function<
void()> callback) { newAlarmCallback_ = callback; }
67 const std::string interfaceUID_;
68 const std::string interfaceType_;
69 const std::string mfSubject_;
70 std::function<void()> newAlarmCallback_;
virtual void stop(void) override
by default do nothing on FSM transitions
virtual void pause(void) override
by default do nothing on FSM transitions
virtual bool running(void) override
States.
virtual void resume(void) override
by default do nothing on FSM transitions
virtual void configure(void) override
by default do nothing on FSM transitions
virtual void start(std::string) override
by default do nothing on FSM transitions
virtual void halt(void) override
by default do nothing on FSM transitions