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
56enum EAxisMovement : unsigned int
57{
69 amLimited = 2
70};
71
75typedef TSet<EAxisMovement> AxisMovements;
76
80enum EAxisLocation : int
81{
85 alNA = -1,
89 alX = 0,
126 // alAUX3, // Auxiliary axis 3 has no location in the constellation of axes.
127 // alAUX4, // Auxiliary axis 4 has no location in the constellation of axes.
135 alFirstEntry = 0
137
141typedef TSet<EAxisLocation> AxisLocations;
142
146_GMI_FUNC std::string_view getAxisName(int axis_loc);
147
154_GMI_FUNC std::string_view getAxisUnit(int axis_loc, EAxisValueType type);
155
161
168_GMI_FUNC std::string_view getMovementsUnit(const AxisMovements& ams, EAxisValueType type);
169
174{
175 public:
181 AxisValue(int location, double value);
187 AxisValue(const Value& location, const Value& value);
191 AxisValue() = default;
195 EAxisLocation _location{alNA};
199 double _value{0.0};
200};
201
202inline AxisValue::AxisValue(int location, double value)
203 : _location(static_cast<EAxisLocation>(location))
204 , _value(value)
205{}
206
207inline AxisValue::AxisValue(const Value& location, const Value& value)
208 : _location(static_cast<EAxisLocation>(location.getInteger()))
209 , _value(value.getFloat())
210{}
211
212}// namespace sf::gmi
Counted vector having additional methods and operators for ease of usage.
Definition TVector.h:25
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:174
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 axes can make. (are used as bit locations in TAxisMovements)
Definition GmiTypes.h:57
@ amRadial
Units are [rad, rad/s, rad/s2] rotates and/or moves between angles.
Definition GmiTypes.h:65
@ amLinear
Units are [m, m/s, m/s2m] and axis moves lineair.
Definition GmiTypes.h:61
@ amLimited
Movement is limited between begin and end values.
Definition GmiTypes.h:69
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 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:141
_GMI_FUNC std::string_view getAxisValueTypeName(EAxisValueType type)
Gets name of the given axis value type.
EAxisLocation
Enumeration of axis locations.
Definition GmiTypes.h:81
@ alLastEntry
Last entry used in iterations.
Definition GmiTypes.h:131
@ alB
Angular swivel and moves [rad].
Definition GmiTypes.h:105
@ alY
Lineair and moves in [m].
Definition GmiTypes.h:93
@ alAux1
Auxiliary axis 1 has no location in the constellation of axes.
Definition GmiTypes.h:121
@ alAux2
Auxiliary axis 2 has no location in the constellation of axes.
Definition GmiTypes.h:125
@ alC
Angular Turntable and moves [rad and/or Hz].
Definition GmiTypes.h:109
@ alE
Tool Lineair and moves in [m].
Definition GmiTypes.h:117
@ alZ
Lineair and moves in [m].
Definition GmiTypes.h:97
@ alA
Angular Gimbal and moves [rad].
Definition GmiTypes.h:101
@ alNA
Not available axis.
Definition GmiTypes.h:85
@ alFirstEntry
First axis used for iterations to alLAST_ENTRY.
Definition GmiTypes.h:135
@ alX
Lineair and moves in [m].
Definition GmiTypes.h:89
@ alD
Tool Angular and moves [rad].
Definition GmiTypes.h:113
_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:75