ifw-fcf 6.0.0
Loading...
Searching...
No Matches
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 <core/dit/fits/fits.hpp>
16#include <ifw/core/protocol/base/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
26namespace 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<protocol::base::IComm> comm_if,
65 protocol::base::Dispatcher<>& failure,
66 protocol::base::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 core::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 noexcept = 0;
264
270 virtual std::shared_ptr<IDeviceConfig> GetConfig() const = 0;
271
275 virtual void StartMonitoring() = 0;
276
280 virtual void StopMonitoring() = 0;
281
285 virtual void WriteConfig() = 0;
286
291 virtual std::string GetName() const noexcept = 0;
292 };
293
294 }
295 }
296}
297
298
299#endif //FCF_DEVMGR_COMMON_IDEVICE_HPP
Device Configuration class.
Definition: iDeviceConfig.hpp:31
Definition: iDevice.hpp:39
virtual bool IsDisabling() const =0
Check if device is disablig.
virtual void HwEnable(rad::AnyEvent const &last_event)=0
Executes a hardware enable command.
virtual void Init()=0
Executes a Init command.
virtual void WriteConfig()=0
Write configuration into OLDB.
virtual std::shared_ptr< IDeviceConfig > GetConfig() const =0
Get a pointer of device configuration.
virtual void Disable()=0
Executes a Disable command.
virtual std::string GetName() const noexcept=0
Get device name.
virtual std::shared_ptr< DeviceLcsIf > GetLcsIf() const noexcept=0
Get a pointer of device LCS interface.
virtual void HwDisable(rad::AnyEvent const &last_event)=0
Executes a hardware disable command.
virtual void Reset()=0
Executes a Reset command.
virtual void StopMonitoring()=0
Stop device monitoring.
virtual void UpdateStatus()=0
Update internal status by connecting to the LCS.
virtual void Ignore(rad::AnyEvent const &last_event)=0
Executes a Ignore.
virtual void Stop()=0
Executes a Stop command.
virtual bool IsReady() const =0
Check if device is Standby/Ready.
virtual void Setup(const std::any &payload)=0
Executes a setup.
virtual void Status(const std::any &payload, std::string &buffer)=0
Obtain the status of the device.
virtual void CheckHwFailure() const =0
Check if device is in failure state.
virtual void Enable()=0
Executes a Enable command.
virtual void StopIgn(rad::AnyEvent const &last_event)=0
Executes a StopIgn.
virtual bool IsNotReady() const =0
Check if device is Standby/NotReady.
virtual void CreateObjects(std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config=nullptr)=0
Create basic objects needed by the device class.
virtual void Simulate(rad::AnyEvent const &last_event)=0
Executes a Simulat.
virtual bool IsSetupActive(const std::any &payload) const =0
Check if setup is still active.
virtual bool IsOperational() const =0
Check if device is Operational.
virtual void StartMonitoring()=0
Start device monitoring via OPCUA subscriptions.
virtual void RegisterComm(std::shared_ptr< protocol::base::IComm > comm_if, protocol::base::Dispatcher<> &failure, protocol::base::Dispatcher<> &normal)=0
Register a communication interface object.
virtual void HwReset(rad::AnyEvent const &last_event)=0
Executes a hardware reset command.
virtual void HwInit(rad::AnyEvent const &last_event)=0
Executes a hardware init command.
virtual void StopSim(rad::AnyEvent const &last_event)=0
Executes a StopSim.
virtual void Status(bool end_acq, const core::dit::did::Did &dictionary, std::shared_ptr< CCfits::FITS > &fits_handle)=0
Obtain the status of the device.
deviceMaker class header file.
Definition: actionMgr.cpp:29
std::string const
Definition: test{{cookiecutter.device_name|capitalize()}}.cpp:161