MotionLib  1.0.0
SamBuCa motion library
Public Types | Public Member Functions | Protected Attributes | List of all members
smc::AxisPositionMonitor Class Referenceabstract

This object represent a link between an axis and a position sensor. More...

#include <AxisPositionMonitor.hpp>

Inheritance diagram for smc::AxisPositionMonitor:
Inheritance graph
[legend]
Collaboration diagram for smc::AxisPositionMonitor:
Collaboration graph
[legend]

Public Types

enum  State { UNKNOWN , ENABLED , DISABLED , TRIGGERED }
 
typedef std::shared_ptr< AxisPositionMonitorShared
 
- Public Types inherited from smc::DeviceBase
typedef smc::DeviceType DeviceType
 
typedef std::shared_ptr< DeviceBaseShared
 

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< AxisaxisDevice () const
 
std::shared_ptr< PositionSensorpositionSensorDevice () const
 
virtual std::future< units::value_tgetDifference (units::unit_t unit) const =0
 Get current position difference between axis and positionSensor.
 
virtual std::future< units::value_tgetMaxDifference (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...
 
- Public Member Functions inherited from smc::DeviceBase
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< Axism_axis
 
std::weak_ptr< PositionSensorm_position
 
- Protected Attributes inherited from smc::DeviceBase
const std::string m_uid
 

Additional Inherited Members

- Public Attributes inherited from smc::DeviceBase
ccut::Signal< const DeviceBase::Shared & > updateSignal
 device update signal More...
 
- Protected Member Functions inherited from smc::DeviceBase
 DeviceBase (const std::string &uid)
 Construct a new ABaseDevice, linking pointer to platform object. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AxisPositionMonitor()

smc::AxisPositionMonitor::AxisPositionMonitor ( const std::string &  address,
const std::shared_ptr< Axis > &  axis,
const std::shared_ptr< PositionSensor > &  position 
)

Construct a new AxisPositionMonitor Device.

Parameters
addressUnique address for the AxisPositionMonitor
platformParent platform for the object
configPlatformParent config platform for the object

Definition at line 45 of file AxisPositionMonitor.cpp.

Member Function Documentation

◆ lastDifference()

virtual units::value_t smc::AxisPositionMonitor::lastDifference ( units::unit_t  unit) const
pure virtual

Get last known difference.

Returns
units::value_t

updateSignal is emitted whenever this value updated

Implemented in smc::internal::MFEAxisPositionMonitor.

◆ lastState()

virtual State smc::AxisPositionMonitor::lastState ( ) const
pure virtual

Get last known state.

Returns
State

Implemented in smc::internal::MFEAxisPositionMonitor.

◆ setEnabled()

virtual std::future<void> smc::AxisPositionMonitor::setEnabled ( bool  enabled)
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.

◆ type()

DeviceBase::DeviceType smc::AxisPositionMonitor::type ( ) const
overridevirtual

Get device type.

Returns
DeviceType AXIS_POSITION_MONITOR device type

Implements smc::DeviceBase.

Definition at line 54 of file AxisPositionMonitor.cpp.


The documentation for this class was generated from the following files: