etsi_its_messages v3.4.0
Loading...
Searching...
No Matches
denm_ts_getters.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright Institute for Automotive Engineering (ika), RWTH Aachen University
3
8
9#pragma once
10
11namespace etsi_its_denm_ts_msgs::access {
12
14
16
20 * @param denm DENM to get the WGS Heading-Value from
21 * @return heading value in degree as decimal number
22 */
23inline double getWGSHeading(const DENM& denm) {
24 if (denm.denm.location_is_present) {
25 if (denm.denm.location.event_position_heading_is_present) {
26 return getWGSHeadingCDD(denm.denm.location.event_position_heading);
27 } else {
28 throw std::invalid_argument("Wgs84Angle is not present!");
29 }
30 } else {
31 throw std::invalid_argument("LocationContainer is not present!");
32 }
33}
34
41inline double getWGSHeadingConfidence(const DENM& denm) {
42 if (denm.denm.location_is_present) {
43 if (denm.denm.location.event_position_heading_is_present) {
44 return getWGSHeadingConfidenceCDD(denm.denm.location.event_position_heading);
45 } else {
46 throw std::invalid_argument("Wgs84Angle is not present!");
47 }
48 } else {
49 throw std::invalid_argument("LocationContainer is not present!");
50 }
51}
54
59inline uint8_t getCauseCode(const DENM& denm) { return denm.denm.situation.event_type.cc_and_scc.choice; }
67inline uint8_t getSubCauseCode(const DENM& denm) {
68 int cause_code = getCauseCode(denm);
69 if (cause_code == CauseCodeChoice().CHOICE_TRAFFIC_CONDITION1)
70 return denm.denm.situation.event_type.cc_and_scc.traffic_condition1.value;
71 else if (cause_code == CauseCodeChoice().CHOICE_ACCIDENT2)
72 return denm.denm.situation.event_type.cc_and_scc.accident2.value;
73 else if (cause_code == CauseCodeChoice().CHOICE_ROADWORKS3)
74 return denm.denm.situation.event_type.cc_and_scc.roadworks3.value;
75 else if (cause_code == CauseCodeChoice().CHOICE_IMPASSABILITY5)
76 return denm.denm.situation.event_type.cc_and_scc.impassability5.value;
77 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_ADHESION6)
78 return denm.denm.situation.event_type.cc_and_scc.adverse_weather_condition_adhesion6.value;
79 else if (cause_code == CauseCodeChoice().CHOICE_AQUAPLANING7)
80 return denm.denm.situation.event_type.cc_and_scc.aquaplaning7.value;
81 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_SURFACE_CONDITION9)
82 return denm.denm.situation.event_type.cc_and_scc.hazardous_location_surface_condition9.value;
83 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD10)
84 return denm.denm.situation.event_type.cc_and_scc.hazardous_location_obstacle_on_the_road10.value;
85 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD11)
86 return denm.denm.situation.event_type.cc_and_scc.hazardous_location_animal_on_the_road11.value;
87 else if (cause_code == CauseCodeChoice().CHOICE_HUMAN_PRESENCE_ON_THE_ROAD12)
88 return denm.denm.situation.event_type.cc_and_scc.human_presence_on_the_road12.value;
89 else if (cause_code == CauseCodeChoice().CHOICE_WRONG_WAY_DRIVING14)
90 return denm.denm.situation.event_type.cc_and_scc.wrong_way_driving14.value;
91 else if (cause_code == CauseCodeChoice().CHOICE_RESCUE_AND_RECOVERY_WORK_IN_PROGRESS15)
92 return denm.denm.situation.event_type.cc_and_scc.rescue_and_recovery_work_in_progress15.value;
93 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION17)
94 return denm.denm.situation.event_type.cc_and_scc.adverse_weather_condition_extreme_weather_condition17.value;
95 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_VISIBILITY18)
96 return denm.denm.situation.event_type.cc_and_scc.adverse_weather_condition_visibility18.value;
97 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_PRECIPITATION19)
98 return denm.denm.situation.event_type.cc_and_scc.adverse_weather_condition_precipitation19.value;
99 else if (cause_code == CauseCodeChoice().CHOICE_VIOLENCE20)
100 return denm.denm.situation.event_type.cc_and_scc.violence20.value;
101 else if (cause_code == CauseCodeChoice().CHOICE_SLOW_VEHICLE26)
102 return denm.denm.situation.event_type.cc_and_scc.slow_vehicle26.value;
103 else if (cause_code == CauseCodeChoice().CHOICE_DANGEROUS_END_OF_QUEUE27)
104 return denm.denm.situation.event_type.cc_and_scc.dangerous_end_of_queue27.value;
105 else if (cause_code == CauseCodeChoice().CHOICE_PUBLIC_TRANSPORT_VEHICLE_APPROACHING28)
106 return denm.denm.situation.event_type.cc_and_scc.public_transport_vehicle_approaching28.value;
107 else if (cause_code == CauseCodeChoice().CHOICE_VEHICLE_BREAKDOWN91)
108 return denm.denm.situation.event_type.cc_and_scc.vehicle_breakdown91.value;
109 else if (cause_code == CauseCodeChoice().CHOICE_POST_CRASH92)
110 return denm.denm.situation.event_type.cc_and_scc.post_crash92.value;
111 else if (cause_code == CauseCodeChoice().CHOICE_HUMAN_PROBLEM93)
112 return denm.denm.situation.event_type.cc_and_scc.human_problem93.value;
113 else if (cause_code == CauseCodeChoice().CHOICE_STATIONARY_VEHICLE94)
114 return denm.denm.situation.event_type.cc_and_scc.stationary_vehicle94.value;
115 else if (cause_code == CauseCodeChoice().CHOICE_EMERGENCY_VEHICLE_APPROACHING95)
116 return denm.denm.situation.event_type.cc_and_scc.emergency_vehicle_approaching95.value;
117 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_DANGEROUS_CURVE96)
118 return denm.denm.situation.event_type.cc_and_scc.hazardous_location_dangerous_curve96.value;
119 else if (cause_code == CauseCodeChoice().CHOICE_COLLISION_RISK97)
120 return denm.denm.situation.event_type.cc_and_scc.collision_risk97.value;
121 else if (cause_code == CauseCodeChoice().CHOICE_SIGNAL_VIOLATION98)
122 return denm.denm.situation.event_type.cc_and_scc.signal_violation98.value;
123 else if (cause_code == CauseCodeChoice().CHOICE_DANGEROUS_SITUATION99)
124 return denm.denm.situation.event_type.cc_and_scc.dangerous_situation99.value;
125 else if (cause_code == CauseCodeChoice().CHOICE_RAILWAY_LEVEL_CROSSING100)
126 return denm.denm.situation.event_type.cc_and_scc.railway_level_crossing100.value;
127 return denm.denm.situation.event_type.cc_and_scc.reserved0.value;
128}
129
135 * @param denm DENM to get the causeCodeType value from
136 * @return causeCodeType value
137 */
138inline std::string getCauseCodeType(const DENM& denm) {
139 if (denm.denm.situation_is_present) {
140 int cause_code = getCauseCode(denm);
141 std::string cause_code_type = "undefined";
142
143 if (cause_code == CauseCodeChoice().CHOICE_TRAFFIC_CONDITION1)
144 cause_code_type = "traffic condition";
145 else if (cause_code == CauseCodeChoice().CHOICE_ACCIDENT2)
146 cause_code_type = "accident";
147 else if (cause_code == CauseCodeChoice().CHOICE_ROADWORKS3)
148 cause_code_type = "roadworks";
149 else if (cause_code == CauseCodeChoice().CHOICE_IMPASSABILITY5)
150 cause_code_type = "impassability";
151 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_ADHESION6)
152 cause_code_type = "adverse weather condition - adhesion";
153 else if (cause_code == CauseCodeChoice().CHOICE_AQUAPLANING7)
154 cause_code_type = "aquaplaning";
155 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_SURFACE_CONDITION9)
156 cause_code_type = "hazardous location - surface condition";
157 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD10)
158 cause_code_type = "hazardous location - obstacle on the road";
159 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD11)
160 cause_code_type = "hazardous location - animal on the road";
161 else if (cause_code == CauseCodeChoice().CHOICE_HUMAN_PRESENCE_ON_THE_ROAD12)
162 cause_code_type = "human presence on the road";
163 else if (cause_code == CauseCodeChoice().CHOICE_WRONG_WAY_DRIVING14)
164 cause_code_type = "wrong way driving";
165 else if (cause_code == CauseCodeChoice().CHOICE_RESCUE_AND_RECOVERY_WORK_IN_PROGRESS15)
166 cause_code_type = "rescue and recovery in progress";
167 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION17)
168 cause_code_type = "adverse weather condition - extreme weather condition";
169 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_VISIBILITY18)
170 cause_code_type = "adverse weather condition - visibility";
171 else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_PRECIPITATION19)
172 cause_code_type = "adverse weather condition - precipitation";
173 else if (cause_code == CauseCodeChoice().CHOICE_VIOLENCE20)
174 cause_code_type = "violence";
175 else if (cause_code == CauseCodeChoice().CHOICE_SLOW_VEHICLE26)
176 cause_code_type = "slow vehicle";
177 else if (cause_code == CauseCodeChoice().CHOICE_DANGEROUS_END_OF_QUEUE27)
178 cause_code_type = "dangerous end of queue";
179 else if (cause_code == CauseCodeChoice().CHOICE_PUBLIC_TRANSPORT_VEHICLE_APPROACHING28)
180 cause_code_type = "public transport vehicle approaching";
181 else if (cause_code == CauseCodeChoice().CHOICE_VEHICLE_BREAKDOWN91)
182 cause_code_type = "vehicle breakdown";
183 else if (cause_code == CauseCodeChoice().CHOICE_POST_CRASH92)
184 cause_code_type = "post crash";
185 else if (cause_code == CauseCodeChoice().CHOICE_HUMAN_PROBLEM93)
186 cause_code_type = "human problem";
187 else if (cause_code == CauseCodeChoice().CHOICE_STATIONARY_VEHICLE94)
188 cause_code_type = "stationary vehicle";
189 else if (cause_code == CauseCodeChoice().CHOICE_EMERGENCY_VEHICLE_APPROACHING95)
190 cause_code_type = "emergency vehicle approaching";
191 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_DANGEROUS_CURVE96)
192 cause_code_type = "hazardous location - dangerous curve";
193 else if (cause_code == CauseCodeChoice().CHOICE_COLLISION_RISK97)
194 cause_code_type = "collision risk";
195 else if (cause_code == CauseCodeChoice().CHOICE_SIGNAL_VIOLATION98)
196 cause_code_type = "signal violation";
197 else if (cause_code == CauseCodeChoice().CHOICE_DANGEROUS_SITUATION99)
198 cause_code_type = "dangerous situation";
199 else if (cause_code == CauseCodeChoice().CHOICE_RAILWAY_LEVEL_CROSSING100)
200 cause_code_type = "railway level crossing";
201
202 return cause_code_type;
203 } else {
204 throw std::invalid_argument("SituationContainer is not present!");
205 }
206}
207
209
216inline std::string getSubCauseCodeType(const DENM& denm) {
217 if (denm.denm.situation_is_present) {
218 int cause_code = getCauseCode(denm);
219 int sub_cause_code = getSubCauseCode(denm);
220 std::string sub_cause_code_type = "undefined";
221 if (cause_code == CauseCodeChoice().CHOICE_TRAFFIC_CONDITION1) {
222 if (sub_cause_code == TrafficConditionSubCauseCode().UNAVAILABLE)
223 sub_cause_code_type = "unavailable";
224 else if (sub_cause_code == TrafficConditionSubCauseCode().INCREASED_VOLUME_OF_TRAFFIC)
225 sub_cause_code_type = "increased volume of traffic";
226 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_SLOWLY_INCREASING)
227 sub_cause_code_type = "traffic jam slowly increasing";
228 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_INCREASING)
229 sub_cause_code_type = "traffic jam increasing";
230 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_STRONGLY_INCREASING)
231 sub_cause_code_type = "traffic jam strongly increasing";
232 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM)
233 sub_cause_code_type = "traffic jam";
234 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_SLIGHTLY_DECREASING)
235 sub_cause_code_type = "traffic jam slightly decreasing";
236 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_DECREASING)
237 sub_cause_code_type = "traffic jam decreasing";
238 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_STRONGLY_DECREASING)
239 sub_cause_code_type = "traffic jam strongly decreasing";
240 else if (sub_cause_code == TrafficConditionSubCauseCode().TRAFFIC_JAM_STABLE)
241 sub_cause_code_type = "traffic jam stable";
242 } else if (cause_code == CauseCodeChoice().CHOICE_ACCIDENT2) {
243 if (sub_cause_code == AccidentSubCauseCode().UNAVAILABLE)
244 sub_cause_code_type = "unavailable";
245 else if (sub_cause_code == AccidentSubCauseCode().MULTI_VEHICLE_ACCIDENT)
246 sub_cause_code_type = "multi-vehicle accident";
247 else if (sub_cause_code == AccidentSubCauseCode().HEAVY_ACCIDENT)
248 sub_cause_code_type = "heavy accident";
249 else if (sub_cause_code == AccidentSubCauseCode().ACCIDENT_INVOLVING_LORRY)
250 sub_cause_code_type = "accident involving lorry";
251 else if (sub_cause_code == AccidentSubCauseCode().ACCIDENT_INVOLVING_BUS)
252 sub_cause_code_type = "accident involving bus";
253 else if (sub_cause_code == AccidentSubCauseCode().ACCIDENT_INVOLVING_HAZARDOUS_MATERIALS)
254 sub_cause_code_type = "accident involving hazardous materials";
255 else if (sub_cause_code == AccidentSubCauseCode().ACCIDENT_ON_OPPOSITE_LANE)
256 sub_cause_code_type = "accident on opposite lane";
257 else if (sub_cause_code == AccidentSubCauseCode().UNSECURED_ACCIDENT)
258 sub_cause_code_type = "unsecured accident";
259 else if (sub_cause_code == AccidentSubCauseCode().ASSISTANCE_REQUESTED)
260 sub_cause_code_type = "assistance requested (e-Call)";
261 } else if (cause_code == CauseCodeChoice().CHOICE_ROADWORKS3) {
262 if (sub_cause_code == RoadworksSubCauseCode().UNAVAILABLE)
263 sub_cause_code_type = "unavailable";
264 else if (sub_cause_code == RoadworksSubCauseCode().MAJOR_ROADWORKS)
265 sub_cause_code_type = "major roadworks";
266 else if (sub_cause_code == RoadworksSubCauseCode().ROAD_MARKING_WORK)
267 sub_cause_code_type = "road marking work";
268 else if (sub_cause_code == RoadworksSubCauseCode().SLOW_MOVING_ROAD_MAINTENANCE)
269 sub_cause_code_type = "slow moving road maintenance";
270 else if (sub_cause_code == RoadworksSubCauseCode().SHORT_TERM_STATIONARY_ROADWORKS)
271 sub_cause_code_type = "short-term stationary roadworks";
272 else if (sub_cause_code == RoadworksSubCauseCode().STREET_CLEANING)
273 sub_cause_code_type = "street cleaning";
274 else if (sub_cause_code == RoadworksSubCauseCode().WINTER_SERVICE)
275 sub_cause_code_type = "winter service";
276 } else if (cause_code == CauseCodeChoice().CHOICE_IMPASSABILITY5) {
277 if (sub_cause_code == ImpassabilitySubCauseCode().UNAVAILABLE)
278 sub_cause_code_type = "unavailable";
279 else if (sub_cause_code == ImpassabilitySubCauseCode().FLOODING)
280 sub_cause_code_type = "flooding";
281 else if (sub_cause_code == ImpassabilitySubCauseCode().DANGER_OF_AVALANCHES)
282 sub_cause_code_type = "danger of avalanches";
283 else if (sub_cause_code == ImpassabilitySubCauseCode().BLASTING_OF_AVALANCHES)
284 sub_cause_code_type = "blasting of avalanches";
285 else if (sub_cause_code == ImpassabilitySubCauseCode().LANDSLIPS)
286 sub_cause_code_type = "landslips";
287 else if (sub_cause_code == ImpassabilitySubCauseCode().CHEMICAL_SPILLAGE)
288 sub_cause_code_type = "chemical spillage";
289 else if (sub_cause_code == ImpassabilitySubCauseCode().WINTER_CLOSURE)
290 sub_cause_code_type = "winter closure";
291 else if (sub_cause_code == ImpassabilitySubCauseCode().SINKHOLE)
292 sub_cause_code_type = "sinkhole";
293 else if (sub_cause_code == ImpassabilitySubCauseCode().EARTHQUAKE_DAMAGE)
294 sub_cause_code_type = "earthquake damage";
295 else if (sub_cause_code == ImpassabilitySubCauseCode().FALLEN_TREES)
296 sub_cause_code_type = "fallen trees";
297 else if (sub_cause_code == ImpassabilitySubCauseCode().ROCKFALLS)
298 sub_cause_code_type = "rockfalls";
299 else if (sub_cause_code == ImpassabilitySubCauseCode().SEWER_OVERFLOW)
300 sub_cause_code_type = "sewer overflow";
301 else if (sub_cause_code == ImpassabilitySubCauseCode().STORM_DAMAGE)
302 sub_cause_code_type = "storm damage";
303 else if (sub_cause_code == ImpassabilitySubCauseCode().SUBSIDENCE)
304 sub_cause_code_type = "subsidence";
305 else if (sub_cause_code == ImpassabilitySubCauseCode().BURST_PIPE)
306 sub_cause_code_type = "burst pipe";
307 else if (sub_cause_code == ImpassabilitySubCauseCode().BURST_WATER_MAIN)
308 sub_cause_code_type = "burst water main";
309 else if (sub_cause_code == ImpassabilitySubCauseCode().FALLEN_POWER_CABLES)
310 sub_cause_code_type = "fallen power cables";
311 else if (sub_cause_code == ImpassabilitySubCauseCode().SNOW_DRIFTS)
312 sub_cause_code_type = "snow drifts";
313 } else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_ADHESION6) {
314 if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().UNAVAILABLE)
315 sub_cause_code_type = "unavailable";
316 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().HEAVY_FROST_ON_ROAD)
317 sub_cause_code_type = "heavy frost on road";
318 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().FUEL_ON_ROAD)
319 sub_cause_code_type = "fuel on road";
320 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().MUD_ON_ROAD)
321 sub_cause_code_type = "mud on road";
322 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().SNOW_ON_ROAD)
323 sub_cause_code_type = "snow on road";
324 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().ICE_ON_ROAD)
325 sub_cause_code_type = "ice on road";
326 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().BLACK_ICE_ON_ROAD)
327 sub_cause_code_type = "black ice on road";
328 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().OIL_ON_ROAD)
329 sub_cause_code_type = "oil on road";
330 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().LOOSE_CHIPPINGS)
331 sub_cause_code_type = "loose chippings";
332 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().INSTANT_BLACK_ICE)
333 sub_cause_code_type = "instant black ice";
334 else if (sub_cause_code == AdverseWeatherConditionAdhesionSubCauseCode().ROADS_SALTED)
335 sub_cause_code_type = "roads salted";
336 } else if (cause_code == CauseCodeChoice().CHOICE_AQUAPLANING7)
337 sub_cause_code_type = "not defined";
338 else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_SURFACE_CONDITION9) {
339 if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().UNAVAILABLE)
340 sub_cause_code_type = "unavailable";
341 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().ROCKFALLS)
342 sub_cause_code_type = "rockfalls";
343 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().EARTHQUAKE_DAMAGE)
344 sub_cause_code_type = "earthquake damage";
345 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().SEWER_COLLAPSE)
346 sub_cause_code_type = "sewer collapse";
347 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().SUBSIDENCE)
348 sub_cause_code_type = "subsidence";
349 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().SNOW_DRIFTS)
350 sub_cause_code_type = "snow drifts";
351 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().STORM_DAMAGE)
352 sub_cause_code_type = "storm damage";
353 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().BURST_PIPE)
354 sub_cause_code_type = "burst pipe";
355 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().VOLCANO_ERUPTION)
356 sub_cause_code_type = "volcano eruption";
357 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().FALLING_ICE)
358 sub_cause_code_type = "falling ice";
359 else if (sub_cause_code == HazardousLocationSurfaceConditionSubCauseCode().FIRE)
360 sub_cause_code_type = "fire";
361 } else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_OBSTACLE_ON_THE_ROAD10) {
362 if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().UNAVAILABLE)
363 sub_cause_code_type = "unavailable";
364 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().SHED_LOAD)
365 sub_cause_code_type = "shed load";
366 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().PARTS_OF_VEHICLES)
367 sub_cause_code_type = "parts of vehicles";
368 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().PARTS_OF_TYRES)
369 sub_cause_code_type = "parts of tyres";
370 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().BIG_OBJECTS)
371 sub_cause_code_type = "big objects";
372 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().FALLEN_TREES)
373 sub_cause_code_type = "fallen trees";
374 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().HUB_CAPS)
375 sub_cause_code_type = "hub caps";
376 else if (sub_cause_code == HazardousLocationObstacleOnTheRoadSubCauseCode().WAITING_VEHICLES)
377 sub_cause_code_type = "waiting vehicles";
378 } else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_ANIMAL_ON_THE_ROAD11) {
379 if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().UNAVAILABLE)
380 sub_cause_code_type = "unavailable";
381 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().WILD_ANIMALS)
382 sub_cause_code_type = "wild animals";
383 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().HERD_OF_ANIMALS)
384 sub_cause_code_type = "herd of animals";
385 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().SMALL_ANIMALS)
386 sub_cause_code_type = "small animals";
387 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().LARGE_ANIMALS)
388 sub_cause_code_type = "large animals";
389 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().WILD_ANIMALS_SMALL)
390 sub_cause_code_type = "wild animals small";
391 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().WILD_ANIMALS_LARGE)
392 sub_cause_code_type = "wild animals large";
393 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().DOMESTIC_ANIMALS)
394 sub_cause_code_type = "domestic animals";
395 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().DOMESTIC_ANIMALS_SMALL)
396 sub_cause_code_type = "domestic animals small";
397 else if (sub_cause_code == HazardousLocationAnimalOnTheRoadSubCauseCode().DOMESTIC_ANIMALS_LARGE)
398 sub_cause_code_type = "domestic animals large";
399 } else if (cause_code == CauseCodeChoice().CHOICE_HUMAN_PRESENCE_ON_THE_ROAD12) {
400 if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().UNAVAILABLE)
401 sub_cause_code_type = "unavailable";
402 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().CHILDREN_ON_ROADWAY)
403 sub_cause_code_type = "children on roadway";
404 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().CYCLIST_ON_ROADWAY)
405 sub_cause_code_type = "cyclist on roadway";
406 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().MOTORCYCLIST_ON_ROADWAY)
407 sub_cause_code_type = "motorcyclist on roadway";
408 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().PEDESTRIAN)
409 sub_cause_code_type = "pedestrian";
410 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().ORDINARY_PEDESTRIAN)
411 sub_cause_code_type = "ordinary pedestrian";
412 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().ROAD_WORKER)
413 sub_cause_code_type = "road worker";
414 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().FIRST_RESPONDER)
415 sub_cause_code_type = "first responder";
416 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().LIGHT_VRU_VEHICLE)
417 sub_cause_code_type = "light VRU vehicle";
418 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().BICYCLIST)
419 sub_cause_code_type = "bicyclist";
420 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().WHEELCHAIR_USER)
421 sub_cause_code_type = "wheelchair user";
422 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().HORSE_AND_RIDER)
423 sub_cause_code_type = "horse and rider";
424 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().ROLLERSKATER)
425 sub_cause_code_type = "rollerskater";
426 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().E_SCOOTER)
427 sub_cause_code_type = "e-scooter";
428 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().PERSONAL_TRANSPORTER)
429 sub_cause_code_type = "personal transporter";
430 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().PEDELEC)
431 sub_cause_code_type = "pedelec";
432 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().SPEED_PEDELEC)
433 sub_cause_code_type = "speed pedelec";
434 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().PTW)
435 sub_cause_code_type = "PTW";
436 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().MOPED)
437 sub_cause_code_type = "moped";
438 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().MOTORCYCLE)
439 sub_cause_code_type = "motorcycle";
440 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().MOTORCYCLE_AND_SIDECAR_RIGHT)
441 sub_cause_code_type = "motorcycle and sidecar right";
442 else if (sub_cause_code == HumanPresenceOnTheRoadSubCauseCode().MOTORCYCLE_AND_SIDECAR_LEFT)
443 sub_cause_code_type = "motorcycle and sidecar left";
444 } else if (cause_code == CauseCodeChoice().CHOICE_WRONG_WAY_DRIVING14) {
445 if (sub_cause_code == WrongWayDrivingSubCauseCode().UNAVAILABLE)
446 sub_cause_code_type = "unavailable";
447 else if (sub_cause_code == WrongWayDrivingSubCauseCode().WRONG_LANE)
448 sub_cause_code_type = "vehicle driving in wrong lane";
449 else if (sub_cause_code == WrongWayDrivingSubCauseCode().WRONG_DIRECTION)
450 sub_cause_code_type = "vehicle driving in wrong driving direction";
451 } else if (cause_code == CauseCodeChoice().CHOICE_RESCUE_AND_RECOVERY_WORK_IN_PROGRESS15) {
452 if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().UNAVAILABLE)
453 sub_cause_code_type = "unavailable";
454 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().EMERGENCY_VEHICLES)
455 sub_cause_code_type = "emergency vehicles";
456 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().RESCUE_HELICOPTER_LANDING)
457 sub_cause_code_type = "rescue helicopter landing";
458 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().POLICE_ACTIVITY_ONGOING)
459 sub_cause_code_type = "police activity ongoing";
460 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().MEDICAL_EMERGENCY_ONGOING)
461 sub_cause_code_type = "medical emergency ongoing";
462 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().CHILD_ABDUCTION_IN_PROGRESS)
463 sub_cause_code_type = "child abduction in progress";
464 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().PRIORITIZED_VEHICLE)
465 sub_cause_code_type = "prioritized vehicle";
466 else if (sub_cause_code == RescueAndRecoveryWorkInProgressSubCauseCode().RESCUE_AND_RECOVERY_VEHICLE)
467 sub_cause_code_type = "rescue and recovery vehicle";
468 } else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_EXTREME_WEATHER_CONDITION17) {
469 if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().UNAVAILABLE)
470 sub_cause_code_type = "unavailable";
471 else if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().STRONG_WINDS)
472 sub_cause_code_type = "strong winds";
473 else if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().DAMAGING_HAIL)
474 sub_cause_code_type = "damaging hail";
475 else if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().HURRICANE)
476 sub_cause_code_type = "hurricane";
477 else if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().THUNDERSTORM)
478 sub_cause_code_type = "thunderstorm";
479 else if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().TORNADO)
480 sub_cause_code_type = "tornado";
481 else if (sub_cause_code == AdverseWeatherConditionExtremeWeatherConditionSubCauseCode().BLIZZARD)
482 sub_cause_code_type = "blizzard";
483 } else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_VISIBILITY18) {
484 if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().UNAVAILABLE)
485 sub_cause_code_type = "unavailable";
486 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().FOG)
487 sub_cause_code_type = "fog";
488 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().SMOKE)
489 sub_cause_code_type = "smoke";
490 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().HEAVY_SNOWFALL)
491 sub_cause_code_type = "heavy snowfall";
492 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().HEAVY_RAIN)
493 sub_cause_code_type = "heavy rain";
494 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().HEAVY_HAIL)
495 sub_cause_code_type = "heavy hail";
496 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().LOW_SUN_GLARE)
497 sub_cause_code_type = "low sun glare";
498 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().SANDSTORMS)
499 sub_cause_code_type = "sandstorms";
500 else if (sub_cause_code == AdverseWeatherConditionVisibilitySubCauseCode().SWARMS_OF_INSECTS)
501 sub_cause_code_type = "swarms of insects";
502 } else if (cause_code == CauseCodeChoice().CHOICE_ADVERSE_WEATHER_CONDITION_PRECIPITATION19) {
503 if (sub_cause_code == AdverseWeatherConditionPrecipitationSubCauseCode().UNAVAILABLE)
504 sub_cause_code_type = "unavailable";
505 else if (sub_cause_code == AdverseWeatherConditionPrecipitationSubCauseCode().HEAVY_RAIN)
506 sub_cause_code_type = "heavy rain";
507 else if (sub_cause_code == AdverseWeatherConditionPrecipitationSubCauseCode().HEAVY_SNOWFALL)
508 sub_cause_code_type = "heavy snowfall";
509 else if (sub_cause_code == AdverseWeatherConditionPrecipitationSubCauseCode().SOFT_HAIL)
510 sub_cause_code_type = "soft hail";
511 } else if (cause_code == CauseCodeChoice().CHOICE_VIOLENCE20)
512 sub_cause_code_type = "not defined";
513 else if (cause_code == CauseCodeChoice().CHOICE_SLOW_VEHICLE26) {
514 if (sub_cause_code == SlowVehicleSubCauseCode().UNAVAILABLE)
515 sub_cause_code_type = "unavailable";
516 else if (sub_cause_code == SlowVehicleSubCauseCode().MAINTENANCE_VEHICLE)
517 sub_cause_code_type = "maintenance vehicle";
518 else if (sub_cause_code == SlowVehicleSubCauseCode().VEHICLES_SLOWING_TO_LOOK_AT_ACCIDENT)
519 sub_cause_code_type = "vehicles slowing to look at accident";
520 else if (sub_cause_code == SlowVehicleSubCauseCode().ABNORMAL_LOAD)
521 sub_cause_code_type = "abnormal load";
522 else if (sub_cause_code == SlowVehicleSubCauseCode().ABNORMAL_WIDE_LOAD)
523 sub_cause_code_type = "abnormal wide load";
524 else if (sub_cause_code == SlowVehicleSubCauseCode().CONVOY)
525 sub_cause_code_type = "convoy";
526 else if (sub_cause_code == SlowVehicleSubCauseCode().SNOWPLOUGH)
527 sub_cause_code_type = "snowplough";
528 else if (sub_cause_code == SlowVehicleSubCauseCode().DEICING)
529 sub_cause_code_type = "deicing";
530 else if (sub_cause_code == SlowVehicleSubCauseCode().SALTING_VEHICLES)
531 sub_cause_code_type = "salting vehicles";
532 } else if (cause_code == CauseCodeChoice().CHOICE_DANGEROUS_END_OF_QUEUE27) {
533 if (sub_cause_code == DangerousEndOfQueueSubCauseCode().UNAVAILABLE)
534 sub_cause_code_type = "unavailable";
535 else if (sub_cause_code == DangerousEndOfQueueSubCauseCode().SUDDEN_END_OF_QUEUE)
536 sub_cause_code_type = "sudden end of queue";
537 else if (sub_cause_code == DangerousEndOfQueueSubCauseCode().QUEUE_OVER_HILL)
538 sub_cause_code_type = "queue over hill";
539 else if (sub_cause_code == DangerousEndOfQueueSubCauseCode().QUEUE_AROUND_BEND)
540 sub_cause_code_type = "queue around bend";
541 else if (sub_cause_code == DangerousEndOfQueueSubCauseCode().QUEUE_IN_TUNNEL)
542 sub_cause_code_type = "queue in tunnel";
543 } else if (cause_code == CauseCodeChoice().CHOICE_PUBLIC_TRANSPORT_VEHICLE_APPROACHING28)
544 sub_cause_code_type = "not defined";
545 else if (cause_code == CauseCodeChoice().CHOICE_VEHICLE_BREAKDOWN91) {
546 if (sub_cause_code == VehicleBreakdownSubCauseCode().UNAVAILABLE)
547 sub_cause_code_type = "unavailable";
548 else if (sub_cause_code == VehicleBreakdownSubCauseCode().LACK_OF_FUEL)
549 sub_cause_code_type = "lack of fuel";
550 else if (sub_cause_code == VehicleBreakdownSubCauseCode().LACK_OF_BATTERY_POWER)
551 sub_cause_code_type = "lack of battery power";
552 else if (sub_cause_code == VehicleBreakdownSubCauseCode().ENGINE_PROBLEM)
553 sub_cause_code_type = "engine problem";
554 else if (sub_cause_code == VehicleBreakdownSubCauseCode().TRANSMISSION_PROBLEM)
555 sub_cause_code_type = "transmission problem";
556 else if (sub_cause_code == VehicleBreakdownSubCauseCode().ENGINE_COOLING_PROBLEM)
557 sub_cause_code_type = "engine cooling problem";
558 else if (sub_cause_code == VehicleBreakdownSubCauseCode().BRAKING_SYSTEM_PROBLEM)
559 sub_cause_code_type = "braking system problem";
560 else if (sub_cause_code == VehicleBreakdownSubCauseCode().STEERING_PROBLEM)
561 sub_cause_code_type = "steering problem";
562 else if (sub_cause_code == VehicleBreakdownSubCauseCode().TYRE_PUNCTURE)
563 sub_cause_code_type = "tyre puncture";
564 else if (sub_cause_code == VehicleBreakdownSubCauseCode().TYRE_PRESSURE_PROBLEM)
565 sub_cause_code_type = "tyre pressure problem";
566 else if (sub_cause_code == VehicleBreakdownSubCauseCode().VEHICLE_ON_FIRE)
567 sub_cause_code_type = "vehicle on fire";
568 } else if (cause_code == CauseCodeChoice().CHOICE_POST_CRASH92) {
569 if (sub_cause_code == PostCrashSubCauseCode().UNAVAILABLE)
570 sub_cause_code_type = "unavailable";
571 else if (sub_cause_code == PostCrashSubCauseCode().ACCIDENT_WITHOUT_E_CALL_TRIGGERED)
572 sub_cause_code_type = "accident without e-Call triggered";
573 else if (sub_cause_code == PostCrashSubCauseCode().ACCIDENT_WITH_E_CALL_MANUALLY_TRIGGERED)
574 sub_cause_code_type = "accident with e-Call manually triggered";
575 else if (sub_cause_code == PostCrashSubCauseCode().ACCIDENT_WITH_E_CALL_AUTOMATICALLY_TRIGGERED)
576 sub_cause_code_type = "accident with e-Call automatically triggered";
577 else if (sub_cause_code == PostCrashSubCauseCode().ACCIDENT_WITH_E_CALL_TRIGGERED_WITHOUT_ACCESS_TO_CELLULAR_NETWORK)
578 sub_cause_code_type = "accident with e-Call triggered without a possible access to a cell network";
579 } else if (cause_code == CauseCodeChoice().CHOICE_HUMAN_PROBLEM93) {
580 if (sub_cause_code == HumanProblemSubCauseCode().UNAVAILABLE)
581 sub_cause_code_type = "unavailable";
582 else if (sub_cause_code == HumanProblemSubCauseCode().GLYCEMIA_PROBLEM)
583 sub_cause_code_type = "glycemia problem";
584 else if (sub_cause_code == HumanProblemSubCauseCode().HEART_PROBLEM)
585 sub_cause_code_type = "heart problem";
586 } else if (cause_code == CauseCodeChoice().CHOICE_STATIONARY_VEHICLE94) {
587 if (sub_cause_code == StationaryVehicleSubCauseCode().UNAVAILABLE)
588 sub_cause_code_type = "unavailable";
589 else if (sub_cause_code == StationaryVehicleSubCauseCode().HUMAN_PROBLEM)
590 sub_cause_code_type = "human problem";
591 else if (sub_cause_code == StationaryVehicleSubCauseCode().VEHICLE_BREAKDOWN)
592 sub_cause_code_type = "vehicle breakdown";
593 else if (sub_cause_code == StationaryVehicleSubCauseCode().POST_CRASH)
594 sub_cause_code_type = "post crash";
595 else if (sub_cause_code == StationaryVehicleSubCauseCode().PUBLIC_TRANSPORT_STOP)
596 sub_cause_code_type = "public transport stop";
597 else if (sub_cause_code == StationaryVehicleSubCauseCode().CARRYING_DANGEROUS_GOODS)
598 sub_cause_code_type = "carrying dangerous goods";
599 else if (sub_cause_code == StationaryVehicleSubCauseCode().VEHICLE_ON_FIRE)
600 sub_cause_code_type = "vehicle on fire";
601 } else if (cause_code == CauseCodeChoice().CHOICE_EMERGENCY_VEHICLE_APPROACHING95) {
602 if (sub_cause_code == EmergencyVehicleApproachingSubCauseCode().UNAVAILABLE)
603 sub_cause_code_type = "unavailable";
604 else if (sub_cause_code == EmergencyVehicleApproachingSubCauseCode().EMERGENCY_VEHICLE_APPROACHING)
605 sub_cause_code_type = "emergency vehicle approaching";
606 else if (sub_cause_code == EmergencyVehicleApproachingSubCauseCode().PRIORITIZED_VEHICLE_APPROACHING)
607 sub_cause_code_type = "prioritized vehicle approaching";
608 } else if (cause_code == CauseCodeChoice().CHOICE_HAZARDOUS_LOCATION_DANGEROUS_CURVE96) {
609 if (sub_cause_code == HazardousLocationDangerousCurveSubCauseCode().UNAVAILABLE)
610 sub_cause_code_type = "unavailable";
611 else if (sub_cause_code == HazardousLocationDangerousCurveSubCauseCode().DANGEROUS_LEFT_TURN_CURVE)
612 sub_cause_code_type = "dangerous left turn curve";
613 else if (sub_cause_code == HazardousLocationDangerousCurveSubCauseCode().DANGEROUS_RIGHT_TURN_CURVE)
614 sub_cause_code_type = "dangerous right turn curve";
615 else if (sub_cause_code == HazardousLocationDangerousCurveSubCauseCode().MULTIPLE_CURVES_STARTING_WITH_UNKNOWN_TURNING_DIRECTION)
616 sub_cause_code_type = "multiple curves starting with unknown turning direction";
617 else if (sub_cause_code == HazardousLocationDangerousCurveSubCauseCode().MULTIPLE_CURVES_STARTING_WITH_LEFT_TURN)
618 sub_cause_code_type = "multiple curves starting with left turn";
619 else if (sub_cause_code == HazardousLocationDangerousCurveSubCauseCode().MULTIPLE_CURVES_STARTING_WITH_RIGHT_TURN)
620 sub_cause_code_type = "multiple curves starting with right turn";
621 } else if (cause_code == CauseCodeChoice().CHOICE_COLLISION_RISK97) {
622 if (sub_cause_code == CollisionRiskSubCauseCode().UNAVAILABLE)
623 sub_cause_code_type = "unavailable";
624 else if (sub_cause_code == CollisionRiskSubCauseCode().LONGITUDINAL_COLLISION_RISK)
625 sub_cause_code_type = "longitudinal collision risk";
626 else if (sub_cause_code == CollisionRiskSubCauseCode().CROSSING_COLLISION_RISK)
627 sub_cause_code_type = "crossing collision risk";
628 else if (sub_cause_code == CollisionRiskSubCauseCode().LATERAL_COLLISION_RISK)
629 sub_cause_code_type = "lateral collision risk";
630 else if (sub_cause_code == CollisionRiskSubCauseCode().VULNERABLE_ROAD_USER)
631 sub_cause_code_type = "collision risk involving vulnerable road user";
632 else if (sub_cause_code == CollisionRiskSubCauseCode().COLLISION_RISK_WITH_PEDESTRIAN)
633 sub_cause_code_type = "collision risk involving pedestrian";
634 else if (sub_cause_code == CollisionRiskSubCauseCode().COLLISION_RISK_WITH_CYCLIST)
635 sub_cause_code_type = "collision risk involving cyclist";
636 else if (sub_cause_code == CollisionRiskSubCauseCode().COLLISION_RISK_WITH_MOTOR_VEHICLE)
637 sub_cause_code_type = "collision risk involving motor vehicle";
638 } else if (cause_code == CauseCodeChoice().CHOICE_SIGNAL_VIOLATION98) {
639 if (sub_cause_code == SignalViolationSubCauseCode().UNAVAILABLE)
640 sub_cause_code_type = "unavailable";
641 else if (sub_cause_code == SignalViolationSubCauseCode().STOP_SIGN_VIOLATION)
642 sub_cause_code_type = "stop sign violation";
643 else if (sub_cause_code == SignalViolationSubCauseCode().TRAFFIC_LIGHT_VIOLATION)
644 sub_cause_code_type = "traffic light violation";
645 else if (sub_cause_code == SignalViolationSubCauseCode().TURNING_REGULATION_VIOLATION)
646 sub_cause_code_type = "turning regulation violation";
647 } else if (cause_code == CauseCodeChoice().CHOICE_DANGEROUS_SITUATION99) {
648 if (sub_cause_code == DangerousSituationSubCauseCode().UNAVAILABLE)
649 sub_cause_code_type = "unavailable";
650 else if (sub_cause_code == DangerousSituationSubCauseCode().EMERGENCY_ELECTRONIC_BRAKE_ENGAGED)
651 sub_cause_code_type = "emergency electronic brake engaged";
652 else if (sub_cause_code == DangerousSituationSubCauseCode().PRE_CRASH_SYSTEM_ENGAGED)
653 sub_cause_code_type = "pre-crash system engaged";
654 else if (sub_cause_code == DangerousSituationSubCauseCode().ESP_ENGAGED)
655 sub_cause_code_type = "ESP (electronic stability program) engaged";
656 else if (sub_cause_code == DangerousSituationSubCauseCode().ABS_ENGAGED)
657 sub_cause_code_type = "ABS (anti-lock braking system) engaged";
658 else if (sub_cause_code == DangerousSituationSubCauseCode().EB_ENGAGED)
659 sub_cause_code_type = "AEB (automatic emergency braking) engaged";
660 else if (sub_cause_code == DangerousSituationSubCauseCode().BRAKE_WARNING_ENGAGED)
661 sub_cause_code_type = "brake warning engaged";
662 else if (sub_cause_code == DangerousSituationSubCauseCode().COLLISION_RISK_WARNING_ENGAGED)
663 sub_cause_code_type = "collision risk warning engaged";
664 } else if (cause_code == CauseCodeChoice().CHOICE_RAILWAY_LEVEL_CROSSING100) {
665 if (sub_cause_code == RailwayLevelCrossingSubCauseCode().UNAVAILABLE)
666 sub_cause_code_type = "unavailable";
667 else if (sub_cause_code == RailwayLevelCrossingSubCauseCode().DO_NOT_CROSS_ABNORMAL_SITUATION)
668 sub_cause_code_type = "do not cross abnormal situation";
669 else if (sub_cause_code == RailwayLevelCrossingSubCauseCode().CLOSED)
670 sub_cause_code_type = "closed";
671 else if (sub_cause_code == RailwayLevelCrossingSubCauseCode().UNGUARDED)
672 sub_cause_code_type = "unguarded";
673 else if (sub_cause_code == RailwayLevelCrossingSubCauseCode().NOMINAL)
674 sub_cause_code_type = "nominal";
675 }
676 return sub_cause_code_type;
677 } else {
678 throw std::invalid_argument("SituationContainer is not present!");
679 }
680}
681
682} // namespace etsi_its_denm_ts_msgs::access
Getter functions for the ETSI ITS Common Data Dictionary (CDD) v2.2.1.
Common getter functions for the ETSI ITS DENM (EN and TS).
double getWGSHeading(const DENM &denm)
Get the WGS Heading object.
double getWGSHeadingConfidenceCDD(const Wgs84Angle &heading)
Get the WGS Heading confidence.
double getWGSHeadingCDD(const Wgs84Angle &heading)
Get the WGS Heading value.
std::string getCauseCodeType(const DENM &denm)
Get the Cause Code Type object.
double getWGSHeadingConfidence(const DENM &denm)
Get the WGS Heading confidence.
std::string getSubCauseCodeType(const DENM &denm)
Get the Sub Cause Code Type object.
uint8_t getCauseCode(const DENM &denm)
Get the Cause Code object.
uint8_t getSubCauseCode(const DENM &denm)
Get the Sub Cause Code object.