Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
GmiTypes.h
Go to the documentation of this file.
1#pragma once
2#include <gmi/iface/global.h>
3#include <misc/gen/TSet.h>
4#include <misc/gen/Value.h>
5#if IS_QT
6 #include <QMetaType>
7#endif
8
9namespace sf::gmi
10{
11
12#if IS_QT
13Q_NAMESPACE_EXPORT(_GMI_DATA)
14#endif
15
19typedef unsigned long long IdType;
20
25
49#if IS_QT
50Q_ENUM_NS(EAxisValueType)
51#endif
52
57enum EAxisMovement : unsigned int
58{
70 amLimited = 2
71};
72
77
81enum EAxisLocation : int
82{
86 alNA = -1,
90 alX = 0,
127 // alAUX3, // Auxiliary axis 3 has no location in the constellation of axes.
128 // alAUX4, // Auxiliary axis 4 has no location in the constellation of axes.
136 alFirstEntry = 0
138
143
147_GMI_FUNC std::string_view getAxisName(int axis_loc);
148
155_GMI_FUNC std::string_view getAxisUnit(int axis_loc, EAxisValueType type);
156
162
169_GMI_FUNC std::string_view getMovementsUnit(const AxisMovements& ams, EAxisValueType type);
170
175{
176 public:
182 AxisValue(int location, double value);
188 AxisValue(const Value& location, const Value& value);
192 AxisValue() = default;
196 EAxisLocation _location{alNA};
200 double _value{0.0};
201};
202
203inline AxisValue::AxisValue(int location, double value)
204 : _location(static_cast<EAxisLocation>(location))
205 , _value(value)
206{}
207
208inline AxisValue::AxisValue(const Value& location, const Value& value)
209 : _location(static_cast<EAxisLocation>(location.getInteger()))
210 , _value(value.getFloat())
211{}
212
213}// namespace sf::gmi
Template class for managing bit maks preferably when bits are defined as enumerate values.
Definition TSet.h:14
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
Single position, speed or acceleration value of a specific axis.
Definition GmiTypes.h:175
AxisValue()=default
Default constructor.
#define _GMI_FUNC
Definition gmi/iface/global.h:34
#define _GMI_DATA
Definition gmi/iface/global.h:33
#define _GMI_CLASS
Definition gmi/iface/global.h:35
Definition AxesCoord.h:7
_GMI_FUNC std::string_view getMovementsUnit(const AxisMovements &ams, EAxisValueType type)
Gets the axis unit based on the movements of the axis.
EAxisMovement
Movements an axis can make.
Definition GmiTypes.h:58
@ amRadial
Units are rad, rad/s, rad/s² rotates and/or moves between angles.
Definition GmiTypes.h:66
@ amLinear
Units are m, m/s or m/s², and the axis moves lineair.
Definition GmiTypes.h:62
@ amLimited
Movement is limited between begin- and end-values.
Definition GmiTypes.h:70
unsigned long long IdType
Type for gathering parameter ID's.
Definition GmiTypes.h:19
EAxisValueType
List of axis coordinate types. Use a full namespace type path when specifying a Q_PROPERTY(....
Definition GmiTypes.h:31
@ avtPosition
Axis positional coordinate value.
Definition GmiTypes.h:39
@ avtNone
Axis is not present.
Definition GmiTypes.h:35
@ avtAcceleration
Axis acceleration coordinate value.
Definition GmiTypes.h:47
@ avtVelocity
Axis velocity coordinate value.
Definition GmiTypes.h:43
_GMI_FUNC std::string_view getAxisUnit(int axis_loc, EAxisValueType type)
Gets the default axis unit.
TSet< EAxisLocation > AxisLocations
Bitmap set of axis locations.
Definition GmiTypes.h:142
_GMI_FUNC std::string_view getAxisValueTypeName(EAxisValueType type)
Gets the name of the given axis value type.
EAxisLocation
Enumeration of axis locations.
Definition GmiTypes.h:82
@ alLastEntry
The last entry used in iterations.
Definition GmiTypes.h:132
@ alB
Angular swivel and moves [rad].
Definition GmiTypes.h:106
@ alY
Lineair and moves in [m].
Definition GmiTypes.h:94
@ alAux1
Auxiliary axis 1 has no location in the constellation of axes.
Definition GmiTypes.h:122
@ alAux2
Auxiliary axis 2 has no location in the constellation of axes.
Definition GmiTypes.h:126
@ alC
Angular Turntable and moves [rad and/or Hz].
Definition GmiTypes.h:110
@ alE
Tool Lineair and moves in [m].
Definition GmiTypes.h:118
@ alZ
Lineair and moves in [m].
Definition GmiTypes.h:98
@ alA
Angular Gimbal and moves [rad].
Definition GmiTypes.h:102
@ alNA
Not available axis.
Definition GmiTypes.h:86
@ alFirstEntry
First axis used for iterations to alLAST_ENTRY.
Definition GmiTypes.h:136
@ alX
Lineair and moves in [m].
Definition GmiTypes.h:90
@ alD
Tool Angular and moves [rad].
Definition GmiTypes.h:114
_GMI_FUNC std::string_view getAxisName(int axis_loc)
Gets the name of the given axis location.
TVector< IdType > IdList
Type for gathering parameter ID's.
Definition GmiTypes.h:24
TSet< EAxisMovement > AxisMovements
Bitmap set of axis movements.
Definition GmiTypes.h:76