Go to the documentation of this file.
10 #ifndef FCF_DEVMGR_DEVICE_IODEV_LCSIF_HPP
11 #define FCF_DEVMGR_DEVICE_IODEV_LCSIF_HPP
14 #include <unordered_map>
17 #include <yaml-cpp/yaml.h>
24 #include <rad/mal/publisher.hpp>
85 std::unordered_map<std::string, IODevData> m_values;
124 IODevLcsIf(std::shared_ptr<fcf::devmgr::common::IDeviceConfig> config,
152 void GetStates(
int& state,
int& substate)
override;
170 void Stop()
override;
192 void WriteOutputs(
const fcf::common::VectorVariant& channel_list);
193 void SetOutputs(
const fcf::common::VectorVariant& channel_list);
239 void Listener(fcf::common::VectorVariant& params);
246 virtual std::string
GetRpcError(
const short error_code)
const;
257 void PublishState(
const fcf::common::Variant& value);
266 void PublishSubstate(
const fcf::common::Variant& value);
268 void PublishError(
const fcf::common::Variant& value);
270 void PublishChannel(
const std::string channel,
271 const fcf::common::Variant& value);
276 std::unordered_map<std::string, std::string> m_channels_map;
277 std::unordered_map<std::string, IODevData> m_channel_values;
278 log4cplus::Logger m_logger;
283 #include "iodevLcsIf.ipp"
285 #endif //FCF_DEVMGR_DEVICE_IODEV_LCSIF_HPP
friend std::ostream & operator<<(std::ostream &dest, const IODevData &obj)
Definition: iodevLcsIf.cpp:24
@ STAT_CHANNEL
Definition: iodevLcsIf.hpp:111
void SetValue(const double &value)
DataContext class header file.
fcf::common::Variant GetRawValue() const
void StartMonitoring()
Start monitoring of controller attributes.
Definition: iodevLcsIf.cpp:274
void Listener(fcf::common::VectorVariant ¶ms)
Callback to manage changes on the monitored items.
Definition: iodevLcsIf.cpp:324
void GetValue(bool &value) const
std::string GetErrorText() const
void SetValue(const bool &value)
virtual void ReadStatus(IODevControllerData &status)
Read status from the controller.
Definition: iodevLcsIf.cpp:313
void SetValue(const int &value)
void Enable() override
Executes the Enable RPC.
Definition: iodevLcsIf.cpp:134
virtual void InitObject()
Initialize object.
Definition: iodevLcsIf.cpp:51
@ STAT_ERROR
Definition: iodevLcsIf.hpp:108
The ChannelData struct.
Definition: iodevLcsIf.hpp:33
The IODevControllerData struct.
Definition: iodevLcsIf.hpp:65
void ClearChannelValues()
void Stop() override
Executes the Stop RPC.
Definition: iodevLcsIf.cpp:144
virtual ~IODevControllerData()
Definition: iodevLcsIf.cpp:33
void StopMonitoring()
Stop monitoring of controller attributes.
Definition: iodevLcsIf.cpp:293
std::string m_named_value
Definition: iodevLcsIf.hpp:53
@ STAT_SUBSTATE
Definition: iodevLcsIf.hpp:110
virtual bool IsReady() const
Check if controller is in Standby/Ready state.
Definition: iodevLcsIf.cpp:150
deviceLcsIf class header file.
std::string GetNamedValue() const
virtual std::string GetSubstateStr() const
IODevConfig class header file.
Definition: dataContext.hpp:90
void GetStates(int &state, int &substate) override
Get states (state and substate) of the controller.
Definition: iodevLcsIf.cpp:120
void SetRawValue(const fcf::common::Variant &value)
Definition: deviceLcsIf.hpp:77
@ STAT_LOCAL
Definition: iodevLcsIf.hpp:107
@ STAT_STATE
Definition: iodevLcsIf.hpp:109
virtual bool IsOperational() const
Check if controller is in Operational.
Definition: iodevLcsIf.cpp:181
Sensor Local Control System (LCS) Interface (IF) class.
Definition: iodevLcsIf.hpp:103
void GetChannelValue(const std::string &channel, IODevData &data) const
void SetNamedValue(const std::string &value)
virtual ~IODevLcsIf()
Default destructor.
Definition: iodevLcsIf.hpp:130
virtual bool IsNotReady() const
Check if controller is in Standby/NotReady state.
Definition: iodevLcsIf.cpp:169
void SetData(const IODevControllerData &data)
Definition: iodevLcsIf.cpp:36
virtual ~IODevData()
Definition: iodevLcsIf.cpp:21
IODevLcsIf(std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config, fcf::devmgr::common::DataContext &data_ctx)
IODevLcsIf constructor.
Definition: iodevLcsIf.cpp:41
IODevControllerData()
Definition: iodevLcsIf.cpp:29
void WriteOutputs(const fcf::common::VectorVariant &channel_list)
Definition: iodevLcsIf.cpp:217
void SetChannelValue(const std::string &channel, const IODevData &value)
The DeviceControllerData struct.
Definition: deviceLcsIf.hpp:36
bool IsHwFailure() const
Check if Sensor is in hardware error.
Definition: iodevLcsIf.cpp:202
void GetValue(double &value) const
void GetValue(int &value) const
void SetOutputs(const fcf::common::VectorVariant &channel_list)
Definition: iodevLcsIf.cpp:250
virtual std::string GetRpcError(const short error_code) const
Definition: iodevLcsIf.cpp:391
IODevData()
Definition: iodevLcsIf.cpp:18
fcf::common::Variant m_value
Definition: iodevLcsIf.hpp:52