ifw-fcf  4.1.0-pre2
motorLcsIf.hpp
Go to the documentation of this file.
1 
9 #ifndef FCF_DEVMGR_DEVICE_MOTOR_IF_HPP
10 #define FCF_DEVMGR_DEVICE_MOTOR_IF_HPP
11 
12 // System headers
13 #include <unordered_map>
14 
15 // Third party headers
16 #include <yaml-cpp/yaml.h>
17 
21 
22 #include <Fcfif.hpp>
23 #include <rad/mal/publisher.hpp>
24 
25 namespace fcf::devmgr::motor {
26 
35  public:
37  virtual ~MotorControllerData();
38 
39  inline double GetScaleFactor() const;
40  inline void SetScaleFactor(double scale);
41 
42  inline bool GetBrakeFlag() const;
43  inline void SetBrakeFlag(bool flag);
44 
45  inline bool GetEnableFlag() const;
46  inline void SetEnableFlag(bool flag);
47 
48  inline bool GetLockFlag() const;
49  inline void SetLockFlag(bool flag);
50 
51  inline int GetMode() const;
52  inline void SetMode(int mode);
53 
54  inline bool GetReadyFlag() const;
55  inline void SetReadyFlag(bool flag);
56 
57  inline bool GetInPositionFlag() const;
58  inline void SetInPositionFlag(bool flag);
59 
60  inline short GetInfoData1() const;
61  inline void SetInfoData1(short info);
62 
63  inline short GetInfoData2() const;
64  inline void SetInfoData2(short info);
65 
66  inline bool GetSignalFlag(Signal signal) const;
67  inline void SetSignalFlag(Signal signal, bool flag);
68 
69  inline virtual std::string GetErrorText() const;
70 
71  void SetData(const MotorControllerData& data);
72 
73  protected:
74  double m_scale_factor {1};
75  bool m_brake {false};
76  bool m_enabled {false};
77  bool m_locked {false};
78  int m_mode {};
79  bool m_ready {false};
80  bool m_in_position {false};
81  int m_info_data1 {};
82  int m_info_data2 {};
83  std::vector<bool> m_signals;
84  };
85 
100  {
101  public:
102  enum {
121  };
122 
123  public:
124 
133  MotorLcsIf(std::shared_ptr<fcf::devmgr::common::IDeviceConfig> config,
135 
139  virtual ~MotorLcsIf() {};
140 
141 
150  virtual void InitObject();
151 
161  virtual void ReadStatus(MotorControllerData& status);
162 
174  void Listener(fcf::common::VectorVariant& params);
175 
181  virtual std::string GetRpcError(const short error_code) const;
182 
183 
184  protected:
185 
194  void StorePosition(const fcf::common::Variant& value,
195  int attribute);
196 
197 
198  protected:
199 
202  int m_mot_mode {};
205  bool m_mot_axis_ready {false};
206  bool m_mot_axis_enable {false};
207  bool m_mot_axis_brake {false};
208  bool m_mot_axis_lock {false};
209  bool m_mot_axis_inpos {false};
210  bool m_mot_signal_lstop {false};
211  bool m_mot_signal_lhw {false};
212  bool m_mot_signal_ref {false};
213  bool m_mot_signal_index {false};
214  bool m_mot_signal_uhw {false};
215  bool m_mot_signal_ustop {false};
216 
217  private:
218  log4cplus::Logger m_logger;
219 
220 
221  };
222 
223 }
224 
225 #include "motorLcsIf.ipp"
226 
227 #endif //FCF_DEVMGR_DEVICE_MOTOR_IF_HPP
fcf::devmgr::motor::MotorControllerData::SetEnableFlag
void SetEnableFlag(bool flag)
fcf::devmgr::motor::MotorControllerData::GetInfoData2
short GetInfoData2() const
fcf::devmgr::motor::MotorLcsIf::m_mot_axis_ready
bool m_mot_axis_ready
Definition: motorLcsIf.hpp:205
fcf::devmgr::motor::MotorLcsIf::STAT_AXIS_LOCK
@ STAT_AXIS_LOCK
Definition: motorLcsIf.hpp:105
dataContext.hpp
DataContext class header file.
fcf::devmgr::motor::MotorControllerData::SetMode
void SetMode(int mode)
fcf::devmgr::motor::MotorLcsIf::STAT_INIT_STEP
@ STAT_INIT_STEP
Definition: motorLcsIf.hpp:111
fcf::devmgr::motor
Definition: motor.hpp:20
fcf::devmgr::motor::MotorControllerData::SetLockFlag
void SetLockFlag(bool flag)
fcf::devmgr::motor::MotorControllerData::GetInfoData1
short GetInfoData1() const
fcf::devmgr::motor::MotorLcsIf::STAT_AXIS_INFO1
@ STAT_AXIS_INFO1
Definition: motorLcsIf.hpp:109
fcf::devmgr::motor::MotorLcsIf::m_mot_mode
int m_mot_mode
Definition: motorLcsIf.hpp:202
fcf::devmgr::motor::MotorControllerData::SetScaleFactor
void SetScaleFactor(double scale)
fcf::devmgr::motor::MotorLcsIf::ReadStatus
virtual void ReadStatus(MotorControllerData &status)
Read status from the controller.
Definition: motorLcsIf.cpp:80
fcf::devmgr::motor::MotorControllerData::m_brake
bool m_brake
Definition: motorLcsIf.hpp:75
fcf::devmgr::motor::MotorLcsIf::m_mot_axis_info2
short m_mot_axis_info2
Definition: motorLcsIf.hpp:204
fcf::devmgr::motor::MotorControllerData::m_ready
bool m_ready
Definition: motorLcsIf.hpp:79
fcf::devmgr::motor::MotorControllerData::GetErrorText
virtual std::string GetErrorText() const
fcf::devmgr::motor::MotorControllerData::GetSignalFlag
bool GetSignalFlag(Signal signal) const
fcf::devmgr::motor::MotorControllerData::GetMode
int GetMode() const
fcf::devmgr::motor::MotorLcsIf::m_mot_axis_inpos
bool m_mot_axis_inpos
Definition: motorLcsIf.hpp:209
fcf::devmgr::motor::MotorLcsIf::STAT_MODE
@ STAT_MODE
Definition: motorLcsIf.hpp:106
motorBaseLcsIf.hpp
ShutterLcsIf class header file.
fcf::devmgr::motor::MotorLcsIf::STAT_SIGNAL_LHW
@ STAT_SIGNAL_LHW
Definition: motorLcsIf.hpp:114
fcf::devmgr::motor::MotorLcsIf::STAT_SIGNAL_LSTOP
@ STAT_SIGNAL_LSTOP
Definition: motorLcsIf.hpp:113
fcf::devmgr::motor::MotorLcsIf::STAT_SIGNAL_REF
@ STAT_SIGNAL_REF
Definition: motorLcsIf.hpp:115
fcf::devmgr::motor::MotorControllerData::m_locked
bool m_locked
Definition: motorLcsIf.hpp:77
fcf::devmgr::motor::MotorLcsIf::STAT_SIGNAL_USTOP
@ STAT_SIGNAL_USTOP
Definition: motorLcsIf.hpp:118
fcf::devmgr::motor::MotorControllerData::GetLockFlag
bool GetLockFlag() const
fcf::devmgr::motor::Signal
Signal
Definition: motorConfig.hpp:128
fcf::devmgr::motor::MotorLcsIf::STAT_INIT_ACTION
@ STAT_INIT_ACTION
Definition: motorLcsIf.hpp:112
fcf::devmgr::motor::MotorLcsIf::MotorLcsIf
MotorLcsIf(std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config, fcf::devmgr::common::DataContext &data_ctx)
MotorLcsIf constructor.
Definition: motorLcsIf.cpp:28
fcf::devmgr::motor::MotorControllerData::GetInPositionFlag
bool GetInPositionFlag() const
fcf::devmgr::motor::MotorControllerData::GetBrakeFlag
bool GetBrakeFlag() const
fcf::devmgr::motor::MotorControllerData::m_info_data2
int m_info_data2
Definition: motorLcsIf.hpp:82
fcf::devmgr::motor::MotorBaseLcsIf::STAT_MOTOR_BASE_END
@ STAT_MOTOR_BASE_END
Definition: motorBaseLcsIf.hpp:89
fcf::devmgr::motor::MotorLcsIf::InitObject
virtual void InitObject()
Initialize object.
Definition: motorLcsIf.cpp:38
fcf::devmgr::motor::MotorControllerData::SetInPositionFlag
void SetInPositionFlag(bool flag)
fcf::devmgr::motor::MotorLcsIf::STAT_AXIS_ENABLE
@ STAT_AXIS_ENABLE
Definition: motorLcsIf.hpp:104
fcf::devmgr::motor::MotorControllerData::m_signals
std::vector< bool > m_signals
Definition: motorLcsIf.hpp:83
fcf::devmgr::motor::MotorLcsIf::STAT_AXIS_INFO2
@ STAT_AXIS_INFO2
Definition: motorLcsIf.hpp:110
fcf::devmgr::motor::MotorControllerData::MotorControllerData
MotorControllerData()
Definition: motorLcsIf.cpp:4
fcf::devmgr::motor::MotorLcsIf::~MotorLcsIf
virtual ~MotorLcsIf()
Default destructor.
Definition: motorLcsIf.hpp:139
fcf::devmgr::motor::MotorLcsIf::m_mot_axis_enable
bool m_mot_axis_enable
Definition: motorLcsIf.hpp:206
fcf::devmgr::motor::MotorLcsIf::STAT_MOTOR_END
@ STAT_MOTOR_END
Definition: motorLcsIf.hpp:120
fcf::devmgr::motor::MotorLcsIf::Listener
void Listener(fcf::common::VectorVariant &params)
Callback to manage changes on the monitored items.
Definition: motorLcsIf.cpp:98
fcf::devmgr::motor::MotorLcsIf::STAT_AXIS_INPOS
@ STAT_AXIS_INPOS
Definition: motorLcsIf.hpp:108
fcf::devmgr::motor::MotorLcsIf::m_mot_axis_lock
bool m_mot_axis_lock
Definition: motorLcsIf.hpp:208
fcf::devmgr::motor::MotorLcsIf::StorePosition
void StorePosition(const fcf::common::Variant &value, int attribute)
Store Position.
Definition: motorLcsIf.cpp:322
fcf::devmgr::motor::MotorControllerData::m_mode
int m_mode
Definition: motorLcsIf.hpp:78
fcf::devmgr::motor::MotorLcsIf::STAT_SIGNAL_UHW
@ STAT_SIGNAL_UHW
Definition: motorLcsIf.hpp:117
fcf::devmgr::common::DataContext
Definition: dataContext.hpp:90
fcf::devmgr::motor::MotorLcsIf::m_mot_axis_info1
short m_mot_axis_info1
Definition: motorLcsIf.hpp:203
fcf::devmgr::motor::MotorControllerData::m_in_position
bool m_in_position
Definition: motorLcsIf.hpp:80
fcf::devmgr::motor::MotorLcsIf::m_mot_init_action
int m_mot_init_action
Definition: motorLcsIf.hpp:201
fcf::devmgr::motor::MotorLcsIf::m_mot_signal_ref
bool m_mot_signal_ref
Definition: motorLcsIf.hpp:212
fcf::devmgr::motor::MotorControllerData::SetReadyFlag
void SetReadyFlag(bool flag)
fcf::devmgr::motor::MotorControllerData::SetInfoData1
void SetInfoData1(short info)
fcf::devmgr::motor::MotorBaseControllerData
The MotorBaseControllerData struct.
Definition: motorBaseLcsIf.hpp:34
fcf::devmgr::motor::MotorControllerData::~MotorControllerData
virtual ~MotorControllerData()
Definition: motorLcsIf.cpp:20
fcf::devmgr::motor::MotorLcsIf::m_mot_signal_ustop
bool m_mot_signal_ustop
Definition: motorLcsIf.hpp:215
fcf::devmgr::motor::MotorBaseLcsIf
Motor Local Control System (LCS) Interface (IF) class.
Definition: motorBaseLcsIf.hpp:75
fcf::devmgr::motor::MotorLcsIf::m_mot_signal_index
bool m_mot_signal_index
Definition: motorLcsIf.hpp:213
fcf::devmgr::motor::MotorControllerData::SetBrakeFlag
void SetBrakeFlag(bool flag)
fcf::devmgr::motor::MotorControllerData::m_scale_factor
double m_scale_factor
Definition: motorLcsIf.hpp:74
fcf::devmgr::motor::MotorLcsIf::GetRpcError
virtual std::string GetRpcError(const short error_code) const
Definition: motorLcsIf.cpp:289
fcf::devmgr::motor::MotorControllerData::GetEnableFlag
bool GetEnableFlag() const
fcf::devmgr::motor::MotorControllerData::SetSignalFlag
void SetSignalFlag(Signal signal, bool flag)
fcf::devmgr::motor::MotorLcsIf::STAT_SIGNAL_INDEX
@ STAT_SIGNAL_INDEX
Definition: motorLcsIf.hpp:116
fcf::devmgr::motor::MotorControllerData::GetReadyFlag
bool GetReadyFlag() const
fcf::devmgr::motor::MotorLcsIf::m_mot_signal_lstop
bool m_mot_signal_lstop
Definition: motorLcsIf.hpp:210
fcf::devmgr::motor::MotorLcsIf::m_mot_signal_lhw
bool m_mot_signal_lhw
Definition: motorLcsIf.hpp:211
fcf::devmgr::motor::MotorLcsIf::STAT_SCALE_FACTOR
@ STAT_SCALE_FACTOR
Definition: motorLcsIf.hpp:119
fcf::devmgr::motor::MotorControllerData::GetScaleFactor
double GetScaleFactor() const
fcf::devmgr::motor::MotorLcsIf::m_mot_signal_uhw
bool m_mot_signal_uhw
Definition: motorLcsIf.hpp:214
fcf::devmgr::motor::MotorControllerData::m_info_data1
int m_info_data1
Definition: motorLcsIf.hpp:81
fcf::devmgr::motor::MotorControllerData::SetInfoData2
void SetInfoData2(short info)
fcf::devmgr::motor::MotorControllerData::m_enabled
bool m_enabled
Definition: motorLcsIf.hpp:76
fcf::devmgr::motor::MotorLcsIf::STAT_AXIS_READY
@ STAT_AXIS_READY
Definition: motorLcsIf.hpp:107
motorConfig.hpp
MotorConfig class header file.
fcf::devmgr::motor::MotorControllerData::SetData
void SetData(const MotorControllerData &data)
Definition: motorLcsIf.cpp:23
fcf::devmgr::motor::MotorLcsIf::m_mot_init_step
int m_mot_init_step
Definition: motorLcsIf.hpp:200
fcf::devmgr::motor::MotorLcsIf::STAT_AXIS_BRAKE
@ STAT_AXIS_BRAKE
Definition: motorLcsIf.hpp:103
fcf::devmgr::motor::MotorLcsIf::m_mot_axis_brake
bool m_mot_axis_brake
Definition: motorLcsIf.hpp:207
fcf::devmgr::motor::MotorLcsIf
Motor Local Control System (LCS) Interface (IF) class.
Definition: motorLcsIf.hpp:100
fcf::devmgr::motor::MotorControllerData
The MotorControllerData struct.
Definition: motorLcsIf.hpp:34