MotionLib  1.0.0
SamBuCa motion library
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
smc::internal::GrblPlatform::Context Struct Reference
Collaboration diagram for smc::internal::GrblPlatform::Context:
Collaboration graph
[legend]

Public Member Functions

 Context (const std::string &prefix, const std::string &id)
 
std::string getErrorMessage (grbl::ErrorCode code) const
 
std::string getAlarmMessage (grbl::AlarmCode alarm) const
 
AxisData_getAxisData (const std::string &uid)
 
void checkReply (grbl::ErrorCode code)
 check command result code More...
 
std::set< std::string > listConfig ()
 list config values More...
 
std::set< std::string > listConfig (grbl::Axis)
 list config values related to the given axis More...
 
const grbl::GrblParser::SettingDescfindSetting (const std::string &name, grbl::Axis axis) const
 find setting id for axis More...
 
const grbl::GrblParser::SettingDescfindSetting (const std::string &name) const
 find setting using its name More...
 
const std::string findLocalSetting (const std::string &name) const
 find local setting using its name More...
 
std::string _sendGetSetting (grbl::SettingId settingId)
 retrieve a setting from Grbl, eventually update internal cache
 
void _sendSetSetting (grbl::SettingId settingId, const std::string &value)
 set a setting on Grbl
 
void setSetting (const std::string &name, const std::string &value)
 
void sendHold ()
 
void sendReset ()
 reset grbl instance
 

Static Public Member Functions

static bool isStepperMessage (const std::string &line)
 

Public Attributes

const std::string prefix
 uri prefix (ex: grbl://)
 
const std::string id
 uri platform id as in grbl://<id>/
 
bool triggeredMotion = false
 
std::unique_ptr< grbl::GrblDeviceBasedevice
 
std::map< int, std::string > errors
 
std::map< int, std::string > alarms
 
std::map< std::string, int > settingGroup
 
SettingMap setting
 
grbl::GrblParser::State state
 
grbl::GrblParser::BuildInfo binfo
 
GrblPlatform::Line line = 0
 
std::chrono::steady_clock::time_point nextPoll
 
LocalSettingMap localSetting
 

Detailed Description

Definition at line 84 of file GrblPlatformData.hpp.

Member Function Documentation

◆ checkReply()

void GrblPlatform::Context::checkReply ( grbl::ErrorCode  code)

check command result code

Exceptions
Exceptionon error

Definition at line 63 of file GrblPlatform_Context.cpp.

Here is the caller graph for this function:

◆ findLocalSetting()

const std::string smc::internal::GrblPlatform::Context::findLocalSetting ( const std::string &  name) const

find local setting using its name

Exceptions
Exceptionon error

◆ findSetting() [1/2]

const GrblParser::SettingDesc & GrblPlatform::Context::findSetting ( const std::string &  name) const

find setting using its name

Exceptions
Exceptionon error

Definition at line 125 of file GrblPlatform_Context.cpp.

◆ findSetting() [2/2]

const GrblParser::SettingDesc & GrblPlatform::Context::findSetting ( const std::string &  name,
grbl::Axis  axis 
) const

find setting id for axis

will automatically add prefix if necessary

Exceptions
Exceptionon error

Definition at line 109 of file GrblPlatform_Context.cpp.

Here is the call graph for this function:

◆ listConfig() [1/2]

std::set< std::string > GrblPlatform::Context::listConfig ( )

list config values

moves keys from setting in a set

must be called from processing thread

Definition at line 72 of file GrblPlatform_Context.cpp.

◆ listConfig() [2/2]

std::set< std::string > GrblPlatform::Context::listConfig ( grbl::Axis  grblAxis)

list config values related to the given axis

moves keys from setting in a set, removing prefix

must be called from processing thread

Definition at line 86 of file GrblPlatform_Context.cpp.

Here is the call graph for this function:

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