MotionLib  1.0.0
SamBuCa motion library
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
smc::internal::MFEPlatform Class Reference

SAMBuCa MFC_MFE platform. More...

#include <MFEPlatform.hpp>

Inheritance diagram for smc::internal::MFEPlatform:
Inheritance graph
[legend]
Collaboration diagram for smc::internal::MFEPlatform:
Collaboration graph
[legend]

Classes

struct  Context
 
struct  RegInfo
 
struct  ResolverInfo
 

Public Types

typedef std::shared_ptr< MFEPlatformShared
 
- Public Types inherited from smc::internal::MGrblPlatform
typedef std::shared_ptr< MGrblPlatformShared
 
- Public Types inherited from smc::internal::PlatformBase
typedef std::shared_ptr< PlatformBaseShared
 
typedef std::set< DeviceBase::DeviceTypeDeviceTypeList
 
typedef std::list< DeviceBase::Shared > DeviceList
 

Public Member Functions

std::shared_ptr< MFEPlatformshared_from_this ()
 
std::shared_ptr< const MFEPlatformshared_from_this () const
 
DeviceTypeList getSupportedDevices () const override
 
DeviceList generateDevices (const DeviceTypeList &deviceType) override
 
grbl::Axis getResolverAxis (const std::string &uid) const
 Get the axis associated to resolver. More...
 
grbl::Axis getResolverMonitorAxis (const std::string &uid) const
 Get the axis associated with the given AxisPositionMonitor.
 
void updateResolverSetting (const std::string &resolverId, grbl::SettingId settingId, const std::string &value)
 hook invoked on getSetting/setSetting on resolvers
 
units::value_t getResolverPosition (const std::string &uid, const units::unit_t unit) const
 
units::value_t getResolverMode (const std::string &uid) const
 
AxisPositionMonitor::State getResolverMonitorState (const std::string &uid, uint32_t &diff)
 
void processUpdate (MGrblPlatform::Context &ctx) override
 device status update function More...
 
- Public Member Functions inherited from smc::internal::MGrblPlatform
std::shared_ptr< MGrblPlatformshared_from_this ()
 
std::shared_ptr< const MGrblPlatformshared_from_this () const
 
DeviceTypeList getSupportedDevices () const override
 
DeviceList generateDevices (const DeviceTypeList &deviceType) override
 
void setNotificationWorker (const NotificationWorker::Shared &worker) override
 
std::future< mgrbl::Layout > getLayout ()
 retrieve current layout
 
void stop () override
 
void wake () override
 
void updateInstance (MGrblGpio &gpio) const
 update instance ptr related to the given gpio More...
 
void updateInstance (MGrblAxis &axis) const
 update instance ptr related to the given axis More...
 
void updateInstance (MGrblTrigger &trigger) const
 update instance ptr related to the given trigger More...
 
const std::string & mainTriggerUrl () const
 
std::shared_ptr< GrblPlatformgetFirstInstance () const
 return first instance More...
 
std::shared_ptr< GrblPlatformgetInstance (mgrbl::Instance instance) const
 get instance related to the given axis More...
 
void runOnInstance (Context &ctx, std::function< void(GrblPlatform::Shared &platform, GrblPlatform::Context &ctx)> fun, bool onlyFirst=false) const
 run the given lambda on all grbl sub-platforms More...
 
template<typename T >
std::future< T > run (std::function< void(ImmediateCmd &, Context &)> fun)
 
void loadLayout (Context &ctx)
 
void getBuildInfo (Context &ctx)
 
- Public Member Functions inherited from smc::internal::PlatformBase
void notify (const DeviceId &id)
 
void notify (std::set< DeviceId > &&ids)
 

Static Public Member Functions

static PlatformBase::Shared create (const ccut::yml::NodeRef &config)
 Create new instance of MFEPlatform and return shared_ptr owning it.
 
- Static Public Member Functions inherited from smc::internal::MGrblPlatform
static PlatformBase::Shared create (const ccut::yml::NodeRef &config)
 Create new instance of MGrblPlatform and return shared_ptr owning it.
 

Static Public Attributes

static const std::string s_loggerCat {"smc:platform:mfe"}
 
static const std::string s_resolverMonitorSuffix {"/monitor"}
 
static const std::string s_resolverSettingPrefix {"resolver "}
 
static const std::string s_stepLostConfig {"step-lost threshold"}
 
static const std::set< std::string > s_resolverConfigHidden
 
static const std::set< std::string > s_monitorConfigHidden
 

Protected Member Functions

 MFEPlatform (const ccut::yml::NodeRef &ref)
 
MGrblAxis::Shared createAxis (const std::string &uid, const std::shared_ptr< GrblPlatform > &grbl) override
 
const ResolverInfo_getResolverInfo (const std::string &uid) const
 
void generateGpios (Context &ctx, std::list< DeviceBase::Shared > &out)
 
- Protected Member Functions inherited from smc::internal::MGrblPlatform
 MGrblPlatform (const ccut::yml::NodeRef &node, Context *data=nullptr)
 internal constructor to use this as a sub-platform (MGrblPlatform) More...
 
void processMessage (const std::string &message)
 
void thread_func () override
 
bool processImmediate (Context &ctx)
 
void createPlatforms (Context &ctx)
 
void clearQueue (const std::string &msg)
 
std::vector< std::shared_ptr< GrblPlatform > > getPlatforms () const
 

Protected Attributes

std::map< std::string, ResolverInfom_resolvers
 
- Protected Attributes inherited from smc::internal::MGrblPlatform
std::unique_ptr< Contextm_ctx
 
std::mutex m_lock
 
std::vector< std::shared_ptr< GrblPlatform > > m_platforms
 
std::map< std::string, std::size_t > m_triggers
 
std::map< std::string, std::size_t > m_gpios
 
const std::string m_mainTriggerUrl
 
mgrbl::Layout m_layout
 
ccut::Connection m_dataConn
 
std::queue< ImmediateCmdm_immediate
 
- Protected Attributes inherited from smc::internal::PlatformBase
std::weak_ptr< NotificationWorkerm_notificationWorker
 

Detailed Description

SAMBuCa MFC_MFE platform.

Definition at line 44 of file MFEPlatform.hpp.

Member Function Documentation

◆ getResolverAxis()

grbl::Axis smc::internal::MFEPlatform::getResolverAxis ( const std::string &  uid) const

Get the axis associated to resolver.

Parameters
uidthe resolver uid

Definition at line 419 of file MFEPlatform.cpp.

Here is the caller graph for this function:

◆ processUpdate()

void smc::internal::MFEPlatform::processUpdate ( MGrblPlatform::Context ctx)
overridevirtual

device status update function

updates device information must be called from processing thread

Reimplemented from smc::internal::MGrblPlatform.

Definition at line 303 of file MFEPlatform.cpp.

Member Data Documentation

◆ s_monitorConfigHidden

const std::set< std::string > smc::internal::MFEPlatform::s_monitorConfigHidden
static
Initial value:
{
"position", "mode", "enable"}

Definition at line 108 of file MFEPlatform.hpp.

◆ s_resolverConfigHidden

const std::set< std::string > smc::internal::MFEPlatform::s_resolverConfigHidden
static
Initial value:
{
"step-lost threshold", "enable", "position"}

Definition at line 107 of file MFEPlatform.hpp.


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