9 #ifndef FCF_DEVMGR_DEVICE_ADC_IF_HPP
10 #define FCF_DEVMGR_DEVICE_ADC_IF_HPP
12 #include <unordered_map>
14 #include <yaml-cpp/yaml.h>
19 namespace fcf::devmgr::adc {
51 inline void AddMotor(
const std::string motor,
54 inline void GetMotorNames(std::vector<std::string>& motor_vector);
61 std::map<std::string, fcf::devmgr::motor::MotorControllerData>
m_motors;
79 template<
typename TOPIC_TYPE = fcfif::AdcTopicUnion>
88 STAT_TRACK_MODE = 104,
99 AdcLcsIf(std::shared_ptr<AdcConfig> config,
120 void MoveAbs(
int axis_id,
double position,
double velocity);
128 void MoveRel(
int axis_id,
double position,
double velocity);
139 void MoveVel(
int axis_id,
double velocity);
166 std::string
GetMotorMapValue(std::string motor, std::string category, std::string key);
221 void Listener(fcf::common::VectorVariant& params);
228 virtual std::string
GetRpcError(
const short error_code)
const;
251 void StoreAttribute(
const std::string key,
252 const fcf::common::Variant& value,
263 void PublishPosition(
const std::string nodeid_prefix,
264 const fcf::common::Variant& value,
267 void MovePos(
int axis_id,
double position,
double velocity,
274 std::unordered_map<std::string,
282 std::shared_ptr<AdcConfig> m_own_config;
287 YAML::Node m_motor_map_node;
292 #include "adcLcsIf.ipp"
294 #endif //FCF_DEVMGR_DEVICE_ADC_IF_HPP
void Listener(fcf::common::VectorVariant ¶ms)
Callback to manage changes on the monitored items.
void LoadConfig()
Load the YAML configuration.
ShutterLcsIf class header file.
void SetData(const AdcControllerData &data)
Definition: adcLcsIf.cpp:30
std::unordered_map< std::string, std::unique_ptr< rad::cii::Publisher< fcfif::MotorPositionTopic > > > m_motor_publisher_map
Definition: adcLcsIf.hpp:275
void StopTrackMonitoring()
void SetAlpha(double alpha)
The DeviceControllerData struct.
Definition: deviceLcsIf.hpp:31
short GetTrackingMode() const
void StopTrack()
StopTrack.
virtual std::string GetSubstateStr() const
AdcControllerData()
Definition: adcLcsIf.cpp:18
AdcConfig class header file.
short m_tracking_mode
Definition: adcLcsIf.hpp:57
std::map< std::string, fcf::devmgr::motor::MotorControllerData > m_motors
Definition: adcLcsIf.hpp:61
virtual void ReadStatus(AdcControllerData &status)
Read status from the controller.
void StartTrackMonitoring()
void AddMotor(const std::string motor, const devmgr::motor::MotorControllerData motor_data)
void ReadConfig()
Read the configuration.
void MoveAbs(int axis_id, double position, double velocity)
Executes the MoveAbs RPC.
void MoveVel(int axis_id, double velocity)
Executes the MoveVel RPC.
bool IsMoving()
Check if motor is moving.
bool IsStandstill()
Check if motor is on.
std::vector< std::string > m_monitor_track_vector
Special monitor vector of attributes to be monitored only in tracking mode.
Definition: adcLcsIf.hpp:272
constexpr auto RPC_MOVE_ABS
Definition: motorConfig.hpp:110
void GetMotorNames(std::vector< std::string > &motor_vector)
virtual std::string GetErrorText() const
virtual ~AdcLcsIf()
Default destructor.
Definition: adcLcsIf.hpp:105
Adc Local Control System (LCS) Interface (IF) class.
Definition: adcLcsIf.hpp:80
DataContext class header file.
The MotorControllerData struct.
Definition: motorLcsIf.hpp:34
virtual ~AdcControllerData()
Definition: adcLcsIf.cpp:27
void MoveRel(int axis_id, double position, double velocity)
Executes the MoveRel RPC.
void MoveAngle(double angle)
Move adc to a position angle.
Definition: dataContext.hpp:81
double m_delta
Definition: adcLcsIf.hpp:59
void StopMonitoring()
Stop monitoring of controller attributes.
devmgr::motor::MotorControllerData & GetMotor(std::string motor)
std::unique_ptr< rad::cii::Publisher< TOPIC_TYPE > > m_publisher
Definition: adcLcsIf.hpp:276
bool IsTracking()
Check if adc is tracking.
AdcLcsIf(std::shared_ptr< AdcConfig > config, fcf::devmgr::common::DataContext &data_ctx)
adcLcsIf constructor.
virtual void Init()
Executes the Init RPC.
std::string GetMotorMapValue(std::string motor, std::string category, std::string key)
virtual std::string GetRpcError(const short error_code) const
Definition: deviceLcsIf.hpp:72
void SetTrackingMode(short mode)
double m_alpha
Definition: adcLcsIf.hpp:58
void SetDelta(double delta)
void StartTrack(double angle)
Start ADC tracking.
The adcControllerData struct.
Definition: adcLcsIf.hpp:28