8#ifndef FCF_DEVMGR_DEVICE_MAXIS_IF_HPP
9#define FCF_DEVMGR_DEVICE_MAXIS_IF_HPP
11#include <unordered_map>
13#include <yaml-cpp/yaml.h>
45 std::map<std::string, fcf::devmgr::motor::MotorControllerData> m_motors;
80 MAxisLcsIf(std::shared_ptr<ifw::fcf::devmgr::common::IDeviceConfig> config,
111 void MoveAbs(
int axis_id,
double position,
double velocity, ::fcfif::MotorPosUnit unit = ::fcfif::MotorPosUnit::UU);
119 void MoveRel(
int axis_id,
double position,
double velocity, ::fcfif::MotorPosUnit unit = ::fcfif::MotorPosUnit::UU);
126 void MoveEncAbs(
int axis_id,
long int encoders);
133 void MoveEncRel(
int axis_id,
long int encoders);
144 void MoveVel(
int axis_id,
double velocity);
152 void MoveAxes(
const std::vector<double>& positions);
206 void Listener(ifw::core::protocol::base::VectorVariant& params);
213 virtual std::string
GetRpcError(
const short error_code)
const;
222 std::string
GetMotorMapValue(std::string motor, std::string category, std::string key);
269 const ifw::core::protocol::base::Variant& value,
273 const ifw::core::protocol::base::Variant& value,
276 void MovePos(
int axis_id,
double position,
double velocity,
279 std::pair<std::string, std::string>
GetObjectInfo(
const std::string& map_value)
const;
283 std::vector<std::string> m_monitor_track_vector;
288 std::unique_ptr<elt::configng::CiiConfigDocument> m_motor_map_doc;
289 short m_track_mode {};
291 std::map<std::string, fcf::devmgr::motor::MotorControllerData> m_motors_status;
294 log4cplus::Logger m_logger;
299#include "maxisLcsIf.ipp"
Definition dataContext.hpp:86
Definition deviceLcsIf.hpp:84
MAxis Local Control System (LCS) Interface (IF) class.
Definition maxisLcsIf.hpp:61
bool AreAllInPosition() const
Check whether all motors are in position.
Definition maxisLcsIf.cpp:568
virtual void ReadStatus(MAxisControllerData &status)
Read status from the controller.
Definition maxisLcsIf.cpp:513
void StoreMotorPosition(const std::string nodeid_prefix, const ifw::core::protocol::base::Variant &value, int attribute)
Publish Position.
Definition maxisLcsIf.cpp:769
void UpdateTargetPositions(const std::vector< double > &positions)
UpdateTargetPositions.
Definition maxisLcsIf.cpp:299
std::pair< std::string, std::string > GetObjectInfo(const std::string &map_value) const
Definition maxisLcsIf.cpp:500
std::string GetMotorMapValue(std::string motor, std::string category, std::string key)
GetMotorMapValue.
Definition maxisLcsIf.cpp:478
void ReadConfig()
Read the configuration.
void MoveAbs(int axis_id, double position, double velocity, ::fcfif::MotorPosUnit unit=::fcfif::MotorPosUnit::UU)
Executes the MoveAbs RPC.
Definition maxisLcsIf.cpp:315
virtual void Init()
Executes the Init RPC.
Definition maxisLcsIf.cpp:168
void Listener(ifw::core::protocol::base::VectorVariant ¶ms)
Callback to manage changes on the monitored items.
Definition maxisLcsIf.cpp:628
void MoveAxesByName(std::string namedpos)
Definition maxisLcsIf.cpp:428
virtual void InitObject()
Initialize object.
Definition maxisLcsIf.cpp:78
void LoadConfig()
Load the YAML configuration.
std::optional< double > GetTargetInUserUnits(int axis_id, double value)
GetTargetInUserUnits.
Definition maxisLcsIf.cpp:243
void MoveRel(int axis_id, double position, double velocity, ::fcfif::MotorPosUnit unit=::fcfif::MotorPosUnit::UU)
Executes the MoveRel RPC.
Definition maxisLcsIf.cpp:338
void UpdateTargetPosition(int axis_id, double position, std::string move_type)
UpdateTargetPosition.
Definition maxisLcsIf.cpp:279
void MoveVel(int axis_id, double velocity)
Executes the MoveVel RPC.
Definition maxisLcsIf.cpp:384
virtual void AddCustomAttributes()
Add custom attributes.
Definition maxisLcsIf.cpp:158
MAxisLcsIf(std::shared_ptr< ifw::fcf::devmgr::common::IDeviceConfig > config, ifw::fcf::devmgr::common::DataContext &data_ctx)
adcLcsIf constructor.
Definition maxisLcsIf.cpp:69
bool IsInPosition(const std::string &axis_name) const
IsInPosition.
Definition maxisLcsIf.cpp:547
virtual std::string GetRpcError(const short error_code) const
Definition maxisLcsIf.cpp:599
void MoveEncAbs(int axis_id, long int encoders)
Move a motor in absolute encoder units.
Definition maxisLcsIf.cpp:360
bool IsStandstill() const
IsStandstill.
Definition maxisLcsIf.cpp:589
bool IsMoving() const
IsMoving.
Definition maxisLcsIf.cpp:532
void MoveEncRel(int axis_id, long int encoders)
Move a motor in relative encoder units.
Definition maxisLcsIf.cpp:372
void MovePos(int axis_id, double position, double velocity, std::string move_type=ifw::fcf::devmgr::motor::RPC_MOVE_ABS)
Definition maxisLcsIf.cpp:404
virtual ~MAxisLcsIf()
Default destructor.
Definition maxisLcsIf.hpp:86
void MoveAxes(const std::vector< double > &positions)
MoveAxes.
Definition maxisLcsIf.cpp:447
void StoreMotorAttribute(const std::string nodeid_prefix, const ifw::core::protocol::base::Variant &value, int attribute)
Definition maxisLcsIf.cpp:710
MAxis class header file.
Definition maxis.hpp:18
std::vector< std::pair< std::string, unsigned int > > VectorAttributes
Definition maxisLcsIf.hpp:21
constexpr auto RPC_MOVE_ABS
Definition motorBaseConfig.hpp:46
The DeviceControllerData struct.
Definition deviceLcsIf.hpp:42
The adcControllerData struct.
Definition maxisLcsIf.hpp:29
void GetMotorNames(std::vector< std::string > &motor_vector)
void SetData(const MAxisControllerData &data)
Definition maxisLcsIf.cpp:65
virtual ~MAxisControllerData()
Definition maxisLcsIf.cpp:62
virtual std::string GetErrorText() const
MAxisControllerData()
Definition maxisLcsIf.cpp:56
void AddMotor(const std::string motor, const fcf::devmgr::motor::MotorControllerData motor_data)
virtual std::string GetSubstateStr() const
fcf::devmgr::motor::MotorControllerData GetMotor(std::string motor) const
The MotorControllerData struct.
Definition motorLcsIf.hpp:31