24 #ifndef AXISPOSITIONMONITOR_HPP__
25 #define AXISPOSITIONMONITOR_HPP__
29 #include "../util/serialize.hpp"
31 #include "DeviceBase.hpp"
32 #include "PositionSensor.hpp"
50 typedef std::shared_ptr<AxisPositionMonitor> Shared;
60 const std::shared_ptr<Axis> &axis,
61 const std::shared_ptr<PositionSensor> &position);
78 inline std::shared_ptr<Axis> axisDevice()
const {
return m_axis.lock(); }
80 inline std::shared_ptr<PositionSensor> positionSensorDevice()
const
82 return m_position.lock();
89 units::unit_t unit)
const = 0;
95 units::unit_t unit)
const = 0;
127 std::weak_ptr<Axis> m_axis;
128 std::weak_ptr<PositionSensor> m_position;
136 const std::string &
to_string(AxisPositionMonitor::State state);
145 AxisPositionMonitor::State
from_string(
const std::string &);
This object represent a link between an axis and a position sensor.
virtual std::future< State > getState() const =0
Get the current device state.
virtual std::future< units::value_t > getMaxDifference(units::unit_t unit) const =0
Get max difference since monitor was enabled.
virtual std::future< void > setEnabled(bool enabled)=0
Enable/disable the monitor.
DeviceType type() const override
Get device type.
virtual units::value_t lastDifference(units::unit_t unit) const =0
Get last known difference.
AxisPositionMonitor(const std::string &address, const std::shared_ptr< Axis > &axis, const std::shared_ptr< PositionSensor > &position)
Construct a new AxisPositionMonitor Device.
virtual std::future< units::value_t > getDifference(units::unit_t unit) const =0
Get current position difference between axis and positionSensor.
virtual State lastState() const =0
Get last known state.
AxisPositionMonitor::State from_string(const std::string &str)
convert string to state
const std::string & to_string(Axis::State state)
convert State to string
DeviceType
List of possible device types supported.
main motion-lib namespace