MotionLib  1.0.0
SamBuCa motion library
Classes | Typedefs | Enumerations | Functions
Devices

devices interface More...

Classes

class  smc::Axis
 
class  smc::AxisPositionMonitor
 This object represent a link between an axis and a position sensor. More...
 
class  smc::DeviceBase
 
class  smc::Gpio
 
class  smc::PlatformDevice
 
class  smc::Trigger
 

Typedefs

typedef std::string smc::DeviceId
 

Enumerations

enum class  smc::DeviceType {
  smc::AXIS , smc::POSITION_SENSOR , smc::GPIO , smc::TRIGGER ,
  smc::PLATFORM , smc::AXIS_POSITION_MONITOR , smc::UNKNOWN = -1
}
 List of possible device types supported. More...
 

Functions

const std::string & smc::to_string (Axis::State state)
 convert State to string More...
 
const std::string & smc::to_string (AxisPositionMonitor::State state)
 convert state to string More...
 
template<>
AxisPositionMonitor::State smc::from_string (const std::string &)
 convert string to state More...
 
const std::string & smc::to_string (DeviceType type)
 convert DeviceType to string More...
 
template<>
const std::set< AxisPositionMonitor::State > & smc::getEnumValues ()
 Get devices types list (to be iterated) More...
 

Detailed Description

devices interface

Enumeration Type Documentation

◆ DeviceType

enum smc::DeviceType
strong

List of possible device types supported.

Enumerator
AXIS 

actuator device

POSITION_SENSOR 

position sensor device

GPIO 

gpio like device

TRIGGER 

hardware/software trigger device

PLATFORM 

special device representing the platform itself

AXIS_POSITION_MONITOR 

device representing link with axis and position

UNKNOWN 

unknown device type

Definition at line 51 of file DeviceBase.hpp.

Function Documentation

◆ from_string()

template<>
units::io_port_t smc::from_string ( const std::string &  )

convert string to state

base from_string template

convert string to IOPort

convert string to Unit

convert string to DeviceType

Parameters
[in]strthe string to parse
Returns
State or UNKNOWN if string couldn't be parsed
Parameters
[in]strthe string to parse
Returns
DeviceType or UNKNOWN if string couldn't be parsed
Parameters
[in]strthe string to parse
Returns
Unit or UNKNOWN if string couldn't be parsed
Parameters
[in]strthe string to parse
Returns
IOPort (empty on parse error)

this template is customized for (de)serializable types

Definition at line 74 of file AxisPositionMonitor.cpp.

◆ getEnumValues()

template<>
const std::set< units::Unit > & smc::getEnumValues ( )

Get devices types list (to be iterated)

List values for enum.

Get Unit values list (to be iterated)

Returns
std::set<std::string>
Template Parameters
T
Returns
possible values for enum

Definition at line 60 of file AxisPositionMonitor.cpp.

◆ to_string() [1/3]

const std::string & smc::to_string ( Axis::State  state)

convert State to string

Parameters
statethe state to convert
Returns
const std::string& the string representation of the state

Definition at line 78 of file Axis.cpp.

Here is the caller graph for this function:

◆ to_string() [2/3]

const std::string & smc::to_string ( AxisPositionMonitor::State  state)

convert state to string

Parameters
statethe state to convert

Definition at line 65 of file AxisPositionMonitor.cpp.

◆ to_string() [3/3]

const std::string & smc::to_string ( DeviceType  type)

convert DeviceType to string

Parameters
[in]typetype to convert

Definition at line 52 of file DeviceBase.cpp.