InertiaSDK

Loading...
Searching...
No Matches
InertiaConfig.h
1#pragma once
2#include "data/config/AbstractConfig.h"
3#include "data/config/AccelConfig.h"
4#include "data/config/AccelExtConfig.h"
5#include "data/config/ADC2Config.h"
6#include "data/config/ADCConfig.h"
7#include "data/config/CompassConfig.h"
8#include "data/config/CorrelationConfig.h"
9#include "data/config/DetectionConfig.h"
10#include "data/config/DualAxisConfig.h"
11#include "data/config/GenericSensorConfig.h"
12#include "data/config/GlobalSamplingConfig.h"
13#include "data/config/GPSConfigSettings.h"
14#include "data/config/GyroConfig.h"
15#include "data/config/HeartBeatConfig.h"
16#include "data/config/IMAConfig.h"
17#include "data/config/IOConfigSettings.h"
18#include "data/config/LoggingConfig.h"
19#include "data/config/NexoDAQSettings.h"
20#include "data/config/OtherAxisCapability.h"
21#include "data/config/OtherAxisConfig.h"
22#include "data/config/PowerManagementSettings.h"
23#include "data/config/QuadAxisConfig.h"
24#include "data/config/RadioConfig.h"
25#include "data/config/RTCConfig.h"
26#include "data/config/SchedulerSettings.h"
27#include "data/config/SensorSpecificSettings.h"
28#include "data/config/SingleAxisCapability.h"
29#include "data/config/SingleAxisConfig.h"
30#include "data/config/StatusConfig.h"
31#include "data/config/TemperatureConfig.h"
32#include "data/config/TripleAxisConfig.h"
33#include "data/config/VMonBoardConfig.h"
34#include "data/config/TOFConfig.h"
35
36 namespace inertia
37{
38 typedef std::shared_ptr<AbstractConfig> SensorConfigPtr;
39 typedef std::map<ConfigType, SensorConfigPtr> SensorConfigMap;
40 enum ValueType : unsigned;
41
42
47 struct INERTIA_API InertiaConfig
48{
49 private:
50 std::shared_ptr<void> m_data;
51
52 public:
56 InertiaConfig();
57
63 InertiaConfig(std::vector<uint8_t> const& in, const unsigned dbfStart = 5);
64
69 InertiaConfig(std::wstring const& argString);
70
71
75 bool GetIsRequest() const;
76
80 void SetIsRequest(const bool isRequest);
81
85 bool GetIsDefault() const;
86
90 void SetIsDefault(const bool isDefault);
91
92
98 void AddConfig(const ConfigType config, const int sensorID = -1, const AxisConfigDescriptorType descrType = AXIS_DESCRIPTOR_CONFIGURATION);
99
103 void AddConfig(SensorConfigPtr const& config);
104
105
109 bool HasConfigs() const;
110
117 bool HasConfig(const ConfigType config, const int sensorID = -1, const AxisConfigDescriptorType descrType = AXIS_DESCRIPTOR_CONFIGURATION) const;
118
125 std::vector<unsigned> GetInstances(const ConfigType config, const unsigned sensorID, const AxisConfigDescriptorType descrType) const;
126
131 SensorConfigPtr const GetConfig(const ConfigType config) const;
132
137 GlobalSamplingConfig const& GetGlobalSamplingConfig() const;
138
143 RadioConfig const& GetRadioConfig() const;
144
150 AccelConfig const& GetAccelConfig() const;
151
157 CompassConfig const& GetCompassConfig() const;
158
164 GyroConfig const& GetGyroConfig() const;
165
170 StatusConfig const& GetStatusConfig() const;
171
177 HeartBeatConfig const& GetHeartBeatConfig() const;
178
184 TemperatureConfig const& GetTemperatureConfig() const;
185
191 CorrelationConfig const& GetCorrelationConfig() const;
192
197 LoggingConfig const& GetLoggingConfig() const;
198
203 IMAConfig const& GetIMAConfig() const;
204
209 RTCConfig const& GetRTCConfig() const;
210
216 ADCConfig const& GetADCConfig() const;
217
223 DetectionConfig const& GetDetectionConfig() const;
224
229 ADC2Config const& GetADC2Config() const;
230
235 AccelConfigExt const& GetAccelConfigExt() const;
236
241 VmonBoardConfig const& GetVmonBoardConfig() const;
242
248 GenericSensorConfig const& GetGenericSensorConfig(const ConfigType config) const;
249
256 SingleAxisConfig const& GetSingleAxisConfig(const unsigned sensorID, const int instance = -1) const;
257
263 DualAxisConfig const& GetDualAxisConfig(const unsigned sensorID) const;
264
270 TripleAxisConfig const& GetTripleAxisConfig(const unsigned sensorID) const;
271
277 QuadAxisConfig const& GetQuadAxisConfig(const unsigned sensorID) const;
278
284 OtherAxisConfig const& GetOtherAxisConfig(const unsigned sensorID) const;
285
292 SingleAxisCapability const& GetSingleAxisCapability(const unsigned sensorID, const int instance = -1) const;
293
299 OtherAxisCapability const& GetOtherAxisCapability(const unsigned sensorID) const;
300
301
306 unsigned GetSensorID(inertia::ValueType const& valueType) const;
307
312 std::vector<unsigned> GetSensorIDs(inertia::ValueType const& valueType) const;
313
314
318 void Merge(InertiaConfig const& config);
319
325 bool IsLastReceived(const ConfigType config, const unsigned sensorID) const;
326
330 std::vector<uint8_t> GetBytes() const;
331
335 const ChannelMap GetChannelMap() const;
336
340 unsigned GetLowestModulo() const;
341
345 InertiaConfig GetDeepCopy() const;
346
347
348#ifdef WITH_BOOST_PROGRAM_OPTIONS
353 static const po::options_description GetOptionDescription();
354
360 static const po::options_description GetOptionDescription(ConfigType const config);
361#endif
362
367 const std::wstring ToString() const;
368
373 const std::wstring ToReadableString(bool const advanced) const;
374
379 static ConfigType GetConfigType(std::wstring const& configName);
380
385 static const std::wstring GetName(ConfigType const type);
386};
387
388}
inertia
Definition FlashCommands.h:6
inertia::AxisConfigDescriptorType
AxisConfigDescriptorType
Definition AxisConfig.h:10
inertia::ValueType
ValueType
Definition ChannelSpec.h:7
inertia::ConfigType
ConfigType
Definition ConfigChannel.h:7
inertia::SensorConfigMap
std::map< ConfigType, SensorConfigPtr > SensorConfigMap
Map with configurations for a ConfigType.
Definition InertiaConfig.h:39
inertia::SensorConfigPtr
std::shared_ptr< AbstractConfig > SensorConfigPtr
Pointer to AbstractConfig.
Definition InertiaConfig.h:38
inertia::ChannelMap
std::map< unsigned, Channel > ChannelMap
Map with Channel information per samplingChannel.
Definition platform.h:58
inertia::ADC2Config
Definition ADC2Config.h:77
inertia::ADCConfig
Definition ADCConfig.h:23
inertia::AccelConfigExt
Definition AccelExtConfig.h:10
inertia::AccelConfig
Definition AccelConfig.h:59
inertia::CompassConfig
Definition CompassConfig.h:45
inertia::CorrelationConfig
Definition CorrelationConfig.h:10
inertia::DetectionConfig
Definition DetectionConfig.h:19
inertia::DualAxisConfig
Definition DualAxisConfig.h:13
inertia::GenericSensorConfig
Definition GenericSensorConfig.h:11
inertia::GlobalSamplingConfig
Definition GlobalSamplingConfig.h:37
inertia::GyroConfig
Definition GyroConfig.h:21
inertia::HeartBeatConfig
Definition HeartBeatConfig.h:10
inertia::IMAConfig
Definition IMAConfig.h:18
inertia::InertiaConfig::GetDeepCopy
InertiaConfig GetDeepCopy() const
inertia::InertiaConfig::HasConfigs
bool HasConfigs() const
inertia::InertiaConfig::GetBytes
std::vector< uint8_t > GetBytes() const
inertia::InertiaConfig::GetConfig
SensorConfigPtr const GetConfig(const ConfigType config) const
inertia::InertiaConfig::GetIMAConfig
IMAConfig const & GetIMAConfig() const
inertia::InertiaConfig::GetSensorIDs
std::vector< unsigned > GetSensorIDs(inertia::ValueType const &valueType) const
inertia::InertiaConfig::SetIsDefault
void SetIsDefault(const bool isDefault)
inertia::InertiaConfig::GetQuadAxisConfig
QuadAxisConfig const & GetQuadAxisConfig(const unsigned sensorID) const
inertia::InertiaConfig::GetSingleAxisConfig
SingleAxisConfig const & GetSingleAxisConfig(const unsigned sensorID, const int instance=-1) const
inertia::InertiaConfig::GetConfigType
static ConfigType GetConfigType(std::wstring const &configName)
inertia::InertiaConfig::Merge
void Merge(InertiaConfig const &config)
inertia::InertiaConfig::ToReadableString
const std::wstring ToReadableString(bool const advanced) const
inertia::InertiaConfig::GetOptionDescription
static const po::options_description GetOptionDescription()
inertia::InertiaConfig::GetOtherAxisCapability
OtherAxisCapability const & GetOtherAxisCapability(const unsigned sensorID) const
inertia::InertiaConfig::InertiaConfig
InertiaConfig(std::vector< uint8_t > const &in, const unsigned dbfStart=5)
inertia::InertiaConfig::GetGlobalSamplingConfig
GlobalSamplingConfig const & GetGlobalSamplingConfig() const
inertia::InertiaConfig::GetADC2Config
ADC2Config const & GetADC2Config() const
inertia::InertiaConfig::GetOtherAxisConfig
OtherAxisConfig const & GetOtherAxisConfig(const unsigned sensorID) const
inertia::InertiaConfig::InertiaConfig
InertiaConfig(std::wstring const &argString)
inertia::InertiaConfig::GetName
static const std::wstring GetName(ConfigType const type)
inertia::InertiaConfig::GetVmonBoardConfig
VmonBoardConfig const & GetVmonBoardConfig() const
inertia::InertiaConfig::GetTripleAxisConfig
TripleAxisConfig const & GetTripleAxisConfig(const unsigned sensorID) const
inertia::InertiaConfig::GetGenericSensorConfig
GenericSensorConfig const & GetGenericSensorConfig(const ConfigType config) const
inertia::InertiaConfig::GetDetectionConfig
DetectionConfig const & GetDetectionConfig() const
inertia::InertiaConfig::GetDualAxisConfig
DualAxisConfig const & GetDualAxisConfig(const unsigned sensorID) const
inertia::InertiaConfig::GetOptionDescription
static const po::options_description GetOptionDescription(ConfigType const config)
inertia::InertiaConfig::GetSensorID
unsigned GetSensorID(inertia::ValueType const &valueType) const
inertia::InertiaConfig::GetADCConfig
ADCConfig const & GetADCConfig() const
inertia::InertiaConfig::GetIsDefault
bool GetIsDefault() const
inertia::InertiaConfig::GetGyroConfig
GyroConfig const & GetGyroConfig() const
inertia::InertiaConfig::GetStatusConfig
StatusConfig const & GetStatusConfig() const
inertia::InertiaConfig::GetSingleAxisCapability
SingleAxisCapability const & GetSingleAxisCapability(const unsigned sensorID, const int instance=-1) const
inertia::InertiaConfig::HasConfig
bool HasConfig(const ConfigType config, const int sensorID=-1, const AxisConfigDescriptorType descrType=AXIS_DESCRIPTOR_CONFIGURATION) const
inertia::InertiaConfig::GetAccelConfig
AccelConfig const & GetAccelConfig() const
inertia::InertiaConfig::GetHeartBeatConfig
HeartBeatConfig const & GetHeartBeatConfig() const
inertia::InertiaConfig::GetIsRequest
bool GetIsRequest() const
inertia::InertiaConfig::AddConfig
void AddConfig(const ConfigType config, const int sensorID=-1, const AxisConfigDescriptorType descrType=AXIS_DESCRIPTOR_CONFIGURATION)
inertia::InertiaConfig::GetCorrelationConfig
CorrelationConfig const & GetCorrelationConfig() const
inertia::InertiaConfig::ToString
const std::wstring ToString() const
inertia::InertiaConfig::GetAccelConfigExt
AccelConfigExt const & GetAccelConfigExt() const
inertia::InertiaConfig::GetLowestModulo
unsigned GetLowestModulo() const
inertia::InertiaConfig::GetInstances
std::vector< unsigned > GetInstances(const ConfigType config, const unsigned sensorID, const AxisConfigDescriptorType descrType) const
inertia::InertiaConfig::GetCompassConfig
CompassConfig const & GetCompassConfig() const
inertia::InertiaConfig::SetIsRequest
void SetIsRequest(const bool isRequest)
inertia::InertiaConfig::IsLastReceived
bool IsLastReceived(const ConfigType config, const unsigned sensorID) const
inertia::InertiaConfig::AddConfig
void AddConfig(SensorConfigPtr const &config)
inertia::InertiaConfig::GetChannelMap
const ChannelMap GetChannelMap() const
inertia::InertiaConfig::GetRadioConfig
RadioConfig const & GetRadioConfig() const
inertia::InertiaConfig::GetLoggingConfig
LoggingConfig const & GetLoggingConfig() const
inertia::InertiaConfig::InertiaConfig
InertiaConfig()
inertia::InertiaConfig::GetTemperatureConfig
TemperatureConfig const & GetTemperatureConfig() const
inertia::InertiaConfig::GetRTCConfig
RTCConfig const & GetRTCConfig() const
inertia::LoggingConfig
Definition LoggingConfig.h:18
inertia::OtherAxisCapability
Definition OtherAxisCapability.h:11
inertia::OtherAxisConfig
Definition OtherAxisConfig.h:11
inertia::QuadAxisConfig
Definition QuadAxisConfig.h:13
inertia::RTCConfig
Definition RTCConfig.h:18
inertia::RadioConfig
Definition RadioConfig.h:32
inertia::SingleAxisCapability
Definition SingleAxisCapability.h:11
inertia::SingleAxisConfig
Definition SingleAxisConfig.h:13
inertia::StatusConfig
Definition StatusConfig.h:36
inertia::TemperatureConfig
Definition TemperatureConfig.h:10
inertia::TripleAxisConfig
Definition TripleAxisConfig.h:13
inertia::VmonBoardConfig
Definition VMonBoardConfig.h:98