Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::gmi Namespace Reference

Classes

class  AxesCoord
 All axis values in one structure accompanied by some handy manipulation methods. More...
 
class  AxisValue
 Single position, speed or acceleration value of a specific axis. More...
 
struct  BufferInfo
 Structure to hold data update information. More...
 
class  Controller
 Pure virtual class for implementation of motion controllers. More...
 
struct  ParamInfo
 Structure to hold parameter information. More...
 
class  ParamState
 Structure to hold a single state. More...
 
struct  ResultInfo
 Structure to hold parameter information. More...
 

Typedefs

typedef void(* NotifyProc) (void *data, IdType id)
 Function type for the function type which is called when a parameter changes as a result of changes in the interface itself.
 
typedef void(* ControllerEvent) (Controller *ctrl, EControllerEvent event)
 Handler type for motion event handling.
 
typedef unsigned long long IdType
 Type for gathering parameter ID's.
 
typedef TVector< IdTypeIdList
 Type for gathering parameter ID's.
 
typedef TSet< EAxisMovementAxisMovements
 Bitmap set of axis movements.
 
typedef TSet< EAxisLocationAxisLocations
 Bitmap set of axis locations.
 

Enumerations

enum  EParamFlag {
  pfREADONLY = 1 << 0 , pfEFFECTPARAM = 1 << 1 , pfEFFECTRESULT = 1 << 2 , pfAXIS = 1 << 3 ,
  pfMOVE = 1 << 4 , pfMOVEPOS = 1 << 5 , pfMOVEVEL = 1 << 6 , pfEXPORT = 1 << 7 ,
  pfSYSTEM = 1 << 8 , pfWRITEABLE = 1 << 9 , pfALIAS = 1 << 10 , pfARCHIVE = 1 << 11 ,
  pfMOVECON = 1 << 12
}
 Parameter flags for defining parameter behaviour. More...
 
enum  EResultFlag { rfINDEX = 1 << 0 , rfASYNC = 1 << 1 , rfASYNCINDEX = 1 << 2 , rfHUGE = 1 << 3 }
 Result flags for defining result behaviour. More...
 
enum  EParam {
  mpNONE = 0x0000 , mpVERSION = 0x0001 , mpAXISCOUNT = 0x0002 , mpMOVEPOS = 0x0003 ,
  mpMOVEVEL = 0x0004 , mpJOYSTICK = 0x0005 , mpTRIGGER_AXIS = 0x0006 , mpTRIGGER_DENSITY = 0x0007 ,
  mpTRIGGER_MODE = 0x0008 , mpJOYSTICK_AXIS = 0x0009 , mpPOP_AXIS = 0x000A , mpTRIGGER_ENABLE = 0x000B ,
  mpMOVECON = 0x000C , mpCHUCKJAW = 0x000D , mpERROR = 0x000E , mpERROR_MESSAGE = 0x000F ,
  mpTRIGGER_FREQ = 0x0010 , mpTIMEUNIT = 0x0011 , mpLAST = 0x0200 , mpAXIS_MASK = 0x8000 ,
  mpAXIS_NAME = 0x8001 , mpAXIS_IDX_POS = 0x8002 , mpAXIS_MODE = 0x8003 , mpAXIS_ACCURACY = 0x8004 ,
  mpAXIS_RESOLUTION = 0x8005 , mpAXIS_MIN_POS = 0x8010 , mpAXIS_MAX_POS = 0x8011 , mpAXIS_MAX_VEL = 0x8012 ,
  mpAXIS_MAX_ACC = 0x8013 , mpAXIS_OFS_POS = 0x8014 , mpAXIS_CUR_POS = 0x8020 , mpAXIS_CUR_VEL = 0x8021 ,
  mpAXIS_TRG_POS = 0x8030 , mpAXIS_TRG_VEL = 0x8031 , mpAXIS_TRG_ACC = 0x8032 , mpAXIS_HOME_OFS = 0x8033 ,
  mpAXIS_MOVEMENT = 0x8034 , mpAXIS_LAST = 0x8200
}
 Motion default parameters. List of ids which must always be implemented for each motion implementation. More...
 
