ifw-fcf  3.0.0
shutterLcsIf.hpp
Go to the documentation of this file.
1 
10 #ifndef FCF_DEVMGR_DEVICE_SHUTTER_IF_HPP
11 #define FCF_DEVMGR_DEVICE_SHUTTER_IF_HPP
12 
13 // System headers
14 #include <unordered_map>
15 
16 // Third party headers
17 #include <yaml-cpp/yaml.h>
18 
19 #include <fcf/devmgr/common/events.rad.hpp>
20 
24 
25 #include <Fcfif.hpp>
26 #include <rad/mal/publisher.hpp>
27 
28 namespace fcf::devmgr::shutter {
29 
38  public:
40  virtual ~ShutterControllerData();
41 
42  inline std::string GetErrorText() const;
43  inline virtual std::string GetSubstateStr() const;
44 
45  void SetData(const ShutterControllerData& data);
46 
47  protected:
48 
49  };
50 
64  template<typename TOPIC_TYPE = fcfif::ShutterTopicUnion>
66  {
67 
68  public:
69 
77  ShutterLcsIf(std::shared_ptr<fcf::devmgr::common::IDeviceConfig> config,
78  fcf::devmgr::common::DataContext& data_ctx, bool initialise = true);
79 
80 
84  virtual ~ShutterLcsIf() {};
85 
90  virtual bool IsReady();
91 
96  virtual bool IsOperational();
97 
104  void Open();
105 
112  void Close();
113 
118  bool IsOpening();
119 
124  bool IsClosing();
125 
130  bool IsOpen();
131 
136  bool IsClose();
137 
143  bool force_read = true);
144 
156  void Listener(fcf::common::VectorVariant& params);
157 
163  virtual std::string GetRpcError(const short error) const;
164 
165  private:
166 
178  void StoreAttribute(const std::string key,
179  const fcf::common::Variant& value,
180  bool publish,
181  int attribute);
182 
183 
184  protected:
185  std::unique_ptr<rad::cii::Publisher<TOPIC_TYPE>> m_publisher;
186 
187  private:
188 
189  };
190 }
191 
192 #include "shutterLcsIf.ipp"
193 
194 #endif //FCF_DEVMGR_DEVICE_SHUTTER_IF_HPP
dataContext.hpp
DataContext class header file.
fcf::devmgr::shutter::ShutterLcsIf::~ShutterLcsIf
virtual ~ShutterLcsIf()
Default destructor.
Definition: shutterLcsIf.hpp:84
fcf::devmgr::shutter::ShutterControllerData::GetSubstateStr
virtual std::string GetSubstateStr() const
fcf::devmgr::shutter::ShutterLcsIf::ShutterLcsIf
ShutterLcsIf(std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config, fcf::devmgr::common::DataContext &data_ctx, bool initialise=true)
ShutterLcsIf constructor.
fcf::devmgr::shutter::ShutterLcsIf::Open
void Open()
Executes the Open RPC.
fcf::devmgr::shutter::ShutterControllerData::GetErrorText
std::string GetErrorText() const
fcf::devmgr::shutter::ShutterLcsIf::m_publisher
std::unique_ptr< rad::cii::Publisher< TOPIC_TYPE > > m_publisher
Definition: shutterLcsIf.hpp:185
fcf::devmgr::shutter::ShutterLcsIf::IsClosing
bool IsClosing()
Check if controller is closing the shutter.
fcf::devmgr::shutter::ShutterControllerData::~ShutterControllerData
virtual ~ShutterControllerData()
Definition: shutterLcsIf.cpp:20
fcf::devmgr::shutter::ShutterControllerData::SetData
void SetData(const ShutterControllerData &data)
fcf::devmgr::shutter::ShutterLcsIf::Close
void Close()
Executes the Close RPC.
deviceLcsIf.hpp
deviceLcsIf class header file.
fcf::devmgr::shutter::ShutterLcsIf::IsOperational
virtual bool IsOperational()
Check if controller is in Operational.
fcf::devmgr::shutter::ShutterControllerData
The ShutterControllerData struct.
Definition: shutterLcsIf.hpp:37
fcf::devmgr::common::DataContext
Definition: dataContext.hpp:92
fcf::devmgr::shutter::ShutterLcsIf::IsReady
virtual bool IsReady()
Check if controller is in Standby/Ready state.
fcf::devmgr::common::DeviceLcsIf
Definition: deviceLcsIf.hpp:75
shutterConfig.hpp
ShutterConfig class header file.
fcf::devmgr::shutter::ShutterLcsIf::IsClose
bool IsClose()
Check if shutter is close.
fcf::devmgr::shutter::ShutterLcsIf::IsOpen
bool IsOpen()
Check if shutter is open.
fcf::devmgr::shutter::ShutterLcsIf::Listener
void Listener(fcf::common::VectorVariant &params)
Callback to manage changes on the monitored items.
fcf::devmgr::shutter::ShutterControllerData::ShutterControllerData
ShutterControllerData()
Definition: shutterLcsIf.cpp:16
fcf::devmgr::shutter::ShutterLcsIf
Shutter Local Control System (LCS) Interface (IF) class.
Definition: shutterLcsIf.hpp:66
fcf::devmgr::common::DeviceControllerData
The DeviceControllerData struct.
Definition: deviceLcsIf.hpp:34
fcf::devmgr::shutter::ShutterLcsIf::GetRpcError
virtual std::string GetRpcError(const short error) const
fcf::devmgr::shutter::ShutterLcsIf::IsOpening
bool IsOpening()
Check if controller is opening the shutter.
fcf::devmgr::shutter::ShutterLcsIf::ReadStatus
virtual void ReadStatus(fcf::devmgr::common::DeviceControllerData &status, bool force_read=true)
Read status from the controller.
fcf::devmgr::shutter
Definition: shutter.hpp:21