MotionLib  1.0.0
SamBuCa motion library
Public Types | Public Member Functions | Protected Attributes | List of all members
smc::internal::GrblAxis Class Reference
Inheritance diagram for smc::internal::GrblAxis:
Inheritance graph
[legend]
Collaboration diagram for smc::internal::GrblAxis:
Collaboration graph
[legend]

Public Types

typedef std::shared_ptr< GrblAxisShared
 
- Public Types inherited from smc::Axis
enum  State { UNKNOWN , IDLE , RUNNING , ERROR }
 Axis State. More...
 
typedef std::shared_ptr< AxisShared
 
- Public Types inherited from smc::DeviceBase
typedef smc::DeviceType DeviceType
 
typedef std::shared_ptr< DeviceBaseShared
 

Public Member Functions

 GrblAxis (const std::string &uid, const std::shared_ptr< GrblPlatform > &grbl)
 
std::future< void > moveTo (const units::Value &position) const override
 Move this axis to given position. More...
 
std::future< void > moveBy (const units::Value &distance) const override
 Move this axis by given distance. More...
 
std::future< void > stop () const override
 Stop any ongoing motion, flush the motion-queue. More...
 
std::future< void > pause () const override
 Pause ongoing motion, prevent queued motions from running. More...
 
std::future< void > resume () const override
 Resume paused motion. More...
 
std::future< units::value_tgetPosition (units::unit_t unit) const override
 Get current position of this axis. More...
 
units::value_t lastPosition (units::unit_t unit) const override
 Get last known position of the axis. More...
 
std::future< void > setActualPosition (const units::Value &position) const override
 Set current axis position. More...
 
std::future< void > takeReference (const std::chrono::milliseconds &timeout=std::chrono::seconds{ 120}) const override
 Start a homing sequence. More...
 
std::future< StategetState () const override
 Get the current axis state. More...
 
std::future< std::set< std::string > > listConfig () const override
 list device configuration options
 
std::future< std::string > getConfig (const std::string &name) const override
 get device configuration value More...
 
std::future< void > setConfig (const std::string &name, const std::string &value) const override
 set device configuration value More...
 
bool canConvert (const units::Value &value, units::unit_t unit) const override
 Check if unit conversion is possible in a manner specific to this device. More...
 
bool convert (units::Value &value, units::unit_t unit) const override
 Convert value in a manner specific to this device. More...
 
- Public Member Functions inherited from smc::Axis
 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...
 
- Public Member Functions inherited from smc::DeviceBase
DeviceId uid () const
 Get the address of device. More...
 
std::string toString () const
 debug and logging operation
 

Protected Attributes

std::weak_ptr< GrblPlatformm_grbl
 
- 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

Definition at line 36 of file GrblAxis.hpp.

Member Function Documentation

◆ canConvert()

bool GrblAxis::canConvert ( const units::Value value,
units::unit_t  unit 
) const
overridevirtual

Check if unit conversion is possible in a manner specific to this device.

Parameters
valueValue to check
unitUnit to check
Returns
true If conversion is possible
false If conversion is not possible

Reimplemented from smc::DeviceBase.

Reimplemented in smc::internal::MGrblAxis.

Definition at line 506 of file GrblAxis.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ convert()

bool GrblAxis::convert ( units::Value value,
units::unit_t  unit 
) const
overridevirtual

Convert value in a manner specific to this device.

Parameters
valueValue to convert
unitUnit to convert to
Returns
true If conversion was successful
false If conversion is not possible

Reimplemented from smc::DeviceBase.

Reimplemented in smc::internal::MGrblAxis.

Definition at line 512 of file GrblAxis.cpp.

Here is the caller graph for this function:

◆ getConfig()

std::future< std::string > GrblAxis::getConfig ( const std::string &  name) const
overridevirtual

get device configuration value

Parameters
namevalue to retrieve
Returns
the current value (yml encoded)

Reimplemented from smc::DeviceBase.

Reimplemented in smc::internal::MGrblAxis.

Definition at line 434 of file GrblAxis.cpp.

Here is the caller graph for this function:

◆ getPosition()

std::future< units::value_t > GrblAxis::getPosition ( units::unit_t  unit) const
overridevirtual

Get current position of this axis.

Returns
future<mm> Future completed with value when command executed.

Implements smc::Axis.

Reimplemented in smc::internal::MGrblAxis.

Definition at line 238 of file GrblAxis.cpp.

Here is the caller graph for this function:

◆ getState()

std::future< Axis::State > GrblAxis::getState ( ) const
overridevirtual

Get the current axis state.

Get the state of the axis: Idle, Run, Error, Unknown

Returns
future<State> Future completed with status when command executed

Implements smc::Axis.

Reimplemented in smc::internal::MGrblAxis.

Definition at line 391 of file GrblAxis.cpp.

Here is the caller graph for this function:

◆ lastPosition()

units::value_t GrblAxis::lastPosition ( units::unit_t  unit) const
overridevirtual

Get last known position of the axis.

Returns
units::value_t

updateSignal is emitted whenever this value updated

Implements smc::Axis.

Reimplemented in smc::internal::MGrblAxis.

Definition at line 308 of file GrblAxis.cpp.

Here is the caller graph for this function:

◆ moveBy()

std::future< void > GrblAxis::moveBy ( const units::Value distance) const
overridevirtual

Move this axis by given distance.

Parameters
distanceDistance to move by
Returns
future<void> Future completed when command executed

Implements smc::Axis.

Reimplemented in smc::internal::MGrblAxis.

Definition at line 92 of file GrblAxis.cpp.

Here is the caller graph for this function:

◆ moveTo()

std::future< void > GrblAxis::moveTo ( const units::Value position) const
overridevirtual

Move this axis to given position.

Parameters
positionPosition to move to
Returns
future<void> Future completed when command executed

Implements smc::Axis.

Reimplemented in smc::internal::MGrblAxis.

Definition at line 48 of file GrblAxis.cpp.

Here is the caller graph for this function:

◆ pause()

std::future< void > GrblAxis::pause ( ) const
overridevirtual

Pause ongoing motion, prevent queued motions from running.

Pauses ongoing motion using proper deceleration, motion may be resumed using Axis::resume.

Returns
future<void> Future completed when motion is stopped

Reimplemented from smc::Axis.

Reimplemented in smc::internal::MGrblAxis.

Definition at line 195 of file GrblAxis.cpp.

Here is the caller graph for this function:

◆ resume()

std::future< void > GrblAxis::resume ( ) const
overridevirtual

Resume paused motion.

resumes paused motion using proper acceleration.

Returns
std::future<void>

Reimplemented from smc::Axis.

Reimplemented in smc::internal::MGrblAxis.

Definition at line 216 of file GrblAxis.cpp.

Here is the caller graph for this function:

◆ setActualPosition()

std::future< void > GrblAxis::setActualPosition ( const units::Value position) const
overridevirtual

Set current axis position.

Parameters
positionnew position for axis
Returns
future<void> Future completed when command executed

Reimplemented from smc::Axis.

Reimplemented in smc::internal::MGrblAxis, and smc::internal::MFEAxis.

Definition at line 273 of file GrblAxis.cpp.

Here is the caller graph for this function:

◆ setConfig()

std::future< void > GrblAxis::setConfig ( const std::string &  name,
const std::string &  value 
) const
overridevirtual

set device configuration value

Parameters
namename of the configuration value to set
valuevalue to set

Reimplemented from smc::DeviceBase.

Reimplemented in smc::internal::MGrblAxis.

Definition at line 478 of file GrblAxis.cpp.

◆ stop()

std::future< void > GrblAxis::stop ( ) const
overridevirtual

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).

Returns
future<void> Future completed when everything has been cleared

Implements smc::Axis.

Reimplemented in smc::internal::MGrblAxis.

Definition at line 172 of file GrblAxis.cpp.

Here is the caller graph for this function:

◆ takeReference()

std::future< void > GrblAxis::takeReference ( const std::chrono::milliseconds &  timeout = std::chrono::seconds{ 120}) const
overridevirtual

Start a homing sequence.

Parameters
timeoutTimeout for homing sequence request
Returns
future<void> Future completed when command executed

Reimplemented from smc::Axis.

Reimplemented in smc::internal::MGrblAxis.

Definition at line 329 of file GrblAxis.cpp.

Here is the caller graph for this function:

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