enum  EResult { mrLAST = 0x0200 , mrAXIS_INDEX_POS = 0x8000 , mrAXIS_LAST = 0x8200 }
 Motion default results. More...
 
enum  EMovePosCmd {
  mpcCOMPLETE = 0 , mpcABORT = 1 , mpcSTOP = 2 , mpcPOSITION = 3 ,
  mpcCURVE = 4
}
 Enumerate for controller position movement command. More...
 
enum  EMoveVelCmd { mvcCOMPLETE = 0 , mvcABORT = 1 , mvcSTOP = 2 , mvcON = 3 }
 Enumerate for controller velocity movement command. More...
 
enum  EMoveConCmd { mccCOMPLETE = 0 , mccABORT = 1 , mccSTOP = 2 , mccON = 3 }
 Enumerate for controller continuous movement command. More...
 
enum  EJoystickCmd { jscINHIBIT = -1 , jscOFF = 0 , jscSTOP = 1 , jscON = 2 }
 Enumerate for controller Joy movement command. More...
 
enum  EAxisMode {
  amDISABLED = 0 , amPOSITION = 1 , amVELOCITY = 2 , amHOME = 3 ,
  amCONTINUE = 4
}
 Enumerate for controller mode of operation. More...
 
enum  EAxisMinMax : unsigned int { ammMIN_POS = 0 , ammMAX_POS = 1 , ammMAX_VEL = 2 , ammMAX_ACC = 3 }
 Enumerate for retrieving axis extremes. More...
 
enum  EChuckJaw { cjOFF = 0 , cjOPEN = 1 , cjCLOSE = 2 }
 
enum  EControllerEvent {
  ceSTATUS = 0x0000 , ceHOOKED = 0x1001 , ceUNHOOKED = 0x1002 , ceCOMPLETE = 0x2001 ,
  cePOPEVENT = 0x3001
}
 Enumerate for controller events. More...
 
enum  EAxisValueType : unsigned int { avtNone = 0 , avtPosition , avtVelocity , avtAcceleration }
 List of axis coordinate types. Use a full namespace type path when specifying a Q_PROPERTY(...) More...
 
enum  EAxisMovement : unsigned int { amLinear = 0 , amRadial = 1 , amLimited = 2 }
 Movements an axes can make. (are used as bit locations in TAxisMovements) More...
 
enum  EAxisLocation : int {
  alNA = -1 , alX = 0 , alY , alZ ,
  alA , alB , alC , alD ,
  alE , alAux1 , alAux2 , alLastEntry ,
  alFirstEntry = 0
}
 Enumeration of axis locations. More...
 

Functions

_GMI_FUNC std::string_view getAxisName (int axis_loc)
 Gets the name of the given axis location.
 
_GMI_FUNC std::string_view getAxisUnit (int axis_loc, EAxisValueType type)
 Gets the default axis unit.
 
_GMI_FUNC std::string_view getAxisValueTypeName (EAxisValueType type)
 Gets name of the given axis value type.
 
_GMI_FUNC std::string_view getMovementsUnit (const AxisMovements &ams, EAxisValueType type)
 Gets the axis unit based on the movements of the axis.
 
_GMI_FUNC bool getTargetTime (double dist, double vel, double acc, double &time)
 Calculates the time needed to move over the distance.
 
_GMI_FUNC bool getTargetTime (const AxesCoord &dist, const AxesCoord &max_vel, const AxesCoord &max_acc, AxesCoord &trg_time)
 Calculates the time needed to move over the distance for all axes in the AxisCoord.
 
_GMI_FUNC bool getAccelerationTime (double dist, double vel, double acc, double &time)
 Calculates the time needed to move over the distance.
 
_GMI_FUNC bool getAccelerationTime (const AxesCoord &dist, const AxesCoord &max_vel, const AxesCoord &max_acc, AxesCoord &trg_time)
 Calculates the time needed to move over the distance for all axes in the AxisCoord.
 
