24#include <unordered_map>
26#include <wx/datetime.h>
29#include "ais_target_data.h"
30#include "config_vars.h"
31#include "ocpn_frame.h"
32#include "navutil_base.h"
35extern bool g_bAISRolloverShowClass;
36extern bool g_bAISRolloverShowCOG;
37extern bool g_bAISRolloverShowCPA;
38extern bool g_bShowMag;
39extern bool g_bShowTrue;
41extern bool g_bAISShowTracks;
44static std::unordered_map<int, wxString> s_ERI_hash;
46void make_hash_ERI(
int key,
const wxString &description) {
47 s_ERI_hash[key] = description;
50void clear_hash_ERI() { s_ERI_hash.clear(); }
52static wxString FormatTimeAdaptive(
int seconds) {
55 return wxString::Format(_T(
"%3ds"), seconds);
56 else if (seconds < 3600) {
59 return wxString::Format(_T(
"%2dmin %02ds"), m, s);
61 int h = seconds / 3600;
63 return wxString::Format(_T(
"%2dh %02dmin"), h, m);
66static wxString html_escape(
const wxString &src) {
70 ret.Replace(_T(
"<"), _T(
"<"));
71 ret.Replace(_T(
">"), _T(
">"));
83wxString trimAISField(
char *data) {
86 wxString field = wxString::From8BitData(data);
87 while (field.Right(1) ==
'@' || field.Right(1) ==
' ') field.RemoveLast();
96wxString ais_get_status(
int index) {
97 static const wxString ais_status[] = {
98 _(
"Underway using Engine"),
100 _(
"Not Under Command"),
101 _(
"Restricted Manoeuvrability"),
102 _(
"Constrained by draught"),
105 _(
"Engaged in Fishing"),
106 _(
"Underway Sailing"),
107 _(
"High Speed Craft"),
108 _(
"Wing In Ground Effect"),
109 _(
"Power-driven vessel towing astern (regional use)"),
110 _(
"Power-driven vessel pushing ahead or towing alongside (regional use)"),
115 _(
"AtoN Virtual (On Position)"),
116 _(
"AtoN Virtual (Off Position)"),
118 _(
"AtoN Real (On Position)"),
119 _(
"AtoN Real(Off Position)")};
121 return ais_status[index];
125 strncpy(ShipName,
"Unknown ", SHIP_NAME_LEN);
126 strncpy(CallSign,
" ", 8);
127 strncpy(Destination,
" ", DESTINATION_LEN);
128 ShipNameExtension[0] = 0;
129 b_show_AIS_CPA =
false;
138 wxDateTime now = wxDateTime::Now();
140 PositionReportTicks = now.GetTicks();
141 StaticReportTicks = now.GetTicks();
148 NavStatus = UNDEFINED;
152 b_isDSCtarget =
false;
162 DimA = DimB = DimC = DimD = 0;
179 n_alert_state = AIS_NO_ALERT;
180 b_suppress_audio =
false;
181 b_positionDoubtful =
false;
182 b_positionOnceValid =
false;
188 strncpy(Euro_VIN,
" ", 8);
191 b_isEuroInland =
false;
192 b_blue_paddle =
false;
196 b_PersistTrack =
false;
197 b_mPropPersistTrack =
false;
198 b_in_ack_timeout =
false;
203 b_isFollower =
false;
205 b_show_track = g_bAISShowTracks;
206 b_SarAircraftPosnReport =
false;
208 b_nameFromCache =
false;
210 for (
unsigned int i = 0; i < AIS_TARGETDATA_MAX_CANVAS; i++)
215 strncpy(ShipName, q->ShipName, SHIP_NAME_LEN);
216 strncpy(CallSign, q->CallSign, 8);
217 strncpy(Destination, q->Destination, DESTINATION_LEN);
218 ShipNameExtension[0] = 0;
219 b_show_AIS_CPA = q->b_show_AIS_CPA;
229 PositionReportTicks = q->PositionReportTicks;
230 StaticReportTicks = q->StaticReportTicks;
232 b_removed = q->b_removed;
237 NavStatus = q->NavStatus;
238 SyncState = q->SyncState;
240 ShipType = q->ShipType;
241 b_isDSCtarget = q->b_isDSCtarget;
242 m_dscNature = q->m_dscNature;
243 m_dscTXmmsi = q->m_dscTXmmsi;
248 Range_NM = q->Range_NM;
257 ETA_Day = q->ETA_Day;
259 ETA_Min = q->ETA_Min;
263 RecentPeriod = q->RecentPeriod;
265 m_utc_hour = q->m_utc_hour;
266 m_utc_min = q->m_utc_min;
267 m_utc_sec = q->m_utc_sec;
270 n_alert_state = q->n_alert_state;
271 b_suppress_audio = q->b_suppress_audio;
272 b_positionDoubtful = q->b_positionDoubtful;
273 b_positionOnceValid = q->b_positionOnceValid;
274 b_nameValid = q->b_nameValid;
276 Euro_Length = q->Euro_Length;
277 Euro_Beam = q->Euro_Beam;
278 Euro_Draft = q->Euro_Draft;
279 memcpy(Euro_VIN, q->Euro_VIN, EURO_VIN_LEN);
280 UN_shiptype = q->UN_shiptype;
282 b_isEuroInland = q->b_isEuroInland;
283 b_blue_paddle = q->b_blue_paddle;
285 b_OwnShip = q->b_OwnShip;
286 b_in_ack_timeout = q->b_in_ack_timeout;
288 m_ptrack = q->m_ptrack;
290 b_active = q->b_active;
291 blue_paddle = q->blue_paddle;
292 bCPA_Valid = q->bCPA_Valid;
294 b_show_track = q->b_show_track;
295 b_SarAircraftPosnReport = q->b_SarAircraftPosnReport;
296 altitude = q->altitude;
299AisTargetData::~AisTargetData() { m_ptrack.clear(); }
301wxString AisTargetData::GetFullName(
void) {
304 wxString shipName = trimAISField(ShipName);
305 if (shipName == _T(
"Unknown"))
306 retName = wxGetTranslation(shipName);
310 if (strlen(ShipNameExtension)) {
311 wxString shipNameExt = trimAISField(ShipNameExtension);
312 retName += shipNameExt;
319wxString AisTargetData::BuildQueryResult(
void) {
321 wxDateTime now = wxDateTime::Now();
323 wxString tableStart = _T(
"\n<table border=0 cellpadding=1 cellspacing=0>\n");
324 wxString tableEnd = _T(
"</table>\n\n");
325 wxString rowStart = _T(
"<tr><td><font size=-2>");
326 wxString rowStartH = _T(
"<tr><td nowrap>");
327 wxString rowSeparator = _T(
"</font></td><td></td><td><b>");
328 wxString rowSeparatorH = _T(
"</td><td></td><td>");
329 wxString colSeparator = _T(
"<td></td>");
330 wxString rowEnd = _T(
"</b></td></tr>\n");
331 wxString vertSpacer =
332 _T(
"<tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>\n\n");
334 wxString IMOstr, MMSIstr, ClassStr;
336 html << tableStart << _T(
"<tr><td nowrap colspan=2>");
338 html << _T(
"<font size=+2><i><b>") << GetFullName();
339 html << _T(
"</b></i></font> <b>");
342 if ((Class != AIS_ATON) && (Class != AIS_BASE) && (Class != AIS_GPSG_BUDDY) &&
343 (Class != AIS_SART)) {
344 html << trimAISField(CallSign) << _T(
"</b>") << rowEnd;
346 if (Class != AIS_CLASS_B) {
347 if (IMO > 0) IMOstr = wxString::Format(_T(
"%08d"), abs(IMO));
350 html << _T(
"</b>") << rowEnd;
354 if (Class != AIS_GPSG_BUDDY) {
355 MMSIstr = wxString::Format(_T(
"%09d"), abs(MMSI));
357 ClassStr = wxGetTranslation(Get_class_string(
false));
359 if (Class == AIS_ATON) {
360 wxString cls(_T(
"AtoN: "));
361 cls += Get_vessel_type_string(
false);
362 ClassStr = wxGetTranslation(cls);
365 if (b_SarAircraftPosnReport) {
366 int airtype = (MMSI % 1000) / 100;
367 ClassStr = airtype == 5 ? _(
"SAR Helicopter") : _(
"SAR Aircraft");
371 html << _T(
"<tr><td colspan=2><table width=100% border=0 cellpadding=0 ")
373 << rowStart << _("MMSI")
374 << _T("</font></td><td> </td><td><font size=-2>") << _("Class")
375 << _T("</font></td><td> </td><td align=right><font size=-2>")
376 << _("IMO") << _T("</font></td></tr>") << rowStartH << _T("<b>")
377 << MMSIstr << _T("</b></td><td> </td><td><b>") << ClassStr
378 << _T("</b></td><td> </td><td align=right><b>") << IMOstr
379 << rowEnd << _T("</table></td></tr>");
382 html << _T("<tr><td colspan=2><table width=100% border=0 cellpadding=0 ")
384 << rowStart << _("MMSI")
385 << _T("</font></td><td> </td><td align=right><font size=-2>")
386 << _("Class") << _T("</font></td></tr>") << rowStartH << _T("<b>")
387 << MMSIstr << _T("</b></td><td> </td><td align=right><b>")
388 << ClassStr << rowEnd << _T("</table></td></tr>");
390 if ((Class != AIS_SART) )
391 html << _T("<tr><td colspan=2><table width=100% border=0 cellpadding=0 ")
394 << ((Class == AIS_BASE || Class == AIS_ATON) ? _("Nation") : _("Flag"))
395 << rowEnd << _T("</font></td></tr>") << rowStartH << _T("<b>")
396 << GetCountryCode(true) << rowEnd << _T("</table></td></tr>");
401 if ((Class != AIS_BASE) && (Class != AIS_CLASS_B) && (Class != AIS_SART)) {
402 if ((NavStatus <= 21) && (NavStatus >= 0))
403 navStatStr = wxGetTranslation(ais_get_status(NavStatus));
404 }
else if (Class == AIS_SART) {
405 if (NavStatus == RESERVED_14)
406 navStatStr = _(
"Active");
407 else if (NavStatus == UNDEFINED)
408 navStatStr = _(
"Testing");
411 wxString sart_sub_type;
412 if (Class == AIS_SART) {
413 int mmsi_start = MMSI / 1000000;
414 switch (mmsi_start) {
419 sart_sub_type = _T(
"MOB");
422 sart_sub_type = _T(
"EPIRB");
425 sart_sub_type = _(
"Unknown");
430 wxString AISTypeStr, UNTypeStr, sizeString;
431 if ((Class != AIS_BASE) && (Class != AIS_SART) && (Class != AIS_DSC)) {
433 AISTypeStr = wxGetTranslation(Get_vessel_type_string());
435 if (b_isEuroInland && UN_shiptype) {
436 auto it = s_ERI_hash.find(UN_shiptype);
438 if (it == s_ERI_hash.end())
439 type = _(
"Undefined");
443 UNTypeStr = wxGetTranslation(type);
446 if (b_SarAircraftPosnReport) {
452 if (Class == AIS_SART) {
453 if (MSG_14_text.Len()) {
454 html << rowStart << _(
"Safety Broadcast Message") << rowEnd << rowStartH
455 << _T(
"<b>") << MSG_14_text << rowEnd;
461 if (NavStatus != ATON_VIRTUAL && Class != AIS_ARPA && Class != AIS_APRS) {
462 if ((Class == AIS_CLASS_B) || (Class == AIS_ATON)) {
464 wxString::Format(_T(
"%dm x %dm"), (DimA + DimB), (DimC + DimD));
465 }
else if (!b_SarAircraftPosnReport) {
466 if ((DimA + DimB + DimC + DimD) == 0) {
467 if (b_isEuroInland) {
468 if (Euro_Length == 0.0) {
469 if (Euro_Draft > 0.01) {
470 sizeString << wxString::Format(_T(
"---m x ---m x %4.1fm"),
473 sizeString << _T(
"---m x ---m x ---m");
476 if (Euro_Draft > 0.01) {
477 sizeString << wxString::Format(_T(
"%5.1fm x %4.1fm x %4.1fm"),
478 Euro_Length, Euro_Beam,
481 sizeString << wxString::Format(_T(
"%5.1fm x %4.1fm x ---m\n\n"),
482 Euro_Length, Euro_Beam);
487 sizeString << wxString::Format(_T(
"---m x ---m x %4.1fm"), Draft);
489 sizeString << _T(
"---m x ---m x ---m");
492 }
else if (Draft < 0.01) {
493 sizeString << wxString::Format(_T(
"%dm x %dm x ---m"), (DimA + DimB),
496 sizeString << wxString::Format(_T(
"%dm x %dm x %4.1fm"),
497 (DimA + DimB), (DimC + DimD), Draft);
503 if (Class == AIS_SART) {
504 html << _T(
"<tr><td colspan=2>")
505 << _T(
"<b>") << AISTypeStr;
506 if (sart_sub_type.Length()) html << _T(
" (") << sart_sub_type << _T(
"), ");
508 html << rowEnd << _T(
"<tr><td colspan=2>")
509 << _T(
"<b>") << sizeString << rowEnd;
512 else if (Class == AIS_ATON) {
513 html << _T(
"<tr><td colspan=2>")
514 << _T(
"<b>") << navStatStr;
515 html << rowEnd << _T(
"<tr><td colspan=2>")
516 << _T(
"<b>") << sizeString << rowEnd;
518 else if (Class == AIS_DSC && (ShipType == 12 || ShipType == 16) ) {
519 if (ShipType == 16) {
520 html << _T(
"<tr><td colspan=2>") << _T(
"<b>") << _(
"Distress relay");
521 if (m_dscTXmmsi > 2000000) {
522 wxString mmsirelay = wxString::Format(_T(
" %09d"), abs(m_dscTXmmsi));
523 html << _T(
" ") << _(
"by:") << mmsirelay;
525 html << _T(
"<b>") << sizeString << rowEnd;
527 html << _T(
"<tr><td colspan=2>") << _(
"Nature of distress: ")
528 << rowEnd << _T(
"<tr><td colspan=2>");
529 if (m_dscNature < 13) {
530 html << _T(
"<tr><td colspan=2>") << _T(
"<b>") << GetNatureofDistress(m_dscNature)
531 << _T(
"<b>") << sizeString << rowEnd << _T(
"<tr><td colspan=2>");
534 else if ((Class != AIS_BASE) && (Class != AIS_DSC)) {
535 html << _T(
"<tr><td colspan=2>")
536 << _T(
"<b>") << AISTypeStr;
537 if (navStatStr.Length()) html << _T(
", ") << navStatStr;
538 if (UNTypeStr.Length()) html << _T(
" (UN Type ") << UNTypeStr << _T(
")");
539 html << rowEnd << _T(
"<tr><td colspan=2>")
540 << _T(
"<b>") << sizeString << rowEnd;
543 if (b_positionOnceValid) {
545 if (b_positionDoubtful) posTypeStr << _(
" (Last Known)");
548 int target_age = now.GetTicks() - PositionReportTicks;
553 html << vertSpacer << rowStart << _(
"Position") << posTypeStr
554 << _T(
"</font></td><td align=right><font size=-2>") << _(
"Report Age")
555 << _T(
"</font></td></tr>")
557 << rowStartH << _T(
"<b>") << toSDMM(1, Lat)
558 << _T(
"</b></td><td align=right><b>") << FormatTimeAdaptive(target_age)
559 << rowEnd << rowStartH << _T(
"<b>") << toSDMM(2, Lon) << rowEnd;
562 wxString courseStr, sogStr, hdgStr, rotStr, rngStr, brgStr, destStr, etaStr;
564 if (Class == AIS_GPSG_BUDDY) {
565 long month, year, day;
566 m_date_string.Mid(0, 2).ToLong(&day);
567 m_date_string.Mid(2, 2).ToLong(&month);
568 m_date_string.Mid(4, 2).ToLong(&year);
571 date.SetMonth((wxDateTime::Month)(month - 1));
572 date.SetYear(year + 2000);
574 wxString f_date = date.FormatISODate();
576 html << vertSpacer << rowStart << _(
"Report as of") << rowEnd << rowStartH
577 << _T(
"<b>") << f_date + _T(
"</b> at <b>")
578 << wxString::Format(_T(
"%d:%d UTC "), m_utc_hour, m_utc_min) << rowEnd;
580 if (Class == AIS_CLASS_A && !b_SarAircraftPosnReport) {
581 html << vertSpacer << rowStart << _(
"Destination")
582 << _T(
"</font></td><td align=right><font size=-2>") << _(
"ETA (UTC)")
583 << _T(
"</font></td></tr>\n") << rowStartH << _T(
"<b>");
584 wxString dest = trimAISField(Destination);
586 html << html_escape(dest);
589 html << _T(
"</b></td><td nowrap align=right><b>");
591 if ((ETA_Mo) && (ETA_Hr < 24)) {
593 if (now.GetMonth() > (ETA_Mo - 1)) yearOffset = 1;
594 wxDateTime eta(ETA_Day, wxDateTime::Month(ETA_Mo - 1),
595 now.GetYear() + yearOffset, ETA_Hr, ETA_Min);
596 html << eta.Format(_T(
"%b %d %H:%M"));
602 if (Class == AIS_CLASS_A || Class == AIS_CLASS_B || Class == AIS_ARPA ||
603 Class == AIS_APRS || Class == AIS_SART) {
604 int crs = wxRound(COG);
606 wxString magString, trueString;
608 magString << wxString::Format(wxString(
"%03d%c(M)"),
609 static_cast<int>(m_callbacks.get_mag(COG)),
612 trueString << wxString::Format( wxString(
"%03d%c "), (
int)crs, 0x00B0 );
614 courseStr << trueString << magString;
615 }
else if (COG == 360.0)
616 courseStr = _T(
"---");
618 courseStr = _T(
"0°");
620 double speed_show = toUsrSpeed(SOG);
622 if ((SOG <= 102.2) || b_SarAircraftPosnReport) {
623 if (speed_show < 10.0)
625 wxString::Format(_T(
"%.2f "), speed_show) + getUsrSpeedUnit();
626 else if (speed_show < 100.0)
628 wxString::Format(_T(
"%.1f "), speed_show) + getUsrSpeedUnit();
631 wxString::Format(_T(
"%.0f "), speed_show) + getUsrSpeedUnit();
639 hdgStr = wxString::Format(_T(
"%03d°"), (
int)HDG);
643 if (ROTAIS != -128) {
645 rotStr << _T(
"> 5°/30s ") << _(
"Right");
646 else if (ROTAIS == -127)
647 rotStr << _T(
"> 5°/30s ") << _(
"Left");
650 rotStr << wxString::Format(_T(
"%3d°/Min "), ROTIND)
653 rotStr << wxString::Format(_T(
"%3d°/Min "), -ROTIND)
658 }
else if (!b_SarAircraftPosnReport)
663 if (b_positionOnceValid && bGPSValid && (Range_NM >= 0.))
664 rngStr = FormatDistanceAdaptive(Range_NM);
668 int brg = (int)wxRound(Brg);
669 if (Brg > 359.5) brg = 0;
670 if (b_positionOnceValid && bGPSValid && (Brg >= 0.) && (Range_NM > 0.) &&
672 wxString magString, trueString;
674 magString << wxString::Format(wxString(
"%03d%c(M)"),
675 static_cast<int>(m_callbacks.get_mag(COG)),
678 trueString << wxString::Format( wxString(
"%03d%c "), (
int)Brg, 0x00B0 );
680 brgStr << trueString << magString;
684 wxString turnRateHdr;
685 if ((Class != AIS_ATON) && (Class != AIS_BASE) && (Class != AIS_DSC)) {
687 << _T(
"<tr><td colspan=2><table width=100% border=0 cellpadding=0 ")
689 << rowStart << _("Speed")
690 << _T("</font></td><td> </td><td><font size=-2>") << _("Course")
691 << _T("</font></td><td> </td><td align=right><font size=-2>");
692 if (!b_SarAircraftPosnReport) html << _("Heading");
694 html << _T("</font></td></tr>") << rowStartH << _T("<b>") << sogStr
695 << _T("</b></td><td> </td><td><b>") << courseStr
696 << _T("</b></td><td> </td><td align=right><b>");
697 if (!b_SarAircraftPosnReport) html << hdgStr;
698 html << rowEnd << _T("</table></td></tr>") << vertSpacer;
700 if (!b_SarAircraftPosnReport) turnRateHdr = _("Turn Rate");
702 html << _T("<tr><td colspan=2><table width=100% border=0 cellpadding=0 ")
704 << rowStart << _("Range")
705 << _T("</font></td><td> </td><td><font size=-2>") << _("Bearing")
706 << _T("</font></td><td> </td><td align=right><font size=-2>")
707 << turnRateHdr << _T("</font></td></tr>") << rowStartH << _T("<b>")
708 << rngStr << _T("</b></td><td> </td><td><b>") << brgStr
709 << _T("</b></td><td> </td><td align=right><b>");
711 if (!b_SarAircraftPosnReport) html << rotStr;
712 html << rowEnd << _T("</table></td></tr>") << vertSpacer;
716 tcpaStr << _T(
"</b> ") << _(
"in ") << _T(
"</td><td align=right><b>")
717 << FormatTimeAdaptive((
int)(TCPA * 60.));
719 html << rowStart << _T(
"<font size=-2>") << _(
"CPA")
720 << _T(
"</font>") << rowEnd << rowStartH << _T(
"<b>")
721 << FormatDistanceAdaptive(CPA) << tcpaStr << rowEnd;
724 if (Class != AIS_BASE) {
725 if (blue_paddle == 1) {
726 html << rowStart << _(
"Inland Blue Flag") << rowEnd << rowStartH
727 << _T(
"<b>") << _(
"Clear") << rowEnd;
728 }
else if (blue_paddle == 2) {
729 html << rowStart << _(
"Inland Blue Flag") << rowEnd << rowStartH
730 << _T(
"<b>") << _(
"Set") << rowEnd;
734 if (b_SarAircraftPosnReport) {
736 if (altitude != 4095)
737 altStr.Printf(_T(
"%4d m"), altitude);
739 altStr = _(
"Unknown");
741 html << rowStart << _(
"Altitude")
742 << _T(
"</font></td><td> </td><td><font size=-0>") << rowStartH
743 << _T(
"<b>") << altStr << _T(
"</b></td><td> </td><td><b>")
744 << rowEnd << _T(
"</table></td></tr>") << vertSpacer;
747 html << _T(
"</table>");
751wxString AisTargetData::GetRolloverString(
void) {
755 result.Append(_T(
"\""));
756 result.Append(GetFullName());
757 result.Append(_T(
"\" "));
759 if (Class != AIS_GPSG_BUDDY) {
760 t.Printf(_T(
"%09d"), abs(MMSI));
762 result.Append(_T(
" "));
763 result.Append(GetCountryCode(
false));
765 t = trimAISField(CallSign);
767 result.Append(_T(
" ("));
769 result.Append(_T(
")"));
771 if (g_bAISRolloverShowClass || (Class == AIS_SART)) {
772 if (result.Len()) result.Append(_T(
"\n"));
773 result.Append(_T(
"["));
774 if (Class == AIS_ATON) {
775 result.Append(wxGetTranslation(Get_class_string(
true)));
776 result.Append(_T(
": "));
777 result.Append(wxGetTranslation(Get_vessel_type_string(
false)));
778 }
else if (b_SarAircraftPosnReport) {
779 int airtype = (MMSI % 1000) / 100;
780 result.Append(airtype == 5 ? _(
"SAR Helicopter") : _(
"SAR Aircraft"));
782 result.Append(wxGetTranslation(Get_class_string(
false)));
784 result.Append(_T(
"] "));
785 if ((Class != AIS_ATON) && (Class != AIS_BASE)) {
786 if (Class == AIS_SART) {
787 int mmsi_start = MMSI / 1000000;
788 switch (mmsi_start) {
795 result += _T(
"EPIRB");
798 result += _(
"Unknown");
803 if (Class != AIS_SART) {
804 if (!b_SarAircraftPosnReport)
805 result.Append(wxGetTranslation(Get_vessel_type_string(
false)));
808 if ((Class != AIS_CLASS_B) && (Class != AIS_SART) &&
809 Class != AIS_DSC && !b_SarAircraftPosnReport) {
810 if ((NavStatus <= 15) && (NavStatus >= 0)) {
811 result.Append(_T(
" ("));
812 result.Append(wxGetTranslation(ais_get_status(NavStatus)));
813 result.Append(_T(
")"));
815 }
else if (Class == AIS_SART) {
816 result.Append(_T(
" ("));
817 if (NavStatus == RESERVED_14)
818 result.Append(_(
"Active"));
819 else if (NavStatus == UNDEFINED)
820 result.Append(_(
"Testing"));
821 result.Append(_T(
")"));
822 }
else if (Class == AIS_DSC) {
823 result.Append(_T(
" ("));
824 result.Append(GetNatureofDistress(m_dscNature));
825 result.Append(_T(
")"));
830 if (g_bAISRolloverShowCOG && ((SOG <= 102.2) || b_SarAircraftPosnReport) &&
831 ((Class != AIS_ATON) && (Class != AIS_BASE))) {
832 if (result.Len()) result << _T(
"\n");
834 double speed_show = toUsrSpeed(SOG);
835 if (speed_show < 10.0)
836 result << wxString::Format(_T(
"SOG %.2f "), speed_show)
837 << getUsrSpeedUnit() << _T(
" ");
838 else if (speed_show < 100.0)
839 result << wxString::Format(_T(
"SOG %.1f "), speed_show)
840 << getUsrSpeedUnit() << _T(
" ");
842 result << wxString::Format(_T(
"SOG %.0f "), speed_show)
843 << getUsrSpeedUnit() << _T(
" ");
845 int crs = wxRound(COG);
846 if (b_positionOnceValid) {
848 wxString magString, trueString;
850 magString << wxString::Format(wxString(
"%03d%c(M) "),
851 static_cast<int>(m_callbacks.get_mag(COG)),
854 trueString << wxString::Format( wxString(
"%03d%c "), (
int)crs, 0x00B0 );
856 result << trueString << magString;
859 else if (COG == 360.0)
860 result << _(
" COG Unavailable");
862 result << wxString(
" COG 000\u00B0");
864 result << _(
" COG Unavailable");
867 if (g_bAISRolloverShowCPA && bCPA_Valid) {
868 if (result.Len()) result << _T(
"\n");
869 result << _(
"CPA") << _T(
" ") << FormatDistanceAdaptive(CPA) << _T(
" ")
870 << _(
"in") << _T(
" ") << wxString::Format(_T(
"%.0f"), TCPA)
871 << _T(
" ") << _(
"min");
876wxString AisTargetData::Get_vessel_type_string(
bool b_short) {
878 if (Class == AIS_ATON) {
932 if ((Class == AIS_CLASS_B) || (Class == AIS_CLASS_A)) {
933 if ((ShipType >= 40) && (ShipType < 50)) i = 8;
935 if ((ShipType >= 60) && (ShipType < 70)) i = 16;
937 if ((ShipType >= 70) && (ShipType < 80)) i = 17;
939 if ((ShipType >= 80) && (ShipType < 90)) i = 18;
940 }
else if (Class == AIS_GPSG_BUDDY)
942 else if (Class == AIS_ARPA)
944 else if (Class == AIS_APRS)
946 else if (Class == AIS_DSC)
947 i = (ShipType == 12 || ShipType == 16) ? 54 : 53;
950 return ais_get_type(i);
952 return ais_get_short_type(i);
955wxString AisTargetData::Get_class_string(
bool b_short) {
962 return b_short ? _(
"AtoN") : _(
"Aid to Navigation");
964 return b_short ? _(
"Base") : _(
"Base Station");
966 return b_short ? _(
"Buddy") : _(
"GPSGate Buddy");
968 if (ShipType == 12 || ( ShipType == 16 && m_dscNature < 13))
969 return b_short ? _(
"DSC") : _(
"DSC Distress");
971 return b_short ? _(
"DSC") : _(
"DSC Position Report");
973 return b_short ? _(
"SART") : _(
"SART");
975 return b_short ? _(
"ARPA") : _(
"ARPA");
977 return b_short ? _(
"APRS") : _(
"APRS Position Report");
980 return b_short ? _(
"Unk") : _(
"Unknown");
984wxString AisTargetData::GetNatureofDistress(
int dscnature) {
986 wxString dscDistressType[] = { _(
"Fire, explosion"), _(
"Floding"),
987 _(
"Collision"), _(
"Grounding"),
988 _(
"Listing, in danger of capsazing"), _(
"Sinking"),
989 _(
"Disabled and adrift"), _(
"Undesignated distress"),
990 _(
"Abandoning ship"), _(
"Pirazy/armed robbery attack"),
991 _(
"Man overboard"), _T(
"-"), _(
"EPIRB emission") };
992 if (dscnature >= 0 && dscnature < 13)
993 return dscDistressType[dscnature];
995 return wxEmptyString;
998void AisTargetData::Toggle_AIS_CPA(
void) {
999 b_show_AIS_CPA = !b_show_AIS_CPA ? true :
false;
1002void AisTargetData::ToggleShowTrack(
void) {
1003 b_show_track = !b_show_track ? true :
false;
1008wxString AisTargetData::GetCountryCode(
1012 int nMID = MMSI / 1000000;
1014 if (111 == nMID) nMID = (MMSI - 111000000) / 1000;
1016 if (Class == AIS_BASE) nMID = MMSI / 10000;
1018 if (99 == MMSI / 10000000) nMID = (MMSI - 990000000) / 10000;
1020 if (nMID < 201 || nMID > 775)
return wxEmptyString;
1022#if wxUSE_XLOCALE || !wxCHECK_VERSION(3, 0, 0)
1026 return b_CntryLongStr ? _(
"Albania") : _T(
"AL");
1028 return b_CntryLongStr ? _(
"Andorra") : _T(
"AD");
1030 return b_CntryLongStr ? _(
"Austria") : _T(
"AT");
1032 return b_CntryLongStr ? _(
"Azores") : _T(
"AZ");
1034 return b_CntryLongStr ? _(
"Belgium") : _T(
"BE");
1036 return b_CntryLongStr ? _(
"Belarus") : _T(
"BY");
1038 return b_CntryLongStr ? _(
"Bulgaria") : _T(
"BG");
1040 return b_CntryLongStr ? _(
"Vatican City State") : _T(
"VA");
1043 return b_CntryLongStr ? _(
"Cyprus") : _T(
"CY");
1045 return b_CntryLongStr ? _(
"Germany") : _T(
"DE");
1047 return b_CntryLongStr ? _(
"Cyprus") : _T(
"CY");
1049 return b_CntryLongStr ? _(
"Georgia") : _T(
"GE");
1051 return b_CntryLongStr ? _(
"Moldova") : _T(
"MD");
1053 return b_CntryLongStr ? _(
"Malta") : _T(
"MT");
1055 return b_CntryLongStr ? _(
"Armenia") : _T(
"AM");
1057 return b_CntryLongStr ? _(
"Germany") : _T(
"DE");
1060 return b_CntryLongStr ? _(
"Denmark") : _T(
"DK");
1062 return b_CntryLongStr ? _(
"Spain") : _T(
"ES");
1064 return b_CntryLongStr ? _(
"Spain") : _T(
"ES");
1068 return b_CntryLongStr ? _(
"France") : _T(
"FR");
1070 return b_CntryLongStr ? _(
"Malta") : _T(
"MT");
1072 return b_CntryLongStr ? _(
"Finland") : _T(
"FI");
1074 return b_CntryLongStr ? _(
"Faroe Islands") : _T(
"FO");
1079 return b_CntryLongStr ? _(
"Great Britain") : _T(
"GB");
1081 return b_CntryLongStr ? _(
"Gibraltar") : _T(
"GI");
1083 return b_CntryLongStr ? _(
"Greece") : _T(
"GR");
1085 return b_CntryLongStr ? _(
"Croatia") : _T(
"HR");
1089 return b_CntryLongStr ? _(
"Greece") : _T(
"GR");
1091 return b_CntryLongStr ? _(
"Morocco") : _T(
"MA");
1093 return b_CntryLongStr ? _(
"Hungary") : _T(
"HU");
1097 return b_CntryLongStr ? _(
"Netherlands") : _T(
"NL");
1099 return b_CntryLongStr ? _(
"Italy") : _T(
"IT");
1102 return b_CntryLongStr ? _(
"Malta") : _T(
"MT");
1104 return b_CntryLongStr ? _(
"Ireland") : _T(
"IE");
1106 return b_CntryLongStr ? _(
"Iceland") : _T(
"IS");
1108 return b_CntryLongStr ? _(
"Liechtenstein") : _T(
"LI");
1110 return b_CntryLongStr ? _(
"Luxembourg") : _T(
"LU");
1112 return b_CntryLongStr ? _(
"Monaco") : _T(
"MC");
1114 return b_CntryLongStr ? _(
"Madeira") : _T(
"PT");
1116 return b_CntryLongStr ? _(
"Malta") : _T(
"MT");
1120 return b_CntryLongStr ? _(
"Norway") : _T(
"NO");
1122 return b_CntryLongStr ? _(
"Poland") : _T(
"PL");
1124 return b_CntryLongStr ? _(
"Montenegro") : _T(
"ME");
1126 return b_CntryLongStr ? _(
"Portugal") : _T(
"PT");
1128 return b_CntryLongStr ? _(
"Romania") : _T(
"RO");
1131 return b_CntryLongStr ? _(
"Sweden") : _T(
"SE");
1133 return b_CntryLongStr ? _(
"Slovak Republic") : _T(
"SK");
1135 return b_CntryLongStr ? _(
"San Marino") : _T(
"SM");
1137 return b_CntryLongStr ? _(
"Switzerland") : _T(
"CH");
1139 return b_CntryLongStr ? _(
"Czech Republic") : _T(
"CZ");
1141 return b_CntryLongStr ? _(
"Turkey") : _T(
"TR");
1143 return b_CntryLongStr ? _(
"Ukraine") : _T(
"UA");
1145 return b_CntryLongStr ? _(
"Russian") : _T(
"RU");
1147 return b_CntryLongStr ? _(
"Macedonia") : _T(
"MK");
1149 return b_CntryLongStr ? _(
"Latvia") : _T(
"LV");
1151 return b_CntryLongStr ? _(
"Estonia") : _T(
"EE");
1153 return b_CntryLongStr ? _(
"Lithuania") : _T(
"LT");
1155 return b_CntryLongStr ? _(
"Slovenia") : _T(
"SI");
1157 return b_CntryLongStr ? _(
"Serbia") : _T(
"RS");
1159 return b_CntryLongStr ? _(
"Anguilla") : _T(
"AI");
1161 return b_CntryLongStr ? _(
"Alaska") : _T(
"AK");
1164 return b_CntryLongStr ? _(
"Antigua and Barbuda") : _T(
"AG");
1166 return b_CntryLongStr ? _(
"Antilles") : _T(
"AN");
1168 return b_CntryLongStr ? _(
"Aruba") : _T(
"AW");
1171 return b_CntryLongStr ? _(
"Bahamas") : _T(
"BS");
1173 return b_CntryLongStr ? _(
"Bermuda") : _T(
"BM");
1175 return b_CntryLongStr ? _(
"Bahamas") : _T(
"BS");
1177 return b_CntryLongStr ? _(
"Belize") : _T(
"BZ");
1179 return b_CntryLongStr ? _(
"Barbados") : _T(
"BB");
1181 return b_CntryLongStr ? _(
"Canada") : _T(
"CA");
1183 return b_CntryLongStr ? _(
"Cayman Islands") : _T(
"KY");
1185 return b_CntryLongStr ? _(
"Costa Rica") : _T(
"CR");
1187 return b_CntryLongStr ? _(
"Cuba") : _T(
"CU");
1189 return b_CntryLongStr ? _(
"Dominica") : _T(
"DM");
1191 return b_CntryLongStr ? _(
"Dominican Republic") : _T(
"DM");
1193 return b_CntryLongStr ? _(
"Guadeloupe") : _T(
"GP");
1195 return b_CntryLongStr ? _(
"Grenada") : _T(
"GD");
1197 return b_CntryLongStr ? _(
"Greenland") : _T(
"GL");
1199 return b_CntryLongStr ? _(
"Guatemala") : _T(
"GT");
1201 return b_CntryLongStr ? _(
"Honduras") : _T(
"HN");
1203 return b_CntryLongStr ? _(
"Haiti") : _T(
"HT");
1205 return b_CntryLongStr ? _(
"United States of America") : _T(
"US");
1207 return b_CntryLongStr ? _(
"Jamaica") : _T(
"JM");
1209 return b_CntryLongStr ? _(
"Saint Kitts and Nevis") : _T(
"KN");
1211 return b_CntryLongStr ? _(
"Saint Lucia") : _T(
"LC");
1213 return b_CntryLongStr ? _(
"Mexico") : _T(
"MX");
1215 return b_CntryLongStr ? _(
"Martinique") : _T(
"MQ");
1217 return b_CntryLongStr ? _(
"Montserrat") : _T(
"MS");
1219 return b_CntryLongStr ? _(
"Nicaragua") : _T(
"NI");
1227 return b_CntryLongStr ? _(
"Panama") : _T(
"PA");
1229 return b_CntryLongStr ? _(
"Puerto Rico") : _T(
"PR");
1231 return b_CntryLongStr ? _(
"El Salvador") : _T(
"SV");
1233 return b_CntryLongStr ? _(
"Saint Pierre and Miquelon") : _T(
"PM");
1235 return b_CntryLongStr ? _(
"Trinidad and Tobago") : _T(
"TT");
1237 return b_CntryLongStr ? _(
"Turks and Caicos Islands") : _T(
"TC");
1242 return b_CntryLongStr ? _(
"United States of America") : _T(
"US");
1248 return b_CntryLongStr ? _(
"Panama") : _T(
"PA");
1252 return b_CntryLongStr ? _(
"Saint Vincent and the Grenadines") : _T(
"VC");
1254 return b_CntryLongStr ? _(
"British Virgin Islands") : _T(
"VG");
1256 return b_CntryLongStr ? _(
"United States Virgin Islands") : _T(
"AE");
1258 return b_CntryLongStr ? _(
"Afghanistan") : _T(
"AF");
1260 return b_CntryLongStr ? _(
"Saudi Arabia") : _T(
"SA");
1262 return b_CntryLongStr ? _(
"Bangladesh") : _T(
"BD");
1264 return b_CntryLongStr ? _(
"Bahrain") : _T(
"BH");
1266 return b_CntryLongStr ? _(
"Bhutan") : _T(
"BT");
1270 return b_CntryLongStr ? _(
"China") : _T(
"CN");
1272 return b_CntryLongStr ? _(
"Taiwan") : _T(
"TW");
1274 return b_CntryLongStr ? _(
"Sri Lanka") : _T(
"LK");
1276 return b_CntryLongStr ? _(
"India") : _T(
"IN");
1278 return b_CntryLongStr ? _(
"Iran") : _T(
"IR");
1280 return b_CntryLongStr ? _(
"Azerbaijani Republic") : _T(
"AZ");
1282 return b_CntryLongStr ? _(
"Iraq") : _T(
"IQ");
1284 return b_CntryLongStr ? _(
"Israel") : _T(
"IL");
1286 return b_CntryLongStr ? _(
"Japan") : _T(
"JP");
1288 return b_CntryLongStr ? _(
"Japan") : _T(
"JP");
1290 return b_CntryLongStr ? _(
"Turkmenistan") : _T(
"TM");
1292 return b_CntryLongStr ? _(
"Kazakhstan") : _T(
"KZ");
1294 return b_CntryLongStr ? _(
"Uzbekistan") : _T(
"UZ");
1296 return b_CntryLongStr ? _(
"Jordan") : _T(
"JO");
1299 return b_CntryLongStr ? _(
"Korea") : _T(
"KR");
1301 return b_CntryLongStr ? _(
"Palestine") : _T(
"PS");
1303 return b_CntryLongStr ? _(
"People's Rep. of Korea") : _T(
"KP");
1305 return b_CntryLongStr ? _(
"Kuwait") : _T(
"KW");
1307 return b_CntryLongStr ? _(
"Lebanon") : _T(
"LB");
1309 return b_CntryLongStr ? _(
"Kyrgyz Republic") : _T(
"KG");
1311 return b_CntryLongStr ? _(
"Macao") : _T(
"MO");
1313 return b_CntryLongStr ? _(
"Maldives") : _T(
"MV");
1315 return b_CntryLongStr ? _(
"Mongolia") : _T(
"MN");
1317 return b_CntryLongStr ? _(
"Nepal") : _T(
"NP");
1319 return b_CntryLongStr ? _(
"Oman") : _T(
"OM");
1321 return b_CntryLongStr ? _(
"Pakistan") : _T(
"PK");
1323 return b_CntryLongStr ? _(
"Qatar") : _T(
"QA");
1325 return b_CntryLongStr ? _(
"Syrian Arab Republic") : _T(
"SY");
1328 return b_CntryLongStr ? _(
"United Arab Emirates") : _T(
"AE");
1330 return b_CntryLongStr ? _(
"Tajikistan") : _T(
"TJ");
1333 return b_CntryLongStr ? _(
"Yemen") : _T(
"YE");
1335 return b_CntryLongStr ? _(
"Hong Kong") : _T(
"HK");
1337 return b_CntryLongStr ? _(
"Bosnia and Herzegovina") : _T(
"BA");
1339 return b_CntryLongStr ? _(
"Adelie Land") : _T(
"TF");
1341 return b_CntryLongStr ? _(
"Australia") : _T(
"AU");
1343 return b_CntryLongStr ? _(
"Myanmar") : _T(
"MM");
1345 return b_CntryLongStr ? _(
"Brunei Darussalam") : _T(
"BN");
1347 return b_CntryLongStr ? _(
"Micronesia") : _T(
"FM");
1349 return b_CntryLongStr ? _(
"Palau") : _T(
"PW");
1351 return b_CntryLongStr ? _(
"New Zealand") : _T(
"NZ");
1354 return b_CntryLongStr ? _(
"Cambodia") : _T(
"KH");
1356 return b_CntryLongStr ? _(
"Christmas Island") : _T(
"CX");
1358 return b_CntryLongStr ? _(
"Cook Islands") : _T(
"CK");
1360 return b_CntryLongStr ? _(
"Fiji") : _T(
"FJ");
1362 return b_CntryLongStr ? _(
"Cocos (Keeling) Islands") : _T(
"CC");
1364 return b_CntryLongStr ? _(
"Indonesia") : _T(
"ID");
1366 return b_CntryLongStr ? _(
"Kiribati") : _T(
"KI");
1368 return b_CntryLongStr ? _(
"Lao People's Dem. Rep.") : _T(
"LA");
1370 return b_CntryLongStr ? _(
"Malaysia") : _T(
"MY");
1372 return b_CntryLongStr ? _(
"Northern Mariana Islands") : _T(
"MP");
1374 return b_CntryLongStr ? _(
"Marshall Islands") : _T(
"MH");
1376 return b_CntryLongStr ? _(
"New Caledonia") : _T(
"NC");
1378 return b_CntryLongStr ? _(
"Niue") : _T(
"NU");
1380 return b_CntryLongStr ? _(
"Nauru") : _T(
"NR");
1382 return b_CntryLongStr ? _(
"French Polynesia") : _T(
"PF");
1384 return b_CntryLongStr ? _(
"Philippines") : _T(
"PH");
1386 return b_CntryLongStr ? _(
"East Timor") : _T(
"TL");
1388 return b_CntryLongStr ? _(
"Papua New Guinea") : _T(
"PG");
1390 return b_CntryLongStr ? _(
"Pitcairn Island") : _T(
"PN");
1392 return b_CntryLongStr ? _(
"Solomon Islands") : _T(
"SB");
1394 return b_CntryLongStr ? _(
"American Samoa") : _T(
"AS");
1396 return b_CntryLongStr ? _(
"Samoa") : _T(
"WS");
1401 return b_CntryLongStr ? _(
"Singapore") : _T(
"SG");
1403 return b_CntryLongStr ? _(
"Thailand") : _T(
"TH");
1405 return b_CntryLongStr ? _(
"Tonga") : _T(
"TO");
1407 return b_CntryLongStr ? _(
"Tuvalu") : _T(
"TV");
1409 return b_CntryLongStr ? _(
"Viet Nam") : _T(
"VN");
1412 return b_CntryLongStr ? _(
"Vanuatu") : _T(
"VU");
1414 return b_CntryLongStr ? _(
"Wallis and Futuna Islands") : _T(
"WF");
1416 return b_CntryLongStr ? _(
"South Africa") : _T(
"ZA");
1418 return b_CntryLongStr ? _(
"Angola") : _T(
"AO");
1420 return b_CntryLongStr ? _(
"Algeria") : _T(
"DZ");
1422 return b_CntryLongStr ? _(
"Saint Paul") : _T(
"TF");
1424 return b_CntryLongStr ? _(
"Ascension Island") : _T(
"SH");
1426 return b_CntryLongStr ? _(
"Burundi") : _T(
"BI");
1428 return b_CntryLongStr ? _(
"Benin") : _T(
"BJ");
1430 return b_CntryLongStr ? _(
"Botswana") : _T(
"BW");
1432 return b_CntryLongStr ? _(
"Central African Republic") : _T(
"CF");
1434 return b_CntryLongStr ? _(
"Cameroon") : _T(
"CM");
1436 return b_CntryLongStr ? _(
"Congo") : _T(
"CD");
1438 return b_CntryLongStr ? _(
"Comoros") : _T(
"KM");
1440 return b_CntryLongStr ? _(
"Capo Verde") : _T(
"CV");
1442 return b_CntryLongStr ? _(
"Crozet Archipelago") : _T(
"TF");
1444 return b_CntryLongStr ? _(
"Ivory Coast") : _T(
"CI");
1446 return b_CntryLongStr ? _(
"Comoros (Union of the)") : _T(
"KM");
1448 return b_CntryLongStr ? _(
"Djibouti") : _T(
"DJ");
1450 return b_CntryLongStr ? _(
"Egypt") : _T(
"EG");
1452 return b_CntryLongStr ? _(
"Ethiopia") : _T(
"ET");
1454 return b_CntryLongStr ? _(
"Eritrea") : _T(
"ER");
1456 return b_CntryLongStr ? _(
"Gabonese Republic") : _T(
"GA");
1458 return b_CntryLongStr ? _(
"Ghana") : _T(
"GH");
1460 return b_CntryLongStr ? _(
"Gambia") : _T(
"GM");
1462 return b_CntryLongStr ? _(
"Guinea-Bissau") : _T(
"GW");
1464 return b_CntryLongStr ? _(
"Equatorial Guinea") : _T(
"GQ");
1466 return b_CntryLongStr ? _(
"Guinea") : _T(
"GN");
1468 return b_CntryLongStr ? _(
"Burkina Faso") : _T(
"BF");
1470 return b_CntryLongStr ? _(
"Kenya") : _T(
"KE");
1472 return b_CntryLongStr ? _(
"Kerguelen Islands") : _T(
"TF");
1475 return b_CntryLongStr ? _(
"Liberia") : _T(
"LR");
1477 return b_CntryLongStr ? _(
"South Sudan (Republic of)") : _T(
"SS");
1479 return b_CntryLongStr ? _(
"Libya") : _T(
"LY");
1481 return b_CntryLongStr ? _(
"Lesotho") : _T(
"LS");
1483 return b_CntryLongStr ? _(
"Mauritius") : _T(
"MU");
1485 return b_CntryLongStr ? _(
"Madagascar") : _T(
"MG");
1487 return b_CntryLongStr ? _(
"Mali") : _T(
"ML");
1489 return b_CntryLongStr ? _(
"Mozambique") : _T(
"MZ");
1491 return b_CntryLongStr ? _(
"Mauritania") : _T(
"MR");
1493 return b_CntryLongStr ? _(
"Malawi") : _T(
"MW");
1495 return b_CntryLongStr ? _(
"Niger") : _T(
"NE");
1497 return b_CntryLongStr ? _(
"Nigeria") : _T(
"NG");
1499 return b_CntryLongStr ? _(
"Namibia") : _T(
"NA");
1501 return b_CntryLongStr ? _(
"Reunion") : _T(
"RE");
1503 return b_CntryLongStr ? _(
"Rwanda") : _T(
"RW");
1505 return b_CntryLongStr ? _(
"Sudan") : _T(
"SD");
1507 return b_CntryLongStr ? _(
"Senegal") : _T(
"SN");
1509 return b_CntryLongStr ? _(
"Seychelles") : _T(
"SC");
1511 return b_CntryLongStr ? _(
"Saint Helena") : _T(
"SH");
1513 return b_CntryLongStr ? _(
"Somalia") : _T(
"SO");
1515 return b_CntryLongStr ? _(
"Sierra Leone") : _T(
"SL");
1517 return b_CntryLongStr ? _(
"Sao Tome and Principe") : _T(
"ST");
1519 return b_CntryLongStr ? _(
"Eswatini") : _T(
"SZ");
1521 return b_CntryLongStr ? _(
"Chad") : _T(
"TD");
1523 return b_CntryLongStr ? _(
"Togolese Republic") : _T(
"TG");
1525 return b_CntryLongStr ? _(
"Tunisia") : _T(
"TN");
1527 return b_CntryLongStr ? _(
"Tanzania") : _T(
"TZ");
1529 return b_CntryLongStr ? _(
"Uganda") : _T(
"UG");
1531 return b_CntryLongStr ? _(
"Dem Rep.of the Congo") : _T(
"CD");
1533 return b_CntryLongStr ? _(
"Tanzania") : _T(
"TZ");
1535 return b_CntryLongStr ? _(
"Zambia") : _T(
"ZM");
1537 return b_CntryLongStr ? _(
"Zimbabwe") : _T(
"ZW");
1539 return b_CntryLongStr ? _(
"Argentine Republic") : _T(
"AR");
1541 return b_CntryLongStr ? _(
"Brazil") : _T(
"BR");
1543 return b_CntryLongStr ? _(
"Bolivia") : _T(
"BO");
1545 return b_CntryLongStr ? _(
"Chile") : _T(
"CL");
1547 return b_CntryLongStr ? _(
"Colombia") : _T(
"CO");
1549 return b_CntryLongStr ? _(
"Ecuador") : _T(
"EC");
1551 return b_CntryLongStr ? _(
"Falkland Islands") : _T(
"FK");
1553 return b_CntryLongStr ? _(
"France - Guiana") : _T(
"GY");
1555 return b_CntryLongStr ? _(
"Guyana") : _T(
"GY");
1557 return b_CntryLongStr ? _(
"Paraguay") : _T(
"PY");
1559 return b_CntryLongStr ? _(
"Peru") : _T(
"PE");
1561 return b_CntryLongStr ? _(
"Suriname") : _T(
"SR");
1563 return b_CntryLongStr ? _(
"Uruguay") : _T(
"UY");
1565 return b_CntryLongStr ? _(
"Venezuela") : _T(
"VE");
1568 return wxEmptyString;
1571 return wxEmptyString;
1576wxString ais_get_type(
int index) {
1577 static const wxString ais_type[] = {
1578 _(
"Fishing Vessel"),
1580 _(
"Towing Vessel, Long"),
1582 _(
"Diving Ops Vessel"),
1583 _(
"Military Vessel"),
1584 _(
"Sailing Vessel"),
1585 _(
"Pleasure craft"),
1586 _(
"High Speed Craft"),
1588 _(
"Search and Rescue Vessel"),
1591 _(
"Pollution Control Vessel"),
1592 _(
"Law Enforcement Vessel"),
1593 _(
"Medical Transport"),
1594 _(
"Passenger Ship"),
1599 _(
"Reference Point"),
1601 _(
"Fixed Structure"),
1604 _(
"Light w/Sectors"),
1605 _(
"Leading Light Front"),
1606 _(
"Leading Light Rear"),
1607 _(
"Cardinal N Beacon"),
1608 _(
"Cardinal E Beacon"),
1609 _(
"Cardinal S Beacon"),
1610 _(
"Cardinal W Beacon"),
1611 _(
"Beacon, Port Hand"),
1612 _(
"Beacon, Starboard Hand"),
1613 _(
"Beacon, Preferred Channel Port Hand"),
1614 _(
"Beacon, Preferred Channel Starboard Hand"),
1615 _(
"Beacon, Isolated Danger"),
1616 _(
"Beacon, Safe Water"),
1617 _(
"Beacon, Special Mark"),
1618 _(
"Cardinal Mark N"),
1619 _(
"Cardinal Mark E"),
1620 _(
"Cardinal Mark S"),
1621 _(
"Cardinal Mark W"),
1622 _(
"Port Hand Mark"),
1623 _(
"Starboard Hand Mark"),
1624 _(
"Preferred Channel Port Hand"),
1625 _(
"Preferred Channel Starboard Hand"),
1626 _(
"Isolated Danger"),
1629 _(
"Light Vessel/Rig"),
1631 _(
"Position Report"),
1633 _(
"ARPA radar target"),
1634 _(
"APRS Position Report")
1637 return ais_type[index];
1640wxString ais_get_short_type(
int index) {
1641 static const wxString short_ais_type[] = {
1701 return short_ais_type[index];