31#include <wx/dcmemory.h>
33#include <wx/glcanvas.h>
34#include <wx/notebook.h>
38#include "o_sound/o_sound.h"
78#if wxUSE_XLOCALE || !wxCHECK_VERSION(3, 0, 0)
79extern wxLocale* plocale_def_lang;
84extern arrayofCanvasPtr g_canvasArray;
86void NotifySetupOptionsPlugin(
const PlugInData* pic);
101 wxItemKind kind, wxString shortHelp, wxString longHelp,
102 wxObject* clientData,
int position,
int tool_sel,
105 return s_ppim->AddToolbarTool(label, bitmap, bmpRollover, kind, shortHelp,
106 longHelp, clientData, position, tool_sel,
113 if (s_ppim) s_ppim->RemoveToolbarTool(tool_id);
117 if (s_ppim) s_ppim->SetToolbarToolViz(item, viz);
121 if (s_ppim) s_ppim->SetToolbarItemState(item, toggle);
125 if (s_ppim) s_ppim->SetToolbarItemBitmaps(item, bitmap, bmpRollover);
129 wxString SVGfileRollover, wxString SVGfileToggled,
130 wxItemKind kind, wxString shortHelp, wxString longHelp,
131 wxObject* clientData,
int position,
int tool_sel,
134 return s_ppim->AddToolbarTool(label, SVGfile, SVGfileRollover,
135 SVGfileToggled, kind, shortHelp, longHelp,
136 clientData, position, tool_sel, pplugin);
142 wxString SVGfileRollover,
143 wxString SVGfileToggled) {
145 s_ppim->SetToolbarItemBitmaps(item, SVGfile, SVGfileRollover,
153 return s_ppim->AddCanvasContextMenuItemPIM(pitem, pplugin, name,
false);
159 if (s_ppim) s_ppim->SetCanvasContextMenuItemViz(item, viz, name);
163 if (s_ppim) s_ppim->SetCanvasContextMenuItemGrey(item, grey, name);
167 if (s_ppim) s_ppim->RemoveCanvasContextMenuItem(item, name);
173 return s_ppim->AddCanvasContextMenuItemPIM(pitem, pplugin,
"",
false);
188int AddCanvasContextMenuItemExt(wxMenuItem* pitem,
opencpn_plugin* pplugin,
189 const std::string object_type) {
192 return s_ppim->AddCanvasContextMenuItemPIM(pitem, pplugin,
193 object_type.c_str(),
true);
201 return reinterpret_cast<wxFileConfig*
>(
208 wxWindow* pret = NULL;
210 MyFrame* pFrame = s_ppim->GetParentFrame();
211 pret = (wxWindow*)pFrame->GetPrimaryCanvas();
217 if (win) win->Refresh(
true);
277 return FontMgr::Get().GetFontLegacy(TextElement, default_size);
280wxFont* GetOCPNScaledFont_PlugIn(wxString TextElement,
int default_size) {
281 return FontMgr::Get().GetFontLegacy(TextElement, default_size);
285 return g_Platform->GetToolbarScaleFactor(GUIScaleFactor);
289 return g_Platform->GetToolbarScaleFactor(g_GUIScaleFactor);
293 return g_Platform->GetChartScaleFactorExp(g_ChartScaleFactor);
301 return FontMgr::Get().
AddAuxKey(TextElement);
306 return g_StyleManager->GetCurrentStyle()->name;
312 unsigned int height) {
313 wxBitmap bmp =
LoadSVG(filename, width, height);
322 if (w == 0 || h == 0) {
329 return LoadSVG(filename, w, h);
344 ArrayOfPlugIn_AIS_Targets* pret =
new ArrayOfPlugIn_AIS_Targets;
347 for (
const auto& it :
g_pAIS->GetTargetList()) {
356 td.n_alarm_state = AIS_ALARM_SET;
366 SendMessageToAllPlugins(message_id, message_body);
374 Nevent.SetID(message_id);
375 Nevent.SetJSONText(message_body);
376 gFrame->GetEventHandler()->AddPendingEvent(Nevent);
382 gFrame->JumpToPosition(gFrame->GetFocusCanvas(), lat, lon,
scale);
387#if wxUSE_XLOCALE || !wxCHECK_VERSION(3, 0, 0)
389 if (plocale_def_lang) {
393 return plocale_def_lang->AddCatalog(catalog);
403 std::string full_sentence = buf.ToStdString();
405 if ((full_sentence[0] ==
'$') || (full_sentence[0] ==
'!')) {
407 std::string
id = full_sentence.substr(1, 5);
410 auto address = std::make_shared<NavAddr0183>(
"virtual");
411 auto msg = std::make_shared<const Nmea0183Msg>(
id, full_sentence, address);
412 NavMsgBus::GetInstance().
Notify(std::move(msg));
418 wxXmlDocument doc =
ChartData->GetXMLDescription(dbIndex, b_getGeom);
424 bool b_ProgressDialog) {
426 ArrayOfCDI ChartDirArray;
427 for (
unsigned int i = 0; i < dir_array.GetCount(); i++) {
428 wxString dirname = dir_array[i];
430 cdi.fullpath = dirname;
431 cdi.magic_number =
"";
432 ChartDirArray.Add(cdi);
434 bool b_ret = gFrame->UpdateChartDatabaseInplace(
435 ChartDirArray, b_force_update, b_ProgressDialog, ChartListFileName);
436 gFrame->RefreshGroupIndices();
437 gFrame->ChartsRefresh();
442 return ChartData->GetChartDirArrayString();
447 wxFileName fn(full_path);
448 wxString fdir = fn.GetPath();
452 bret =
ChartData->AddSingleChart(full_path);
456 pConfig->UpdateChartDirs(
ChartData->GetChartDirArray());
457 ChartData->SaveBinary(ChartListFileName);
460 ArrayOfCDI XnewChartDirArray;
461 pConfig->LoadChartDirArray(XnewChartDirArray);
472 if (b_RefreshCanvas || !gFrame->GetPrimaryCanvas()->GetQuiltMode()) {
473 gFrame->ChartsRefresh();
483 bret =
ChartData->RemoveSingleChart(full_path);
486 pConfig->UpdateChartDirs(
ChartData->GetChartDirArray());
487 ChartData->SaveBinary(ChartListFileName);
490 ArrayOfCDI XnewChartDirArray;
491 pConfig->LoadChartDirArray(XnewChartDirArray);
502 gFrame->ChartsRefresh();
512 if (!g_pOptions)
return NULL;
517 parentid = g_pOptions->m_pageDisplay;
520 parentid = g_pOptions->m_pageConnections;
523 parentid = g_pOptions->m_pageCharts;
526 parentid = g_pOptions->m_pageShips;
529 parentid = g_pOptions->m_pageUI;
532 parentid = g_pOptions->m_pagePlugins;
535 wxLogMessage(
"Error in PluginManager::AddOptionsPage: Unknown parent");
540 return g_pOptions->AddPage(parentid, title);
544 if (!g_pOptions)
return false;
545 return g_pOptions->DeletePluginPage(page);
549 wxString* accumulator) {
550 if (!pos)
return false;
553 AisError nerr = AIS_GENERIC_ERROR;
554 if (
g_pAIS) nerr =
g_pAIS->DecodeSingleVDO(str, &gpd, accumulator);
555 if (nerr == AIS_NoError) {
576 if (g_bShowChartBar) {
578 if (cc && cc->GetPiano()) {
579 val = cc->GetPiano()->GetHeight();
585bool GetRoutepointGPX(
RoutePoint* pRoutePoint,
char* buffer,
586 unsigned int buffer_length) {
590 pgpx->AddGPXWaypoint(pRoutePoint);
591 wxString gpxfilename = wxFileName::CreateTempFileName(
"gpx");
592 pgpx->SaveFile(gpxfilename);
595 wxFFile gpxfile(gpxfilename);
597 if (gpxfile.ReadAll(&s)) {
598 if (s.Length() < buffer_length) {
599 strncpy(buffer, (
const char*)s.mb_str(wxConvUTF8), buffer_length - 1);
605 ::wxRemoveFile(gpxfilename);
612 return GetRoutepointGPX(
g_pRouteMan->GetpActivePoint(), buffer,
619 double dist,
double* dlat,
621 PositionBearingDistanceMercator(lat, lon, brg, dist, dlat, dlon);
625 double lon1,
double* brg,
double* dist) {
626 DistanceBearingMercator(lat0, lon0, lat1, lon1, brg, dist);
631 return DistGreatCircle(slat, slon, dlat, dlon);
634void toTM_Plugin(
float lat,
float lon,
float lat0,
float lon0,
double* x,
636 toTM(lat, lon, lat0, lon0, x, y);
639void fromTM_Plugin(
double x,
double y,
double lat0,
double lon0,
double* lat,
641 fromTM(x, y, lat0, lon0, lat, lon);
644void toSM_Plugin(
double lat,
double lon,
double lat0,
double lon0,
double* x,
646 toSM(lat, lon, lat0, lon0, x, y);
649void fromSM_Plugin(
double x,
double y,
double lat0,
double lon0,
double* lat,
651 fromSM(x, y, lat0, lon0, lat, lon);
655 double* x,
double* y) {
656 toSM_ECC(lat, lon, lat0, lon0, x, y);
660 double* lat,
double* lon) {
661 fromSM_ECC(x, y, lat0, lon0, lat, lon);
673 return toUsrSpeed(kts_speed,
unit);
677 return toUsrWindSpeed(kts_speed,
unit);
681 return fromUsrSpeed(usr_speed,
unit);
685 return fromUsrWindSpeed(usr_wspeed,
unit);
693 return fromUsrTemp(usr_temp,
unit);
697 return getUsrDistanceUnit(
unit);
703 return getUsrWindSpeedUnit(
unit);
716 return fromUsrDepth(usr_depth,
unit);
743 static bool loaded =
false;
745 gshhsCrossesLandInit();
748 return gshhsCrossesLand(lat1, lon1, lat2, lon2);
764 const wxString& icon_ident,
765 const wxString& wp_name,
766 const wxString& GUID) {
767 wxDateTime now = wxDateTime::Now();
778PlugIn_Waypoint::~PlugIn_Waypoint() {}
781PlugIn_Route::PlugIn_Route() {
pWaypointList =
new Plugin_WaypointList; }
783PlugIn_Route::~PlugIn_Route() {
791PlugIn_Track::PlugIn_Track() {
pWaypointList =
new Plugin_WaypointList; }
793PlugIn_Track::~PlugIn_Track() {
803 wxString description) {
804 wxImage image = pimage->ConvertToImage();
805 WayPointmanGui(*pWayPointMan).ProcessIcon(image, key, description);
814 wxPlugin_HyperlinkListNode* linknode = src->
m_HyperlinkList->GetFirst();
820 h->Link = link->
Link;
821 h->LType = link->
Type;
825 linknode = linknode->GetNext();
835 bool b_unique =
true;
836 for (
RoutePoint* prp : *pWayPointMan->GetWaypointList()) {
837 if (prp->m_GUID == pwaypoint->
m_GUID) {
843 if (!b_unique)
return false;
851 cloneHyperlinkList(pWP, pwaypoint);
861 pWP->
m_btemp = (b_permanent ==
false);
866 NavObj_dB::GetInstance().InsertRoutePoint(pWP);
869 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
870 pRouteManagerDialog->UpdateWptListCtrl();
877 bool b_found =
false;
878 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(GUID);
880 if (prp) b_found =
true;
883 pWayPointMan->DestroyWaypoint(prp);
884 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
885 pRouteManagerDialog->UpdateWptListCtrl();
893 bool b_found =
false;
896 if (prp) b_found =
true;
899 double lat_save = prp->m_lat;
900 double lon_save = prp->m_lon;
902 prp->m_lat = pwaypoint->
m_lat;
903 prp->m_lon = pwaypoint->
m_lon;
916 wxPlugin_HyperlinkListNode* linknode =
923 h->Link = link->
Link;
924 h->LType = link->
Type;
928 linknode = linknode->GetNext();
933 if (prp) prp->ReLoadIcon();
935 auto canvas = gFrame->GetPrimaryCanvas();
936 SelectCtx ctx(canvas->m_bShowNavobjects, canvas->GetCanvasTrueScale(),
937 canvas->GetScaleValue());
939 pSelect->FindSelection(ctx, lat_save, lon_save, SELTYPE_ROUTEPOINT);
941 pFind->m_slat = pwaypoint->
m_lat;
942 pFind->m_slon = pwaypoint->
m_lon;
947 NavObj_dB::GetInstance().UpdateRoutePoint(prp);
950 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
951 pRouteManagerDialog->UpdateWptListCtrl();
960 dst->
m_lat = src->m_lat;
961 dst->
m_lon = src->m_lon;
977 for (
Hyperlink* link : *src->m_HyperlinkList) {
981 h->
Type = link->LType;
990 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(GUID);
992 if (!prp)
return false;
994 PlugInFromRoutePoint(pwaypoint, prp);
1000 wxArrayString result;
1002 for (
RoutePoint* prp : *pWayPointMan->GetWaypointList()) {
1003 result.Add(prp->m_GUID);
1010 wxArrayString result;
1012 result.Add(proute->m_GUID);
1018 wxArrayString result;
1020 result.Add(ptrack->m_GUID);
1027 wxArrayString result;
1028 for (
RoutePoint* prp : *pWayPointMan->GetWaypointList()) {
1031 result.Add(prp->m_GUID);
1034 if (!prp->m_bIsInLayer) result.Add(prp->m_GUID);
1037 if (prp->m_bIsInLayer) result.Add(prp->m_GUID);
1045 wxArrayString result;
1050 result.Add(proute->m_GUID);
1053 if (!proute->m_bIsInLayer) result.Add(proute->m_GUID);
1056 if (proute->m_bIsInLayer) result.Add(proute->m_GUID);
1065 wxArrayString result;
1069 result.Add(ptrack->m_GUID);
1072 if (!ptrack->m_bIsInLayer) result.Add(ptrack->m_GUID);
1075 if (ptrack->m_bIsInLayer) result.Add(ptrack->m_GUID);
1084 wxArrayString result;
1086 for (
int i = 0; i < pWayPointMan->GetNumIcons(); i++) {
1087 wxString* ps = pWayPointMan->GetIconKey(i);
1099 wxDateTime plannedDeparture;
1101 wxPlugin_WaypointListNode* pwpnode = proute->
pWaypointList->GetFirst();
1103 pwp = pwpnode->GetData();
1109 cloneHyperlinkList(pWP, pwp);
1114 route->AddPoint(pWP);
1116 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
1119 pSelect->AddSelectableRouteSegment(pWP_src->m_lat, pWP_src->m_lon,
1120 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
1127 pwpnode = pwpnode->GetNext();
1135 if (!proute->
m_GUID.IsEmpty()) {
1138 route->
m_btemp = (b_permanent ==
false);
1144 NavObj_dB::GetInstance().InsertRoute(route);
1146 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
1147 pRouteManagerDialog->UpdateRouteListCtrl();
1153 bool b_found =
false;
1165 bool b_found =
false;
1169 if (pRoute) b_found =
true;
1172 bool b_permanent = (pRoute->
m_btemp ==
false);
1187 wxPlugin_WaypointListNode* pwpnode = ptrack->
pWaypointList->GetFirst();
1189 pwp = pwpnode->GetData();
1194 track->AddPoint(pWP);
1197 pSelect->AddSelectableTrackSegment(pWP_src->m_lat, pWP_src->m_lon,
1198 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
1203 pwpnode = pwpnode->GetNext();
1209 track->m_GUID = ptrack->
m_GUID;
1210 track->m_btemp = (b_permanent ==
false);
1213 if (b_permanent) NavObj_dB::GetInstance().InsertTrack(track);
1216 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
1217 pRouteManagerDialog->UpdateTrkListCtrl();
1223 bool b_found =
false;
1228 NavObj_dB::GetInstance().DeleteTrack(pTrack);
1233 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
1234 pRouteManagerDialog->UpdateTrkListCtrl();
1240 bool b_found =
false;
1244 if (pTrack) b_found =
true;
1247 bool b_permanent = (pTrack->m_btemp ==
false);
1248 NavObj_dB::GetInstance().DeleteTrack(pTrack);
1262 return glChartCanvas::HasNormalizedViewPort(ocpn_vp);
1288 glChartCanvas::NormalizedViewPort(ocpn_vp, lat, lon);
1307 pret->
MMSI = ptarget->MMSI;
1308 pret->
Class = ptarget->Class;
1310 pret->
SOG = ptarget->SOG;
1311 pret->
COG = ptarget->COG;
1312 pret->
HDG = ptarget->HDG;
1313 pret->
Lon = ptarget->Lon;
1314 pret->
Lat = ptarget->Lat;
1315 pret->
ROTAIS = ptarget->ROTAIS;
1316 pret->
ShipType = ptarget->ShipType;
1317 pret->
IMO = ptarget->IMO;
1319 pret->
Range_NM = ptarget->Range_NM;
1320 pret->
Brg = ptarget->Brg;
1324 pret->
TCPA = ptarget->TCPA;
1325 pret->
CPA = ptarget->CPA;
1329 memcpy(pret->CallSign, ptarget->CallSign,
sizeof(ptarget->CallSign) - 1);
1330 memcpy(pret->ShipName, ptarget->ShipName,
sizeof(ptarget->ShipName) - 1);
1349 gFrame->GetPrimaryCanvas()->DoRotateCanvas(rotation);
1355 gFrame->GetPrimaryCanvas()->DoTiltCanvas(tilt);
1359 gFrame->GetPrimaryCanvas()->SetVPProjection(projection);
1362o_sound::Sound* g_PluginSound = o_sound::Factory();
1363static void onPlugInPlaySoundExFinished(
void* ptr) {}
1367 bool ok = g_PluginSound->Load(sound_file, deviceIndex);
1369 wxLogWarning(
"Cannot load sound file: %s", sound_file);
1372 auto cmd_sound =
dynamic_cast<o_sound::SystemCmdSound*
>(g_PluginSound);
1373 if (cmd_sound) cmd_sound->SetCmd(g_CmdSoundString.mb_str(wxConvUTF8));
1375 g_PluginSound->SetFinishedCallback(onPlugInPlaySoundExFinished, NULL);
1376 ok = g_PluginSound->Play();
1378 wxLogWarning(
"Cannot play sound file: %s", sound_file);
1384 return gFrame->GetPrimaryCanvas()->CheckEdgePan(x, y, dragging, margin,
1390 return style->GetIcon(name);
1394 gFrame->GetPrimaryCanvas()->pPlugIn_Cursor = pCursor;
1405 g_options->pScanCheckBox->SetValue(
true);
1406 g_options->pUpdateCheckBox->SetValue(
true);
1412 g_options->pUpdateCheckBox->SetValue(
true);
1419 wxString Title, wxString initDir) {
1420 return g_Platform->DoDirSelectorDialog(parent, file_spec, Title, initDir);
1424 wxString Title, wxString initDir,
1425 wxString suggestedName, wxString wildcard) {
1426 return g_Platform->DoFileSelectorDialog(parent, file_spec, Title, initDir,
1427 suggestedName, wildcard);
1450 if (gFrame->GetPrimaryCanvas())
1462 ViewPort ocpn_vp = CreateCompatibleViewportEx(vp);
1467 AISDraw(dc, ocpn_vp, NULL);
1471 return FontMgr::Get().
SetFontColor(TextElement, color);
1481 wxFontStyle style, wxFontWeight weight,
1482 bool underline,
const wxString& facename,
1483 wxFontEncoding encoding) {
1485 underline, facename, encoding);
1488int PluginGetMinAvailableGshhgQuality() {
1489 return gFrame->GetPrimaryCanvas()->GetMinAvailableGshhgQuality();
1491int PluginGetMaxAvailableGshhgQuality() {
1492 return gFrame->GetPrimaryCanvas()->GetMaxAvailableGshhgQuality();
1500bool LaunchDefaultBrowser_Plugin(wxString url) {
1501 if (g_Platform) g_Platform->platformLaunchDefaultBrowser(url);
1511 if (cc && cc->GetSelectedRoutePoint()) {
1512 return cc->GetSelectedRoutePoint()->
m_GUID;
1514 return wxEmptyString;
1519 if (cc && cc->GetSelectedRoute()) {
1520 return cc->GetSelectedRoute()->
m_GUID;
1522 return wxEmptyString;
1527 if (cc && cc->GetSelectedTrack()) {
1528 return cc->GetSelectedTrack()->m_GUID;
1530 return wxEmptyString;
1540 std::unique_ptr<PlugIn_Route> r;
1542 if (route ==
nullptr)
return r;
1551 PlugInFromRoutePoint(dst_wp, src_wp);
1563 std::unique_ptr<PlugIn_Track> t;
1566 if (!pTrack)
return t;
1568 std::unique_ptr<PlugIn_Track> tk =
1573 dst_track->
m_EndString = pTrack->m_TrackEndString;
1574 dst_track->
m_GUID = pTrack->m_GUID;
1576 for (
int i = 0; i < pTrack->GetnPoints(); i++) {
1581 dst_wp->
m_lat = ptp->m_lat;
1582 dst_wp->
m_lon = ptp->m_lon;
1601 auto oCanvas =
dynamic_cast<ChartCanvas*
>(canvas);
1602 if (oCanvas) gFrame->JumpToPosition(oCanvas, lat, lon,
scale);
1610 ChartCanvas* l_canvas = gFrame->GetCanvasUnderMouse();
1612 for (
unsigned int i = 0; i < g_canvasArray.GetCount(); ++i) {
1613 if (l_canvas == g_canvasArray[i])
return i;
1631 if (g_canvasConfig == 0)
1632 return gFrame->GetPrimaryCanvas();
1634 if ((canvasIndex >= 0) && g_canvasArray[canvasIndex]) {
1635 return g_canvasArray[canvasIndex];
1643 if (g_canvasConfig == 0)
1644 return gFrame->GetPrimaryCanvas()->CheckEdgePan(x, y, dragging, margin,
1647 if ((canvasIndex >= 0) && g_canvasArray[canvasIndex]) {
1648 return g_canvasArray[canvasIndex]->CheckEdgePan(x, y, dragging, margin,
1657 if (g_canvasConfig == 0)
1658 gFrame->GetPrimaryCanvas()->pPlugIn_Cursor = pCursor;
1660 if ((canvasIndex >= 0) && g_canvasArray[canvasIndex]) {
1661 g_canvasArray[canvasIndex]->pPlugIn_Cursor = pCursor;
1667 if (g_canvasConfig == 1)
return 2;
1678 return wxRect(0, 0, 1, 1);
1708 pivp.
lat_min = tvp.GetBBox().GetMinLat();
1709 pivp.
lat_max = tvp.GetBBox().GetMaxLat();
1710 pivp.
lon_min = tvp.GetBBox().GetMinLon();
1711 pivp.
lon_max = tvp.GetBBox().GetMaxLon();
1713 pivp.
bValid = tvp.IsValid();
1718ListOfPI_S57Obj* PlugInManager::GetLightsObjRuleListVisibleAtLatLon(
1720 ListOfPI_S57Obj* list = NULL;
1734 list = picbx->GetLightsObjRuleListVisibleAtLatLon(zlat, zlon, &pi_vp);
1745#include <wx/listimpl.cpp>
1746WX_DEFINE_LIST(Plugin_WaypointExList)
1749PlugIn_Waypoint_Ex::PlugIn_Waypoint_Ex() {
InitDefaults(); }
1751PlugIn_Waypoint_Ex::PlugIn_Waypoint_Ex(
1752 double lat,
double lon,
const wxString& icon_ident,
const wxString& wp_name,
1753 const wxString& GUID,
const double ScaMin,
const bool bNameVisible,
1754 const int nRangeRings,
const double RangeDistance,
1755 const wxColor RangeColor) {
1787 if (!prp)
return false;
1789 if (prp->
m_bIsInRoute && !prp->IsShared())
return false;
1801 for (
RoutePoint* prp : *proute->pRoutePointList) {
1802 if (prp == pWP) nCount++;
1808PlugIn_Waypoint_Ex::~PlugIn_Waypoint_Ex() {}
1810WX_DEFINE_LIST(Plugin_WaypointExV2List)
1812PlugIn_Waypoint_ExV2::PlugIn_Waypoint_ExV2() {
InitDefaults(); }
1814PlugIn_Waypoint_ExV2::PlugIn_Waypoint_ExV2(
1815 double lat,
double lon,
const wxString& icon_ident,
const wxString& wp_name,
1816 const wxString& GUID,
const double ScaMin,
const double ScaMax,
1817 const bool bNameVisible,
const int nRangeRings,
const double RangeDistance,
1818 const int RangeDistanceUnits,
const wxColor RangeColor,
1819 const double WaypointArrivalRadius,
const bool ShowWaypointRangeRings,
1820 const double PlannedSpeed,
const wxString TideStation) {
1866PlugIn_Waypoint_ExV2::~PlugIn_Waypoint_ExV2() {}
1870 if (!prp)
return false;
1871 if (prp->
m_bIsInRoute && !prp->IsShared())
return false;
1882 for (
RoutePoint* prp : *proute->pRoutePointList) {
1883 if (prp == pWP) nCount++;
1890PlugIn_Route_ExV2::PlugIn_Route_ExV2() {
1902 wxDateTime now = wxDateTime::Now();
1903 m_GUID = wxString::Format(
"RT%d%d%d%d", (
int)now.GetMillisecond(),
1904 (
int)now.GetSecond(), (
int)now.GetMinute(),
1905 (
int)now.GetHour());
1909PlugIn_Route_ExV2::~PlugIn_Route_ExV2() {
1919 dst->
m_lat = src->m_lat;
1920 dst->
m_lon = src->m_lon;
1921 dst->
IconName = src->GetIconName();
1924 dst->
IconDescription = pWayPointMan->GetIconDescription(src->GetIconName());
1937 for (
Hyperlink* link : *src->m_HyperlinkList) {
1941 h->
Type = link->LType;
1956 dst->
scamin = src->GetScaMin();
1960 dst->
scamax = src->GetScaMax();
1969 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(GUID);
1971 if (!prp)
return false;
1973 PlugInExV2FromRoutePoint(pwaypoint, prp);
1978static void cloneHyperlinkListExV2(
RoutePoint* dst,
1984 wxPlugin_HyperlinkListNode* linknode = src->
m_HyperlinkList->GetFirst();
1990 h->Link = link->
Link;
1991 h->LType = link->
Type;
1995 linknode = linknode->GetNext();
2006 cloneHyperlinkListExV2(pWP, src);
2016 pWP->
m_btemp = (b_permanent ==
false);
2025 pWP->SetScaMin(src->
scamin);
2032 pWP->SetScaMax(src->
scamax);
2034 if (src->
m_ETD.IsValid())
2037 pWP->
SetETD(wxEmptyString);
2047 bool b_unique =
true;
2048 for (
RoutePoint* prp : *pWayPointMan->GetWaypointList()) {
2049 if (prp->m_GUID == pwaypointex->
m_GUID) {
2055 if (!b_unique)
return false;
2057 RoutePoint* pWP = CreateNewPoint(pwaypointex, b_permanent);
2059 pWP->SetShowWaypointRangeRings(pwaypointex->
nrange_rings > 0);
2061 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
2064 NavObj_dB::GetInstance().InsertRoutePoint(pWP);
2067 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2068 pRouteManagerDialog->UpdateWptListCtrl();
2075 bool b_found =
false;
2078 if (prp) b_found =
true;
2081 double lat_save = prp->m_lat;
2082 double lon_save = prp->m_lon;
2084 prp->m_lat = pwaypoint->
m_lat;
2085 prp->m_lon = pwaypoint->
m_lon;
2086 prp->SetIconName(pwaypoint->
IconName);
2100 h->Link = link->
Link;
2101 h->LType = link->
Type;
2107 prp->SetWaypointRangeRingsNumber(pwaypoint->
nrange_rings);
2112 prp->SetScaMin(pwaypoint->
scamin);
2116 prp->SetShowWaypointRangeRings(pwaypoint->
nrange_rings > 0);
2118 if (prp) prp->ReLoadIcon();
2120 auto canvas = gFrame->GetPrimaryCanvas();
2121 SelectCtx ctx(canvas->m_bShowNavobjects, canvas->GetCanvasTrueScale(),
2122 canvas->GetScaleValue());
2124 pSelect->FindSelection(ctx, lat_save, lon_save, SELTYPE_ROUTEPOINT);
2126 pFind->m_slat = pwaypoint->
m_lat;
2127 pFind->m_slon = pwaypoint->
m_lon;
2132 NavObj_dB::GetInstance().UpdateRoutePoint(prp);
2135 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2136 pRouteManagerDialog->UpdateWptListCtrl();
2139 if (pwaypoint->
m_ETD.IsValid())
2142 prp->
SetETD(wxEmptyString);
2145 prp->SetScaMax(pwaypoint->
scamax);
2152 const wxString& GUID) {
2167 wxDateTime plannedDeparture;
2169 wxPlugin_WaypointExV2ListNode* pwpnode = proute->
pWaypointList->GetFirst();
2171 pwaypointex = pwpnode->GetData();
2173 pWP = pWayPointMan->FindRoutePointByGUID(pwaypointex->
m_GUID);
2175 pWP = CreateNewPoint(pwaypointex, b_permanent);
2179 route->AddPoint(pWP);
2181 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
2184 pSelect->AddSelectableRouteSegment(pWP_src->m_lat, pWP_src->m_lon,
2185 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
2192 pwpnode = pwpnode->GetNext();
2200 if (!proute->
m_GUID.IsEmpty()) {
2203 route->
m_btemp = (b_permanent ==
false);
2208 route->
m_Colour = proute->m_Colour;
2209 route->
m_style = proute->m_style;
2217 NavObj_dB::GetInstance().InsertRoute(route);
2220 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2221 pRouteManagerDialog->UpdateRouteListCtrl();
2227 bool b_found =
false;
2231 if (pRoute) b_found =
true;
2234 bool b_permanent = !pRoute->
m_btemp;
2237 b_found = AddPlugInRouteExV3(proute, b_permanent);
2243std::unique_ptr<HostApi121::PlugIn_Route_Ex> GetRouteExV3_Plugin(
2244 const wxString& GUID) {
2245 std::unique_ptr<HostApi121::PlugIn_Route_Ex> dst_route;
2247 if (route ==
nullptr)
return dst_route;
2249 dst_route = std::unique_ptr<HostApi121::PlugIn_Route_Ex>(
2253 for (
RoutePoint* src_wp : *route->pRoutePointList) {
2255 PlugInExV2FromRoutePoint(dst_wp, src_wp);
2256 dst_route->pWaypointList->Append(dst_wp);
2261 dst_route->m_GUID = route->
m_GUID;
2262 dst_route->m_isActive =
g_pRouteMan->GetpActiveRoute() == route;
2263 dst_route->m_isVisible = route->IsVisible();
2266 dst_route->m_Colour = route->
m_Colour;
2267 dst_route->m_style = route->
m_style;
2282 wxDateTime plannedDeparture;
2284 wxPlugin_WaypointExV2ListNode* pwpnode = proute->
pWaypointList->GetFirst();
2286 pwaypointex = pwpnode->GetData();
2288 pWP = pWayPointMan->FindRoutePointByGUID(pwaypointex->
m_GUID);
2290 pWP = CreateNewPoint(pwaypointex, b_permanent);
2294 route->AddPoint(pWP);
2296 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
2299 pSelect->AddSelectableRouteSegment(pWP_src->m_lat, pWP_src->m_lon,
2300 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
2307 pwpnode = pwpnode->GetNext();
2315 if (!proute->
m_GUID.IsEmpty()) {
2318 route->
m_btemp = (b_permanent ==
false);
2326 NavObj_dB::GetInstance().InsertRoute(route);
2329 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2330 pRouteManagerDialog->UpdateRouteListCtrl();
2336 bool b_found =
false;
2340 if (pRoute) b_found =
true;
2343 bool b_permanent = !pRoute->
m_btemp;
2353 std::unique_ptr<PlugIn_Route_ExV2> r;
2355 if (route ==
nullptr)
return r;
2362 PlugInExV2FromRoutePoint(dst_wp, src_wp);
2377PlugIn_Route_Ex::PlugIn_Route_Ex() {
2381PlugIn_Route_Ex::~PlugIn_Route_Ex() {
2393 dst->
m_lat = src->m_lat;
2394 dst->
m_lon = src->m_lon;
2395 dst->
IconName = src->GetIconName();
2398 dst->
IconDescription = pWayPointMan->GetIconDescription(src->GetIconName());
2410 for (
Hyperlink* link : *src->m_HyperlinkList) {
2414 h->
Type = link->LType;
2427 dst->
scamin = src->GetScaMin();
2432static void cloneHyperlinkListEx(
RoutePoint* dst,
2438 wxPlugin_HyperlinkListNode* linknode = src->
m_HyperlinkList->GetFirst();
2444 h->Link = link->
Link;
2445 h->LType = link->
Type;
2449 linknode = linknode->GetNext();
2460 cloneHyperlinkListEx(pWP, src);
2470 pWP->
m_btemp = (b_permanent ==
false);
2477 pWP->SetScaMin(src->
scamin);
2486 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(GUID);
2488 if (!prp)
return false;
2490 PlugInExFromRoutePoint(pwaypoint, prp);
2500 bool b_unique =
true;
2501 for (
RoutePoint* prp : *pWayPointMan->GetWaypointList()) {
2502 if (prp->m_GUID == pwaypointex->
m_GUID) {
2508 if (!b_unique)
return false;
2510 RoutePoint* pWP = CreateNewPoint(pwaypointex, b_permanent);
2512 pWP->SetShowWaypointRangeRings(pwaypointex->
nrange_rings > 0);
2514 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
2517 NavObj_dB::GetInstance().InsertRoutePoint(pWP);
2519 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2520 pRouteManagerDialog->UpdateWptListCtrl();
2527 bool b_found =
false;
2530 if (prp) b_found =
true;
2533 double lat_save = prp->m_lat;
2534 double lon_save = prp->m_lon;
2536 prp->m_lat = pwaypoint->
m_lat;
2537 prp->m_lon = pwaypoint->
m_lon;
2538 prp->SetIconName(pwaypoint->
IconName);
2550 wxPlugin_HyperlinkListNode* linknode =
2557 h->Link = link->
Link;
2558 h->LType = link->
Type;
2562 linknode = linknode->GetNext();
2568 prp->SetWaypointRangeRingsNumber(pwaypoint->
nrange_rings);
2571 prp->SetScaMin(pwaypoint->
scamin);
2575 prp->SetShowWaypointRangeRings(pwaypoint->
nrange_rings > 0);
2577 if (prp) prp->ReLoadIcon();
2579 auto canvas = gFrame->GetPrimaryCanvas();
2580 SelectCtx ctx(canvas->m_bShowNavobjects, canvas->GetCanvasTrueScale(),
2581 canvas->GetScaleValue());
2583 pSelect->FindSelection(ctx, lat_save, lon_save, SELTYPE_ROUTEPOINT);
2585 pFind->m_slat = pwaypoint->
m_lat;
2586 pFind->m_slon = pwaypoint->
m_lon;
2591 NavObj_dB::GetInstance().UpdateRoutePoint(prp);
2594 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2595 pRouteManagerDialog->UpdateWptListCtrl();
2607 wxDateTime plannedDeparture;
2609 wxPlugin_WaypointExListNode* pwpnode = proute->
pWaypointList->GetFirst();
2611 pwaypointex = pwpnode->GetData();
2613 pWP = pWayPointMan->FindRoutePointByGUID(pwaypointex->
m_GUID);
2615 pWP = CreateNewPoint(pwaypointex, b_permanent);
2619 route->AddPoint(pWP);
2621 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
2624 pSelect->AddSelectableRouteSegment(pWP_src->m_lat, pWP_src->m_lon,
2625 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
2632 pwpnode = pwpnode->GetNext();
2640 if (!proute->
m_GUID.IsEmpty()) {
2643 route->
m_btemp = (b_permanent ==
false);
2651 NavObj_dB::GetInstance().InsertRoute(route);
2654 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2655 pRouteManagerDialog->UpdateRouteListCtrl();
2661 bool b_found =
false;
2665 if (pRoute) b_found =
true;
2668 bool b_permanent = !pRoute->
m_btemp;
2682std::unique_ptr<HostApi121::PlugIn_Route_Ex> GetRouteEx_PluginA(
2683 const wxString& GUID) {
2684 std::unique_ptr<HostApi121::PlugIn_Route_Ex> r;
2686 if (route ==
nullptr)
return r;
2688 r = std::unique_ptr<HostApi121::PlugIn_Route_Ex>(
2694 for (
RoutePoint* src_wp : *route->pRoutePointList) {
2696 PlugInExV2FromRoutePoint(dst_wp, src_wp);
2711 const wxString& GUID) {
2712 return ::GetRouteEx_PluginA(GUID);
2719 return wxEmptyString;
2728 return wxEmptyString;
2738 MyApp& app = wxGetApp();
2739 return (app.m_comm_bridge.GetPriorityMaps());
2743 MyApp& app = wxGetApp();
2744 app.m_comm_bridge.UpdateAndApplyMaps(map);
2748 std::vector<std::string> result;
2750 MyApp& app = wxGetApp();
2753 app.m_comm_bridge.GetPriorityContainer(
"position").active_source;
2754 result.push_back(
id);
2755 id = app.m_comm_bridge.GetPriorityContainer(
"velocity").active_source;
2756 result.push_back(
id);
2757 id = app.m_comm_bridge.GetPriorityContainer(
"heading").active_source;
2758 result.push_back(
id);
2759 id = app.m_comm_bridge.GetPriorityContainer(
"variation").active_source;
2760 result.push_back(
id);
2761 id = app.m_comm_bridge.GetPriorityContainer(
"satellites").active_source;
2762 result.push_back(
id);
2769#if defined(__WXOSX__) || defined(__WXGTK3__)
2771 if (gFrame) rv = gFrame->GetContentScaleFactor();
2776 double scaler = 1.0;
2778 if (gFrame) scaler = (double)(gFrame->ToDIP(100)) / 100.;
2795 bool state = gFrame->IsFullScreen();
2796 if (set_full_screen_on && !state)
2797 gFrame->ToggleFullScreen();
2798 else if (!set_full_screen_on && state)
2799 gFrame->ToggleFullScreen();
2802extern bool g_useMUI;
2804 bool current_mui_state = g_useMUI;
2807 if (enable && !current_mui_state) {
2809 for (
unsigned int i = 0; i < g_canvasArray.GetCount(); i++) {
2811 if (cc) cc->CreateMUIBar();
2813 }
else if (!enable && current_mui_state) {
2815 for (
unsigned int i = 0; i < g_canvasArray.GetCount(); i++) {
2817 if (cc) cc->DestroyMuiBar();
2826 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2827 if (cc) cc->SetShowGPSCompassWindow(enable);
2833 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2835 return cc->GetShowGPSCompassWindow();
2842extern bool g_bShowStatusBar;
2844 g_bShowStatusBar = enable;
2845 gFrame->ConfigureStatusBar();
2851 bool current_chartbar_state = g_bShowChartBar;
2852 for (
unsigned int i = 0; i < g_canvasArray.GetCount(); i++) {
2854 if (current_chartbar_state && !enable) {
2855 gFrame->ToggleChartBar(cc);
2856 g_bShowChartBar = current_chartbar_state;
2857 }
else if (!current_chartbar_state && enable) {
2858 gFrame->ToggleChartBar(cc);
2859 g_bShowChartBar = current_chartbar_state;
2862 g_bShowChartBar = enable;
2867extern bool g_bShowMenuBar;
2870 if (g_bShowMenuBar) {
2871 g_bShowMenuBar =
false;
2872 if (gFrame->m_pMenuBar) {
2873 gFrame->SetMenuBar(NULL);
2874 gFrame->m_pMenuBar->Destroy();
2875 gFrame->m_pMenuBar = NULL;
2879 g_bShowMenuBar =
true;
2880 gFrame->BuildMenuBar();
2887 if (ps52plib) ps52plib->m_chartSymbols.UpdateTableColor(table, name, color);
2891 wxColor ret = wxColor(*wxRED);
2893 int i_table = ps52plib->m_chartSymbols.FindColorTable(map_name.c_str());
2894 ret = ps52plib->m_chartSymbols.GetwxColor(name.c_str(), i_table);
2901 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2902 if (cc) cc->SetShowGrid(enable);
2908 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2909 if (cc) cc->SetShowOutlines(enable);
2915 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2916 if (cc) cc->SetShowDepthUnits(enable);
2922 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2923 if (cc) cc->SetShowAIS(enable);
2929 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2930 if (cc) cc->ShowTides(enable);
2936 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2937 if (cc) cc->ShowCurrents(enable);
2943 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2944 if (cc) cc->SetShowENCText(enable);
2950 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2951 if (cc) cc->SetShowENCDepth(enable);
2957 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2958 if (cc) cc->SetShowENCBuoyLabels(enable);
2964 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2965 if (cc) cc->SetShowENCLights(enable);
2971 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2972 if (cc) cc->SetShowENCLightDesc(enable);
2977 int valSet = STANDARD;
2980 valSet = DISPLAYBASE;
2989 valSet = MARINERS_STANDARD;
2996 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2997 if (cc) cc->SetENCDisplayCategory(valSet);
3001 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3003 return ((
PI_DisCat)cc->GetENCDisplayCategory());
3005 return PI_DisCat::PI_STANDARD;
3009 int newMode = NORTH_UP_MODE;
3011 newMode = COURSE_UP_MODE;
3013 newMode = HEAD_UP_MODE;
3016 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3017 if (cc) cc->SetUpMode(newMode);
3022 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3023 if (cc)
return ((
PI_NavMode)cc->GetUpMode());
3025 return PI_NavMode::PI_NORTH_UP_MODE;
3030 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3031 if (cc)
return (cc->GetShowGrid());
3038 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3039 if (cc)
return (cc->GetShowOutlines());
3046 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3047 if (cc)
return (cc->GetShowDepthUnits());
3054 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3055 if (cc)
return (cc->GetShowAIS());
3062 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3063 if (cc)
return (cc->GetbShowTide());
3070 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3071 if (cc)
return (cc->GetbShowCurrent());
3078 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3079 if (cc)
return (cc->GetShowENCText());
3086 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3087 if (cc)
return (cc->GetShowENCDepth());
3094 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3095 if (cc)
return (cc->GetShowENCBuoyLabels());
3102 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3103 if (cc)
return (cc->GetShowENCLights());
3108bool GetShowENCLightDesc(
int CanvasIndex) {
3110 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3111 if (cc)
return (cc->GetbShowCurrent());
3122 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3123 if (cc) cc->ToggleLookahead();
3129 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3130 if (cc)
return (cc->GetLookahead());
3135extern bool g_bTrackActive;
3137 if (!g_bTrackActive && enable)
3139 else if (g_bTrackActive && !enable)
3145 gFrame->SetAndApplyColorScheme((ColorScheme)cs);
3152 if (win) win->Refresh(eraseBackground);
3156 if (g_canvasConfig == 1) {
3161 gFrame->CreateCanvasLayout();
3162 gFrame->DoChartUpdate();
3167 gFrame->CreateCanvasLayout();
3168 gFrame->DoChartUpdate();
3179 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3186 g_disable_main_toolbar = !enable;
3191 if (gFrame) gFrame->ScheduleSettingsDialog();
3196 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3198 bool bfollow = cc->GetbFollow();
3199 cc->ResetOwnshipOffset();
3210 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3212 if (cc->GetbFollow() != enable_follow) cc->TogglebFollow();
3219 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3220 if (cc)
return cc->GetbFollow();
3227 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3228 if (cc) cc->SetShowFocusBar(enable);
3233 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3234 if (cc)
return (cc->GetShowFocusBar());
3248 pConfig->LoadMyConfigRaw(
false);
3251 pConfig->LoadCanvasConfigs(
false);
3252 auto& config_array = ConfigMgr::Get().GetCanvasConfigArray();
3253 for (
auto pcc : config_array) {
3254 if (pcc && pcc->canvas) {
3255 pcc->canvas->ApplyCanvasConfig(pcc);
3256 pcc->canvas->Refresh();
3266 g_CanvasHideNotificationIcon = !enable;
AisDecoder * g_pAIS
Global instance.
Class AisDecoder and helpers.
ChartDB * ChartData
Global instance.
Charts database management
ChartGroupArray * g_pGroupArray
Global instance.
ChartCanvas * g_focusCanvas
Global instance.
ChartCanvas * g_overlayCanvas
Global instance.
Generic Chart canvas base.
ChartCanvas - Main chart display and interaction component.
float GetVPScale()
Return the ViewPort scale factor, in physical pixels per meter.
void ZoomCanvasSimple(double factor)
Perform an immediate zoom operation without smooth transitions.
Manages the chart database and provides access to chart data.
bool LoadBinary(const wxString &filename, ArrayOfCDI &dir_array_check)
Load the chart database from a binary file.
Wrapper class for plugin-based charts.
wxFont * FindOrCreateFont(int point_size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underline=false, const wxString &facename=wxEmptyString, wxFontEncoding encoding=wxFONTENCODING_DEFAULT)
Creates or finds a matching font in the font cache.
wxColour GetFontColor(const wxString &TextElement) const
Gets the text color for a UI element.
bool AddAuxKey(wxString key)
Adds new plugin-defined font configuration key.
bool SetFontColor(const wxString &TextElement, const wxColour color) const
Sets the text color for a UI element.
static wxString GetUUID(void)
Return a unique RFC4122 version 4 compliant GUID string.
virtual std::unique_ptr< HostApi121::PlugIn_Route_Ex > GetRoute(const wxString &GUID)
Retrieve route from database.
void Notify(std::shared_ptr< const NavMsg > message)
Accept message received by driver, make it available for upper layers.
Extended OpenGL-optimized chart base class with additional querying capabilities.
virtual ListOfPI_S57Obj * GetLightsObjRuleListVisibleAtLatLon(float lat, float lon, PlugIn_ViewPort *VPoint)
Gets list of visible light objects at specified position.
Basic data for a loaded plugin, trivially copyable.
AIS target information accessible to plugins.
double HDG
Heading in degrees true.
int ROTAIS
Rate of turn as indicated in AIS message.
unsigned char ShipType
Ship type as per ITU-R M.1371.
double Lat
Latitude in decimal degrees.
int MMSI
Maritime Mobile Service Identity number.
bool bCPA_Valid
True if CPA calculation is valid.
double Brg
Bearing to target in degrees true.
double Lon
Longitude in decimal degrees.
double CPA
Closest Point of Approach in nautical miles.
int Class
AIS class (Class A: 0, Class B: 1)
double SOG
Speed over ground in knots.
double Range_NM
Range to target in nautical miles.
int NavStatus
Navigational status (0-15 as per ITU-R M.1371)
int IMO
IMO ship identification number.
double TCPA
Time to Closest Point of Approach in minutes.
double COG
Course over ground in degrees.
plugin_ais_alarm_type alarm_state
Current alarm state for this target.
Extended position fix information.
int nSats
Number of satellites used in the fix.
double Var
Magnetic variation in degrees, typically from RMC message.
double Cog
Course over ground in degrees [0-360).
double Lat
Latitude in decimal degrees.
double Hdm
Heading magnetic in degrees [0-360).
time_t FixTime
UTC time of fix.
double Lon
Longitude in decimal degrees.
double Sog
Speed over ground in knots.
double Hdt
Heading true in degrees [0-360).
Enhanced route class for working with PlugIn_Waypoint_ExV2 waypoints.
bool m_isVisible
True if route should be displayed.
Plugin_WaypointExV2List * pWaypointList
List of waypoints making up this route in order.
wxString m_StartString
Description of route start point.
wxString m_Description
Optional route description/notes.
wxString m_NameString
User-visible name of the route.
bool m_isActive
True if this is the active route.
wxString m_GUID
Globally unique identifier.
wxString m_EndString
Description of route end point.
Extended route class for managing complex route features.
wxString m_Description
Optional route description/notes.
wxString m_EndString
Description of route end point.
Plugin_WaypointExList * pWaypointList
List of waypoints making up this route in order.
wxString m_NameString
User-visible name of the route.
bool m_isVisible
True if route should be displayed.
wxString m_GUID
Globally unique identifier.
wxString m_StartString
Description of route start point.
Plugin route class for managing ordered waypoint collections.
wxString m_GUID
Globally unique identifier.
wxString m_EndString
Name/description of ending point.
wxString m_NameString
Route name.
Plugin_WaypointList * pWaypointList
List of waypoints making up this route in order.
wxString m_StartString
Name/description of starting point.
Plugin track class for managing recorded track data.
Plugin_WaypointList * pWaypointList
List of waypoints making up this track in chronological order.
wxString m_GUID
Globally unique identifier.
wxString m_EndString
Description of track end point/time.
wxString m_StartString
Description of track start point/time.
wxString m_NameString
Display name of the track.
Contains view parameters and status information for a chart display viewport.
double view_scale_ppm
Display scale in pixels per meter.
wxRect rv_rect
Rectangle defining the rendered view area.
int pix_width
Viewport width in pixels.
double lon_max
Maximum longitude of the viewport.
double clon
Center longitude of the viewport in decimal degrees.
double lat_max
Maximum latitude of the viewport.
int pix_height
Viewport height in pixels.
double clat
Center latitude of the viewport in decimal degrees.
double skew
Display skew angle in radians.
double rotation
Display rotation angle in radians.
bool bValid
True if this viewport is valid and can be used for rendering.
double lon_min
Minimum longitude of the viewport.
double lat_min
Minimum latitude of the viewport.
int m_projection_type
Chart projection type (PROJECTION_MERCATOR, etc.)
bool b_quilt
True if the viewport is in quilt mode (showing multiple charts)
float chart_scale
Conventional chart displayed scale (e.g., 1:50000)
wxDateTime m_ETD
Estimated departure time in UTC, or wxInvalidDateTime if not set.
wxString m_MarkDescription
Optional description text.
int GetRouteMembershipCount()
Gets number of routes containing this waypoint.
wxString m_GUID
Globally unique identifier.
wxString m_TideStation
Tide Station Identifier.
void InitDefaults()
Initializes waypoint properties to default values.
wxDateTime m_CreateTime
Creation timestamp in UTC.
bool m_bShowWaypointRangeRings
True to show range rings on chart.
wxString IconDescription
User-friendly description of icon.
double m_lat
Latitude in decimal degrees.
wxColour RangeRingColor
Color to draw range rings.
bool IsActive
Active state (e.g. destination)
Plugin_HyperlinkList * m_HyperlinkList
List of hyperlinks associated with this waypoint.
double scamin
Minimum display scale (1:X) for waypoint visibility.
double scamax
Maximum display scale (1:X) for waypoint visibility.
bool b_useScamin
True to enable scale-dependent visibility.
wxString IconName
Name of icon to use for waypoint symbol.
bool IsNameVisible
True to show waypoint name on chart.
double m_PlannedSpeed
Planned speed for next leg (knots)
double RangeRingSpace
Distance between range rings in preferred units.
double m_lon
Longitude in decimal degrees.
double m_WaypointArrivalRadius
Arrival radius in nautical miles.
int RangeRingSpaceUnits
Units for range ring spacing - 0:nm, 1:km.
wxString m_MarkName
Display name of waypoint.
bool IsVisible
Visibility state on chart.
int nrange_rings
Number of range rings to display around waypoint.
bool GetFSStatus()
Gets "free-standing" status of waypoint.
Extended waypoint class with additional navigation features.
bool GetFSStatus()
Gets "free-standing" status of waypoint.
wxDateTime m_CreateTime
Creation timestamp in UTC.
wxColour RangeRingColor
Color to draw range rings.
int nrange_rings
Number of range rings to display around waypoint.
wxString IconDescription
User-friendly description of icon.
bool b_useScamin
True to enable scale-dependent visibility.
double RangeRingSpace
Distance between range rings in preferred units.
Plugin_HyperlinkList * m_HyperlinkList
List of hyperlinks associated with this waypoint.
wxString m_MarkName
Display name of waypoint.
wxString m_GUID
Globally unique identifier.
double m_lon
Longitude in decimal degrees.
wxString IconName
Name of icon to use for waypoint symbol.
void InitDefaults()
Initializes waypoint properties to default values.
double scamin
Minimum display scale (1:X) for waypoint visibility.
bool IsNameVisible
True to show waypoint name on chart.
double m_lat
Latitude in decimal degrees.
wxString m_MarkDescription
Optional description text.
int GetRouteMembershipCount()
Gets number of routes containing this waypoint.
bool IsActive
Active state (e.g. destination)
bool IsVisible
Visibility state on chart.
Plugin waypoint class providing core waypoint/mark functionality.
double m_lon
Longitude in decimal degrees.
wxString m_IconName
Icon identifier.
wxString m_MarkDescription
Optional description.
wxString m_GUID
Globally unique identifier.
bool m_IsVisible
Visibility state.
PlugIn_Waypoint()
Default constructor - creates waypoint at 0,0.
wxDateTime m_CreateTime
Creation timestamp in UTC.
wxString m_MarkName
Display name.
double m_lat
Latitude in decimal degrees.
Plugin_HyperlinkList * m_HyperlinkList
List of associated hyperlinks.
Class representing a hyperlink associated with a waypoint or route.
wxString Link
The actual URL or file path.
wxString DescrText
User-visible description of the link.
wxString Type
Link type identifier (e.g., "Website", "Chart", "Image")
Represents a waypoint or mark within the navigation system.
HyperlinkList * m_HyperlinkList
List of hyperlinks associated with this waypoint.
wxColour m_wxcWaypointRangeRingsColour
Color for the range rings display.
wxString m_MarkDescription
Description text for the waypoint.
int m_iWaypointRangeRingsNumber
Number of range rings to display around the waypoint.
void SetCreateTime(wxDateTime dt)
Sets the create time of this RoutePoint in UTC.
wxString m_GUID
Globally Unique Identifier for the waypoint.
bool m_bIsolatedMark
Flag indicating if the waypoint is a standalone mark.
bool m_bIsActive
Flag indicating if this waypoint is active for navigation.
wxDateTime GetManualETD()
Retrieves the manually set Estimated Time of Departure for this waypoint, in UTC.
bool m_bIsInRoute
Flag indicating if this waypoint is part of a route.
bool m_bShowName
Flag indicating if the waypoint name should be shown.
double GetPlannedSpeed()
Return the planned speed associated with this waypoint.
bool m_btemp
Flag indicating if this is a temporary waypoint.
int m_iWaypointRangeRingsStepUnits
Units for the range rings step (0=nm, 1=km).
wxDateTime GetCreateTime(void)
Returns the Create Time of this RoutePoint in UTC.
float m_fWaypointRangeRingsStep
Distance between consecutive range rings.
wxString m_TideStation
Associated tide station identifier.
void SetETD(const wxDateTime &etd)
Sets the Estimated Time of Departure for this waypoint, in UTC.
Represents a navigational route in the navigation system.
double m_PlannedSpeed
Default planned speed for the route in knots.
wxString m_RouteStartString
Name or description of the route's starting point.
wxString m_RouteDescription
Additional descriptive information about the route.
RoutePointList * pRoutePointList
Ordered list of waypoints (RoutePoints) that make up this route.
wxString m_Colour
Color name for rendering the route on the chart.
wxString m_RouteEndString
Name or description of the route's ending point.
bool m_btemp
Flag indicating if this is a temporary route.
wxPenStyle m_style
Style of the route line when rendered on the chart.
wxString m_TimeDisplayFormat
Format for displaying times in the UI.
wxString m_RouteNameString
User-assigned name for the route.
wxString m_GUID
Globally unique identifier for this route.
wxDateTime m_PlannedDeparture
Planned departure time for the route, in UTC.
bool DeleteRoute(Route *pRoute)
Represents a single point in a track.
wxDateTime GetCreateTime(void)
Retrieves the creation timestamp of a track point as a wxDateTime object.
void SetCreateTime(wxDateTime dt)
Sets the creation timestamp for a track point.
Represents a track, which is a series of connected track points.
ViewPort - Core geographic projection and coordinate transformation engine.
void SetBoxes()
Computes the bounding box coordinates for the current viewport.
double view_scale_ppm
Requested view scale in physical pixels per meter (ppm), before applying projections.
double ref_scale
The nominal scale of the "reference chart" for this view.
int pix_height
Height of the viewport in physical pixels.
double rotation
Rotation angle of the viewport in radians.
int pix_width
Width of the viewport in physical pixels.
wxPoint2DDouble GetDoublePixFromLL(double lat, double lon)
Convert latitude and longitude on the ViewPort to physical pixel coordinates with double precision.
double skew
Angular distortion (shear transform) applied to the viewport in radians.
void GetLLFromPix(const wxPoint &p, double *lat, double *lon)
Convert physical pixel coordinates on the ViewPort to latitude and longitude.
double clon
Center longitude of the viewport in degrees.
double clat
Center latitude of the viewport in degrees.
wxPoint GetPixFromLL(double lat, double lon)
Convert latitude and longitude on the ViewPort to physical pixel coordinates.
double chart_scale
Chart scale denominator (e.g., 50000 for a 1:50000 scale).
Device context class that can use either wxDC or OpenGL for drawing.
Base class for OpenCPN plugins.
Raw messages layer, supports sending and recieving navmsg messages.
Config file user configuration interface.
OpenGL chart rendering canvas.
wxFont GetOCPNGUIScaledFont(wxString item)
Retrieves a font optimized for touch and high-resolution interfaces.
General purpose GUI support.
Miscellaneous globals primarely used by gui layer, not persisted in configuration file.
GUI constant definitions.
Multiplexer class and helpers.
MySQL based storage for routes, tracks, etc.
wxString getUsrHeightUnit(int unit)
Get the abbreviation for the preferred height unit.
double toUsrHeight(double m_height, int unit)
Convert height from meters to preferred height units.
double fromUsrDistance(double usr_distance, int unit, int default_val)
Convert distance from user units to nautical miles.
double fromUsrHeight(double usr_height, int unit)
Convert height from preferred height units to meters.
double toUsrDepth(double m_depth, int unit)
Convert a depth from meters to user display units.
double toUsrTemp(double cel_temp, int unit)
Convert a temperature from Celsius to user display units.
double toUsrDistance(double nm_distance, int unit)
Convert a distance from nautical miles (NMi) to user display units.
User notifications manager.
OCPN_AUIManager * g_pauimgr
Global instance.
PlugIn Object Definition/API.
@ OBJECTS_ALL
Return all objects including those in layers.
@ OBJECTS_ONLY_LAYERS
Return only objects that are in layers.
@ OBJECTS_NO_LAYERS
Exclude objects that are in layers.
plugin_ais_alarm_type
Enumeration of AIS alarm states.
enum _PI_DisCat PI_DisCat
Display categories for S52 chart features.
PI_ColorScheme
Color schemes for different lighting conditions.
@ PI_COURSE_UP_MODE
Course Up Mode - Current course over ground at the top.
@ PI_HEAD_UP_MODE
Head Up Mode - Current vessel heading at the top.
@ PI_OTHER
Other - additional features for detailed navigation.
@ PI_DISPLAYBASE
Display Base - features that must always be shown.
@ PI_STANDARD
Standard - default features for safe navigation.
@ PI_MARINERS_STANDARD
Mariner specified standard features.
enum _PI_NavMode PI_NavMode
Navigation mode options for chart display orientation.
enum _OBJECT_LAYER_REQ OBJECT_LAYER_REQ
Filter options for object queries.
OptionsParentPI
Enum defining parent pages in OpenCPN options dialog where plugins can add panels.
@ PI_OPTIONS_PARENT_DISPLAY
Display settings section.
@ PI_OPTIONS_PARENT_UI
User Interface section.
@ PI_OPTIONS_PARENT_SHIPS
Ships section.
@ PI_OPTIONS_PARENT_CHARTS
Charts section.
@ PI_OPTIONS_PARENT_PLUGINS
Plugins section.
@ PI_OPTIONS_PARENT_CONNECTIONS
Connections section.
void EnableNotificationCanvasIcon(bool enable)
Plugin Notification Framework GUI support.
void SetCanvasContextMenuItemGrey(int item, bool grey)
Sets menu item enabled/disabled state.
bool UpdateSingleWaypoint(PlugIn_Waypoint *pwaypoint)
Updates a single waypoint.
bool PlugInHasNormalizedViewPort(PlugIn_ViewPort *vp)
Checks if viewport has been normalized.
void PluginCenterOwnship(int CanvasIndex)
Center the chart view on the own ship position for a specific canvas.
void SetCanvasRotation(double rotation)
Sets chart display rotation angle.
wxString GetSelectedWaypointGUID_Plugin()
Gets GUID of currently selected waypoint.
void RemovePlugInTool(int tool_id)
Removes a tool from OpenCPN's toolbar.
void SetCanvasProjection(int projection)
Sets chart projection type.
double toUsrTemp_Plugin(double cel_temp, int unit)
Converts Celsius to user's preferred temperature unit.
wxWindow * PluginGetFocusCanvas()
Gets the currently focused chart canvas.
int AddChartToDBInPlace(wxString &full_path, bool b_RefreshCanvas)
Adds a chart to the database without full rebuild.
void fromSM_Plugin(double x, double y, double lat0, double lon0, double *lat, double *lon)
Converts Simple Mercator coordinates to geographic.
wxWindow * GetOCPNCanvasWindow()
Gets OpenCPN's main canvas window.
bool GetEnableLatLonGrid(int CanvasIndex)
Gets latitude/longitude grid visibility state.
bool UpdatePlugInRouteEx(PlugIn_Route_Ex *proute)
Updates an existing extended route.
void SetCanvasContextMenuItemViz(int item, bool viz)
Temporarily changes context menu item visibility.
int PlatformDirSelectorDialog(wxWindow *parent, wxString *file_spec, wxString Title, wxString initDir)
Shows platform-optimized directory selector dialog.
bool GetTouchMode()
Gets touch interface mode state.
int GetCanvasCount()
Gets total number of chart canvases.
bool GetSingleWaypointExV2(wxString GUID, PlugIn_Waypoint_ExV2 *pwaypoint)
Gets extended waypoint data by GUID.
wxString getUsrWindSpeedUnit_Plugin(int unit)
Gets display string for user's preferred wind speed unit.
void SetCanvasMenuItemViz(int item, bool viz, const char *name)
Temporarily changes context menu item visibility.
void PlugInMultMatrixViewport(PlugIn_ViewPort *vp, float lat, float lon)
Applies viewport transformation matrix.
wxFont * OCPNGetFont(wxString TextElement, int default_size)
Gets a font for UI elements.
bool GetEnableMainToolbar()
Check if the main toolbar is enabled.
bool GetEnableENCTextDisplay(int CanvasIndex)
Gets ENC text label visibility.
bool UpdateSingleWaypointEx(PlugIn_Waypoint_Ex *pwaypoint)
Updates an existing extended waypoint.
wxString getUsrDistanceUnit_Plugin(int unit)
Gets display string for user's preferred distance unit.
bool DeletePlugInTrack(wxString &GUID)
Deletes a track.
wxFileConfig * GetOCPNConfigObject()
Gets OpenCPN's configuration object.
wxString getUsrHeightUnit_Plugin(int unit)
Gets display string for user's preferred height unit.
bool DeletePlugInRoute(wxString &GUID)
Deletes a route.
void EnableSplitScreenLayout(bool enable)
Enable or disable the split-screen layout.
double toUsrWindSpeed_Plugin(double kts_speed, int unit)
Converts knots to user's preferred wind speed unit.
bool GetEnableLightsDisplay(int CanvasIndex)
Gets light icon visibility.
wxFont GetOCPNGUIScaledFont_PlugIn(wxString item)
Gets a uniquely scaled font copy for responsive UI elements.
wxBitmap GetBitmapFromSVGFile(wxString filename, unsigned int width, unsigned int height)
Creates bitmap from SVG file.
wxFont * FindOrCreateFont_PlugIn(int point_size, wxFontFamily family, wxFontStyle style, wxFontWeight weight, bool underline, const wxString &facename, wxFontEncoding encoding)
Creates or finds a font in the font cache.
int GetGlobalWatchdogTimoutSeconds()
Comm Global Watchdog Query
wxColour GetFontColour_PlugIn(wxString TextElement)
Gets color configured for a UI text element.
void EnableChartBar(bool enable, int CanvasIndex)
Controls visibility of chart info bar.
void PositionBearingDistanceMercator_Plugin(double lat, double lon, double brg, double dist, double *dlat, double *dlon)
Calculates destination point given starting point, bearing and distance.
double toUsrDistance_Plugin(double nm_distance, int unit)
Converts nautical miles to user's preferred distance unit.
void SetENCDisplayCategory(PI_DisCat cat, int CanvasIndex)
Sets ENC (Electronic Navigation Chart) feature display category.
void toSM_Plugin(double lat, double lon, double lat0, double lon0, double *x, double *y)
Converts geographic coordinates to Simple Mercator projection.
PI_DisCat GetENCDisplayCategory(int CanvasIndex)
Gets current ENC display category.
void EnableTouchMode(bool enable)
Enables/disables touch interface mode.
void EnableCurrentStationsDisplay(bool enable, int CanvasIndex)
Controls current station icon display.
void EnableChartOutlines(bool enable, int CanvasIndex)
Controls chart outline display.
void EnableMUIBar(bool enable, int CanvasIndex)
Controls visibility of MUI (Mobile/Touch User Interface) bar.
double OCPN_GetDisplayContentScaleFactor()
Gets content scaling factor for current display.
wxArrayString GetIconNameArray()
Gets array of available waypoint icons.
double DistGreatCircle_Plugin(double slat, double slon, double dlat, double dlon)
Calculates great circle distance between two points.
bool AddSingleWaypointExV2(PlugIn_Waypoint_ExV2 *pwaypointex, bool b_permanent)
Adds a waypoint with extended V2 properties.
void EnableLookaheadMode(bool enable, int CanvasIndex)
Enables/disables look-ahead mode for a canvas.
bool PluginGetFollowMode(int CanvasIndex)
Get the current follow mode status for a specific canvas.
bool ShuttingDown()
Checks if OpenCPN is in shutdown process.
wxScrolledWindow * AddOptionsPage(OptionsParentPI parent, wxString title)
Adds a new preferences page to OpenCPN options dialog.
void EnableLightsDisplay(bool enable, int CanvasIndex)
Controls light icon display.
void PlugInHandleAutopilotRoute(bool enable)
Controls autopilot route handling.
wxArrayString GetTrackGUIDArray()
Gets array of track GUIDs.
wxString getUsrDepthUnit_Plugin(int unit)
Gets display string for user's preferred depth unit.
void RemoveCanvasMenuItem(int item, const char *name)
Removes a context menu item completely.
void JumpToPosition(double lat, double lon, double scale)
Centers chart display on specified position at given scale.
int InsertPlugInToolSVG(wxString label, wxString SVGfile, wxString SVGfileRollover, wxString SVGfileToggled, wxItemKind kind, wxString shortHelp, wxString longHelp, wxObject *clientData, int position, int tool_sel, opencpn_plugin *pplugin)
Adds a tool using SVG graphics.
bool GetEnableCurrentStationsDisplay(int CanvasIndex)
Gets current station icon visibility.
wxDialog * GetActiveOptionsDialog()
Gets pointer to active options dialog.
wxString getUsrSpeedUnit_Plugin(int unit)
Gets display string for user's preferred speed unit.
std::unique_ptr< PlugIn_Waypoint > GetWaypoint_Plugin(const wxString &GUID)
Gets waypoint details by GUID.
bool GetEnableLookaheadMode(int CanvasIndex)
Gets look-ahead mode state for a canvas.
void EnableTideStationsDisplay(bool enable, int CanvasIndex)
Controls tide station icon display.
bool GetEnableChartBar(int CanvasIndex)
Gets chart bar visibility state.
wxBitmap GetIcon_PlugIn(const wxString &name)
Gets icon bitmap by name.
bool PlugIn_GSHHS_CrossesLand(double lat1, double lon1, double lat2, double lon2)
Checks if a great circle route crosses land.
void SetNavigationMode(PI_NavMode mode, int CanvasIndex)
Sets the navigation mode for a specific chart canvas.
bool GetEnableStatusBar()
Gets status bar visibility state.
bool GetEnableDepthUnitDisplay(int CanvasIndex)
Gets depth unit display state.
int InsertPlugInTool(wxString label, wxBitmap *bitmap, wxBitmap *bmpRollover, wxItemKind kind, wxString shortHelp, wxString longHelp, wxObject *clientData, int position, int tool_sel, opencpn_plugin *pplugin)
Adds a tool to OpenCPN's toolbar.
void EnableENCDepthSoundingsDisplay(bool enable, int CanvasIndex)
Controls ENC depth sounding display.
void PlugInAISDrawGL(wxGLCanvas *glcanvas, const PlugIn_ViewPort &vp)
Renders AIS targets on a secondary OpenGL canvas.
double GetCanvasTilt()
Gets current canvas tilt angle.
void AddChartDirectory(wxString &path)
Adds a chart directory to OpenCPN's chart database.
double fromDMM_PlugIn(wxString sdms)
Parse a formatted coordinate string to get decimal degrees.
double toUsrDepth_Plugin(double m_depth, int unit)
Converts meters to user's preferred depth unit.
bool GetActiveRoutepointGPX(char *buffer, unsigned int buffer_length)
Gets GPX representation of active route waypoint.
std::unique_ptr< PlugIn_Waypoint_ExV2 > GetWaypointExV2_Plugin(const wxString &GUID)
Gets complete waypoint details by GUID.
double PlugInGetDisplaySizeMM()
Gets physical display size in millimeters.
bool UpdatePlugInRoute(PlugIn_Route *proute)
Updates an existing route.
void SetToolbarToolBitmaps(int item, wxBitmap *bitmap, wxBitmap *bmpRollover)
Updates toolbar tool bitmaps.
void EnableBuoyLightLabelsDisplay(bool enable, int CanvasIndex)
Controls buoy/light name label display.
wxString GetActiveWaypointGUID(void)
Gets GUID of currently active waypoint.
void ConfigFlushAndReload()
Flush configuration changes to disk and reload settings.
ArrayOfPlugIn_AIS_Targets * GetAISTargetArray()
Gets array of AIS targets.
void EnableAisTargetDisplay(bool enable, int CanvasIndex)
Controls AIS target display.
int PlatformFileSelectorDialog(wxWindow *parent, wxString *file_spec, wxString Title, wxString initDir, wxString suggestedName, wxString wildcard)
Shows platform-optimized file selector dialog.
bool CheckMUIEdgePan_PlugIn(int x, int y, bool dragging, int margin, int delta, int canvasIndex)
Checks if chart should pan when cursor near edge.
std::unique_ptr< PlugIn_Route_ExV2 > GetRouteExV2_Plugin(const wxString &GUID)
Gets route details with V2 waypoints by GUID.
double fromUsrDepth_Plugin(double usr_depth, int unit)
Converts from user's preferred depth unit to meters.
bool AddPlugInRoute(PlugIn_Route *proute, bool b_permanent)
Adds a new route.
double fromDMM_Plugin(wxString sdms)
Converts degrees/decimal minutes string to decimal degrees.
void EnableENCTextDisplay(bool enable, int CanvasIndex)
Controls ENC text label display.
void EnableTenHertzUpdate(bool enable)
Enable or disable 10 Hz update rate.
wxRect GetMasterToolbarRect()
Gets bounding rectangle of master toolbar.
void toTM_Plugin(float lat, float lon, float lat0, float lon0, double *x, double *y)
Converts geographic coordinates to Transverse Mercator projection.
void CanvasJumpToPosition(wxWindow *canvas, double lat, double lon, double scale)
Centers specified canvas on given position at given scale.
bool GetGlobalColor(wxString colorName, wxColour *pcolour)
Gets a functionally-named color for a specific UI purpose.
double fromUsrSpeed_Plugin(double usr_speed, int unit)
Converts from user's preferred speed unit to knots.
void GetDoubleCanvasPixLL(PlugIn_ViewPort *vp, wxPoint2DDouble *pp, double lat, double lon)
Converts lat/lon to canvas pixels with double precision.
std::unique_ptr< PlugIn_Track > GetTrack_Plugin(const wxString &GUID)
Gets track details by GUID.
bool PlugInPlaySoundEx(wxString &sound_file, int deviceIndex)
Start playing a sound file asynchronously.
void EnableCompassGPSIcon(bool enable, int CanvasIndex)
Controls visibility of compass/GPS status icon.
wxString GetActiveRouteGUID(void)
Gets GUID of currently active route.
void EnableDepthUnitDisplay(bool enable, int CanvasIndex)
Controls depth unit display.
bool GetEnableTideStationsDisplay(int CanvasIndex)
Gets tide station icon visibility.
bool PlugInSetFontColor(const wxString TextElement, const wxColour color)
Sets text color for a UI element.
std::unique_ptr< PlugIn_Waypoint_Ex > GetWaypointEx_Plugin(const wxString &GUID)
Gets extended waypoint by GUID.
bool GetTrackingMode()
Get the current tracking mode status.
bool GetEnableChartOutlines(int CanvasIndex)
Gets chart outline visibility state.
void GetCanvasPixLL(PlugIn_ViewPort *vp, wxPoint *pp, double lat, double lon)
Converts lat/lon to canvas physical pixel coordinates.
double toUsrHeight_Plugin(double m_height, int unit)
Height Conversion Functions.
wxColor GetGlobalColorD(std::string map_name, std::string name)
Gets a color from the global color scheme.
wxString GetNewGUID()
Generates a new globally unique identifier (GUID).
bool GetEnableCompassGPSIcon(int CanvasIndex)
Gets compass icon visibility state.
void SetMUICursor_PlugIn(wxCursor *pCursor, int canvasIndex)
Sets mouse cursor for specific canvas.
wxString * GetpSharedDataLocation()
Gets shared application data location.
void EnableMenu(bool enable)
Shows/hides the main menu bar.
void DimeWindow(wxWindow *win)
Applies system color scheme to window.
bool GetEnableAisTargetDisplay(int CanvasIndex)
Gets AIS target display state.
wxWindow * GetCanvasUnderMouse()
Gets canvas window under mouse cursor.
wxArrayString GetRouteGUIDArray()
Gets array of route GUIDs.
bool AddPlugInRouteExV2(PlugIn_Route_ExV2 *proute, bool b_permanent)
Adds a new route with V2 waypoints.
std::vector< std::string > GetPriorityMaps()
Comm Priority query support methods
double GetOCPNGUIToolScaleFactor_PlugIn()
Gets current global GUI scaling factor.
void SetToolbarToolBitmapsSVG(int item, wxString SVGfile, wxString SVGfileRollover, wxString SVGfileToggled)
Updates SVG graphics for toolbar tool.
wxString getUsrTempUnit_Plugin(int unit)
Gets display string for user's preferred temperature unit.
bool AddSingleWaypointEx(PlugIn_Waypoint_Ex *pwaypointex, bool b_permanent)
Adds a waypoint with extended properties.
int AddCanvasContextMenuItem(wxMenuItem *pitem, opencpn_plugin *pplugin)
Adds item to chart canvas context menu.
wxString GetActiveStyleName()
Gets name of currently active style sheet.
wxArrayString GetChartDBDirArrayString()
Gets chart database directory list.
void SetCursor_PlugIn(wxCursor *pCursor)
Sets mouse cursor.
bool GetEnableTenHertzUpdate()
Check if 10 Hz update rate is enabled.
int GetCanvasIndexUnderMouse()
Gets index of chart canvas under mouse cursor.
wxString GetLocaleCanonicalName()
Gets system locale canonical name.
wxWindow * PluginGetOverlayRenderCanvas()
Gets the canvas currently designated for overlay rendering.
bool AddPersistentFontKey(wxString TextElement)
Registers a new font configuration element.
bool AddPlugInTrack(PlugIn_Track *ptrack, bool b_permanent)
Adds a new track.
bool UpdateChartDBInplace(wxArrayString dir_array, bool b_force_update, bool b_ProgressDialog)
Updates chart database in place.
void UpdateAndApplyPriorityMaps(std::vector< std::string > map)
Sets and applies new priority mapping scheme.
void RequestWindowRefresh(wxWindow *win, bool eraseBackground)
Requests window refresh.
void EnableLatLonGrid(bool enable, int CanvasIndex)
Controls latitude/longitude grid display.
void SetAppColorScheme(PI_ColorScheme cs)
Set the application color scheme.
bool DeleteSingleWaypoint(wxString &GUID)
Deletes a single waypoint.
void RemoveCanvasContextMenuItem(int item)
Removes a context menu item completely.
bool DecodeSingleVDOMessage(const wxString &str, PlugIn_Position_Fix_Ex *pos, wxString *accumulator)
Decodes a single VDO (Own Ship AIS) message.
wxAuiManager * GetFrameAuiManager()
Gets main frame AUI manager.
bool AddCustomWaypointIcon(wxBitmap *pimage, wxString key, wxString description)
Adds a custom waypoint icon.
bool CheckEdgePan_PlugIn(int x, int y, bool dragging, int margin, int delta)
Checks if chart should pan when cursor near edge.
double toUsrSpeed_Plugin(double kts_speed, int unit)
Converts knots to user's preferred speed unit.
int GetChartbarHeight()
Gets height of chart bar in pixels.
bool UpdatePlugInRouteExV2(PlugIn_Route_ExV2 *proute)
Updates existing route with V2 waypoints.
std::vector< std::string > GetActivePriorityIdentifiers()
Gets list of active priority identifiers.
bool GetEnableENCDepthSoundingsDisplay(int CanvasIndex)
Gets ENC depth sounding visibility.
void SetToolbarItemState(int item, bool toggle)
Sets toolbar item toggle state.
bool DeleteOptionsPage(wxScrolledWindow *page)
Remove a previously added options page.
void EnableLightDescriptionsDisplay(bool enable, int CanvasIndex)
Controls light description text display.
float GetOCPNChartScaleFactor_Plugin()
Gets chart rendering scale factor.
PI_NavMode GetNavigationMode(int CanvasIndex)
Gets current navigation mode for a canvas.
int AddCanvasMenuItem(wxMenuItem *pitem, opencpn_plugin *pplugin, const char *name)
Adds item to canvas context menu.
int RemoveChartFromDBInPlace(wxString &full_path)
Removes a chart from database without full rebuild.
void PlugInNormalizeViewport(PlugIn_ViewPort *vp, float lat, float lon)
Normalizes viewport parameters.
PI_ColorScheme GetAppColorScheme()
Get the current application color scheme.
void ExitOCPN()
Exits OpenCPN application.
wxArrayString GetWaypointGUIDArray()
Gets array of all waypoint/marks GUIDs.
wxWindow * GetCanvasByIndex(int canvasIndex)
Gets chart canvas window by index.
void fromTM_Plugin(double x, double y, double lat0, double lon0, double *lat, double *lon)
Converts Transverse Mercator coordinates to geographic.
double OCPN_GetWinDIPScaleFactor()
Gets Windows-specific DPI scaling factor.
void PushNMEABuffer(wxString buf)
Pushes NMEA sentence to the system.
void SetEnableMainToolbar(bool enable)
Show or hide the main toolbar.
void SetFullScreen(bool set_full_screen_on)
Sets full screen mode.
bool GetEnableMenu()
Gets menu bar visibility state.
void SetCanvasMenuItemGrey(int item, bool grey, const char *name)
Sets menu item enabled/disabled state.
bool GetEnableBuoyLightLabelsDisplay(int CanvasIndex)
Gets buoy/light label visibility.
double fromUsrWindSpeed_Plugin(double usr_wspeed, int unit)
Converts from user's preferred wind speed unit to knots.
bool GetEnableCanvasFocusBar(int CanvasIndex)
Gets focus indicator visibility state.
wxXmlDocument GetChartDatabaseEntryXML(int dbIndex, bool b_getGeom)
Gets chart database entry as XML.
void SendPluginMessage(wxString message_id, wxString message_body)
Sends message to other plugins.
bool AddPlugInRouteEx(PlugIn_Route_Ex *proute, bool b_permanent)
Adds a route with extended features.
void fromSM_ECC_Plugin(double x, double y, double lat0, double lon0, double *lat, double *lon)
Converts Elliptical Simple Mercator coordinates to geographic.
void EnableStatusBar(bool enable)
Shows/hides the status bar.
void RequestRefresh(wxWindow *win)
Requests window refresh.
bool UpdateSingleWaypointExV2(PlugIn_Waypoint_ExV2 *pwaypoint)
Updates an existing extended V2 waypoint.
void PluginZoomCanvas(int CanvasIndex, double factor)
Zoom a specific chart canvas by the given factor.
bool IsTouchInterface_PlugIn()
Checks if touch interface mode is enabled.
int GetLatLonFormat()
Gets currently selected latitude/longitude display format.
bool AddSingleWaypoint(PlugIn_Waypoint *pwaypoint, bool b_permanent)
Adds a single waypoint.
bool GetSingleWaypoint(wxString GUID, PlugIn_Waypoint *pwaypoint)
Gets waypoint data by GUID.
double fromUsrHeight_Plugin(double usr_height, int unit)
Converts from user's preferred height unit to meters.
void SetToolbarToolViz(int item, bool viz)
Temporarily changes toolbar tool visibility.
double fromUsrTemp_Plugin(double usr_temp, int unit)
Converts from user's preferred temperature unit to Celsius.
void SetCanvasTilt(double tilt)
Gets current canvas tilt angle.
std::unique_ptr< PlugIn_Route > GetRoute_Plugin(const wxString &GUID)
Gets route details by GUID.
bool GetEnableMUIBar(int CanvasIndex)
Gets MUI bar visibility state.
bool AddLocaleCatalog(wxString catalog)
Adds a locale catalog for translations.
bool GetFullScreen()
Gets full screen state.
void SetTrackingMode(bool enable)
Enable or disable tracking mode.
void PluginSetFollowMode(int CanvasIndex, bool enable_follow)
Set follow mode for a specific canvas.
void ShowGlobalSettingsDialog()
Display the global settings dialog.
void toSM_ECC_Plugin(double lat, double lon, double lat0, double lon0, double *x, double *y)
Converts geographic coordinates to Elliptical Simple Mercator projection.
bool UpdatePlugInTrack(PlugIn_Track *ptrack)
Updates an existing track.
double fromUsrDistance_Plugin(double usr_distance, int unit)
Converts from user's preferred distance unit to nautical miles.
wxString GetSelectedTrackGUID_Plugin()
Gets GUID of currently selected track.
void DistanceBearingMercator_Plugin(double lat0, double lon0, double lat1, double lon1, double *brg, double *dist)
Calculates bearing and distance between two points using Mercator projection.
void SetGlobalColor(std::string table, std::string name, wxColor color)
Sets a color in the global color scheme.
void ZeroXTE()
Resets cross track error to zero.
void PlugInPlaySound(wxString &sound_file)
Plays a sound file asynchronously.
void GetCanvasLLPix(PlugIn_ViewPort *vp, wxPoint p, double *plat, double *plon)
Converts canvas physical pixel coordinates to lat/lon.
void EnableCanvasFocusBar(bool enable, int CanvasIndex)
Controls visibility of canvas focus indicator.
wxString GetSelectedRouteGUID_Plugin()
Gets GUID of currently selected route.
void ForceChartDBUpdate()
Forces an update of the chart database.
bool GetSingleWaypointEx(wxString GUID, PlugIn_Waypoint_Ex *pwaypoint)
Gets extended waypoint data by GUID.
void ForceChartDBRebuild()
Forces complete rebuild of chart database.
options * g_options
Global instance.
double gLat
Vessel's current latitude in decimal degrees.
double gLon
Vessel's current longitude in decimal degrees.
Position, course, speed, etc.
Tools to send data to plugins.
PlugInManager and helper classes – Mostly gui parts (dialogs) and plugin API stuff.
Routeman * g_pRouteMan
Global instance.
RouteList * pRouteList
Global instance.
bool g_bPluginHandleAutopilotRoute
Global instance.
Select * pSelect
Global instance.
A generic position and navigation data structure.
double kCog
Course over ground in degrees.
double kHdt
True heading in degrees.
double kLat
Latitude in decimal degrees.
double kSog
Speed over ground in knots.
double kLon
Longitude in decimal degrees.
wxBitmap LoadSVG(const wxString filename, const unsigned int width, const unsigned int height, wxBitmap *default_bitmap, bool use_cache)
Load SVG file and return it's bitmap representation of requested size In case file can't be loaded an...
bool SVGDocumentPixelSize(const wxString filename, unsigned int &width, unsigned int &height)
Return the size of the SVG document in standard 96 DPI pixels https://developer.mozilla....
std::vector< Track * > g_TrackList
Global instance.
Recorded track abstraction.
WaypointMan drawing stuff.