Build: add GCC-13, Clang-14, Clang-15, Clang-16, Clang-17
[marnav.git] / src / marnav / ais / name.cpp
blob8d96a5435cea19c3598dec57f71ee88cf01946e4
1 #include <marnav/ais/name.hpp>
3 namespace marnav::ais
5 std::string to_name(message_id t)
7 switch (t) {
8 case message_id::NONE:
9 return "<none>";
10 case message_id::position_report_class_a:
11 return "Position Report Class A";
12 case message_id::position_report_class_a_assigned_schedule:
13 return "Position Report Class A - Assigned Schedule";
14 case message_id::position_report_class_a_response_to_interrogation:
15 return "Position Report Class A - Response to Interrogation";
16 case message_id::base_station_report:
17 return "Base Station Report";
18 case message_id::static_and_voyage_related_data:
19 return "Static and Voyage related Data";
20 case message_id::binary_addressed_message:
21 return "Binary Addressed Message";
22 case message_id::binary_acknowledge:
23 return "Binary Acknowledge";
24 case message_id::binary_broadcast_message:
25 return "Binary Broadcast Message";
26 case message_id::standard_sar_aircraft_position_report:
27 return "Standard SAR Aircraft Position Report";
28 case message_id::utc_and_date_inquiry:
29 return "UTC and Date Inquiry";
30 case message_id::utc_and_date_response:
31 return "UTC and Date Response";
32 case message_id::addressed_safety_related_message:
33 return "Addresed Safety related Message";
34 case message_id::safety_related_acknowledgement:
35 return "Safety related Acknowledgement";
36 case message_id::safety_related_broadcast_message:
37 return "Safety related Broadcast Message";
38 case message_id::interrogation:
39 return "Interrogation";
40 case message_id::assignment_mode_command:
41 return "Assignment Mode Command";
42 case message_id::dgnss_binary_broadcast_message:
43 return "DGNSS Binary Broadcast Message";
44 case message_id::standard_class_b_cs_position_report:
45 return "Standard Class B CS Position Report";
46 case message_id::extended_class_b_equipment_position_report:
47 return "Extended Class B Equipment Position Report";
48 case message_id::data_link_management:
49 return "Data Link Management";
50 case message_id::aid_to_navigation_report:
51 return "Aid to Navigation Report";
52 case message_id::channel_management:
53 return "Channel Management";
54 case message_id::group_assignment_command:
55 return "Group Assignment Command";
56 case message_id::static_data_report:
57 return "Static Data Report";
58 case message_id::single_slot_binary_message:
59 return "Single Slot Binary Message";
60 case message_id::multiple_slot_binary_message_with_communications_state:
61 return "Multiple slot Binary Message with Communication State";
62 case message_id::position_report_for_long_range_applications:
63 return "Position Report for long range Applications";
65 return "-";
68 /// Returns a printable name (in english) for the specified type.
69 ///
70 /// @param[in] t Ship type to get the name for.
71 /// @return The printable name for the ship type.
72 std::string to_name(ship_type t)
74 switch (t) {
75 case ship_type::not_available:
76 return "Not Available";
77 case ship_type::wing_in_ground:
78 return "Wing in ground";
79 case ship_type::wing_in_ground_hazardous_cat_a:
80 return "Wing in ground hazardous Cat A";
81 case ship_type::wing_in_ground_hazardous_cat_b:
82 return "Wing in ground hazardous Cat B";
83 case ship_type::wing_in_ground_hazardous_cat_c:
84 return "Wing in ground hazardous Cat C";
85 case ship_type::wing_in_ground_hazardous_cat_d:
86 return "Wing in ground hazardous Cat D";
87 case ship_type::fishing:
88 return "Fishing";
89 case ship_type::towing:
90 return "Towing";
91 case ship_type::towing_large:
92 return "Towing large";
93 case ship_type::dredging_or_underwater_ops:
94 return "Dredging or underwater ops";
95 case ship_type::diving_ops:
96 return "Diving ops";
97 case ship_type::military_ops:
98 return "Military ops";
99 case ship_type::sailing:
100 return "Sailing";
101 case ship_type::pleasure_craft:
102 return "Pleasure Craft";
103 case ship_type::high_speed_craft:
104 return "High speed craft";
105 case ship_type::high_speed_craft_hazardous_cat_a:
106 return "High speed craft hazardous Cat A";
107 case ship_type::high_speed_craft_hazardous_cat_b:
108 return "High speed craft hazardous Cat B";
109 case ship_type::high_speed_craft_hazardous_cat_c:
110 return "High speed craft hazardous Cat C";
111 case ship_type::high_speed_craft_hazardous_cat_d:
112 return "High speed craft hazardous Cat D";
113 case ship_type::high_speed_craft_no_info:
114 return "High speed craft no_info";
115 case ship_type::pilot_vessel:
116 return "Pilot Vessel";
117 case ship_type::search_and_rescue_vessel:
118 return "Search and Rescue Vessel";
119 case ship_type::tug:
120 return "Tug";
121 case ship_type::port_tender:
122 return "Port Tender";
123 case ship_type::anti_pollution_equipment:
124 return "Anti Pollution Equipment";
125 case ship_type::law_enforcement:
126 return "Law Enforcement";
127 case ship_type::medical_transport:
128 return "Medical Transport";
129 case ship_type::noncombatant:
130 return "Noncombatant";
131 case ship_type::passenger:
132 return "Passenger";
133 case ship_type::passenger_hazardous_cat_a:
134 return "Passenger hazardous Cat A";
135 case ship_type::passenger_hazardous_cat_b:
136 return "Passenger hazardous Cat B";
137 case ship_type::passenger_hazardous_cat_c:
138 return "Passenger hazardous Cat C";
139 case ship_type::passenger_hazardous_cat_d:
140 return "Passenger hazardous Cat D";
141 case ship_type::passenger_no_info:
142 return "Passenger no info";
143 case ship_type::cargo:
144 return "Cargo";
145 case ship_type::cargo_hazardous_cat_a:
146 return "Cargo hazardous Cat A";
147 case ship_type::cargo_hazardous_cat_b:
148 return "Cargo hazardous Cat B";
149 case ship_type::cargo_hazardous_cat_c:
150 return "Cargo hazardous Cat C";
151 case ship_type::cargo_hazardous_cat_d:
152 return "Cargo hazardous Cat D";
153 case ship_type::cargo_no_info:
154 return "Cargo no info";
155 case ship_type::tanker:
156 return "Tanker";
157 case ship_type::tanker_hazardous_cat_a:
158 return "Tanker hazardous Cat A";
159 case ship_type::tanker_hazardous_cat_b:
160 return "Tanker hazardous Cat B";
161 case ship_type::tanker_hazardous_cat_c:
162 return "Tanker hazardous Cat C";
163 case ship_type::tanker_hazardous_cat_d:
164 return "Tanker hazardous Cat D";
165 case ship_type::tanker_no_info:
166 return "Tanker no info";
167 case ship_type::other:
168 return "Other";
169 case ship_type::other_hazardous_cat_a:
170 return "Other hazardous Cat A";
171 case ship_type::other_hazardous_cat_b:
172 return "Other hazardous Cat B";
173 case ship_type::other_hazardous_cat_c:
174 return "Other hazardous Cat C";
175 case ship_type::other_hazardous_cat_d:
176 return "Other hazardous Cat D";
177 case ship_type::other_no_info:
178 return "Other no info";
180 return "-";
183 std::string to_name(epfd_fix_type t)
185 switch (t) {
186 case epfd_fix_type::undefined:
187 return "undefined";
188 case epfd_fix_type::gps:
189 return "GPS";
190 case epfd_fix_type::glonass:
191 return "GLONASS";
192 case epfd_fix_type::combined_gps_glonass:
193 return "Combined GPS GLONASS";
194 case epfd_fix_type::loran_c:
195 return "Loran C";
196 case epfd_fix_type::chayka:
197 return "Chayka";
198 case epfd_fix_type::integrated_navigation_system:
199 return "Integrated Navigation System";
200 case epfd_fix_type::surveyed:
201 return "surveyed";
202 case epfd_fix_type::galileo:
203 return "Galileo";
205 return "-";
208 std::string to_name(navigation_status t)
210 switch (t) {
211 case navigation_status::under_way_using_engine:
212 return "Under way using Engine";
213 case navigation_status::at_anchor:
214 return "At Anchor";
215 case navigation_status::not_under_command:
216 return "Not under Command";
217 case navigation_status::restricted_maneuverability:
218 return "Restricted Maneuverability";
219 case navigation_status::constrained_by_her_draught:
220 return "Constrained by her Draught";
221 case navigation_status::moored:
222 return "Moored";
223 case navigation_status::aground:
224 return "Aground";
225 case navigation_status::engaged_in_Fishing:
226 return "Engaged in Fishing";
227 case navigation_status::under_way_sailing:
228 return "Under way Sailing";
229 case navigation_status::reserved_09:
230 break;
231 case navigation_status::reserved_10:
232 break;
233 case navigation_status::reserved_11:
234 break;
235 case navigation_status::reserved_12:
236 break;
237 case navigation_status::reserved_13:
238 break;
239 case navigation_status::ais_sart_is_active:
240 return "AIS SART is Active";
241 case navigation_status::not_defined:
242 return "Not Defined";
244 return "-";
247 std::string to_name(virtual_aid t)
249 switch (t) {
250 case virtual_aid::real_aid:
251 return "Real Aid";
252 case virtual_aid::virtual_aid:
253 return "Virtual Aid";
255 return "-";
258 std::string to_name(off_position_indicator t)
260 switch (t) {
261 case off_position_indicator::on_position:
262 return "On Position";
263 case off_position_indicator::off_position:
264 return "Off Position";
266 return "-";
269 std::string to_name(aid_type_id t)
271 switch (t) {
272 case aid_type_id::unspecified:
273 return "unspecified";
274 case aid_type_id::reference_point:
275 return "Reference point";
276 case aid_type_id::racon:
277 return "RACON (radar transponder marking a navigation hazard)";
278 case aid_type_id::fixed_structure:
279 return "Fixed structure";
280 case aid_type_id::reserved:
281 return "Spare, Reserved for future use";
282 case aid_type_id::light_no_sectors:
283 return "Light, without sectors";
284 case aid_type_id::light_sectors:
285 return "Light, with sectors";
286 case aid_type_id::leading_light_fromt:
287 return "Leading Light Front";
288 case aid_type_id::leading_light_rear:
289 return "Leading Light Rear";
290 case aid_type_id::beacon_cardinal_n:
291 return "Beacon, Cardinal N";
292 case aid_type_id::beacon_cardinal_e:
293 return "Beacon, Cardinal E";
294 case aid_type_id::beacon_cardinal_s:
295 return "Beacon, Cardinal S";
296 case aid_type_id::beacon_cardinal_w:
297 return "Beacon, Cardinal W";
298 case aid_type_id::beacon_port_hand:
299 return "Beacon, Port hand";
300 case aid_type_id::beacon_starboard_hand:
301 return "Beacon, Starboard hand";
302 case aid_type_id::beacon_preferred_channel_port_hand:
303 return "Beacon, Preferred Channel port hand";
304 case aid_type_id::beacon_preferred_channel_starboard_hand:
305 return "Beacon, Preferred Channel starboard hand";
306 case aid_type_id::beacon_isolated_danger:
307 return "Beacon, Isolated danger";
308 case aid_type_id::beacon_safe_water:
309 return "Beacon, Safe water";
310 case aid_type_id::beacon_sepcial_mark:
311 return "Beacon, Special mark";
312 case aid_type_id::cardinal_n:
313 return "Cardinal Mark N";
314 case aid_type_id::cardinal_e:
315 return "Cardinal Mark E";
316 case aid_type_id::cardinal_s:
317 return "Cardinal Mark S";
318 case aid_type_id::cardinal_w:
319 return "Cardinal Mark W";
320 case aid_type_id::mark_port_hand:
321 return "Port hand Mark";
322 case aid_type_id::mark_starboard_hand:
323 return "Starboard hand Mark";
324 case aid_type_id::preferred_channel_port_hand:
325 return "Preferred Channel Port hand";
326 case aid_type_id::preferred_channel_starboard_hand:
327 return "Preferred Channel Starboard hand";
328 case aid_type_id::isolated_danger:
329 return "Isolated danger";
330 case aid_type_id::safe_water:
331 return "Safe Water";
332 case aid_type_id::special_mark:
333 return "Special Mark";
334 case aid_type_id::light_vessel:
335 return "Light Vessel / LANBY / Rigs";
337 return "-";
340 std::string to_name(maneuver_indicator_id t)
342 switch (t) {
343 case maneuver_indicator_id::not_available:
344 return "Not Available";
345 case maneuver_indicator_id::normal:
346 return "Not Special";
347 case maneuver_indicator_id::special:
348 return "Special";
350 return "-";
353 std::string to_name(data_terminal t)
355 switch (t) {
356 case data_terminal::ready:
357 return "ready";
358 case data_terminal::not_ready:
359 return "not ready";
361 return "-";