_GMI_FUNC bool getTargetAccelerationTime (double dist, double vel, double acc, double &trg_time, double &acc_time)
 Calculates the time and acceleration needed to move over the distance.
 
_GMI_FUNC bool getPositionVelocity (double dist, double vel, double acc, double cur_tm, double &cur_pos, double &cur_vel)
 Calculates the position and velocity at the current time from the start.
 
_GMI_FUNC bool calcLinearValue (double dist, double trg_time, double acc_time, double &vel, double &acc)
 ???
 
_GMI_FUNC bool calcLinearValues (const AxesCoord &dist, double trg_time, double acc_time, AxesCoord &vel, AxesCoord &acc)
 ???
 
_GMI_FUNC bool getLinearValues (const AxesCoord &dist, const AxesCoord &max_vel, const AxesCoord &max_acc, AxesCoord &trg_vel, AxesCoord &trg_acc, double &trg_time)
 Calculates the velocity and acceleration needed to move a distance in a linear manner. Returns.
 
_GMI_FUNC int compareValue (double v1, double v2, double tolerance, bool rad_unlimited)
 Compares the passed values v1 and v2. When the two values have no bigger absolute difference the maximum absolute difference passed are assumed equal. The last parameter specifies if the compared value is a radial unlimited axis.
 

Variables

class _GMI_CLASS Controller
 Forward declarations of Controller.
 

Typedef Documentation

◆ AxisLocations

Bitmap set of axis locations.

◆ AxisMovements

Bitmap set of axis movements.

◆ ControllerEvent

typedef void(* sf::gmi::ControllerEvent) (Controller *ctrl, EControllerEvent event)

Handler type for motion event handling.

◆ IdList

Type for gathering parameter ID's.

◆ IdType

typedef unsigned long long sf::gmi::IdType

Type for gathering parameter ID's.

◆ NotifyProc

typedef void(* sf::gmi::NotifyProc) (void *data, IdType id)

Function type for the function type which is called when a parameter changes as a result of changes in the interface itself.

Enumeration Type Documentation

◆ EAxisLocation

Enumeration of axis locations.

Enumerator
alNA 

Not available axis.

alX 

Lineair and moves in [m].

alY 

Lineair and moves in [m].

alZ 

Lineair and moves in [m].

alA 

Angular Gimbal and moves [rad].

alB 

Angular swivel and moves [rad].

alC 

Angular Turntable and moves [rad and/or Hz].

alD 

Tool Angular and moves [rad].

alE 

Tool Lineair and moves in [m].

alAux1 

Auxiliary axis 1 has no location in the constellation of axes.

alAux2 

Auxiliary axis 2 has no location in the constellation of axes.

alLastEntry 

Last entry used in iterations.

alFirstEntry 

First axis used for iterations to alLAST_ENTRY.

◆ EAxisMinMax

enum sf::gmi::EAxisMinMax : unsigned int

Enumerate for retrieving axis extremes.

Enumerator
ammMIN_POS 

Axis minimum position.

ammMAX_POS 

Axis maximum position.

ammMAX_VEL 

Axis maximum velocity.

ammMAX_ACC 

Axis maximum acceleration.

◆ EAxisMode

Enumerate for controller mode of operation.

Enumerator
amDISABLED 

Axis is cannot be moved at all.

amPOSITION 

Axis is moved only to specified position.

amVELOCITY 

Axis is moved with a specified velocity.

amHOME 

Axis executes home sequence on position command.(is optional)

amCONTINUE 

Axis is moved with a specified velocity.

◆ EAxisMovement

enum sf::gmi::EAxisMovement : unsigned int

Movements an axes can make. (are used as bit locations in TAxisMovements)

Enumerator
amLinear 

Units are [m, m/s, m/s2m] and axis moves lineair.

amRadial 

Units are [rad, rad/s, rad/s2] rotates and/or moves between angles.

amLimited 

Movement is limited between begin and end values.

◆ EAxisValueType

enum sf::gmi::EAxisValueType : unsigned int

List of axis coordinate types. Use a full namespace type path when specifying a Q_PROPERTY(...)

Enumerator
avtNone 

Axis not present.

avtPosition 

