Go to the documentation of this file.
10 #ifndef FCF_DEVMGR_DEVICE_SENSOR_LCSIF_HPP
11 #define FCF_DEVMGR_DEVICE_SENSOR_LCSIF_HPP
14 #include <unordered_map>
17 #include <yaml-cpp/yaml.h>
24 #include <rad/mal/publisher.hpp>
43 void SetValue(
const fcf::common::Variant value);
70 fcf::common::Variant value);
79 std::unordered_map<std::string, ChannelData>
m_values;
96 template<
typename TOPIC_TYPE = fcfif::SensorTopicUnion>
116 SensorLcsIf(std::shared_ptr<fcf::devmgr::common::IDeviceConfig> config,
154 bool force_read =
true);
206 void PublishState(
const fcf::common::Variant& value);
215 void PublishSubstate(
const fcf::common::Variant& value);
217 void PublishError(
const fcf::common::Variant& value);
219 void PublishChannel(
const std::string channel,
220 const fcf::common::Variant& value);
239 #include "sensorLcsIf.ipp"
241 #endif //FCF_DEVMGR_DEVICE_SENSOR_LCSIF_HPP
DataContext class header file.
void GetChannelValue(std::string channel, ChannelData &data)
void GetValue(int &value) const
void StopMonitoring()
Stop monitoring of controller attributes.
void GetValue(bool &value) const
std::unordered_map< std::string, ChannelData > m_values
Definition: sensorLcsIf.hpp:79
virtual bool IsOperational()
Check if controller is in Operational.
The sensorControllerData struct.
Definition: sensorLcsIf.hpp:60
void SetData(const SensorControllerData &data)
Definition: sensorLcsIf.cpp:36
friend std::ostream & operator<<(std::ostream &dest, const ChannelData &obj)
Definition: sensorLcsIf.cpp:24
virtual bool IsNotReady()
Check if controller is in Standby/NotReady state.
void ClearChannelValues()
void SetChannelValue(std::string channel, fcf::common::Variant value)
Sensor Local Control System (LCS) Interface (IF) class.
Definition: sensorLcsIf.hpp:97
virtual void ReadStatus(SensorControllerData &status, bool force_read=true)
Read status from the controller.
std::string GetErrorText() const
bool IsHwFailure()
Check if Sensor is in hardware error.
ChannelData()
Definition: sensorLcsIf.cpp:18
virtual ~SensorControllerData()
Definition: sensorLcsIf.cpp:33
deviceLcsIf class header file.
void Listener(fcf::common::VectorVariant ¶ms)
Callback to manage changes on the monitored items.
std::unordered_map< std::string, std::string > m_channels_map
Definition: sensorLcsIf.hpp:228
fcf::common::Variant GetRawValue() const
virtual ~SensorLcsIf()
Default destructor.
Definition: sensorLcsIf.hpp:122
Definition: sensor.hpp:21
std::unique_ptr< rad::cii::Publisher< TOPIC_TYPE > > m_publisher
Definition: sensorLcsIf.hpp:230
Definition: dataContext.hpp:92
void SetValue(const fcf::common::Variant value)
virtual std::string GetSubstateStr() const
void StartMonitoring()
Start monitoring of controller attributes.
Definition: deviceLcsIf.hpp:75
SensorLcsIf(std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config, fcf::devmgr::common::DataContext &data_ctx, bool initialise=true)
sensorLcsIf constructor.
virtual std::string GetRpcError(const short error_code) const
void GetValue(double &value) const
The ChannelData struct.
Definition: sensorLcsIf.hpp:33
SensorConfig class header file.
SensorControllerData()
Definition: sensorLcsIf.cpp:29
virtual ~ChannelData()
Definition: sensorLcsIf.cpp:21
The DeviceControllerData struct.
Definition: deviceLcsIf.hpp:34
std::unordered_map< std::string, ChannelData > m_channel_values
Definition: sensorLcsIf.hpp:229
virtual bool IsReady()
Check if controller is in Standby/Ready state.
fcf::common::Variant m_value
Definition: sensorLcsIf.hpp:48