InertiaSDK

Loading...
Searching...
No Matches
ChannelSpec.h
1#pragma once
2
3 namespace inertia
4{
5
7 enum ValueType : unsigned {
8 VALUE_TYPE_DISABLED = 0,
9 VALUE_TYPE_ACCEL,
10 VALUE_TYPE_COMPASS,
11 VALUE_TYPE_GYRO,
12 VALUE_TYPE_TEMP,
13 VALUE_TYPE_ACCEL_HIGH_G,
14 VALUE_TYPE_PRESSURE,
15 VALUE_TYPE_IMA,
16 VALUE_TYPE_ADC,
17 VALUE_TYPE_ORIENTATION,
18 VALUE_TYPE_STATUS,
19 VALUE_TYPE_GPS,
20 VALUE_TYPE_CUSTOM,
21 MAX_VALUE_TYPES
22};
23
24
26 enum ValueIndexStatus : unsigned {
27 VALUE_INDEX_STATUS_BAT_VOLTAGE = 0,
28 VALUE_INDEX_STATUS_TEMP_INSIDE,
29 VALUE_INDEX_STATUS_POWER_INPUT_PRESENT,
30 VALUE_INDEX_STATUS_RSSI,
31 VALUE_INDEX_STATUS_LOST_SAMPLES_PERCENTAGE,
32 VALUE_INDEX_STATUS_LOST_SAMPLES,
33 VALUE_INDEX_STATUS_BAT_SOC,
34 VALUE_INDEX_STATUS_TEMP_AMBIENT,
35 VALUE_INDEX_STATUS_POWER_INPUT_VOLTAGE,
36 VALUE_INDEX_STATUS_POWER_CONSUMPTION,
37 VALUE_INDEX_STATUS_BAT_PERCENTAGE,
38 VALUE_INDEX_STATUS_CHARGE_CURRENT,
39 MAX_VALUE_INDEX_STATUS
40};
41
42
44 enum GroupFunction : unsigned {
45 GROUP_FUNCTION_NONE = 0,
46 GROUP_FUNCTION_NORM,
47 GROUP_FUNCTION_EULER,
48 MAX_GROUP_FUNCTIONS
49};
50
51
53 enum ValueFunction : unsigned {
54 VALUE_FUNCTION_NONE = 0,
55 VALUE_FUNCTION_FFT,
56 MAX_VALUE_FUNCTIONS
57};
58
59
64 struct INERTIA_API ChannelSpec
65{
66 ValueType valueType;
67 unsigned index;
68 unsigned group;
69 ValueFunction valueFunction;
70 GroupFunction groupFunction;
71
73 ChannelSpec();
74
82 ChannelSpec(const ValueType valueType, const unsigned index = 0, const unsigned group = 0, const GroupFunction groupFunction = GROUP_FUNCTION_NONE, const ValueFunction valueFunction = VALUE_FUNCTION_NONE);
83
87 const std::wstring ToString() const;
88
93 bool operator < (ChannelSpec const& rhs) const;
94};
95
96}
inertia
Definition FlashCommands.h:6
inertia::ValueType
ValueType
Definition ChannelSpec.h:7
inertia::VALUE_TYPE_IMA
@ VALUE_TYPE_IMA
IMA: represents the index within the IMA values.
Definition ChannelSpec.h:15
inertia::VALUE_TYPE_COMPASS
@ VALUE_TYPE_COMPASS
Compass: index 0=X, 1=Y, 2=Z.
Definition ChannelSpec.h:10
inertia::VALUE_TYPE_TEMP
@ VALUE_TYPE_TEMP
Temperature: index 0.
Definition ChannelSpec.h:12
inertia::VALUE_TYPE_GYRO
@ VALUE_TYPE_GYRO
Gyroscope: index 0=X, 1=Y, 2=Z.
Definition ChannelSpec.h:11
inertia::VALUE_TYPE_PRESSURE
@ VALUE_TYPE_PRESSURE
Pressure: index 0.
Definition ChannelSpec.h:14
inertia::VALUE_TYPE_GPS
@ VALUE_TYPE_GPS
GPS values: same order as GPS header.
Definition ChannelSpec.h:19
inertia::VALUE_TYPE_ACCEL_HIGH_G
@ VALUE_TYPE_ACCEL_HIGH_G
High-G Accelerometer: index 0=X, 1=Y, 2=Z.
Definition ChannelSpec.h:13
inertia::VALUE_TYPE_ACCEL
@ VALUE_TYPE_ACCEL
Accelerometer: index 0=X, 1=Y, 2=Z.
Definition ChannelSpec.h:9
inertia::VALUE_TYPE_ORIENTATION
@ VALUE_TYPE_ORIENTATION
Orientation: index 0 to 3 represent the quaternion values.
Definition ChannelSpec.h:17
inertia::VALUE_TYPE_DISABLED
@ VALUE_TYPE_DISABLED
Disabled.
Definition ChannelSpec.h:8
inertia::VALUE_TYPE_ADC
@ VALUE_TYPE_ADC
ADC: represents the analog input index.
Definition ChannelSpec.h:16
inertia::VALUE_TYPE_STATUS
@ VALUE_TYPE_STATUS
Status values: 0=bat, 1=cpuTemp, 2=extIn, 3=rssi, 4=N.A., 5=lostSamples.
Definition ChannelSpec.h:18
inertia::VALUE_TYPE_CUSTOM
@ VALUE_TYPE_CUSTOM
Custom values.
Definition ChannelSpec.h:20
inertia::ValueFunction
ValueFunction
Definition ChannelSpec.h:53
inertia::VALUE_FUNCTION_NONE
@ VALUE_FUNCTION_NONE
No value function.
Definition ChannelSpec.h:54
inertia::VALUE_FUNCTION_FFT
@ VALUE_FUNCTION_FFT
Fast Fourier Transform of value.
Definition ChannelSpec.h:55
inertia::GroupFunction
GroupFunction
Definition ChannelSpec.h:44
inertia::GROUP_FUNCTION_EULER
@ GROUP_FUNCTION_EULER
Get Euler angles of VALUE_TYPE_ORIENTATION, use index 0=roll, 1=pitch, 2=yaw.
Definition ChannelSpec.h:47
inertia::GROUP_FUNCTION_NONE
@ GROUP_FUNCTION_NONE
No group function.
Definition ChannelSpec.h:45
inertia::GROUP_FUNCTION_NORM
@ GROUP_FUNCTION_NORM
Apply normalization function. The resulting value is at index 0.
Definition ChannelSpec.h:46
inertia::ValueIndexStatus
ValueIndexStatus
Definition ChannelSpec.h:26
inertia::VALUE_INDEX_STATUS_BAT_SOC
@ VALUE_INDEX_STATUS_BAT_SOC
Battery percentage.
Definition ChannelSpec.h:33
inertia::VALUE_INDEX_STATUS_LOST_SAMPLES
@ VALUE_INDEX_STATUS_LOST_SAMPLES
Lost samples.
Definition ChannelSpec.h:32
inertia::VALUE_INDEX_STATUS_BAT_VOLTAGE
@ VALUE_INDEX_STATUS_BAT_VOLTAGE
Battery voltage.
Definition ChannelSpec.h:27
inertia::VALUE_INDEX_STATUS_LOST_SAMPLES_PERCENTAGE
@ VALUE_INDEX_STATUS_LOST_SAMPLES_PERCENTAGE
Lost samples percentage.
Definition ChannelSpec.h:31
inertia::VALUE_INDEX_STATUS_POWER_CONSUMPTION
@ VALUE_INDEX_STATUS_POWER_CONSUMPTION
Power consumption.
Definition ChannelSpec.h:36
inertia::VALUE_INDEX_STATUS_TEMP_INSIDE
@ VALUE_INDEX_STATUS_TEMP_INSIDE
Inside temperature / CPU temperature.
Definition ChannelSpec.h:28
inertia::VALUE_INDEX_STATUS_POWER_INPUT_VOLTAGE
@ VALUE_INDEX_STATUS_POWER_INPUT_VOLTAGE
Power input voltage.
Definition ChannelSpec.h:35
inertia::VALUE_INDEX_STATUS_POWER_INPUT_PRESENT
@ VALUE_INDEX_STATUS_POWER_INPUT_PRESENT
Power Voltage / External input.
Definition ChannelSpec.h:29
inertia::VALUE_INDEX_STATUS_CHARGE_CURRENT
@ VALUE_INDEX_STATUS_CHARGE_CURRENT
Charge current.
Definition ChannelSpec.h:38
inertia::VALUE_INDEX_STATUS_TEMP_AMBIENT
@ VALUE_INDEX_STATUS_TEMP_AMBIENT
Ambient temperature.
Definition ChannelSpec.h:34
inertia::VALUE_INDEX_STATUS_BAT_PERCENTAGE
@ VALUE_INDEX_STATUS_BAT_PERCENTAGE
Battery percentage. Not used anymore, use VALUE_INDEX_STATUS_BAT_SOC instead.
Definition ChannelSpec.h:37
inertia::VALUE_INDEX_STATUS_RSSI
@ VALUE_INDEX_STATUS_RSSI
Radio Signal Strength (RSSI).
Definition ChannelSpec.h:30
inertia::ChannelSpec::groupFunction
GroupFunction groupFunction
A function that is applied to all values in a group.
Definition ChannelSpec.h:70
inertia::ChannelSpec::group
unsigned group
The group that the index belongs to, always 0 expect for VALUE_TYPE_CUSTOM were it is the used sampli...
Definition ChannelSpec.h:68
inertia::ChannelSpec::ToString
const std::wstring ToString() const
inertia::ChannelSpec::valueFunction
ValueFunction valueFunction
A function that is applied to the targeted value.
Definition ChannelSpec.h:69
inertia::ChannelSpec::index
unsigned index
The index is used to target a specific axis or index of a sensor.
Definition ChannelSpec.h:67
inertia::ChannelSpec::ChannelSpec
ChannelSpec()
inertia::ChannelSpec::ChannelSpec
ChannelSpec(const ValueType valueType, const unsigned index=0, const unsigned group=0, const GroupFunction groupFunction=GROUP_FUNCTION_NONE, const ValueFunction valueFunction=VALUE_FUNCTION_NONE)
inertia::ChannelSpec::valueType
ValueType valueType
The type is used to target a specific sensor type.
Definition ChannelSpec.h:66