Axis positional coordinate value.

avtVelocity 

Axis velocity coordinate value.

avtAcceleration 

Axis acceleration coordinate value.

◆ EChuckJaw

Enumerate for ChuckJaw states.

Enumerator
cjOFF 

ChuckJaw is off.

cjOPEN 

ChuckJaw is open.

cjCLOSE 

ChuckJaw is closed.

◆ EControllerEvent

Enumerate for controller events.

Enumerator
ceSTATUS 

Controller status changed.

ceHOOKED 

Handler was hooked to the controller.

ceUNHOOKED 

Handler was unhooked to the controller.

ceCOMPLETE 

Complete event on an axis group. Not implemented yet.

cePOPEVENT 

POP axis has made a rotation.

◆ EJoystickCmd

Enumerate for controller Joy movement command.

Enumerator
jscINHIBIT 

Inhibits the joystick control.

jscOFF 

Status report of movement stop.

jscSTOP 

Stops movement, and waits for off.

jscON 

Joystick active.

◆ EMoveConCmd

Enumerate for controller continuous movement command.

Enumerator
mccCOMPLETE 

No movement.

mccABORT 

Abort current movement abrupt.

mccSTOP 

Stop with target deceleration value.

mccON 

Moving with target velocity.

◆ EMovePosCmd

Enumerate for controller position movement command.

Enumerator
mpcCOMPLETE 

Stop current movement smooth.

mpcABORT 

Abort current movement abrupt.

mpcSTOP 

Stop current movement smooth.

mpcPOSITION 

Move in position mode using targeting position,.

mpcCURVE 

Move along the downloaded curve.

◆ EMoveVelCmd

Enumerate for controller velocity movement command.

Enumerator
mvcCOMPLETE 

No movement.

mvcABORT 

Abort current movement abrupt.

mvcSTOP 

Stop with target deceleration value.

mvcON 

Moving with target velocity.

◆ EParam

Motion default parameters. List of ids which must always be implemented for each motion implementation.

Enumerator
mpNONE 

Used to indicate no parameter. Interface parameters from here.

mpVERSION 

Version information of software and hardware drivers and implementation.

mpAXISCOUNT 

Amount of implemented axes. The states carry the axes names.

mpMOVEPOS 

Starts a movement using the current target velocity position or loaded curve. See enum EMovePos.

mpMOVEVEL 

Starts a movement using the target velocity for axis in the velocity mode group.

mpJOYSTICK 

Controls the access to the joystick. Inhibit=-1 (Only when Off), Off=0, Stop=1 or On=2.

mpTRIGGER_AXIS 

Sets the axis which pulses are used to derive the trigger pulses. Values are as EAxisLoc.

mpTRIGGER_DENSITY 

Density of measurements in radians or meters depending on selected axis.

mpTRIGGER_MODE 

Trigger mode 'true' is intern 'false' is extern.

mpJOYSTICK_AXIS 

Joystick axis selection. Values are as EAxisLoc.

mpPOP_AXIS 

Position orientation event source selection. Values are as EAxisLoc.

mpTRIGGER_ENABLE 

Enable output of trigger, true is enable.

mpMOVECON 

Starts a movement using the target velocity for axis in the continuous mode group.

mpCHUCKJAW 

Controls chuck-jaw Off=0, Open=1 and Close=2.

mpERROR 

Reports error and is used to clear it if possible. No error=0, Warning=1, Soft Error=2, Hard Error=3. Hard errors need restart (of system/application)

mpERROR_MESSAGE 

Error message from above error code.

mpTRIGGER_FREQ 

Trigger frequency in Hz.

mpTIMEUNIT 

Time unit in Seconds.

mpLAST 

Free number from here. Axis parameters from here.

mpAXIS_MASK 

Mask to detect gated parameter.

mpAXIS_NAME 

Name of this axis.

mpAXIS_IDX_POS 

Multiplication factor for the index positions.

mpAXIS_MODE 

Mode of the axis (Disabled, Position, Velocity, Home, Contineous)

mpAXIS_ACCURACY 

