30#include <wx/dcmemory.h>
32#include <wx/glcanvas.h>
33#include <wx/notebook.h>
39#include "model/idents.h"
42#include "model/own_ship.h"
44#include "model/route.h"
45#include "model/track.h"
52#include "glChartCanvas.h"
56#include "OCPN_AUIManager.h"
57#include "ocpn_frame.h"
58#include "OCPNPlatform.h"
63#include "routemanagerdialog.h"
64#include "routeman_gui.h"
66#include "SoundFactory.h"
68#include "SystemCmdSound.h"
70#include "waypointman_gui.h"
71#include "shapefile_basemap.h"
78#if wxUSE_XLOCALE || !wxCHECK_VERSION(3, 0, 0)
79extern wxLocale* plocale_def_lang;
88extern bool g_bShowChartBar;
92extern RouteList* pRouteList;
93extern std::vector<Track*> g_TrackList;
95extern s52plib* ps52plib;
96extern wxString ChartListFileName;
98extern ColorScheme global_color_scheme;
99extern wxArrayString g_locale_catalog_array;
100extern int g_GUIScaleFactor;
101extern int g_ChartScaleFactor;
105extern int g_chart_zoom_modifier_raster;
106extern int g_chart_zoom_modifier_vector;
108extern bool g_bopengl;
110extern ChartGroupArray* g_pGroupArray;
114extern unsigned int g_canvasConfig;
116extern wxString g_CmdSoundString;
118unsigned int gs_plib_flags;
121extern bool g_bquiting;
122extern bool g_disable_main_toolbar;
123extern bool g_btenhertz;
124extern bool g_CanvasHideNotificationIcon;
125extern wxString g_default_wp_icon;
126extern bool g_bhide_route_console;
127extern bool g_bhide_context_menus;
128extern int g_maxzoomin;
129extern bool g_bhide_depth_units;
130extern bool g_bhide_overzoom_flag;
131extern wxString g_androidExtFilesDir;
133extern std::vector<std::string> ChartDirectoryExcludedVector;
135WX_DEFINE_ARRAY_PTR(
ChartCanvas*, arrayofCanvasPtr);
136extern arrayofCanvasPtr g_canvasArray;
138void NotifySetupOptionsPlugin(
const PlugInData* pic);
153 wxItemKind kind, wxString shortHelp, wxString longHelp,
154 wxObject* clientData,
int position,
int tool_sel,
157 return s_ppim->AddToolbarTool(label, bitmap, bmpRollover, kind, shortHelp,
158 longHelp, clientData, position, tool_sel,
165 if (s_ppim) s_ppim->RemoveToolbarTool(tool_id);
169 if (s_ppim) s_ppim->SetToolbarToolViz(item, viz);
173 if (s_ppim) s_ppim->SetToolbarItemState(item, toggle);
177 if (s_ppim) s_ppim->SetToolbarItemBitmaps(item, bitmap, bmpRollover);
181 wxString SVGfileRollover, wxString SVGfileToggled,
182 wxItemKind kind, wxString shortHelp, wxString longHelp,
183 wxObject* clientData,
int position,
int tool_sel,
186 return s_ppim->AddToolbarTool(label, SVGfile, SVGfileRollover,
187 SVGfileToggled, kind, shortHelp, longHelp,
188 clientData, position, tool_sel, pplugin);
194 wxString SVGfileRollover,
195 wxString SVGfileToggled) {
197 s_ppim->SetToolbarItemBitmaps(item, SVGfile, SVGfileRollover,
205 return s_ppim->AddCanvasContextMenuItemPIM(pitem, pplugin, name,
false);
211 if (s_ppim) s_ppim->SetCanvasContextMenuItemViz(item, viz, name);
215 if (s_ppim) s_ppim->SetCanvasContextMenuItemGrey(item, grey, name);
219 if (s_ppim) s_ppim->RemoveCanvasContextMenuItem(item, name);
225 return s_ppim->AddCanvasContextMenuItemPIM(pitem, pplugin,
"",
false);
240int AddCanvasContextMenuItemExt(wxMenuItem* pitem,
opencpn_plugin* pplugin,
241 const std::string object_type) {
244 return s_ppim->AddCanvasContextMenuItemPIM(pitem, pplugin,
245 object_type.c_str(),
true);
253 return reinterpret_cast<wxFileConfig*
>(
260 wxWindow* pret = NULL;
262 MyFrame* pFrame = s_ppim->GetParentFrame();
263 pret = (wxWindow*)pFrame->GetPrimaryCanvas();
269 if (win) win->Refresh(
true);
329 return FontMgr::Get().GetFontLegacy(TextElement, default_size);
332wxFont* GetOCPNScaledFont_PlugIn(wxString TextElement,
int default_size) {
333 return FontMgr::Get().GetFontLegacy(TextElement, default_size);
337 return g_Platform->GetToolbarScaleFactor(GUIScaleFactor);
341 return g_Platform->GetToolbarScaleFactor(g_GUIScaleFactor);
345 return g_Platform->GetChartScaleFactorExp(g_ChartScaleFactor);
353 return FontMgr::Get().
AddAuxKey(TextElement);
358 return g_StyleManager->GetCurrentStyle()->name;
364 unsigned int height) {
365 wxBitmap bmp = LoadSVG(filename, width, height);
373 SVGDocumentPixelSize(filename, w, h);
374 if (w == 0 || h == 0) {
381 return LoadSVG(filename, w, h);
392 return g_Platform->GetSharedDataDirPtr();
396 if (!g_pAIS)
return NULL;
398 ArrayOfPlugIn_AIS_Targets* pret =
new ArrayOfPlugIn_AIS_Targets;
401 for (
const auto& it : g_pAIS->GetTargetList()) {
410 td.n_alarm_state = AIS_ALARM_SET;
420 SendMessageToAllPlugins(message_id, message_body);
428 Nevent.SetID(message_id);
429 Nevent.SetJSONText(message_body);
430 gFrame->GetEventHandler()->AddPendingEvent(Nevent);
436 gFrame->JumpToPosition(gFrame->GetFocusCanvas(), lat, lon,
scale);
441#if wxUSE_XLOCALE || !wxCHECK_VERSION(3, 0, 0)
443 if (plocale_def_lang) {
445 g_locale_catalog_array.Add(catalog);
447 return plocale_def_lang->AddCatalog(catalog);
457 std::string full_sentence = buf.ToStdString();
459 if ((full_sentence[0] ==
'$') || (full_sentence[0] ==
'!')) {
461 std::string
id = full_sentence.substr(1, 5);
464 auto address = std::make_shared<NavAddr0183>(
"virtual");
465 auto msg = std::make_shared<const Nmea0183Msg>(
id, full_sentence, address);
466 NavMsgBus::GetInstance().
Notify(std::move(msg));
472 wxXmlDocument doc = ChartData->GetXMLDescription(dbIndex, b_getGeom);
478 bool b_ProgressDialog) {
480 ArrayOfCDI ChartDirArray;
481 for (
unsigned int i = 0; i < dir_array.GetCount(); i++) {
482 wxString dirname = dir_array[i];
484 cdi.fullpath = dirname;
485 cdi.magic_number = _T(
"");
486 ChartDirArray.Add(cdi);
488 bool b_ret = gFrame->UpdateChartDatabaseInplace(
489 ChartDirArray, b_force_update, b_ProgressDialog, ChartListFileName);
490 gFrame->RefreshGroupIndices();
491 gFrame->ChartsRefresh();
496 return ChartData->GetChartDirArrayString();
501 wxFileName fn(full_path);
502 wxString fdir = fn.GetPath();
506 bret = ChartData->AddSingleChart(full_path);
510 pConfig->UpdateChartDirs(ChartData->GetChartDirArray());
511 ChartData->SaveBinary(ChartListFileName);
514 ArrayOfCDI XnewChartDirArray;
515 pConfig->LoadChartDirArray(XnewChartDirArray);
518 ChartData->
LoadBinary(ChartListFileName, XnewChartDirArray);
521 if (g_pGroupArray) ChartData->ApplyGroupArray(g_pGroupArray);
523 if (g_options && g_options->IsShown())
524 g_options->UpdateDisplayedChartDirList(ChartData->GetChartDirArray());
526 if (b_RefreshCanvas || !gFrame->GetPrimaryCanvas()->GetQuiltMode()) {
527 gFrame->ChartsRefresh();
537 bret = ChartData->RemoveSingleChart(full_path);
540 pConfig->UpdateChartDirs(ChartData->GetChartDirArray());
541 ChartData->SaveBinary(ChartListFileName);
544 ArrayOfCDI XnewChartDirArray;
545 pConfig->LoadChartDirArray(XnewChartDirArray);
548 ChartData->
LoadBinary(ChartListFileName, XnewChartDirArray);
551 if (g_pGroupArray) ChartData->ApplyGroupArray(g_pGroupArray);
553 if (g_options && g_options->IsShown())
554 g_options->UpdateDisplayedChartDirList(ChartData->GetChartDirArray());
556 gFrame->ChartsRefresh();
566 if (!g_pOptions)
return NULL;
571 parentid = g_pOptions->m_pageDisplay;
574 parentid = g_pOptions->m_pageConnections;
577 parentid = g_pOptions->m_pageCharts;
580 parentid = g_pOptions->m_pageShips;
583 parentid = g_pOptions->m_pageUI;
586 parentid = g_pOptions->m_pagePlugins;
590 _T(
"Error in PluginManager::AddOptionsPage: Unknown parent"));
595 return g_pOptions->AddPage(parentid, title);
599 if (!g_pOptions)
return false;
600 return g_pOptions->DeletePluginPage(page);
604 wxString* accumulator) {
605 if (!pos)
return false;
608 AisError nerr = AIS_GENERIC_ERROR;
609 if (g_pAIS) nerr = g_pAIS->DecodeSingleVDO(str, &gpd, accumulator);
610 if (nerr == AIS_NoError) {
631 if (g_bShowChartBar) {
633 if (cc && cc->GetPiano()) {
634 val = cc->GetPiano()->GetHeight();
640bool GetRoutepointGPX(
RoutePoint* pRoutePoint,
char* buffer,
641 unsigned int buffer_length) {
645 pgpx->AddGPXWaypoint(pRoutePoint);
646 wxString gpxfilename = wxFileName::CreateTempFileName(wxT(
"gpx"));
647 pgpx->SaveFile(gpxfilename);
650 wxFFile gpxfile(gpxfilename);
652 if (gpxfile.ReadAll(&s)) {
653 if (s.Length() < buffer_length) {
654 strncpy(buffer, (
const char*)s.mb_str(wxConvUTF8), buffer_length - 1);
660 ::wxRemoveFile(gpxfilename);
666 if (g_pRouteMan->IsAnyRouteActive())
667 return GetRoutepointGPX(g_pRouteMan->GetpActivePoint(), buffer,
674 double dist,
double* dlat,
676 PositionBearingDistanceMercator(lat, lon, brg, dist, dlat, dlon);
680 double lon1,
double* brg,
double* dist) {
681 DistanceBearingMercator(lat0, lon0, lat1, lon1, brg, dist);
686 return DistGreatCircle(slat, slon, dlat, dlon);
689void toTM_Plugin(
float lat,
float lon,
float lat0,
float lon0,
double* x,
691 toTM(lat, lon, lat0, lon0, x, y);
694void fromTM_Plugin(
double x,
double y,
double lat0,
double lon0,
double* lat,
696 fromTM(x, y, lat0, lon0, lat, lon);
699void toSM_Plugin(
double lat,
double lon,
double lat0,
double lon0,
double* x,
701 toSM(lat, lon, lat0, lon0, x, y);
704void fromSM_Plugin(
double x,
double y,
double lat0,
double lon0,
double* lat,
706 fromSM(x, y, lat0, lon0, lat, lon);
710 double* x,
double* y) {
711 toSM_ECC(lat, lon, lat0, lon0, x, y);
715 double* lat,
double* lon) {
716 fromSM_ECC(x, y, lat0, lon0, lat, lon);
720 return toUsrDistance(nm_distance,
unit);
724 return fromUsrDistance(usr_distance,
unit);
728 return toUsrSpeed(kts_speed,
unit);
732 return toUsrWindSpeed(kts_speed,
unit);
736 return fromUsrSpeed(usr_speed,
unit);
740 return fromUsrWindSpeed(usr_wspeed,
unit);
744 return toUsrTemp(cel_temp,
unit);
748 return fromUsrTemp(usr_temp,
unit);
752 return getUsrDistanceUnit(
unit);
758 return getUsrWindSpeedUnit(
unit);
767 return toUsrDepth(m_depth,
unit);
771 return fromUsrDepth(usr_depth,
unit);
785 static bool loaded =
false;
787 gshhsCrossesLandInit();
790 return gshhsCrossesLand(lat1, lon1, lat2, lon2);
806 const wxString& icon_ident,
807 const wxString& wp_name,
808 const wxString& GUID) {
809 wxDateTime now = wxDateTime::Now();
820PlugIn_Waypoint::~PlugIn_Waypoint() {}
823PlugIn_Route::PlugIn_Route(
void) {
pWaypointList =
new Plugin_WaypointList; }
825PlugIn_Route::~PlugIn_Route(
void) {
833PlugIn_Track::PlugIn_Track(
void) {
pWaypointList =
new Plugin_WaypointList; }
835PlugIn_Track::~PlugIn_Track(
void) {
845 wxString description) {
846 wxImage image = pimage->ConvertToImage();
847 WayPointmanGui(*pWayPointMan).ProcessIcon(image, key, description);
856 wxPlugin_HyperlinkListNode* linknode = src->
m_HyperlinkList->GetFirst();
862 h->Link = link->
Link;
863 h->LType = link->
Type;
867 linknode = linknode->GetNext();
877 bool b_unique =
true;
878 wxRoutePointListNode* prpnode = pWayPointMan->GetWaypointList()->GetFirst();
886 prpnode = prpnode->GetNext();
889 if (!b_unique)
return false;
897 cloneHyperlinkList(pWP, pwaypoint);
907 pWP->
m_btemp = (b_permanent ==
false);
909 pSelect->AddSelectableRoutePoint(pwaypoint->
m_lat, pwaypoint->
m_lon, pWP);
912 NavObj_dB::GetInstance().InsertRoutePoint(pWP);
915 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
916 pRouteManagerDialog->UpdateWptListCtrl();
923 bool b_found =
false;
924 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(GUID);
926 if (prp) b_found =
true;
929 pWayPointMan->DestroyWaypoint(prp);
930 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
931 pRouteManagerDialog->UpdateWptListCtrl();
939 bool b_found =
false;
942 if (prp) b_found =
true;
945 double lat_save = prp->m_lat;
946 double lon_save = prp->m_lon;
948 prp->m_lat = pwaypoint->
m_lat;
949 prp->m_lon = pwaypoint->
m_lon;
962 wxPlugin_HyperlinkListNode* linknode =
969 h->Link = link->
Link;
970 h->LType = link->
Type;
974 linknode = linknode->GetNext();
979 if (prp) prp->ReLoadIcon();
981 auto canvas = gFrame->GetPrimaryCanvas();
982 SelectCtx ctx(canvas->m_bShowNavobjects, canvas->GetCanvasTrueScale(),
983 canvas->GetScaleValue());
985 pSelect->FindSelection(ctx, lat_save, lon_save, SELTYPE_ROUTEPOINT);
987 pFind->m_slat = pwaypoint->
m_lat;
988 pFind->m_slon = pwaypoint->
m_lon;
993 NavObj_dB::GetInstance().UpdateRoutePoint(prp);
996 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
997 pRouteManagerDialog->UpdateWptListCtrl();
1006 dst->
m_lat = src->m_lat;
1007 dst->
m_lon = src->m_lon;
1030 h->
Link = link->Link;
1031 h->
Type = link->LType;
1035 linknode = linknode->GetNext();
1042 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(GUID);
1044 if (!prp)
return false;
1046 PlugInFromRoutePoint(pwaypoint, prp);
1052 wxArrayString result;
1053 const RoutePointList* list = pWayPointMan->GetWaypointList();
1055 wxRoutePointListNode* prpnode = list->GetFirst();
1060 prpnode = prpnode->GetNext();
1067 wxArrayString result;
1068 RouteList* list = pRouteList;
1070 wxRouteListNode* prpnode = list->GetFirst();
1072 Route* proute = prpnode->GetData();
1073 result.Add(proute->
m_GUID);
1075 prpnode = prpnode->GetNext();
1082 wxArrayString result;
1083 for (
Track* ptrack : g_TrackList) {
1084 result.Add(ptrack->m_GUID);
1091 wxArrayString result;
1092 const RoutePointList* list = pWayPointMan->GetWaypointList();
1094 wxRoutePointListNode* prpnode = list->GetFirst();
1109 prpnode = prpnode->GetNext();
1116 wxArrayString result;
1117 RouteList* list = pRouteList;
1119 wxRouteListNode* prpnode = list->GetFirst();
1121 Route* proute = prpnode->GetData();
1124 result.Add(proute->
m_GUID);
1134 prpnode = prpnode->GetNext();
1141 wxArrayString result;
1142 for (
Track* ptrack : g_TrackList) {
1145 result.Add(ptrack->m_GUID);
1148 if (!ptrack->m_bIsInLayer) result.Add(ptrack->m_GUID);
1151 if (ptrack->m_bIsInLayer) result.Add(ptrack->m_GUID);
1160 wxArrayString result;
1162 for (
int i = 0; i < pWayPointMan->GetNumIcons(); i++) {
1163 wxString* ps = pWayPointMan->GetIconKey(i);
1175 wxDateTime plannedDeparture;
1177 wxPlugin_WaypointListNode* pwpnode = proute->
pWaypointList->GetFirst();
1179 pwp = pwpnode->GetData();
1185 cloneHyperlinkList(pWP, pwp);
1190 route->AddPoint(pWP);
1192 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
1195 pSelect->AddSelectableRouteSegment(pWP_src->m_lat, pWP_src->m_lon,
1196 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
1203 pwpnode = pwpnode->GetNext();
1211 if (!proute->
m_GUID.IsEmpty()) {
1214 route->
m_btemp = (b_permanent ==
false);
1216 pRouteList->Append(route);
1220 NavObj_dB::GetInstance().InsertRoute(route);
1222 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
1223 pRouteManagerDialog->UpdateRouteListCtrl();
1229 bool b_found =
false;
1232 Route* pRoute = g_pRouteMan->FindRouteByGUID(GUID);
1241 bool b_found =
false;
1244 Route* pRoute = g_pRouteMan->FindRouteByGUID(proute->
m_GUID);
1245 if (pRoute) b_found =
true;
1248 bool b_permanent = (pRoute->
m_btemp ==
false);
1263 wxPlugin_WaypointListNode* pwpnode = ptrack->
pWaypointList->GetFirst();
1265 pwp = pwpnode->GetData();
1270 track->AddPoint(pWP);
1273 pSelect->AddSelectableTrackSegment(pWP_src->m_lat, pWP_src->m_lon,
1274 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
1279 pwpnode = pwpnode->GetNext();
1285 track->m_GUID = ptrack->
m_GUID;
1286 track->m_btemp = (b_permanent ==
false);
1288 g_TrackList.push_back(track);
1289 if (b_permanent) NavObj_dB::GetInstance().InsertTrack(track);
1292 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
1293 pRouteManagerDialog->UpdateTrkListCtrl();
1299 bool b_found =
false;
1302 Track* pTrack = g_pRouteMan->FindTrackByGUID(GUID);
1304 NavObj_dB::GetInstance().DeleteTrack(pTrack);
1309 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
1310 pRouteManagerDialog->UpdateTrkListCtrl();
1316 bool b_found =
false;
1319 Track* pTrack = g_pRouteMan->FindTrackByGUID(ptrack->
m_GUID);
1320 if (pTrack) b_found =
true;
1323 bool b_permanent = (pTrack->m_btemp ==
false);
1324 NavObj_dB::GetInstance().DeleteTrack(pTrack);
1338 return glChartCanvas::HasNormalizedViewPort(ocpn_vp);
1364 glChartCanvas::NormalizedViewPort(ocpn_vp, lat, lon);
1383 pret->
MMSI = ptarget->MMSI;
1384 pret->
Class = ptarget->Class;
1386 pret->
SOG = ptarget->SOG;
1387 pret->
COG = ptarget->COG;
1388 pret->
HDG = ptarget->HDG;
1389 pret->
Lon = ptarget->Lon;
1390 pret->
Lat = ptarget->Lat;
1391 pret->
ROTAIS = ptarget->ROTAIS;
1392 pret->
ShipType = ptarget->ShipType;
1393 pret->
IMO = ptarget->IMO;
1395 pret->
Range_NM = ptarget->Range_NM;
1396 pret->
Brg = ptarget->Brg;
1400 pret->
TCPA = ptarget->TCPA;
1401 pret->
CPA = ptarget->CPA;
1405 memcpy(pret->CallSign, ptarget->CallSign,
sizeof(ptarget->CallSign) - 1);
1406 memcpy(pret->ShipName, ptarget->ShipName,
sizeof(ptarget->ShipName) - 1);
1425 gFrame->GetPrimaryCanvas()->DoRotateCanvas(rotation);
1431 gFrame->GetPrimaryCanvas()->DoTiltCanvas(tilt);
1435 gFrame->GetPrimaryCanvas()->SetVPProjection(projection);
1438OcpnSound* g_PluginSound = SoundFactory();
1439static void onPlugInPlaySoundExFinished(
void* ptr) {}
1443 bool ok = g_PluginSound->Load(sound_file, deviceIndex);
1445 wxLogWarning(
"Cannot load sound file: %s", sound_file);
1448 auto cmd_sound =
dynamic_cast<SystemCmdSound*
>(g_PluginSound);
1449 if (cmd_sound) cmd_sound->SetCmd(g_CmdSoundString.mb_str(wxConvUTF8));
1451 g_PluginSound->SetFinishedCallback(onPlugInPlaySoundExFinished, NULL);
1452 ok = g_PluginSound->Play();
1454 wxLogWarning(
"Cannot play sound file: %s", sound_file);
1460 return gFrame->GetPrimaryCanvas()->CheckEdgePan(x, y, dragging, margin,
1466 return style->GetIcon(name);
1470 gFrame->GetPrimaryCanvas()->pPlugIn_Cursor = pCursor;
1475 g_options->AddChartDir(path);
1481 g_options->pScanCheckBox->SetValue(
true);
1482 g_options->pUpdateCheckBox->SetValue(
true);
1488 g_options->pUpdateCheckBox->SetValue(
true);
1495 wxString Title, wxString initDir) {
1496 return g_Platform->DoDirSelectorDialog(parent, file_spec, Title, initDir);
1500 wxString Title, wxString initDir,
1501 wxString suggestedName, wxString wildcard) {
1503 return g_Platform->DoFileSelectorDialog(parent, file_spec, Title, initDir,
1504 suggestedName, wildcard);
1510 wxString ainitDir = g_androidExtFilesDir;
1511 return g_Platform->DoFileSelectorDialog(parent, file_spec, Title, ainitDir,
1512 suggestedName, wildcard);
1536 if (gFrame->GetPrimaryCanvas())
1537 vp.
ref_scale = gFrame->GetPrimaryCanvas()->GetVP().ref_scale;
1548 ViewPort ocpn_vp = CreateCompatibleViewportEx(vp);
1553 AISDraw(dc, ocpn_vp, NULL);
1557 return FontMgr::Get().
SetFontColor(TextElement, color);
1567 wxFontStyle style, wxFontWeight weight,
1568 bool underline,
const wxString& facename,
1569 wxFontEncoding encoding) {
1571 underline, facename, encoding);
1574int PluginGetMinAvailableGshhgQuality() {
1575 return gFrame->GetPrimaryCanvas()->GetMinAvailableGshhgQuality();
1577int PluginGetMaxAvailableGshhgQuality() {
1578 return gFrame->GetPrimaryCanvas()->GetMaxAvailableGshhgQuality();
1583 g_bPluginHandleAutopilotRoute = enable;
1586bool LaunchDefaultBrowser_Plugin(wxString url) {
1587 if (g_Platform) g_Platform->platformLaunchDefaultBrowser(url);
1597 if (cc && cc->GetSelectedRoutePoint()) {
1598 return cc->GetSelectedRoutePoint()->
m_GUID;
1600 return wxEmptyString;
1605 if (cc && cc->GetSelectedRoute()) {
1606 return cc->GetSelectedRoute()->
m_GUID;
1608 return wxEmptyString;
1613 if (cc && cc->GetSelectedTrack()) {
1614 return cc->GetSelectedTrack()->m_GUID;
1616 return wxEmptyString;
1626 std::unique_ptr<PlugIn_Route> r;
1627 Route* route = g_pRouteMan->FindRouteByGUID(GUID);
1628 if (route ==
nullptr)
return r;
1638 src_wp = node->GetData();
1641 PlugInFromRoutePoint(dst_wp, src_wp);
1645 node = node->GetNext();
1656 std::unique_ptr<PlugIn_Track> t;
1658 Track* pTrack = g_pRouteMan->FindTrackByGUID(GUID);
1659 if (!pTrack)
return t;
1661 std::unique_ptr<PlugIn_Track> tk =
1666 dst_track->
m_EndString = pTrack->m_TrackEndString;
1667 dst_track->
m_GUID = pTrack->m_GUID;
1669 for (
int i = 0; i < pTrack->GetnPoints(); i++) {
1674 dst_wp->
m_lat = ptp->m_lat;
1675 dst_wp->
m_lon = ptp->m_lon;
1688 return g_overlayCanvas;
1694 auto oCanvas =
dynamic_cast<ChartCanvas*
>(canvas);
1695 if (oCanvas) gFrame->JumpToPosition(oCanvas, lat, lon,
scale);
1703 ChartCanvas* l_canvas = gFrame->GetCanvasUnderMouse();
1705 for (
unsigned int i = 0; i < g_canvasArray.GetCount(); ++i) {
1706 if (l_canvas == g_canvasArray[i])
return i;
1724 if (g_canvasConfig == 0)
1725 return gFrame->GetPrimaryCanvas();
1727 if ((canvasIndex >= 0) && g_canvasArray[canvasIndex]) {
1728 return g_canvasArray[canvasIndex];
1736 if (g_canvasConfig == 0)
1737 return gFrame->GetPrimaryCanvas()->CheckEdgePan(x, y, dragging, margin,
1740 if ((canvasIndex >= 0) && g_canvasArray[canvasIndex]) {
1741 return g_canvasArray[canvasIndex]->CheckEdgePan(x, y, dragging, margin,
1750 if (g_canvasConfig == 0)
1751 gFrame->GetPrimaryCanvas()->pPlugIn_Cursor = pCursor;
1753 if ((canvasIndex >= 0) && g_canvasArray[canvasIndex]) {
1754 g_canvasArray[canvasIndex]->pPlugIn_Cursor = pCursor;
1760 if (g_canvasConfig == 1)
return 2;
1769 return g_MainToolbar->GetToolbarRect();
1771 return wxRect(0, 0, 1, 1);
1780 g_pRouteMan->ZeroCurrentXTEToActivePoint();
1801 pivp.
lat_min = tvp.GetBBox().GetMinLat();
1802 pivp.
lat_max = tvp.GetBBox().GetMaxLat();
1803 pivp.
lon_min = tvp.GetBBox().GetMinLon();
1804 pivp.
lon_max = tvp.GetBBox().GetMaxLon();
1806 pivp.
bValid = tvp.IsValid();
1811ListOfPI_S57Obj* PlugInManager::GetLightsObjRuleListVisibleAtLatLon(
1813 ListOfPI_S57Obj* list = NULL;
1827 list = picbx->GetLightsObjRuleListVisibleAtLatLon(zlat, zlon, &pi_vp);
1838#include <wx/listimpl.cpp>
1839WX_DEFINE_LIST(Plugin_WaypointExList)
1842PlugIn_Waypoint_Ex::PlugIn_Waypoint_Ex() {
InitDefaults(); }
1844PlugIn_Waypoint_Ex::PlugIn_Waypoint_Ex(
1845 double lat,
double lon,
const wxString& icon_ident,
const wxString& wp_name,
1846 const wxString& GUID,
const double ScaMin,
const bool bNameVisible,
1847 const int nRangeRings,
const double RangeDistance,
1848 const wxColor RangeColor) {
1880 if (!prp)
return false;
1882 if (prp->
m_bIsInRoute && !prp->IsShared())
return false;
1893 wxRouteListNode* node = pRouteList->GetFirst();
1895 Route* proute = node->GetData();
1899 if (prp == pWP) nCount++;
1900 pnode = pnode->GetNext();
1903 node = node->GetNext();
1909PlugIn_Waypoint_Ex::~PlugIn_Waypoint_Ex() {}
1911WX_DEFINE_LIST(Plugin_WaypointExV2List)
1913PlugIn_Waypoint_ExV2::PlugIn_Waypoint_ExV2() {
InitDefaults(); }
1915PlugIn_Waypoint_ExV2::PlugIn_Waypoint_ExV2(
1916 double lat,
double lon,
const wxString& icon_ident,
const wxString& wp_name,
1917 const wxString& GUID,
const double ScaMin,
const double ScaMax,
1918 const bool bNameVisible,
const int nRangeRings,
const double RangeDistance,
1919 const int RangeDistanceUnits,
const wxColor RangeColor,
1920 const double WaypointArrivalRadius,
const bool ShowWaypointRangeRings,
1921 const double PlannedSpeed,
const wxString TideStation) {
1967PlugIn_Waypoint_ExV2::~PlugIn_Waypoint_ExV2() {}
1971 if (!prp)
return false;
1972 if (prp->
m_bIsInRoute && !prp->IsShared())
return false;
1982 wxRouteListNode* node = pRouteList->GetFirst();
1984 Route* proute = node->GetData();
1988 if (prp == pWP) nCount++;
1989 pnode = pnode->GetNext();
1992 node = node->GetNext();
1998PlugIn_Route_ExV2::PlugIn_Route_ExV2() {
2010 wxDateTime now = wxDateTime::Now();
2011 m_GUID = wxString::Format(
"RT%d%d%d%d", (
int)now.GetMillisecond(),
2012 (
int)now.GetSecond(), (
int)now.GetMinute(),
2013 (
int)now.GetHour());
2017PlugIn_Route_ExV2::~PlugIn_Route_ExV2() {
2027 dst->
m_lat = src->m_lat;
2028 dst->
m_lon = src->m_lon;
2029 dst->
IconName = src->GetIconName();
2032 dst->
IconDescription = pWayPointMan->GetIconDescription(src->GetIconName());
2051 h->
Link = link->Link;
2052 h->
Type = link->LType;
2056 linknode = linknode->GetNext();
2070 dst->
scamin = src->GetScaMin();
2074 dst->
scamax = src->GetScaMax();
2083 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(GUID);
2085 if (!prp)
return false;
2087 PlugInExV2FromRoutePoint(pwaypoint, prp);
2092static void cloneHyperlinkListExV2(
RoutePoint* dst,
2098 wxPlugin_HyperlinkListNode* linknode = src->
m_HyperlinkList->GetFirst();
2104 h->Link = link->
Link;
2105 h->LType = link->
Type;
2109 linknode = linknode->GetNext();
2120 cloneHyperlinkListExV2(pWP, src);
2130 pWP->
m_btemp = (b_permanent ==
false);
2139 pWP->SetScaMin(src->
scamin);
2146 pWP->SetScaMax(src->
scamax);
2148 if (src->
m_ETD.IsValid())
2151 pWP->
SetETD(wxEmptyString);
2161 bool b_unique =
true;
2162 wxRoutePointListNode* prpnode = pWayPointMan->GetWaypointList()->GetFirst();
2170 prpnode = prpnode->GetNext();
2173 if (!b_unique)
return false;
2175 RoutePoint* pWP = CreateNewPoint(pwaypointex, b_permanent);
2177 pWP->SetShowWaypointRangeRings(pwaypointex->
nrange_rings > 0);
2179 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
2182 NavObj_dB::GetInstance().InsertRoutePoint(pWP);
2185 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2186 pRouteManagerDialog->UpdateWptListCtrl();
2193 bool b_found =
false;
2196 if (prp) b_found =
true;
2199 double lat_save = prp->m_lat;
2200 double lon_save = prp->m_lon;
2202 prp->m_lat = pwaypoint->
m_lat;
2203 prp->m_lon = pwaypoint->
m_lon;
2204 prp->SetIconName(pwaypoint->
IconName);
2216 wxPlugin_HyperlinkListNode* linknode =
2223 h->Link = link->
Link;
2224 h->LType = link->
Type;
2228 linknode = linknode->GetNext();
2234 prp->SetWaypointRangeRingsNumber(pwaypoint->
nrange_rings);
2239 prp->SetScaMin(pwaypoint->
scamin);
2243 prp->SetShowWaypointRangeRings(pwaypoint->
nrange_rings > 0);
2245 if (prp) prp->ReLoadIcon();
2247 auto canvas = gFrame->GetPrimaryCanvas();
2248 SelectCtx ctx(canvas->m_bShowNavobjects, canvas->GetCanvasTrueScale(),
2249 canvas->GetScaleValue());
2251 pSelect->FindSelection(ctx, lat_save, lon_save, SELTYPE_ROUTEPOINT);
2253 pFind->m_slat = pwaypoint->
m_lat;
2254 pFind->m_slon = pwaypoint->
m_lon;
2259 NavObj_dB::GetInstance().UpdateRoutePoint(prp);
2262 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2263 pRouteManagerDialog->UpdateWptListCtrl();
2266 if (pwaypoint->
m_ETD.IsValid())
2269 prp->
SetETD(wxEmptyString);
2272 prp->SetScaMax(pwaypoint->
scamax);
2279 const wxString& GUID) {
2291 wxDateTime plannedDeparture;
2293 wxPlugin_WaypointExV2ListNode* pwpnode = proute->
pWaypointList->GetFirst();
2295 pwaypointex = pwpnode->GetData();
2297 pWP = pWayPointMan->FindRoutePointByGUID(pwaypointex->
m_GUID);
2299 pWP = CreateNewPoint(pwaypointex, b_permanent);
2303 route->AddPoint(pWP);
2305 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
2308 pSelect->AddSelectableRouteSegment(pWP_src->m_lat, pWP_src->m_lon,
2309 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
2316 pwpnode = pwpnode->GetNext();
2324 if (!proute->
m_GUID.IsEmpty()) {
2327 route->
m_btemp = (b_permanent ==
false);
2331 pRouteList->Append(route);
2335 NavObj_dB::GetInstance().InsertRoute(route);
2338 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2339 pRouteManagerDialog->UpdateRouteListCtrl();
2345 bool b_found =
false;
2348 Route* pRoute = g_pRouteMan->FindRouteByGUID(proute->
m_GUID);
2349 if (pRoute) b_found =
true;
2352 bool b_permanent = !pRoute->
m_btemp;
2362 std::unique_ptr<PlugIn_Route_ExV2> r;
2363 Route* route = g_pRouteMan->FindRouteByGUID(GUID);
2364 if (route ==
nullptr)
return r;
2373 src_wp = node->GetData();
2376 PlugInExV2FromRoutePoint(dst_wp, src_wp);
2380 node = node->GetNext();
2386 dst_route->
m_isActive = g_pRouteMan->GetpActiveRoute() == route;
2394PlugIn_Route_Ex::PlugIn_Route_Ex(
void) {
2398PlugIn_Route_Ex::~PlugIn_Route_Ex(
void) {
2410 dst->
m_lat = src->m_lat;
2411 dst->
m_lon = src->m_lon;
2412 dst->
IconName = src->GetIconName();
2415 dst->
IconDescription = pWayPointMan->GetIconDescription(src->GetIconName());
2434 h->
Link = link->Link;
2435 h->
Type = link->LType;
2439 linknode = linknode->GetNext();
2451 dst->
scamin = src->GetScaMin();
2456static void cloneHyperlinkListEx(
RoutePoint* dst,
2462 wxPlugin_HyperlinkListNode* linknode = src->
m_HyperlinkList->GetFirst();
2468 h->Link = link->
Link;
2469 h->LType = link->
Type;
2473 linknode = linknode->GetNext();
2484 cloneHyperlinkListEx(pWP, src);
2494 pWP->
m_btemp = (b_permanent ==
false);
2501 pWP->SetScaMin(src->
scamin);
2510 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(GUID);
2512 if (!prp)
return false;
2514 PlugInExFromRoutePoint(pwaypoint, prp);
2524 bool b_unique =
true;
2525 wxRoutePointListNode* prpnode = pWayPointMan->GetWaypointList()->GetFirst();
2533 prpnode = prpnode->GetNext();
2536 if (!b_unique)
return false;
2538 RoutePoint* pWP = CreateNewPoint(pwaypointex, b_permanent);
2540 pWP->SetShowWaypointRangeRings(pwaypointex->
nrange_rings > 0);
2542 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
2545 NavObj_dB::GetInstance().InsertRoutePoint(pWP);
2547 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2548 pRouteManagerDialog->UpdateWptListCtrl();
2555 bool b_found =
false;
2558 if (prp) b_found =
true;
2561 double lat_save = prp->m_lat;
2562 double lon_save = prp->m_lon;
2564 prp->m_lat = pwaypoint->
m_lat;
2565 prp->m_lon = pwaypoint->
m_lon;
2566 prp->SetIconName(pwaypoint->
IconName);
2578 wxPlugin_HyperlinkListNode* linknode =
2585 h->Link = link->
Link;
2586 h->LType = link->
Type;
2590 linknode = linknode->GetNext();
2596 prp->SetWaypointRangeRingsNumber(pwaypoint->
nrange_rings);
2599 prp->SetScaMin(pwaypoint->
scamin);
2603 prp->SetShowWaypointRangeRings(pwaypoint->
nrange_rings > 0);
2605 if (prp) prp->ReLoadIcon();
2607 auto canvas = gFrame->GetPrimaryCanvas();
2608 SelectCtx ctx(canvas->m_bShowNavobjects, canvas->GetCanvasTrueScale(),
2609 canvas->GetScaleValue());
2611 pSelect->FindSelection(ctx, lat_save, lon_save, SELTYPE_ROUTEPOINT);
2613 pFind->m_slat = pwaypoint->
m_lat;
2614 pFind->m_slon = pwaypoint->
m_lon;
2619 NavObj_dB::GetInstance().UpdateRoutePoint(prp);
2622 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2623 pRouteManagerDialog->UpdateWptListCtrl();
2635 wxDateTime plannedDeparture;
2637 wxPlugin_WaypointExListNode* pwpnode = proute->
pWaypointList->GetFirst();
2639 pwaypointex = pwpnode->GetData();
2641 pWP = pWayPointMan->FindRoutePointByGUID(pwaypointex->
m_GUID);
2643 pWP = CreateNewPoint(pwaypointex, b_permanent);
2647 route->AddPoint(pWP);
2649 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
2652 pSelect->AddSelectableRouteSegment(pWP_src->m_lat, pWP_src->m_lon,
2653 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
2660 pwpnode = pwpnode->GetNext();
2668 if (!proute->
m_GUID.IsEmpty()) {
2671 route->
m_btemp = (b_permanent ==
false);
2675 pRouteList->Append(route);
2679 NavObj_dB::GetInstance().InsertRoute(route);
2682 if (pRouteManagerDialog && pRouteManagerDialog->IsShown())
2683 pRouteManagerDialog->UpdateRouteListCtrl();
2689 bool b_found =
false;
2692 Route* pRoute = g_pRouteMan->FindRouteByGUID(proute->
m_GUID);
2693 if (pRoute) b_found =
true;
2696 bool b_permanent = !pRoute->
m_btemp;
2711 std::unique_ptr<PlugIn_Route_Ex> r;
2712 Route* route = g_pRouteMan->FindRouteByGUID(GUID);
2713 if (route ==
nullptr)
return r;
2723 src_wp = node->GetData();
2726 PlugInExFromRoutePoint(dst_wp, src_wp);
2730 node = node->GetNext();
2736 dst_route->
m_isActive = g_pRouteMan->GetpActiveRoute() == route;
2745 RoutePoint* rp = g_pRouteMan->GetpActivePoint();
2747 return wxEmptyString;
2754 Route* rt = g_pRouteMan->GetpActiveRoute();
2756 return wxEmptyString;
2766 MyApp& app = wxGetApp();
2767 return (app.m_comm_bridge.GetPriorityMaps());
2771 MyApp& app = wxGetApp();
2772 app.m_comm_bridge.UpdateAndApplyMaps(map);
2776 std::vector<std::string> result;
2778 MyApp& app = wxGetApp();
2781 app.m_comm_bridge.GetPriorityContainer(
"position").active_source;
2782 result.push_back(
id);
2783 id = app.m_comm_bridge.GetPriorityContainer(
"velocity").active_source;
2784 result.push_back(
id);
2785 id = app.m_comm_bridge.GetPriorityContainer(
"heading").active_source;
2786 result.push_back(
id);
2787 id = app.m_comm_bridge.GetPriorityContainer(
"variation").active_source;
2788 result.push_back(
id);
2789 id = app.m_comm_bridge.GetPriorityContainer(
"satellites").active_source;
2790 result.push_back(
id);
2797#if defined(__WXOSX__) || defined(__WXGTK3__)
2799 if (gFrame) rv = gFrame->GetContentScaleFactor();
2804 double scaler = 1.0;
2806 if (gFrame) scaler = (double)(gFrame->ToDIP(100)) / 100.;
2823 bool state = gFrame->IsFullScreen();
2824 if (set_full_screen_on && !state)
2825 gFrame->ToggleFullScreen();
2826 else if (!set_full_screen_on && state)
2827 gFrame->ToggleFullScreen();
2830extern bool g_useMUI;
2832 bool current_mui_state = g_useMUI;
2835 if (enable && !current_mui_state) {
2837 for (
unsigned int i = 0; i < g_canvasArray.GetCount(); i++) {
2839 if (cc) cc->CreateMUIBar();
2841 }
else if (!enable && current_mui_state) {
2843 for (
unsigned int i = 0; i < g_canvasArray.GetCount(); i++) {
2845 if (cc) cc->DestroyMuiBar();
2854 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2855 if (cc) cc->SetShowGPSCompassWindow(enable);
2861 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2863 return cc->GetShowGPSCompassWindow();
2870extern bool g_bShowStatusBar;
2872 g_bShowStatusBar = enable;
2873 gFrame->ConfigureStatusBar();
2879 bool current_chartbar_state = g_bShowChartBar;
2880 for (
unsigned int i = 0; i < g_canvasArray.GetCount(); i++) {
2882 if (current_chartbar_state && !enable) {
2883 gFrame->ToggleChartBar(cc);
2884 g_bShowChartBar = current_chartbar_state;
2885 }
else if (!current_chartbar_state && enable) {
2886 gFrame->ToggleChartBar(cc);
2887 g_bShowChartBar = current_chartbar_state;
2890 g_bShowChartBar = enable;
2895extern bool g_bShowMenuBar;
2898 if (g_bShowMenuBar) {
2899 g_bShowMenuBar =
false;
2900 if (gFrame->m_pMenuBar) {
2901 gFrame->SetMenuBar(NULL);
2902 gFrame->m_pMenuBar->Destroy();
2903 gFrame->m_pMenuBar = NULL;
2907 g_bShowMenuBar =
true;
2908 gFrame->BuildMenuBar();
2915 if (ps52plib) ps52plib->m_chartSymbols.UpdateTableColor(table, name, color);
2919 wxColor ret = wxColor(*wxRED);
2921 int i_table = ps52plib->m_chartSymbols.FindColorTable(map_name.c_str());
2922 ret = ps52plib->m_chartSymbols.GetwxColor(name.c_str(), i_table);
2929 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2930 if (cc) cc->SetShowGrid(enable);
2936 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2937 if (cc) cc->SetShowOutlines(enable);
2943 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2944 if (cc) cc->SetShowDepthUnits(enable);
2950 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2951 if (cc) cc->SetShowAIS(enable);
2957 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2958 if (cc) cc->ShowTides(enable);
2964 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2965 if (cc) cc->ShowCurrents(enable);
2971 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2972 if (cc) cc->SetShowENCText(enable);
2978 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2979 if (cc) cc->SetShowENCDepth(enable);
2985 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2986 if (cc) cc->SetShowENCBuoyLabels(enable);
2992 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
2993 if (cc) cc->SetShowENCLights(enable);
2999 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3000 if (cc) cc->SetShowENCLightDesc(enable);
3005 int valSet = STANDARD;
3008 valSet = DISPLAYBASE;
3017 valSet = MARINERS_STANDARD;
3024 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3025 if (cc) cc->SetENCDisplayCategory(valSet);
3029 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3031 return ((
PI_DisCat)cc->GetENCDisplayCategory());
3033 return PI_DisCat::PI_STANDARD;
3037 int newMode = NORTH_UP_MODE;
3039 newMode = COURSE_UP_MODE;
3041 newMode = HEAD_UP_MODE;
3044 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3045 if (cc) cc->SetUpMode(newMode);
3050 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3051 if (cc)
return ((
PI_NavMode)cc->GetUpMode());
3053 return PI_NavMode::PI_NORTH_UP_MODE;
3058 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3059 if (cc)
return (cc->GetShowGrid());
3066 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3067 if (cc)
return (cc->GetShowOutlines());
3074 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3075 if (cc)
return (cc->GetShowDepthUnits());
3082 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3083 if (cc)
return (cc->GetShowAIS());
3090 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3091 if (cc)
return (cc->GetbShowTide());
3098 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3099 if (cc)
return (cc->GetbShowCurrent());
3106 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3107 if (cc)
return (cc->GetShowENCText());
3114 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3115 if (cc)
return (cc->GetShowENCDepth());
3122 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3123 if (cc)
return (cc->GetShowENCBuoyLabels());
3130 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3131 if (cc)
return (cc->GetShowENCLights());
3136bool GetShowENCLightDesc(
int CanvasIndex) {
3138 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3139 if (cc)
return (cc->GetbShowCurrent());
3150 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3151 if (cc) cc->ToggleLookahead();
3157 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3158 if (cc)
return (cc->GetLookahead());
3163extern bool g_bTrackActive;
3165 if (!g_bTrackActive && enable)
3167 else if (g_bTrackActive && !enable)
3173 gFrame->SetAndApplyColorScheme((ColorScheme)cs);
3180 if (win) win->Refresh(eraseBackground);
3184 if (g_canvasConfig == 1) {
3189 gFrame->CreateCanvasLayout();
3190 gFrame->DoChartUpdate();
3195 gFrame->CreateCanvasLayout();
3196 gFrame->DoChartUpdate();
3207 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3214 g_disable_main_toolbar = !enable;
3215 if (g_MainToolbar) g_MainToolbar->RefreshToolbar();
3219 if (gFrame) gFrame->ScheduleSettingsDialog();
3224 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3226 bool bfollow = cc->GetbFollow();
3227 cc->ResetOwnshipOffset();
3231 cc->JumpToPosition(gLat, gLon, cc->
GetVPScale());
3238 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3240 if (cc->GetbFollow() != enable_follow) cc->TogglebFollow();
3247 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3248 if (cc)
return cc->GetbFollow();
3255 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3256 if (cc) cc->SetShowFocusBar(enable);
3261 ChartCanvas* cc = g_canvasArray.Item(CanvasIndex);
3262 if (cc)
return (cc->GetShowFocusBar());
3276 pConfig->LoadMyConfigRaw(
false);
3279 pConfig->LoadCanvasConfigs(
false);
3280 auto& config_array = ConfigMgr::Get().GetCanvasConfigArray();
3281 for (
auto pcc : config_array) {
3282 if (pcc && pcc->canvas) {
3283 pcc->canvas->ApplyCanvasConfig(pcc);
3284 pcc->canvas->Refresh();
3294 g_CanvasHideNotificationIcon = !enable;
3303wxString DropMarkPI(
double lat,
double lon) {
3304 if ((fabs(lat) > 80.0) || (fabs(lon) > 180.))
return "";
3307 new RoutePoint(lat, lon, g_default_wp_icon, wxEmptyString, wxEmptyString);
3309 pSelect->AddSelectableRoutePoint(lat, lon, pWP);
3310 NavObj_dB::GetInstance().InsertRoutePoint(pWP);
3314wxString RouteCreatePI(
int canvas_index,
bool start) {
3315 if ((
size_t)canvas_index < g_canvasArray.GetCount()) {
3316 ChartCanvas* cc = g_canvasArray.Item(canvas_index);
3322 return cc->FinishRoute();
3329bool DoMeasurePI(
int canvas_index,
bool start) {
3330 if ((
size_t)canvas_index < g_canvasArray.GetCount()) {
3331 ChartCanvas* cc = g_canvasArray.Item(canvas_index);
3334 cc->StartMeasureRoute();
3337 cc->CancelMeasureRoute();
3346wxString NavToHerePI(
double lat,
double lon) {
3348 new RoutePoint(lat, lon, g_default_wp_icon, wxEmptyString, wxEmptyString);
3349 pSelect->AddSelectableRoutePoint(lat, lon, pWP_dest);
3352 wxEmptyString, wxEmptyString);
3353 pSelect->AddSelectableRoutePoint(gLat, gLon, pWP_src);
3356 pRouteList->Append(temp_route);
3358 temp_route->AddPoint(pWP_src);
3359 temp_route->AddPoint(pWP_dest);
3361 pSelect->AddSelectableRouteSegment(gLat, gLon, lat, lon, pWP_src, pWP_dest,
3369 if (g_pRouteMan->GetpActiveRoute()) g_pRouteMan->DeactivateRoute();
3372 return temp_route->
m_GUID;
3375bool ActivateRoutePI(wxString route_guid,
bool activate) {
3376 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
3377 if (!route)
return false;
3380 if (g_pRouteMan->GetpActiveRoute()) g_pRouteMan->DeactivateRoute();
3382 g_pRouteMan->FindBestActivatePoint(route, gLat, gLon, gCog, gSog);
3387 g_pRouteMan->DeactivateRoute();
3394void EnableDefaultConsole(
bool enable) { g_bhide_route_console = !enable; }
3395void EnableDefaultContextMenus(
bool enable) { g_bhide_context_menus = !enable; }
3397void SetMinZoomScale(
double min_scale) {
3398 for (
unsigned int i = 0; i < g_canvasArray.GetCount(); i++) {
3400 cc->SetAbsoluteMinScale(min_scale);
3404void SetMaxZoomScale(
double max_scale) {
3405 g_maxzoomin = wxRound(wxMax(max_scale, 100.));
3408std::shared_ptr<PI_PointContext> GetContextAtPoint(
int x,
int y,
3410 ChartCanvas* cc = g_canvasArray.Item(canvas_index);
3412 return cc->GetCanvasContextAtPoint(x, y);
3414 auto rstruct = std::make_shared<PI_PointContext>();
3415 rstruct->object_type = OBJECT_UNKNOWN;
3416 rstruct->object_ident =
"";
3421wxBitmap GetObjectIcon_PlugIn(
const wxString& name) {
3423 return *pWayPointMan->GetIconBitmap(name);
3425 return wxNullBitmap;
3428bool IsRouteActive(wxString route_guid) {
3429 if (g_pRouteMan->GetpActiveRoute())
3430 return (route_guid.IsSameAs(g_pRouteMan->GetpActiveRoute()->
m_GUID));
3435void SetBoatPosition(
double zlat,
double zlon) {
3438 gFrame->UpdateStatusBar();
3441void RouteInsertWaypoint(
int canvas_index, wxString route_guid,
double zlat,
3445 if (!parent)
return;
3447 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
3453 if ((seltype & SELTYPE_ROUTESEGMENT) != SELTYPE_ROUTESEGMENT)
return;
3455 bool rename =
false;
3456 route->InsertPointAfter(parent->GetFoundRoutepoint(), zlat, zlon, rename);
3458 pSelect->DeleteAllSelectableRoutePoints(route);
3459 pSelect->DeleteAllSelectableRouteSegments(route);
3460 pSelect->AddAllSelectableRouteSegments(route);
3461 pSelect->AddAllSelectableRoutePoints(route);
3463 NavObj_dB::GetInstance().UpdateRoute(route);
3466void RouteAppendWaypoint(
int canvas_index, wxString route_guid) {
3467 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
3472 if (!parent)
return;
3474 parent->m_pMouseRoute = route;
3475 parent->m_routeState = route->GetnPoints() + 1;
3477 parent->m_pMouseRoute->SetHiLite(50);
3479 auto pLast = route->GetLastPoint();
3481 parent->m_prev_rlat = pLast->m_lat;
3482 parent->m_prev_rlon = pLast->m_lon;
3483 parent->m_prev_pMousePoint = pLast;
3485 parent->m_bAppendingRoute =
true;
3488void FinishRoute(
int canvas_index) {
3491 if (!parent)
return;
3493 parent->FinishRoute();
3496bool IsRouteBeingCreated(
int canvas_index) {
3499 if (!parent)
return false;
3500 return !(parent->m_pMouseRoute == NULL);
3503bool AreRouteWaypointNamesVisible(wxString route_guid) {
3504 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
3505 if (!route)
return false;
3506 return route->AreWaypointNamesVisible();
3509void ShowRouteWaypointNames(wxString route_guid,
bool show) {
3510 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
3512 route->ShowWaypointNames(show);
3515void NavigateToWaypoint(wxString waypoint_guid) {
3516 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(waypoint_guid);
3520 wxEmptyString, wxEmptyString);
3521 pSelect->AddSelectableRoutePoint(gLat, gLon, pWP_src);
3524 pRouteList->Append(temp_route);
3526 temp_route->AddPoint(pWP_src);
3527 temp_route->AddPoint(prp);
3528 prp->SetShared(
true);
3530 pSelect->AddSelectableRouteSegment(gLat, gLon, prp->m_lat, prp->m_lon,
3531 pWP_src, prp, temp_route);
3533 wxString name = prp->GetName();
3534 if (name.IsEmpty()) name = _(
"(Unnamed Waypoint)");
3535 wxString rteName = _(
"Go to ");
3536 rteName.Append(name);
3542 if (g_pRouteMan->GetpActiveRoute()) g_pRouteMan->DeactivateRoute();
3547bool IsAISTrackVisible(wxString ais_mmsi) {
3549 ais_mmsi.ToLong(&mmsi);
3550 auto myptarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
3552 return myptarget->b_show_track;
3557void AISToggleShowTrack(wxString ais_mmsi) {
3559 ais_mmsi.ToLong(&mmsi);
3560 auto myptarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
3561 if (myptarget) myptarget->ToggleShowTrack();
3564bool IsAIS_CPAVisible(wxString ais_mmsi) {
3566 ais_mmsi.ToLong(&mmsi);
3567 auto myptarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
3569 return myptarget->b_show_AIS_CPA;
3574void AISToggleShowCPA(wxString ais_mmsi) {
3576 ais_mmsi.ToLong(&mmsi);
3577 auto myptarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
3578 if (myptarget) myptarget->Toggle_AIS_CPA();
3581void ShowAISTargetQueryDialog(
int canvas_index, wxString ais_mmsi) {
3584 if (!parent)
return;
3587 ais_mmsi.ToLong(&mmsi);
3588 ShowAISTargetQueryDialog(parent, mmsi);
3591void ShowAISTargetList(
int canvas_index) {
3594 if (!parent)
return;
3595 parent->ShowAISTargetList();
3598bool IsMeasureActive(
int canvas_index) {
3601 if (!parent)
return false;
3602 return parent->m_bMeasure_Active;
3605void CancelMeasure(
int canvas_index) {
3608 if (!parent)
return;
3609 parent->CancelMeasureRoute();
3612void SetDepthUnitVisible(
bool bviz) { g_bhide_depth_units = !bviz; }
3614void SetOverzoomFlagVisible(
bool bviz) { g_bhide_overzoom_flag = !bviz; }
3617void AddNoShowDirectory(std::string chart_dir) {
3618 ChartDirectoryExcludedVector.push_back(chart_dir);
3620void RemoveNoShowDirectory(std::string chart_dir) {
3621 auto it = std::find(ChartDirectoryExcludedVector.begin(),
3622 ChartDirectoryExcludedVector.end(), chart_dir);
3623 if (it != ChartDirectoryExcludedVector.end())
3624 ChartDirectoryExcludedVector.erase(it);
3626void ClearNoShowVector() { ChartDirectoryExcludedVector.clear(); }
3627const std::vector<std::string>& GetNoShowVector() {
3628 return ChartDirectoryExcludedVector;
Class AisDecoder and helpers.
ChartCanvas - Main chart display and interaction component.
int PrepareContextSelections(double lat, double lon)
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.
Handle logging and forwarding of incoming n0183/n2k messages.
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.
bool m_isActive
True if this is the active route.
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_bIsInLayer
Flag indicating if the waypoint belongs to a layer.
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.
bool m_bRtIsSelected
Flag indicating whether this route is currently selected in the UI.
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.
bool m_bDeleteOnArrival
Flag indicating whether the route should be deleted once navigation reaches the end.
wxString m_RouteEndString
Name or description of the route's ending point.
bool m_btemp
Flag indicating if this is a temporary route.
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 m_bIsInLayer
Flag indicating whether this route belongs to a layer.
int m_lastMousePointIndex
Index of the most recently interacted with route point.
bool DeleteRoute(Route *pRoute)
bool ActivateRoute(Route *pRouteToActivate, RoutePoint *pStartPoint=NULL)
Activates a route for navigation.
Manages a set of ShapeBaseChart objects at different resolutions.
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.
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.
void SetBoxes(void)
Computes the bounding box coordinates for the current viewport.
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.
wxFont GetOCPNGUIScaledFont(wxString item)
Retrieves a font optimized for touch and high-resolution interfaces.
General purpose GUI support.
Multiplexer class and helpers.
Class NotificationManager.
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
Enumeration of color schemes.
@ 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.
int GetChartbarHeight(void)
Gets height of chart bar in pixels.
void RemovePlugInTool(int tool_id)
Removes a tool from OpenCPN's toolbar.
void SetCanvasProjection(int projection)
Sets chart projection type.
wxString * GetpSharedDataLocation(void)
Gets shared application data location.
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.
ArrayOfPlugIn_AIS_Targets * GetAISTargetArray(void)
Gets array of AIS targets.
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.
wxArrayString GetTrackGUIDArray(void)
Gets array of track GUIDs.
wxString getUsrDistanceUnit_Plugin(int unit)
Gets display string for user's preferred distance unit.
bool DeletePlugInTrack(wxString &GUID)
Deletes a track.
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.
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.
wxArrayString GetRouteGUIDArray(void)
Gets array of route GUIDs.
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.
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.
wxArrayString GetIconNameArray(void)
Gets array of available waypoint icons.
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.
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.
wxString GetNewGUID(void)
Generates a new globally unique identifier (GUID).
double fromDMM_Plugin(wxString sdms)
Converts degrees/decimal minutes string to decimal degrees.
void EnableENCTextDisplay(bool enable, int CanvasIndex)
Controls ENC text label display.
int GetCanvasIndexUnderMouse(void)
Gets index of chart canvas under mouse cursor.
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 global color value.
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.
wxWindow * GetCanvasUnderMouse(void)
Gets canvas window under mouse cursor.
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.
wxColor GetGlobalColorD(std::string map_name, std::string name)
Gets a color from the global color scheme.
bool GetEnableCompassGPSIcon(int CanvasIndex)
Gets compass icon visibility state.
void SetMUICursor_PlugIn(wxCursor *pCursor, int canvasIndex)
Sets mouse cursor for specific canvas.
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.
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.
wxArrayString GetWaypointGUIDArray(void)
Gets array of all waypoint/marks GUIDs.
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.
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.
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.
std::unique_ptr< PlugIn_Route_Ex > GetRouteEx_Plugin(const wxString &GUID)
Gets extended route by GUID.
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.
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.
wxAuiManager * GetFrameAuiManager(void)
Gets main frame AUI manager.
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.
int GetLatLonFormat()
Gets currently selected latitude/longitude display format.
bool AddSingleWaypoint(PlugIn_Waypoint *pwaypoint, bool b_permanent)
Adds a single waypoint.
bool IsTouchInterface_PlugIn(void)
Checks if touch interface mode is enabled.
bool GetSingleWaypoint(wxString GUID, PlugIn_Waypoint *pwaypoint)
Gets waypoint data by GUID.
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.
wxString g_locale
Global locale setting for OpenCPN UI.
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.
wxFileConfig * GetOCPNConfigObject(void)
Gets OpenCPN's configuration object.
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.
double g_display_size_mm
The width of the physical screen in millimeters.
void ForceChartDBUpdate()
Forces an update of the chart database.
bool GetSingleWaypointEx(wxString GUID, PlugIn_Waypoint_Ex *pwaypoint)
Gets extended waypoint data by GUID.
bool ShuttingDown(void)
Checks if OpenCPN is in shutdown process.
void ForceChartDBRebuild()
Forces complete rebuild of chart database.
Tools to send data to plugins.
PlugInManager and helper classes – Mostly gui parts (dialogs) and plugin API stuff.
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.