ifw-fcf 7.1.4
Loading...
Searching...
No Matches
iDevice.hpp
Go to the documentation of this file.
1
8#ifndef FCF_DEVMGR_COMMON_IDEVICE_HPP
9#define FCF_DEVMGR_COMMON_IDEVICE_HPP
10
11#include <any>
12
13#include <rad/getPayload.hpp>
14#include <ifw/core/dit/fits/fits.hpp>
15#include <ifw/core/protocol/base/dispatcher.hpp>
16
17// For convenience this macro has been added.
18// This allows you to register the second you inherited from Device class
19// without the need to include anything else
20
22#define REGISTER_DEVICE(T) static ifw::fcf::devmgr::common::DeviceMaker<T> maker(#T)
23
24
25namespace ifw::fcf {
26 namespace devmgr {
27 namespace common {
28
29 class IDeviceConfig;
30 class DeviceLcsIf;
38 class IDevice {
39
40 public:
41
42
47 virtual void CreateObjects(std::shared_ptr<ifw::fcf::devmgr::common::IDeviceConfig> config = nullptr)=0;
63 virtual void RegisterComm(std::shared_ptr<ifw::core::protocol::base::IComm> comm_if,
64 ifw::core::protocol::base::Dispatcher<>& failure,
65 ifw::core::protocol::base::Dispatcher<>& normal) = 0;
66
67
73 virtual bool IsNotReady() const = 0;
79 virtual bool IsReady() const = 0;
80
86 virtual bool IsOperational() const = 0;
87
93 virtual void CheckHwFailure() const = 0;
94
100 virtual bool IsDisabling() const = 0;
101
107 virtual void Init() = 0;
108
114 virtual void Enable() = 0;
115
121 virtual void Disable() = 0;
122
128 virtual void Stop() = 0;
129
135 virtual void Reset() = 0;
136
137
141 virtual void UpdateStatus() = 0;
142
150 virtual void Setup(const std::any& payload) = 0;
151
161 virtual bool IsSetupActive(const std::any& payload) const = 0;
162
168 virtual void Status(const std::any& payload, std::string& buffer) = 0;
169
170
181 virtual void Status(bool end_acq,
182 const ifw::core::dit::did::Did& dictionary,
183 std::shared_ptr<CCfits::FITS>& fits_handle) = 0;
184
192 virtual void Simulate(rad::AnyEvent const& last_event) = 0;
193
201 virtual void StopSim(rad::AnyEvent const& last_event) = 0;
202
210 virtual void Ignore(rad::AnyEvent const& last_event) = 0;
211
219 virtual void StopIgn(rad::AnyEvent const& last_event) = 0;
220
228 virtual void HwReset(rad::AnyEvent const& last_event) = 0;
229
237 virtual void HwInit(rad::AnyEvent const& last_event) = 0;
238
246 virtual void HwEnable(rad::AnyEvent const& last_event) = 0;
247
255 virtual void HwDisable(rad::AnyEvent const& last_event) = 0;
256
262 virtual std::shared_ptr<DeviceLcsIf> GetLcsIf() const noexcept = 0;
263
269 virtual std::shared_ptr<IDeviceConfig> GetConfig() const = 0;
270
274 virtual void StartMonitoring() = 0;
275
279 virtual void StopMonitoring() = 0;
280
284 virtual void WriteConfig() = 0;
285
290 virtual std::string GetName() const noexcept = 0;
291 };
292
293 }
294 }
295}
296
297
298#endif //FCF_DEVMGR_COMMON_IDEVICE_HPP
Device Configuration class.
Definition iDeviceConfig.hpp:29
Definition iDevice.hpp:38
virtual void StopSim(rad::AnyEvent const &last_event)=0
Executes a StopSim.
virtual std::shared_ptr< DeviceLcsIf > GetLcsIf() const noexcept=0
Get a pointer of device LCS interface.
virtual void CreateObjects(std::shared_ptr< ifw::fcf::devmgr::common::IDeviceConfig > config=nullptr)=0
Create basic objects needed by the device class.
virtual bool IsNotReady() const =0
Check if device is Standby/NotReady.
virtual void Stop()=0
Executes a Stop command.
virtual void HwEnable(rad::AnyEvent const &last_event)=0
Executes a hardware enable command.
virtual void Status(const std::any &payload, std::string &buffer)=0
Obtain the status of the device.
virtual bool IsOperational() const =0
Check if device is Operational.
virtual void StopIgn(rad::AnyEvent const &last_event)=0
Executes a StopIgn.
virtual std::shared_ptr< IDeviceConfig > GetConfig() const =0
Get a pointer of device configuration.
virtual void Simulate(rad::AnyEvent const &last_event)=0
Executes a Simulat.
virtual void RegisterComm(std::shared_ptr< ifw::core::protocol::base::IComm > comm_if, ifw::core::protocol::base::Dispatcher<> &failure, ifw::core::protocol::base::Dispatcher<> &normal)=0
Register a communication interface object.
virtual void HwDisable(rad::AnyEvent const &last_event)=0
Executes a hardware disable command.
virtual bool IsSetupActive(const std::any &payload) const =0
Check if setup is still active.
virtual void Setup(const std::any &payload)=0
Executes a setup.
virtual void Ignore(rad::AnyEvent const &last_event)=0
Executes a Ignore.
virtual void WriteConfig()=0
Write configuration into OLDB.
virtual void Status(bool end_acq, const ifw::core::dit::did::Did &dictionary, std::shared_ptr< CCfits::FITS > &fits_handle)=0
Obtain the status of the device.
virtual void Enable()=0
Executes a Enable command.
virtual void Reset()=0
Executes a Reset command.
virtual void HwInit(rad::AnyEvent const &last_event)=0
Executes a hardware init command.
virtual void UpdateStatus()=0
Update internal status by connecting to the LCS.
virtual bool IsDisabling() const =0
Check if device is disablig.
virtual void CheckHwFailure() const =0
Check if device is in failure state.
virtual void StopMonitoring()=0
Stop device monitoring.
virtual void HwReset(rad::AnyEvent const &last_event)=0
Executes a hardware reset command.
virtual void Disable()=0
Executes a Disable command.
virtual void Init()=0
Executes a Init command.
virtual std::string GetName() const noexcept=0
Get device name.
virtual void StartMonitoring()=0
Start device monitoring via OPCUA subscriptions.
virtual bool IsReady() const =0
Check if device is Standby/Ready.
ActionsEnable class source file.
Definition actionMgr.cpp:28
std::string const
Definition test{{cookiecutter.device_name|capitalize()}}.cpp:161