ifw-fcf  3.0.0
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,
79 
80 
84  virtual ~Motor() {};
85 
97  void CreateObjects(std::shared_ptr<fcf::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<fcf::devmgr::common::DeviceLcsIf> GetLcsIf() const;
173 
179  virtual std::shared_ptr<fcf::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
fcf::devmgr::motor::Motor::Motor
Motor(const std::string filename, const std::string name, fcf::devmgr::common::DataContext &data_ctx)
Motor constructor.
Definition: motor.cpp:28
fcf::devmgr::motor::Motor::Setup
virtual void Setup(const std::any &payload)
Executes a setup of the motor device.
Definition: motor.cpp:122
dataContext.hpp
DataContext class header file.
fcf::devmgr::motor
Definition: motor.hpp:20
device.hpp
Device class header file.
fcf::devmgr::motor::Motor::SetTargetNamedPosition
void SetTargetNamedPosition(const std::string named_position)
Definition: motor.cpp:260
fcf::devmgr::motor::Motor::GetLcsIf
virtual std::shared_ptr< fcf::devmgr::common::DeviceLcsIf > GetLcsIf() const
Get a pointer of device LCS interface.
Definition: motor.cpp:111
motorLcsIf.hpp
ShutterLcsIf class header file.
fcf::devmgr::motor::Motor::GetTargetNamedPosition
const std::string GetTargetNamedPosition()
Definition: motor.cpp:267
fcf::devmgr::motor::Motor::Status
virtual void Status(const std::any &payload, std::string &buffer)
Obtain the status of the device.
Definition: motor.cpp:368
fcf::devmgr::motor::Motor::m_lcs_if
std::shared_ptr< MotorLcsIf< fcfif::MotorTopicUnion > > m_lcs_if
Definition: motor.hpp:192
fcf::devmgr::motor::Motor::GetConfig
virtual std::shared_ptr< fcf::devmgr::common::IDeviceConfig > GetConfig() const
Get a pointer of device configuration.
Definition: motor.cpp:116
fcf::devmgr::motor::Motor::m_controller_status
MotorControllerData m_controller_status
< object containing the status of the controller
Definition: motor.hpp:186
fcf::devmgr::motor::Motor::IsSetupActive
virtual bool IsSetupActive(const std::any &payload) const
Check if last setup message is still active.
Definition: motor.cpp:204
fcf::devmgr::common::DataContext
Definition: dataContext.hpp:92
fcf::devmgr::motor::Motor::RegisterComm
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
fcf::devmgr::motor::Motor::m_target_named_pos
std::string m_target_named_pos
pointer to device config object
Definition: motor.hpp:187
fcf::devmgr::motor::Motor::m_config
std::shared_ptr< MotorConfig > m_config
Local Control System Interface.
Definition: motor.hpp:190
fcf::devmgr::common::Device
Definition: device.hpp:30
fcf::devmgr::motor::Motor::UpdateStatus
virtual void UpdateStatus()
Update the status of the motor device in the OLDB.
Definition: motor.cpp:273
fcf::devmgr::motor::Motor::~Motor
virtual ~Motor()
Default destructor.
Definition: motor.hpp:84
fcf::devmgr::motor::Motor
The Motor class.
Definition: motor.hpp:40
fcf::devmgr::motor::Motor::CreateObjects
void CreateObjects(std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config=nullptr)
Create object instances.
Definition: motor.cpp:37
motorConfig.hpp
MotorConfig class header file.
fcf::devmgr::motor::MotorControllerData
The MotorControllerData struct.
Definition: motorLcsIf.hpp:34