Accuracy of the axis for velocity and position. (readonly)

mpAXIS_RESOLUTION 

Resolution of the axis for velocity and position. (readonly)

mpAXIS_MIN_POS 

Minimum position of the axis.

mpAXIS_MAX_POS 

Maximum position of the axis.

mpAXIS_MAX_VEL 

Maximum velocity of the axis.

mpAXIS_MAX_ACC 

Maximum acceleration of the axis.

mpAXIS_OFS_POS 

offset to position of Axis.

mpAXIS_CUR_POS 

Current position of the axis.

mpAXIS_CUR_VEL 

Current velocity of the axis.

mpAXIS_TRG_POS 

Target position of the axis.

mpAXIS_TRG_VEL 

Target velocity of the axis.

mpAXIS_TRG_ACC 

Target acceleration of the axis.

mpAXIS_HOME_OFS 

Defines position after homing of the axis.

mpAXIS_MOVEMENT 

Defines Movement of axis ( linear=0, radial=1, radial_limited=2) .

mpAXIS_LAST 

Free axis parameters numbers from here.

◆ EParamFlag

Parameter flags for defining parameter behaviour.

Enumerator
pfREADONLY 

Parameter cannot be changed at all times.

pfEFFECTPARAM 

Parameter effects other parameters.

pfEFFECTRESULT 

Parameter effects results.

pfAXIS 

Parameter is axis specific.

pfMOVE 

Parameter cannot be changed when moving in any mode.

pfMOVEPOS 

Parameter cannot be changed when moving in position mode.

pfMOVEVEL 

Parameter cannot be changed when moving in velocity mode.

pfEXPORT 

Parameter is exported globally.

pfSYSTEM 

Parameter is a system setting.

pfWRITEABLE 

Parameter is always writeable in any mode.

pfALIAS 

Alias of another parameter in a different form.

pfARCHIVE 

Parameter can be stored for restoring settings.

pfMOVECON 

Parameter cannot be changed when moving in continuous mode.

◆ EResult

Motion default results.

Enumerator
mrLAST 

Free number from here.

mrAXIS_INDEX_POS 

Positions of the axis at each index or.

mrAXIS_LAST 

Free axis parameters numbers from here.

◆ EResultFlag

Result flags for defining result behaviour.

Enumerator
rfINDEX 

Result contains synced i/o input.

rfASYNC 

Result data is not sync synchrone.

rfASYNCINDEX 

Result keeps track of sync counter values at the time async data was generated.

rfHUGE 

Result that generates a huge amount of data.

Function Documentation

◆ calcLinearValue()

_GMI_FUNC bool sf::gmi::calcLinearValue ( double  dist,
double  trg_time,
double  acc_time,
double &  vel,
double &  acc 
)

???

Parameters
distdistance to travel for each axis.
trg_timeTime in which to reach the target
acc_timeTime in which to accelerate.
velVelocity needed to move the distance in time.
accAcceleration needed to reach the previous velocity.
Returns
True on success to calculate.

◆ calcLinearValues()

_GMI_FUNC bool sf::gmi::calcLinearValues ( const AxesCoord dist,
double  trg_time,
double  acc_time,
AxesCoord vel,
AxesCoord acc 
)

???

Parameters
distDistance to travel for each axis.
trg_timeTime in which to reach the target
acc_timeTime in which to accelerate.
velVelocity needed to move the distance in time.
accAcceleration needed to reach the previous velocity.
Returns
True when calculations are successful.

◆ compareValue()

_GMI_FUNC int sf::gmi::compareValue ( double  v1,
double  v2,
double  tolerance,
bool  rad_unlimited 
)

Compares the passed values v1 and v2. When the two values have no bigger absolute difference the maximum absolute difference passed are assumed equal. The last parameter specifies if the compared value is a radial unlimited axis.

Parameters
v1
v2
tolerance
rad_unlimited
Returns
If v1 < v2 the return value is <0 and for v1 > v2 it is >0.

◆ getAccelerationTime() [1/2]

_GMI_FUNC bool sf::gmi::getAccelerationTime ( const AxesCoord dist,
const AxesCoord max_vel,
const AxesCoord max_acc,
AxesCoord trg_time 
)

