MotionLib
1.0.0
SamBuCa motion library
|
Public Types | |
enum | State { UNKNOWN , IDLE , RUNNING , ERROR } |
Axis State. More... | |
typedef std::shared_ptr< Axis > | Shared |
![]() | |
typedef smc::DeviceType | DeviceType |
typedef std::shared_ptr< DeviceBase > | Shared |
Public Member Functions | |
Axis (const std::string &address) | |
Construct a new Axis Device at given location on given platform. More... | |
DeviceType | type () const override |
Get device type. More... | |
virtual std::future< void > | moveTo (const units::Value &position) const =0 |
Move this axis to given position. More... | |
virtual std::future< void > | moveBy (const units::Value &distance) const =0 |
Move this axis by given distance. More... | |
virtual std::future< void > | stop () const =0 |
Stop any ongoing motion, flush the motion-queue. More... | |
virtual std::future< void > | pause () const |
Pause ongoing motion, prevent queued motions from running. More... | |
virtual std::future< void > | resume () const |
Resume paused motion. More... | |
virtual std::future< units::value_t > | getPosition (units::unit_t unit) const =0 |
Get current position of this axis. More... | |
virtual units::value_t | lastPosition (units::unit_t unit) const =0 |
Get last known position of the axis. More... | |
virtual std::future< void > | setActualPosition (const units::Value &position) const |
Set current axis position. More... | |
virtual std::future< void > | takeReference (const std::chrono::milliseconds &timeout=std::chrono::seconds{ 120}) const |
Start a homing sequence. More... | |
virtual std::future< State > | getState () const =0 |
Get the current axis 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 | |
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... | |
![]() | |
const std::string | m_uid |
enum smc::Axis::State |
smc::Axis::Axis | ( | const std::string & | address | ) |
Construct a new Axis Device at given location on given platform.
address | Unique address of the axis |
platform | Platform on which axis is located |
config | optional config platform |
|
pure virtual |
Get current position of this axis.
Implemented in smc::internal::MockAxis, smc::internal::MGrblAxis, and smc::internal::GrblAxis.
|
pure virtual |
Get the current axis state.
Get the state of the axis: Idle, Run, Error, Unknown
Implemented in smc::internal::MockAxis, smc::internal::MGrblAxis, and smc::internal::GrblAxis.
|
pure virtual |
Get last known position of the axis.
updateSignal
is emitted whenever this value updated
Implemented in smc::internal::MockAxis, smc::internal::MGrblAxis, and smc::internal::GrblAxis.
|
pure virtual |
Move this axis by given distance.
distance | Distance to move by |
Implemented in smc::internal::MockAxis, smc::internal::MGrblAxis, and smc::internal::GrblAxis.
|
pure virtual |
Move this axis to given position.
position | Position to move to |
Implemented in smc::internal::MockAxis, smc::internal::MGrblAxis, and smc::internal::GrblAxis.
|
virtual |
Pause ongoing motion, prevent queued motions from running.
Pauses ongoing motion using proper deceleration, motion may be resumed using Axis::resume
.
Reimplemented in smc::internal::MockAxis, smc::internal::MGrblAxis, and smc::internal::GrblAxis.
|
virtual |
Resume paused motion.
resumes paused motion using proper acceleration.
Reimplemented in smc::internal::MockAxis, smc::internal::MGrblAxis, and smc::internal::GrblAxis.
|
virtual |
Set current axis position.
position | new position for axis |
Reimplemented in smc::internal::MockAxis, smc::internal::MGrblAxis, smc::internal::MFEAxis, and smc::internal::GrblAxis.
|
pure virtual |
Stop any ongoing motion, flush the motion-queue.
Stop ongoing motion using proper deceleration, reject pending promises. This may stop other axis depending on motion-queue implementation (ex: axis bound to the same Grbl instance).
Implemented in smc::internal::MockAxis, smc::internal::MGrblAxis, and smc::internal::GrblAxis.
|
virtual |
Start a homing sequence.
timeout | Timeout for homing sequence request |
Reimplemented in smc::internal::MGrblAxis, smc::internal::GrblAxis, and smc::internal::MockAxis.
|
overridevirtual |