Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
GmiInterface.h
Go to the documentation of this file.
1#pragma once
3
6#include <gmi/iface/global.h>
7#include <misc/gen/TVector.h>
8#include <misc/gen/Value.h>
9
10namespace sf::gmi
11{
12
17
22{
23 public:
28
32 ParamState(const std::string& name, const Value& value);
33
37 bool operator==(const ParamState& ps) const;
38
42 std::string _name;
47
52};
53
58{
60 pfREADONLY = 1 << 0,
62 pfEFFECTPARAM = 1 << 1,
66 pfAXIS = 1 << 3,
68 pfMOVE = 1 << 4,
70 pfMOVEPOS = 1 << 5,
72 pfMOVEVEL = 1 << 6,
74 pfEXPORT = 1 << 7,
76 pfSYSTEM = 1 << 8,
78 pfWRITEABLE = 1 << 9,
80 pfALIAS = 1 << 10,
81 //
82 // Parameters like these must not be used to restore.
83 //
85 pfARCHIVE = 1 << 11,
87 pfMOVECON = 1 << 12,
88};
89
94{
96 rfINDEX = 1 << 0,
98 rfASYNC = 1 << 1,
100 rfASYNCINDEX = 1 << 2,
102 rfHUGE = 1 << 3,
103};
104
109{
113 ParamInfo() = default;
114
120 {
121 copyFrom(pi);
122 }
123
130
134 void init();
135
140
142 IdType Id{0};
146 unsigned Axis{0};
148 unsigned Index{0};
150 std::string Name;
152 std::string Unit;
154 std::string Description;
156 Value Round{Value::vitUndefined};
158 Value Default{Value::vitUndefined};
160 Value Minimum{Value::vitUndefined};
162 Value Maximum{Value::vitUndefined};
166 int Flags{0};
167};
168
173{
174 ResultInfo() = default;
175
177 {
178 copy(pi);
179 }
180
182 {
183 return copy(pi);
184 }
185
186 void init();
187
189
193 IdType Id{0};
197 int Flags{0};
202 unsigned Axis{0};
206 unsigned Index{0};
210 std::string Name;
214 std::string Description;
218 unsigned Bits{0};
222 unsigned WordSize{0};
226 unsigned ArraySize{0};
230 unsigned Offset{0};
231};
232
237{
241 BufferInfo() = default;
242
246 void Clear();
247
255 void* Buffer{nullptr};
259 unsigned Size{0};
263 unsigned Remain{0};
267 unsigned Counter{0};
268};
269
270inline void BufferInfo::Clear()
271{
272 Id = 0;
273 Buffer = nullptr;
274 Size = 0;
275 Remain = 0;
276 Counter = 0;
277}
278
283typedef void (*NotifyProc)(void* data, IdType id);
284
290{
294 mpNONE = 0x0000,
298 mpVERSION = 0x0001,
302 mpAXISCOUNT = 0x0002,
306 mpMOVEPOS = 0x0003,
310 mpMOVEVEL = 0x0004,
314 mpJOYSTICK = 0x0005,
327
335 mpPOP_AXIS = 0x000A,
343 mpMOVECON = 0x000C,
347 mpCHUCKJAW = 0x000D,
353 mpERROR = 0x000E,
365 mpTIMEUNIT = 0x0011,
369 mpLAST = 0x0200,
373 mpAXIS_MASK = 0x8000,
377 mpAXIS_NAME = 0x8001,
385 mpAXIS_MODE = 0x8003,
394 //
395 // Axis minimum and maximum positions.
396 //
417 //
418 // Volatile data. It changes when moving.
419 //
428 //
429 // Targeting data before move.
430 //
443 //
444 // Effects all position fields.
445 //
457 mpAXIS_LAST = 0x8200,
458};
459
464{
468 mrLAST = 0x0200,
469 //
470 // Axis results from here.
471 //
476 // measurement trigger. Position is relative from
480 mrAXIS_LAST = 0x8200,
481};
482
509
532
536enum EMoveConCmd : int
537{
553 mccON = 3,
554};
555
559enum EJoystickCmd : int
560{
569
577 jscON = 2,
578};
579
607
611enum EAxisMinMax : unsigned int
612{
628 ammMAX_ACC = 3
630
635{
639 cjOFF = 0,
648};
649
654{
658 ceSTATUS = 0x0000,
663 ceHOOKED = 0x1001,
668 ceUNHOOKED = 0x1002,
672 ceCOMPLETE = 0x2001,
676 cePOPEVENT = 0x3001,
677};
678
684}// namespace sf::gmi
Template class used to bind listeners to a handler_type instance.
Definition TListener.h:79
Counted vector having additional methods and operators for ease of usage. This template class extends...
Definition TVector.h:19
Value container class able to performing arithmetic functions.
Definition Value.h:19
Pure virtual class for implementation of motion controllers.
Definition Controller.h:13
Structure to hold a single state.
Definition GmiInterface.h:22
TVector< ParamState > Vector
Vector holding param-state instances.
Definition GmiInterface.h:51
Value _value
Holds the value of the state.
Definition GmiInterface.h:46
ParamState(const std::string &name, const Value &value)
Copy constructor.
bool operator==(const ParamState &ps) const
Compare equal operator.
std::string _name
Holds the name of the state.
Definition GmiInterface.h:42
ParamState(const ParamState &ps)
Copy constructor.
#define _GMI_CLASS
Definition gmi/iface/global.h:35
Definition AxesCoord.h:7
void(* NotifyProc)(void *data, IdType id)
Function type for the function type which is called when a parameter changes as a result of changes i...
Definition GmiInterface.h:283
EChuckJaw
Definition GmiInterface.h:635
@ cjOFF
ChuckJaw is off.
Definition GmiInterface.h:639
@ cjOPEN
ChuckJaw is open.
Definition GmiInterface.h:643
@ cjCLOSE
ChuckJaw is closed.
Definition GmiInterface.h:647
EControllerEvent
Enumerate for controller events.
Definition GmiInterface.h:654
@ ceCOMPLETE
Complete event on an axis group. Not implemented yet.
Definition GmiInterface.h:672
@ ceSTATUS
Controller status changed.
Definition GmiInterface.h:658
@ ceUNHOOKED
Handler was unhooked to the controller.
Definition GmiInterface.h:668
@ ceHOOKED
Handler was hooked to the controller.
Definition GmiInterface.h:663
@ cePOPEVENT
POP axis has made a rotation.
Definition GmiInterface.h:676
unsigned long long IdType
Type for gathering parameter ID's.
Definition GmiTypes.h:19
EMoveConCmd
Enumerate for controller continuous movement command.
Definition GmiInterface.h:537
@ mccCOMPLETE
No movement.
Definition GmiInterface.h:541
@ mccSTOP
Stop with target deceleration value.
Definition GmiInterface.h:549
@ mccABORT
Abort current movement abrupt.
Definition GmiInterface.h:545
@ mccON
Moving with target velocity.
Definition GmiInterface.h:553
EMovePosCmd
Enumerate for controller position movement command.
Definition GmiInterface.h:487
@ mpcSTOP
Stop current movement smooth.
Definition GmiInterface.h:499
@ mpcABORT
Abort current movement abrupt.
Definition GmiInterface.h:495
@ mpcCOMPLETE
Stop current movement smooth.
Definition GmiInterface.h:491
@ mpcCURVE
Move along the downloaded curve.
Definition GmiInterface.h:507
@ mpcPOSITION
Move in position mode using targeting position,.
Definition GmiInterface.h:503
EAxisMode
Enumerate for controller mode of operation.
Definition GmiInterface.h:584
@ amCONTINUE
Axis is moved with a specified velocity.
Definition GmiInterface.h:605
@ amHOME
Axis executes home sequence on position command.(is optional)
Definition GmiInterface.h:601
@ amPOSITION
Axis is moved only to specified position.
Definition GmiInterface.h:592
@ amVELOCITY
Axis is moved with a specified velocity.
Definition GmiInterface.h:597
@ amDISABLED
Axis is cannot be moved at all.
Definition GmiInterface.h:588
EAxisMinMax
Enumerate for retrieving axis extremes.
Definition GmiInterface.h:612
@ ammMIN_POS
Axis minimum position.
Definition GmiInterface.h:616
@ ammMAX_ACC
Axis maximum acceleration.
Definition GmiInterface.h:628
@ ammMAX_POS
Axis maximum position.
Definition GmiInterface.h:620
@ ammMAX_VEL
Axis maximum velocity.
Definition GmiInterface.h:624
EParamFlag
Parameter flags for defining parameter behaviour.
Definition GmiInterface.h:58
@ pfSYSTEM
Parameter is a system setting.
Definition GmiInterface.h:76
@ pfMOVECON
Parameter cannot be changed when moving in continuous mode.
Definition GmiInterface.h:87
@ pfEXPORT
Parameter is exported globally.
Definition GmiInterface.h:74
@ pfEFFECTRESULT
Parameter effects results.
Definition GmiInterface.h:64
@ pfREADONLY
Parameter cannot be changed at all times.
Definition GmiInterface.h:60
@ pfARCHIVE
Parameter can be stored for restoring settings.
Definition GmiInterface.h:85
@ pfAXIS
Parameter is axis specific.
Definition GmiInterface.h:66
@ pfMOVE
Parameter cannot be changed when moving in any mode.
Definition GmiInterface.h:68
@ pfMOVEPOS
Parameter cannot be changed when moving in position mode.
Definition GmiInterface.h:70
@ pfALIAS
Alias of another parameter in a different form.
Definition GmiInterface.h:80
@ pfMOVEVEL
Parameter cannot be changed when moving in velocity mode.
Definition GmiInterface.h:72
@ pfEFFECTPARAM
Parameter effects other parameters.
Definition GmiInterface.h:62
@ pfWRITEABLE
Parameter is always writeable in any mode.
Definition GmiInterface.h:78
EResultFlag
Result flags for defining result behaviour.
Definition GmiInterface.h:94
@ rfASYNCINDEX
Result keeps track of sync counter values at the time async data was generated.
Definition GmiInterface.h:100
@ rfINDEX
Result contains synced i/o input.
Definition GmiInterface.h:96
@ rfASYNC
Result data is not sync synchrone.
Definition GmiInterface.h:98
@ rfHUGE
Result that generates a huge amount of data.
Definition GmiInterface.h:102
EResult
Motion default results.
Definition GmiInterface.h:464
@ mrLAST
Free number from here.
Definition GmiInterface.h:468
@ mrAXIS_LAST
Free axis parameters numbers from here.
Definition GmiInterface.h:480
@ mrAXIS_INDEX_POS
Positions of the axis at each index or.
Definition GmiInterface.h:475
EJoystickCmd
Enumerate for controller Joy movement command.
Definition GmiInterface.h:560
@ jscSTOP
Stops movement, and waits for off.
Definition GmiInterface.h:573
@ jscINHIBIT
Inhibits the joystick control.
Definition GmiInterface.h:564
@ jscOFF
Status report of movement stop.
Definition GmiInterface.h:568
@ jscON
Joystick active.
Definition GmiInterface.h:577
EMoveVelCmd
Enumerate for controller velocity movement command.
Definition GmiInterface.h:514
@ mvcSTOP
Stop with target deceleration value.
Definition GmiInterface.h:526
@ mvcCOMPLETE
No movement.
Definition GmiInterface.h:518
@ mvcON
Moving with target velocity.
Definition GmiInterface.h:530
@ mvcABORT
Abort current movement abrupt.
Definition GmiInterface.h:522
EParam
Motion default parameters. List of ids which must always be implemented for each motion implementatio...
Definition GmiInterface.h:290
@ mpTRIGGER_AXIS
Sets the axis which pulses are used to derive the trigger pulses. Values are as EAxisLoc.
Definition GmiInterface.h:318
@ mpJOYSTICK_AXIS
Joystick axis selection. Values are as EAxisLoc.
Definition GmiInterface.h:331
@ mpAXISCOUNT
Amount of implemented axes. The states carry the axes names.
Definition GmiInterface.h:302
@ mpAXIS_MODE
Mode of the axis (Disabled, Position, Velocity, Home, Contineous)
Definition GmiInterface.h:385
@ mpCHUCKJAW
Controls chuck-jaw Off=0, Open=1 and Close=2.
Definition GmiInterface.h:347
@ mpMOVECON
Starts a movement using the target velocity for axis in the continuous mode group.
Definition GmiInterface.h:343
@ mpMOVEVEL
Starts a movement using the target velocity for axis in the velocity mode group.
Definition GmiInterface.h:310
@ mpAXIS_MIN_POS
Minimum position of the axis.
Definition GmiInterface.h:400
@ mpTRIGGER_DENSITY
Density of measurements in radians or meters depending on selected axis.
Definition GmiInterface.h:322
@ mpAXIS_MOVEMENT
Defines Movement of axis ( linear=0, radial=1, radial_limited=2) .
Definition GmiInterface.h:453
@ mpAXIS_TRG_POS
Target position of the axis.
Definition GmiInterface.h:434
@ mpTIMEUNIT
Time unit in Seconds.
Definition GmiInterface.h:365
@ mpERROR_MESSAGE
Error message from above error code.
Definition GmiInterface.h:357
@ mpJOYSTICK
Controls the access to the joystick. Inhibit=-1 (Only when Off), Off=0, Stop=1 or On=2.
Definition GmiInterface.h:314
@ mpAXIS_NAME
Name of this axis.
Definition GmiInterface.h:377
@ mpAXIS_IDX_POS
Multiplication factor for the index positions.
Definition GmiInterface.h:381
@ mpAXIS_MASK
Mask to detect gated parameter.
Definition GmiInterface.h:373
@ mpVERSION
Version information of software and hardware drivers and implementation.
Definition GmiInterface.h:298
@ mpAXIS_MAX_ACC
Maximum acceleration of the axis.
Definition GmiInterface.h:412
@ mpAXIS_MAX_POS
Maximum position of the axis.
Definition GmiInterface.h:404
@ mpERROR
Reports error and is used to clear it if possible. No error=0, Warning=1, Soft Error=2,...
Definition GmiInterface.h:353
@ mpAXIS_RESOLUTION
Resolution of the axis for velocity and position. (readonly)
Definition GmiInterface.h:393
@ mpAXIS_LAST
Free axis parameters numbers from here.
Definition GmiInterface.h:457
@ mpAXIS_CUR_POS
Current position of the axis.
Definition GmiInterface.h:423
@ mpTRIGGER_FREQ
Trigger frequency in Hz.
Definition GmiInterface.h:361
@ mpLAST
Free number from here. Axis parameters from here.
Definition GmiInterface.h:369
@ mpAXIS_OFS_POS
offset to position of Axis.
Definition GmiInterface.h:416
@ mpAXIS_MAX_VEL
Maximum velocity of the axis.
Definition GmiInterface.h:408
@ mpAXIS_CUR_VEL
Current velocity of the axis.
Definition GmiInterface.h:427
@ mpMOVEPOS
Definition GmiInterface.h:306
@ mpTRIGGER_MODE
Trigger mode 'true' is intern 'false' is extern.
Definition GmiInterface.h:326
@ mpTRIGGER_ENABLE
Enable output of trigger, true is enable.
Definition GmiInterface.h:339
@ mpNONE
Used to indicate no parameter. Interface parameters from here.
Definition GmiInterface.h:294
@ mpAXIS_TRG_ACC
Target acceleration of the axis.
Definition GmiInterface.h:442
@ mpAXIS_ACCURACY
Accuracy of the axis for velocity and position. (readonly)
Definition GmiInterface.h:389
@ mpAXIS_TRG_VEL
Target velocity of the axis.
Definition GmiInterface.h:438
@ mpPOP_AXIS
Position orientation event source selection. Values are as EAxisLoc.
Definition GmiInterface.h:335
@ mpAXIS_HOME_OFS
Defines position after homing of the axis.
Definition GmiInterface.h:449
TListener< Controller *, EControllerEvent > ControllerListener
Listener type for save motion controller event handling. Save means that there are no dangling pointe...
Definition GmiInterface.h:683
Structure to hold data update information.
Definition GmiInterface.h:237
IdType Id
Holds the ID of the result which is responsible for this data.
Definition GmiInterface.h:251
void Clear()
Clears all members.
Definition GmiInterface.h:270
unsigned Counter
Holds the counter value of the amount of measurements since the last reset of the implementation.
Definition GmiInterface.h:267
BufferInfo()=default
Initializing constructor.
void * Buffer
Holds the buffer pointer.
Definition GmiInterface.h:255
unsigned Size
Holds the size of the buffer.
Definition GmiInterface.h:259
unsigned Remain
Holds the remaining size to store.
Definition GmiInterface.h:263
Structure to hold parameter information.
Definition GmiInterface.h:109
ParamState::Vector States
Number of specified states for this.
Definition GmiInterface.h:164
std::string Unit
Unit of the parameter.
Definition GmiInterface.h:152
ParamInfo(const ParamInfo &pi)
Copy constructor.
Definition GmiInterface.h:119
ParamInfo & operator=(const ParamInfo &pi)
Assignment operator.
ParamInfo & copyFrom(const ParamInfo &pi)
Sets the e instance as when it was constructed.
ParamInfo()=default
Default constructor.
std::string Description
Usage off the parameter of the parameter.
Definition GmiInterface.h:154
std::string Name
Name of the parameter.
Definition GmiInterface.h:150
void init()
initialize/reset the instance as when it was constructed.
Structure to hold parameter information.
Definition GmiInterface.h:173
std::string Name
Name of the parameter.
Definition GmiInterface.h:210
ResultInfo(const ResultInfo &pi)
Definition GmiInterface.h:176
ResultInfo & operator=(const ResultInfo &pi)
Definition GmiInterface.h:181
ResultInfo & copy(const ResultInfo &pi)
std::string Description
Usage off the parameter of the parameter.
Definition GmiInterface.h:214