ifw-fcf  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
13 #include <fcf/common/dispatcher.hpp>
14 
19 
20 namespace fcf::devmgr::motor {
21 
22 
40  {
41 
42  enum {
43  POS_TARGET = 0,
44  POS_ACTUAL,
45  SCALE_FACTOR,
46  AXIS_STATUS,
47  BCKLASHSTEP,
48  LAST_CMD,
49  ERROR_CODE,
50  INIT_STEP,
51  REF_SWITCH,
52  AT_MAX_POS,
53  AT_MAX_POS_VAL,
54  AT_MIN_POS,
55  AT_MIN_POS_VAL,
56  INFO_DATA1,
57  INFO_DATA2,
58  SWITCH_LHW,
59  BRAKE_ACTIVE,
60  LOCAL,
61  SWITCH_INDEX,
62  SWITCH_REF,
63  VEL_TARGET,
64  VEL_ACTUAL,
65  SWITCH_LSTOP,
66  SWITCH_USTOP
67  };
68 
69  public:
76  Motor(const std::string filename,
77  const std::string name,
78  devmgr::common::DataContext& data_ctx);
79 
80 
84  virtual ~Motor() {};
85 
97  void CreateObjects(std::shared_ptr<devmgr::common::IDeviceConfig> config = nullptr);
98 
114  void RegisterComm(std::shared_ptr<fcf::common::IComm> comm_if,
115  fcf::common::Dispatcher<>& failure,
116  fcf::common::Dispatcher<>& normal);
117 
125  virtual void Setup(const std::any& payload);
126 
134  virtual bool IsSetupActive(const std::any& payload) const;
135 
141  virtual void Status(const std::any& payload, std::string& buffer);
142 
153  virtual void Status(bool end_acq,
154  const dit::did::Did& dictionary,
155  std::shared_ptr<CCfits::FITS>& fits_handle);
156  //CCfits::FITS* fits_handle = nullptr);
157 
170  virtual void UpdateStatus();
171 
172  virtual std::shared_ptr<devmgr::common::DeviceLcsIf> GetLcsIf() const;
173 
179  virtual std::shared_ptr<devmgr::common::IDeviceConfig> GetConfig() const;
180 
181  void SetTargetNamedPosition(const std::string named_position);
182  const std::string GetTargetNamedPosition();
183 
184  protected:
187  std::string m_target_named_pos;
188 
190  std::shared_ptr<MotorConfig> m_config;
192  std::shared_ptr<MotorLcsIf<fcfif::MotorTopicUnion>> m_lcs_if;
193  };
194 
195 }
196 
197 
198 #endif //FCF_DEVMGR_DEVICE_MOTOR_HPP
ShutterLcsIf class header file.
Device class header file.
void CreateObjects(std::shared_ptr< devmgr::common::IDeviceConfig > config=nullptr)
Create object instances.
Definition: motor.cpp:37
virtual void Status(const std::any &payload, std::string &buffer)
Obtain the status of the device.
Definition: motor.cpp:360
MotorControllerData m_controller_status
&lt; object containing the status of the controller
Definition: motor.hpp:186
void SetTargetNamedPosition(const std::string named_position)
Definition: motor.cpp:252
virtual void Setup(const std::any &payload)
Executes a setup of the motor device.
Definition: motor.cpp:122
virtual void UpdateStatus()
Update the status of the motor device in the OLDB.
Definition: motor.cpp:265
virtual std::shared_ptr< devmgr::common::IDeviceConfig > GetConfig() const
Get a pointer of device configuration.
Definition: motor.cpp:116
Definition: device.hpp:30
const std::string GetTargetNamedPosition()
Definition: motor.cpp:259
void RegisterComm(std::shared_ptr< fcf::common::IComm > comm_if, fcf::common::Dispatcher<> &failure, fcf::common::Dispatcher<> &normal)
Register a communication interface object.
Definition: motor.cpp:100
DataContext class header file.
The MotorControllerData struct.
Definition: motorLcsIf.hpp:34
virtual ~Motor()
Default destructor.
Definition: motor.hpp:84
Definition: dataContext.hpp:81
std::shared_ptr< MotorLcsIf< fcfif::MotorTopicUnion > > m_lcs_if
Definition: motor.hpp:192
std::shared_ptr< MotorConfig > m_config
Local Control System Interface.
Definition: motor.hpp:190
std::string m_target_named_pos
pointer to device config object
Definition: motor.hpp:187
virtual std::shared_ptr< devmgr::common::DeviceLcsIf > GetLcsIf() const
Get a pointer of device LCS interface.
Definition: motor.cpp:111
The Motor class.
Definition: motor.hpp:39
MotorConfig class header file.
virtual bool IsSetupActive(const std::any &payload) const
Check if last setup message is still active.
Definition: motor.cpp:200
Motor(const std::string filename, const std::string name, devmgr::common::DataContext &data_ctx)
Motor constructor.
Definition: motor.cpp:28