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