ifw-fcf  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
iDevice.hpp
Go to the documentation of this file.
1 
9 #ifndef FCF_DEVMGR_COMMON_IDEVICE_HPP
10 #define FCF_DEVMGR_COMMON_IDEVICE_HPP
11 
12 #include <any>
13 
14 #include <rad/getPayload.hpp>
15 #include <dit/fits/fits.hpp>
16 #include <fcf/common/dispatcher.hpp>
17 
18 
19 // For convenience this macro has been added.
20 // This allows you to register the second you inherited from Device class
21 // without the need to include anything else
22 
24 #define REGISTER_DEVICE(T) static fcf::devmgr::common::DeviceMaker<T> maker(#T)
25 
26 namespace fcf {
27  namespace devmgr {
28  namespace common {
29 
30  class IDeviceConfig;
31  class DeviceLcsIf;
39  class IDevice {
40 
41  public:
42 
43 
48  virtual void CreateObjects(std::shared_ptr<fcf::devmgr::common::IDeviceConfig> config = nullptr)=0;
64  virtual void RegisterComm(std::shared_ptr<fcf::common::IComm> comm_if,
65  fcf::common::Dispatcher<>& failure,
66  fcf::common::Dispatcher<>& normal) = 0;
67 
68 
74  virtual bool IsNotReady() const = 0;
80  virtual bool IsReady() const = 0;
81 
87  virtual bool IsOperational() const = 0;
88 
94  virtual void CheckHwFailure() const = 0;
95 
101  virtual bool IsDisabling() const = 0;
102 
108  virtual void Init() = 0;
109 
115  virtual void Enable() = 0;
116 
122  virtual void Disable() = 0;
123 
129  virtual void Stop() = 0;
130 
136  virtual void Reset() = 0;
137 
138 
142  virtual void UpdateStatus() = 0;
143 
151  virtual void Setup(const std::any& payload) = 0;
152 
162  virtual bool IsSetupActive(const std::any& payload) const = 0;
163 
169  virtual void Status(const std::any& payload, std::string& buffer) = 0;
170 
171 
182  virtual void Status(bool end_acq,
183  const dit::did::Did& dictionary,
184  std::shared_ptr<CCfits::FITS>& fits_handle) = 0;
185 
193  virtual void Simulate(rad::AnyEvent const& last_event) = 0;
194 
202  virtual void StopSim(rad::AnyEvent const& last_event) = 0;
203 
211  virtual void Ignore(rad::AnyEvent const& last_event) = 0;
212 
220  virtual void StopIgn(rad::AnyEvent const& last_event) = 0;
221 
229  virtual void HwReset(rad::AnyEvent const& last_event) = 0;
230 
238  virtual void HwInit(rad::AnyEvent const& last_event) = 0;
239 
247  virtual void HwEnable(rad::AnyEvent const& last_event) = 0;
248 
256  virtual void HwDisable(rad::AnyEvent const& last_event) = 0;
257 
263  virtual std::shared_ptr<DeviceLcsIf> GetLcsIf() const = 0;
264 
270  virtual std::shared_ptr<IDeviceConfig> GetConfig() const = 0;
271 
275  virtual void StartMonitoring() = 0;
276 
280  virtual void StopMonitoring() = 0;
281 
282 
287  virtual std::string GetName() const = 0;
288  };
289 
290  }
291  }
292 }
293 
294 
295 #endif //FCF_DEVMGR_COMMON_IDEVICE_HPP
virtual void HwEnable(rad::AnyEvent const &last_event)=0
Executes a hardware enable command.
Definition: iDevice.hpp:39
virtual void StopSim(rad::AnyEvent const &last_event)=0
Executes a StopSim.
virtual void Disable()=0
Executes a Disable command.
virtual void Setup(const std::any &payload)=0
Executes a setup.
virtual void HwInit(rad::AnyEvent const &last_event)=0
Executes a hardware init command.
virtual std::shared_ptr< IDeviceConfig > GetConfig() const =0
Get a pointer of device configuration.
virtual void CheckHwFailure() const =0
Check if device is in failure state.
virtual bool IsReady() const =0
Check if device is Standby/Ready.
virtual std::shared_ptr< DeviceLcsIf > GetLcsIf() const =0
Get a pointer of device LCS interface.
virtual void Simulate(rad::AnyEvent const &last_event)=0
Executes a Simulat.
virtual void CreateObjects(std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config=nullptr)=0
Create basic objects needed by the device class.
virtual void Stop()=0
Executes a Stop command.
virtual void Reset()=0
Executes a Reset command.
virtual bool IsOperational() const =0
Check if device is Operational.
virtual void UpdateStatus()=0
Update internal status by connecting to the LCS.
virtual bool IsDisabling() const =0
Check if device is disablig.
virtual void StartMonitoring()=0
Start device monitoring via OPCUA subscriptions.
virtual void Status(const std::any &payload, std::string &buffer)=0
Obtain the status of the device.
virtual void Init()=0
Executes a Init command.
virtual void StopMonitoring()=0
Stop device monitoring.
virtual void HwDisable(rad::AnyEvent const &last_event)=0
Executes a hardware disable command.
deviceMaker class header file.
virtual void HwReset(rad::AnyEvent const &last_event)=0
Executes a hardware reset command.
virtual void Enable()=0
Executes a Enable command.
virtual void StopIgn(rad::AnyEvent const &last_event)=0
Executes a StopIgn.
virtual void Ignore(rad::AnyEvent const &last_event)=0
Executes a Ignore.
virtual void RegisterComm(std::shared_ptr< fcf::common::IComm > comm_if, fcf::common::Dispatcher<> &failure, fcf::common::Dispatcher<> &normal)=0
Register a communication interface object.
virtual bool IsSetupActive(const std::any &payload) const =0
Check if setup is still active.
virtual std::string GetName() const =0
Get device name.
virtual bool IsNotReady() const =0
Check if device is Standby/NotReady.