MotionLib
1.0.0
SamBuCa motion library
|
This object represent a link between an axis and a position sensor. More...
#include <AxisPositionMonitor.hpp>
Public Types | |
enum | State { UNKNOWN , ENABLED , DISABLED , TRIGGERED } |
typedef std::shared_ptr< AxisPositionMonitor > | Shared |
![]() | |
typedef smc::DeviceType | DeviceType |
typedef std::shared_ptr< DeviceBase > | Shared |
Public Member Functions | |
AxisPositionMonitor (const std::string &address, const std::shared_ptr< Axis > &axis, const std::shared_ptr< PositionSensor > &position) | |
Construct a new AxisPositionMonitor Device. More... | |
DeviceType | type () const override |
Get device type. More... | |
std::shared_ptr< Axis > | axisDevice () const |
std::shared_ptr< PositionSensor > | positionSensorDevice () const |
virtual std::future< units::value_t > | getDifference (units::unit_t unit) const =0 |
Get current position difference between axis and positionSensor. | |
virtual std::future< units::value_t > | getMaxDifference (units::unit_t unit) const =0 |
Get max difference since monitor was enabled. | |
virtual std::future< State > | getState () const =0 |
Get the current device state. | |
virtual std::future< void > | setEnabled (bool enabled)=0 |
Enable/disable the monitor. More... | |
virtual units::value_t | lastDifference (units::unit_t unit) const =0 |
Get last known difference. More... | |
virtual State | lastState () const =0 |
Get last known state. More... | |
![]() | |
DeviceId | uid () const |
Get the address of device. More... | |
virtual std::future< std::set< std::string > > | listConfig () const |
list device configuration options | |
virtual std::future< std::string > | getConfig (const std::string &name) const |
get device configuration value More... | |
virtual std::future< void > | setConfig (const std::string &name, const std::string &value) const |
set device configuration value More... | |
virtual bool | canConvert (const units::Value &value, units::unit_t unit) const |
Check if unit conversion is possible in a manner specific to this device. More... | |
virtual bool | convert (units::Value &value, units::unit_t unit) const |
Convert value in a manner specific to this device. More... | |
std::string | toString () const |
debug and logging operation | |
Protected Attributes | |
std::weak_ptr< Axis > | m_axis |
std::weak_ptr< PositionSensor > | m_position |
![]() | |
const std::string | m_uid |
Additional Inherited Members | |
![]() | |
ccut::Signal< const DeviceBase::Shared & > | updateSignal |
device update signal More... | |
![]() | |
DeviceBase (const std::string &uid) | |
Construct a new ABaseDevice, linking pointer to platform object. More... | |
This object represent a link between an axis and a position sensor.
this link may be implemented hardware or software
this object is likely to have a configurable threshold
setting.
Definition at line 47 of file AxisPositionMonitor.hpp.
smc::AxisPositionMonitor::AxisPositionMonitor | ( | const std::string & | address, |
const std::shared_ptr< Axis > & | axis, | ||
const std::shared_ptr< PositionSensor > & | position | ||
) |
Construct a new AxisPositionMonitor Device.
address | Unique address for the AxisPositionMonitor |
platform | Parent platform for the object |
configPlatform | Parent config platform for the object |
Definition at line 45 of file AxisPositionMonitor.cpp.
|
pure virtual |
Get last known difference.
updateSignal
is emitted whenever this value updated
Implemented in smc::internal::MFEAxisPositionMonitor.
|
pure virtual |
|
pure virtual |
Enable/disable the monitor.
the difference may still be monitored even if disabled
enabling a TRIGGERED
monitor will re-arm it and reset its max-difference counter
Implemented in smc::internal::MFEAxisPositionMonitor.
|
overridevirtual |
Get device type.
Implements smc::DeviceBase.
Definition at line 54 of file AxisPositionMonitor.cpp.