ifw-fcf 6.0.0
Loading...
Searching...
No Matches
motor.hpp
Go to the documentation of this file.
1
10#ifndef FCF_DEVMGR_DEVICE_MOTOR_HPP
11#define FCF_DEVMGR_DEVICE_MOTOR_HPP
12
17
19
20
38 {
39
40 enum {
41 POS_TARGET = 0,
42 POS_ACTUAL,
43 SCALE_FACTOR,
44 AXIS_STATUS,
45 BCKLASHSTEP,
46 LAST_CMD,
47 ERROR_CODE,
48 INIT_STEP,
49 REF_SWITCH,
50 AT_MAX_POS,
51 AT_MAX_POS_VAL,
52 AT_MIN_POS,
53 AT_MIN_POS_VAL,
54 INFO_DATA1,
55 INFO_DATA2,
56 SWITCH_LHW,
57 BRAKE_ACTIVE,
58 LOCAL,
59 SWITCH_INDEX,
60 SWITCH_REF,
61 VEL_TARGET,
62 VEL_ACTUAL,
63 SWITCH_LSTOP,
64 SWITCH_USTOP
65 };
66
67 public:
74 Motor(const std::string filename,
75 const std::string name,
77
78
82 virtual ~Motor() = default;
83
95 void CreateObjects(std::shared_ptr<fcf::devmgr::common::IDeviceConfig> config = nullptr) override ;
96
104 virtual void Setup(const std::any& payload) override ;
105
113 virtual bool IsSetupActive(const std::any& payload) const override;
114
115
116
122 virtual void Status(const std::any& payload, std::string& buffer) override;
123
134 virtual void Status(bool end_acq,
135 const core::dit::did::Did& dictionary,
136 std::shared_ptr<CCfits::FITS>& fits_handle) override;
137
138
147 void GetStatusList(utils::bat::DbVector& cfg_status,
148 const MotorControllerData& status_data);
161 virtual void UpdateStatus() override;
162
163 void SetTargetNamedPosition(const std::string named_position);
164 const std::string GetTargetNamedPosition();
165
166 protected:
178 void GetStatusBuffer(const std::string& stat_prefix,
179 const MotorControllerData* const data,
180 std::string& buffer);
181
189 void GetStatusHeader(const std::string& prefix,
190 const MotorControllerData* const data,
191 bool end_acq,
192 const core::dit::did::Did& dictionary,
193 std::shared_ptr<CCfits::FITS>& fits_handle);
194
195 protected:
196 void HandleAction(const std::shared_ptr<fcfif::MotorDevice>& motor);
197
198
199 protected:
203
204 log4cplus::Logger m_logger;
205 };
206
207}
208
209
210#endif //FCF_DEVMGR_DEVICE_MOTOR_HPP
Definition: dataContext.hpp:90
Definition: device.hpp:33
The Motor class.
Definition: motor.hpp:38
void GetStatusList(utils::bat::DbVector &cfg_status, const MotorControllerData &status_data)
Get a vector with device status data.
Definition: motor.cpp:203
void CreateObjects(std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config=nullptr) override
Create object instances.
Definition: motor.cpp:35
void GetStatusBuffer(const std::string &stat_prefix, const MotorControllerData *const data, std::string &buffer)
Get status buffer.
Definition: motor.cpp:323
void HandleAction(const std::shared_ptr< fcfif::MotorDevice > &motor)
Definition: motor.cpp:51
virtual ~Motor()=default
Default destructor.
std::string m_target_named_pos
Definition: motor.hpp:202
void SetTargetNamedPosition(const std::string named_position)
Definition: motor.cpp:190
virtual void Setup(const std::any &payload) override
Executes a setup of the motor device.
Definition: motor.cpp:82
virtual void UpdateStatus() override
Update the status of the motor device in the OLDB.
Definition: motor.cpp:292
log4cplus::Logger m_logger
Definition: motor.hpp:204
void GetStatusHeader(const std::string &prefix, const MotorControllerData *const data, bool end_acq, const core::dit::did::Did &dictionary, std::shared_ptr< CCfits::FITS > &fits_handle)
Get device status for the data acquisition.
Definition: motor.cpp:440
virtual void Status(const std::any &payload, std::string &buffer) override
Obtain the status of the device.
Definition: motor.cpp:408
MotorControllerData m_controller_status
< object containing the status of the controller
Definition: motor.hpp:201
const std::string GetTargetNamedPosition()
Definition: motor.cpp:197
virtual bool IsSetupActive(const std::any &payload) const override
Check if last setup message is still active.
Definition: motor.cpp:115
DataContext class header file.
Device class header file.
MotorConfig class header file.
ShutterLcsIf class header file.
Definition: motor.hpp:18
The MotorControllerData struct.
Definition: motorLcsIf.hpp:34