ifw-fcf  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sensor.hpp
Go to the documentation of this file.
1 
10 #ifndef FCF_DEVMGR_DEVICE_SENSOR_HPP
11 #define FCF_DEVMGR_DEVICE_SENSOR_HPP
12 
13 #include <fcf/common/dispatcher.hpp>
14 
20 
21 namespace fcf::devmgr::sensor {
22 
42 
43  public:
50  Sensor(const std::string& filename,
51  const std::string& name,
53 
57  virtual ~Sensor() {};
58 
70  void CreateObjects(std::shared_ptr<fcf::devmgr::common::IDeviceConfig> config = nullptr) override;
71 
87  void RegisterComm(std::shared_ptr<fcf::common::IComm> comm_if,
88  fcf::common::Dispatcher<>& failure,
89  fcf::common::Dispatcher<>& normal) override;
90 
96  virtual bool IsDisabling() const override;
97 
103  virtual void Enable() override;
104 
110  virtual void Disable() override;
111 
117  virtual void Stop() override;
118 
126  virtual void HwReset(rad::AnyEvent const& last_event) override;
127 
135  virtual void HwInit(rad::AnyEvent const& last_event) override;
136 
144  virtual void HwEnable(rad::AnyEvent const& last_event) override;
145 
153  virtual void HwDisable(rad::AnyEvent const& last_event) override;
154 
162  virtual void Setup(const std::any& payload) override;
163 
176  virtual bool IsSetupActive(const std::any& payload) const override;
177 
183  virtual void Status(const std::any& payload, std::string& buffer) override;
184 
195  virtual void Status(bool end_acq,
196  const dit::did::Did& dictionary,
197  std::shared_ptr<CCfits::FITS>& fits_handle) override;
204  virtual void UpdateStatus() override;
205 
210  virtual std::shared_ptr<fcf::devmgr::common::DeviceLcsIf> GetLcsIf() const override;
211 
217  virtual std::shared_ptr<fcf::devmgr::common::IDeviceConfig> GetConfig() const override;
218 
219  protected:
222  fcf::common::VectorVariant m_sensor_list;
224  std::shared_ptr<SensorConfig> m_config;
225 
226  // Local Control System Interface
227  std::shared_ptr<SensorLcsIf<fcfif::SensorTopicUnion>> m_lcs_if;
228  };
229 }
230 
231 
232 #endif //FCF_DEVMGR_DEVICE_SENSOR_HPP
Device class header file.
SensorConfig class header file.
sensorLcsIf class header file.
virtual void HwInit(rad::AnyEvent const &last_event) override
Executes a hardware init command.
Definition: sensor.cpp:173
virtual void Disable() override
Executes a Disable command.
Definition: sensor.cpp:133
SensorControllerData m_controller_status
&lt; object containing the status of the controller
Definition: sensor.hpp:221
std::shared_ptr< SensorLcsIf< fcfif::SensorTopicUnion > > m_lcs_if
Definition: sensor.hpp:227
virtual void Enable() override
Executes a Enable command.
Definition: sensor.cpp:120
virtual void HwReset(rad::AnyEvent const &last_event) override
Executes a hardware reset command.
Definition: sensor.cpp:159
std::shared_ptr< SensorConfig > m_config
Definition: sensor.hpp:224
fcf::common::VectorVariant m_sensor_list
pointer to device config object
Definition: sensor.hpp:222
The sensorControllerData struct.
Definition: sensorLcsIf.hpp:60
virtual void HwDisable(rad::AnyEvent const &last_event) override
Executes a hardware disable command.
Definition: sensor.cpp:201
void CreateObjects(std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config=nullptr) override
Create object instances.
Definition: sensor.cpp:34
virtual std::shared_ptr< fcf::devmgr::common::DeviceLcsIf > GetLcsIf() const override
Definition: sensor.cpp:108
Definition: device.hpp:30
IDeviceConfig class header file.
virtual bool IsDisabling() const override
Check if sensor is disablig.
Definition: sensor.cpp:215
virtual void Setup(const std::any &payload) override
Executes a setup of the sensor device.
Definition: sensor.cpp:222
DataContext class header file.
virtual void UpdateStatus() override
Update the status of the Sensor device in the OLDB.
Definition: sensor.cpp:239
Definition: dataContext.hpp:81
virtual ~Sensor()
Default destructor.
Definition: sensor.hpp:57
virtual bool IsSetupActive(const std::any &payload) const override
Check if last setup message is still active.
Definition: sensor.cpp:229
void RegisterComm(std::shared_ptr< fcf::common::IComm > comm_if, fcf::common::Dispatcher<> &failure, fcf::common::Dispatcher<> &normal) override
Register a communication interface object.
Definition: sensor.cpp:98
Sensor(const std::string &filename, const std::string &name, fcf::devmgr::common::DataContext &data_ctx)
Sensor constructor.
Definition: sensor.cpp:27
virtual std::shared_ptr< fcf::devmgr::common::IDeviceConfig > GetConfig() const override
Get a pointer of device configuration.
Definition: sensor.cpp:114
The Sensor class.
Definition: sensor.hpp:41
virtual void Status(const std::any &payload, std::string &buffer) override
Obtain the status of the device.
Definition: sensor.cpp:295
virtual void Stop() override
Executes a Stop command.
Definition: sensor.cpp:146
virtual void HwEnable(rad::AnyEvent const &last_event) override
Executes a hardware enable command.
Definition: sensor.cpp:187