Calculates the time needed to move over the distance for all axes in the AxisCoord.

Parameters
distdistance to travel.
max_velMaximum velocity.
max_accMaximum acceleration.
trg_timeReturned acceleration time.
Returns
True on success to calculate.

◆ getAccelerationTime() [2/2]

_GMI_FUNC bool sf::gmi::getAccelerationTime ( double  dist,
double  vel,
double  acc,
double &  time 
)

Calculates the time needed to move over the distance.

Parameters
distdistance to travel.
velMaximum velocity.
accMaximum acceleration.
timeReturned target time.
Returns
True on success to calculate.

◆ getAxisName()

_GMI_FUNC std::string_view sf::gmi::getAxisName ( int  axis_loc)

Gets the name of the given axis location.

◆ getAxisUnit()

_GMI_FUNC std::string_view sf::gmi::getAxisUnit ( int  axis_loc,
EAxisValueType  type 
)

Gets the default axis unit.

Parameters
axis_locAxis location.
typeAxis type of value.
Returns
unit

◆ getAxisValueTypeName()

_GMI_FUNC std::string_view sf::gmi::getAxisValueTypeName ( EAxisValueType  type)

Gets name of the given axis value type.

Returns
Position, Velocity, Acceleration

◆ getLinearValues()

_GMI_FUNC bool sf::gmi::getLinearValues ( const AxesCoord dist,
const AxesCoord max_vel,
const AxesCoord max_acc,
AxesCoord trg_vel,
AxesCoord trg_acc,
double &  trg_time 
)

Calculates the velocity and acceleration needed to move a distance in a linear manner. Returns.

Parameters
distDistance to travel.
max_velMaximum velocity.
max_accMaximum acceleration.
trg_velTarget velocity.
trg_accTarget acceleration.
trg_timeTime needed to reach target.
Returns
True when the function was able to make the calculation.

◆ getMovementsUnit()

_GMI_FUNC std::string_view sf::gmi::getMovementsUnit ( const AxisMovements ams,
EAxisValueType  type 
)

Gets the axis unit based on the movements of the axis.

Parameters
ams
type
Returns
Axis units based on the movements of the axis.

◆ getPositionVelocity()

_GMI_FUNC bool sf::gmi::getPositionVelocity ( double  dist,
double  vel,
double  acc,
double  cur_tm,
double &  cur_pos,
double &  cur_vel 
)

Calculates the position and velocity at the current time from the start.

Parameters
distdistance to travel.
velMaximum velocity.
accMaximum acceleration.
cur_tmCurrent time.
cur_posCurrent position.
cur_velCurrent velocity.
Returns
True on success to calculate.

◆ getTargetAccelerationTime()

_GMI_FUNC bool sf::gmi::getTargetAccelerationTime ( double  dist,
double  vel,
double  acc,
double &  trg_time,
double &  acc_time 
)

Calculates the time and acceleration needed to move over the distance.

Parameters
distdistance to travel.
velMaximum velocity.
accMaximum acceleration.
trg_timeTarget time.
acc_timeAcceleration time.
Returns
True on success to calculate.

◆ getTargetTime() [1/2]

_GMI_FUNC bool sf::gmi::getTargetTime ( const AxesCoord dist,
const AxesCoord max_vel,
const AxesCoord max_acc,
AxesCoord trg_time 
)

Calculates the time needed to move over the distance for all axes in the AxisCoord.

Parameters
distdistance to travel.
max_velMaximum velocity.
max_accMaximum acceleration.
trg_timeReturned target time.
Returns
True on success to calculate.

◆ getTargetTime() [2/2]

_GMI_FUNC bool sf::gmi::getTargetTime ( double  dist,
double  vel,
double  acc,
double &  time 
)

Calculates the time needed to move over the distance.

Parameters
distdistance to travel.
velMaximum velocity.
accMaximum acceleration.
timeReturned target time.
Returns
True on success to calculate.

Variable Documentation

◆ Controller

Forward declarations of Controller.