OpenCPN Partial API docs
Loading...
Searching...
No Matches
api_121.cpp
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2024 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
24#include <algorithm>
25#include <map>
26#include <memory>
27#include <string>
28#include <vector>
29
30#include <wx/wx.h>
31#include <wx/event.h>
32#include <wx/string.h>
33#include <wx/window.h>
34
35#include "model/ais_decoder.h"
37#include "model/gui_events.h"
38#include "model/gui_vars.h"
39#include "model/navobj_db.h"
41#include "model/own_ship.h"
42#include "model/route.h"
43#include "model/track.h"
44
45#include "chcanv.h"
46#include "ocpn_plugin.h"
47#include "tcmgr.h"
48
49// translate O route class to PlugIn_Waypoint_ExV2
50static void PlugInExV2FromRoutePoint(PlugIn_Waypoint_ExV2* dst,
51 /* const*/ RoutePoint* src) {
52 dst->m_lat = src->m_lat;
53 dst->m_lon = src->m_lon;
54 dst->IconName = src->GetIconName();
55 dst->m_MarkName = src->GetName();
56 dst->m_MarkDescription = src->GetDescription();
57 dst->IconDescription = pWayPointMan->GetIconDescription(src->GetIconName());
58 dst->IsVisible = src->IsVisible();
59 dst->m_CreateTime = src->GetCreateTime(); // not const
60 dst->m_GUID = src->m_GUID;
61
62 // Transcribe (clone) the html HyperLink List, if present
63 if (src->m_HyperlinkList) {
64 delete dst->m_HyperlinkList;
65 dst->m_HyperlinkList = nullptr;
66
67 if (src->m_HyperlinkList->size() > 0) {
68 dst->m_HyperlinkList = new Plugin_HyperlinkList;
69
70 for (Hyperlink* link : *src->m_HyperlinkList) {
72 h->DescrText = link->DescrText;
73 h->Link = link->Link;
74 h->Type = link->LType;
75 dst->m_HyperlinkList->Append(h);
76 }
77 }
78 }
79
80 // Get the range ring info
85 dst->m_TideStation = src->m_TideStation;
86
87 // Get other extended info
88 dst->IsNameVisible = src->m_bShowName;
89 dst->scamin = src->GetScaMin();
90 dst->b_useScamin = src->GetUseSca();
91 dst->IsActive = src->m_bIsActive;
92
93 dst->scamax = src->GetScaMax();
94 dst->m_PlannedSpeed = src->GetPlannedSpeed();
95 dst->m_ETD = src->GetManualETD();
96 dst->m_WaypointArrivalRadius = src->GetWaypointArrivalRadius();
97 dst->m_bShowWaypointRangeRings = src->GetShowWaypointRangeRings();
98}
99
100static void cloneHyperlinkListExV2(RoutePoint* dst,
101 const PlugIn_Waypoint_ExV2* src) {
102 // Transcribe (clone) the html HyperLink List, if present
103 if (src->m_HyperlinkList == nullptr) return;
104
105 if (src->m_HyperlinkList->GetCount() > 0) {
106 wxPlugin_HyperlinkListNode* linknode = src->m_HyperlinkList->GetFirst();
107 while (linknode) {
108 Plugin_Hyperlink* link = linknode->GetData();
109
110 Hyperlink* h = new Hyperlink();
111 h->DescrText = link->DescrText;
112 h->Link = link->Link;
113 h->LType = link->Type;
114
115 dst->m_HyperlinkList->push_back(h);
116
117 linknode = linknode->GetNext();
118 }
119 }
120}
121
122static RoutePoint* CreateNewPoint(const PlugIn_Waypoint_ExV2* src,
123 bool b_permanent) {
124 RoutePoint* pWP = new RoutePoint(src->m_lat, src->m_lon, src->IconName,
125 src->m_MarkName, src->m_GUID);
126
127 pWP->m_bIsolatedMark = true; // This is an isolated mark
128
129 cloneHyperlinkListExV2(pWP, src);
130
132
133 if (src->m_CreateTime.IsValid())
134 pWP->SetCreateTime(src->m_CreateTime);
135 else {
136 pWP->SetCreateTime(wxDateTime::Now().ToUTC());
137 }
138
139 pWP->m_btemp = (b_permanent == false);
140
141 // Extended fields
142 pWP->SetIconName(src->IconName);
143 pWP->SetWaypointRangeRingsNumber(src->nrange_rings);
144 pWP->SetWaypointRangeRingsStep(src->RangeRingSpace);
145 pWP->SetWaypointRangeRingsStepUnits(src->RangeRingSpaceUnits);
146 pWP->SetWaypointRangeRingsColour(src->RangeRingColor);
147 pWP->SetTideStation(src->m_TideStation);
148 pWP->SetScaMin(src->scamin);
149 pWP->SetUseSca(src->b_useScamin);
150 pWP->SetNameShown(src->IsNameVisible);
151 pWP->SetVisible(src->IsVisible);
152
153 pWP->SetWaypointArrivalRadius(src->m_WaypointArrivalRadius);
154 pWP->SetShowWaypointRangeRings(src->m_bShowWaypointRangeRings);
155 pWP->SetScaMax(src->scamax);
156 pWP->SetPlannedSpeed(src->m_PlannedSpeed);
157 if (src->m_ETD.IsValid())
158 pWP->SetETD(src->m_ETD);
159 else
160 pWP->SetETD(wxEmptyString);
161 return pWP;
162}
163
164static bool AddPlugInRouteExV3(HostApi121::Route* proute, bool b_permanent) {
165 ::Route* route = new ::Route();
166
167 PlugIn_Waypoint_ExV2* pwaypointex;
168 RoutePoint *pWP, *pWP_src;
169 int ip = 0;
170 wxDateTime plannedDeparture;
171
172 wxPlugin_WaypointExV2ListNode* pwpnode = proute->pWaypointList->GetFirst();
173 while (pwpnode) {
174 pwaypointex = pwpnode->GetData();
175
176 pWP = pWayPointMan->FindRoutePointByGUID(pwaypointex->m_GUID);
177 if (!pWP) {
178 pWP = CreateNewPoint(pwaypointex, b_permanent);
179 pWP->m_bIsolatedMark = false;
180 }
181
182 route->AddPoint(pWP);
183
184 pSelect->AddSelectableRoutePoint(pWP->m_lat, pWP->m_lon, pWP);
185
186 if (ip > 0)
187 pSelect->AddSelectableRouteSegment(pWP_src->m_lat, pWP_src->m_lon,
188 pWP->m_lat, pWP->m_lon, pWP_src, pWP,
189 route);
190
191 plannedDeparture = pwaypointex->m_CreateTime;
192 ip++;
193 pWP_src = pWP;
194
195 pwpnode = pwpnode->GetNext(); // PlugInWaypoint
196 }
197
198 route->m_PlannedDeparture = plannedDeparture;
199
200 route->m_RouteNameString = proute->m_NameString;
201 route->m_RouteStartString = proute->m_StartString;
202 route->m_RouteEndString = proute->m_EndString;
203 if (!proute->m_GUID.IsEmpty()) {
204 route->m_GUID = proute->m_GUID;
205 }
206 route->m_btemp = (b_permanent == false);
207 route->SetVisible(proute->m_isVisible);
208 route->m_RouteDescription = proute->m_Description;
209
210 route->m_PlannedSpeed = proute->m_PlannedSpeed;
211 route->m_Colour = proute->m_Colour;
212 route->m_style = proute->m_style;
213 route->m_PlannedDeparture = proute->m_PlannedDeparture;
214 route->m_TimeDisplayFormat = proute->m_TimeDisplayFormat;
215
216 pRouteList->push_back(route);
217
218 if (b_permanent) {
219 // pConfig->AddNewRoute(route);
220 NavObj_dB::GetInstance().InsertRoute(route);
221 }
222
223 GuiEvents::GetInstance().on_routes_update.Notify();
224
225 return true;
226}
227
228static bool UpdatePlugInRouteExV3(HostApi121::Route* proute) {
229 bool b_found = false;
230
231 // Find the Route
232 Route* pRoute = g_pRouteMan->FindRouteByGUID(proute->m_GUID);
233 if (pRoute) b_found = true;
234
235 if (b_found) {
236 bool b_permanent = !pRoute->m_btemp;
237 g_pRouteMan->DeleteRoute(pRoute);
238
239 b_found = AddPlugInRouteExV3(proute, b_permanent);
240 }
241
242 return b_found;
243}
244
245// translate O route class to PlugIn_Waypoint_Ex
246static void PlugInExFromRoutePoint(PlugIn_Waypoint_Ex* dst,
247 /* const*/ RoutePoint* src) {
248 dst->m_lat = src->m_lat;
249 dst->m_lon = src->m_lon;
250 dst->IconName = src->GetIconName();
251 dst->m_MarkName = src->GetName();
252 dst->m_MarkDescription = src->GetDescription();
253 dst->IconDescription = pWayPointMan->GetIconDescription(src->GetIconName());
254 dst->IsVisible = src->IsVisible();
255 dst->m_CreateTime = src->GetCreateTime(); // not const
256 dst->m_GUID = src->m_GUID;
257
258 // Transcribe (clone) the html HyperLink List, if present
259 if (src->m_HyperlinkList) {
260 delete dst->m_HyperlinkList;
261 dst->m_HyperlinkList = nullptr;
262
263 if (src->m_HyperlinkList->size() > 0) {
264 dst->m_HyperlinkList = new Plugin_HyperlinkList;
265 for (Hyperlink* link : *src->m_HyperlinkList) {
267 h->DescrText = link->DescrText;
268 h->Link = link->Link;
269 h->Type = link->LType;
270 dst->m_HyperlinkList->Append(h);
271 }
272 }
273 }
274
275 // Get the range ring info
279
280 // Get other extended info
281 dst->IsNameVisible = src->m_bShowName;
282 dst->scamin = src->GetScaMin();
283 dst->b_useScamin = src->GetUseSca();
284 dst->IsActive = src->m_bIsActive;
285}
286
287static void cloneHyperlinkListEx(RoutePoint* dst,
288 const PlugIn_Waypoint_Ex* src) {
289 // Transcribe (clone) the html HyperLink List, if present
290 if (src->m_HyperlinkList == nullptr) return;
291
292 if (src->m_HyperlinkList->GetCount() > 0) {
293 wxPlugin_HyperlinkListNode* linknode = src->m_HyperlinkList->GetFirst();
294 while (linknode) {
295 Plugin_Hyperlink* link = linknode->GetData();
296
297 Hyperlink* h = new Hyperlink();
298 h->DescrText = link->DescrText;
299 h->Link = link->Link;
300 h->LType = link->Type;
301
302 dst->m_HyperlinkList->push_back(h);
303
304 linknode = linknode->GetNext();
305 }
306 }
307}
308
309static wxString DropMarkPI(double lat, double lon) {
310 if ((fabs(lat) > 80.0) || (fabs(lon) > 180.)) return "";
311
312 RoutePoint* pWP =
313 new RoutePoint(lat, lon, g_default_wp_icon, wxEmptyString, wxEmptyString);
314 pWP->m_bIsolatedMark = true; // This is an isolated mark
315 pSelect->AddSelectableRoutePoint(lat, lon, pWP);
316 NavObj_dB::GetInstance().InsertRoutePoint(pWP);
317 return pWP->m_GUID;
318}
319
320static wxString RouteCreatePI(int canvas_index, bool start) {
321 if ((size_t)canvas_index < g_canvasArray.GetCount()) {
322 ChartCanvas* cc = g_canvasArray.Item(canvas_index);
323 if (cc) {
324 if (start) {
325 cc->StartRoute();
326 return "0";
327 } else {
328 return cc->FinishRoute();
329 }
330 }
331 }
332 return "-1";
333}
334
335static bool DoMeasurePI(int canvas_index, bool start) {
336 if ((size_t)canvas_index < g_canvasArray.GetCount()) {
337 ChartCanvas* cc = g_canvasArray.Item(canvas_index);
338 if (cc) {
339 if (start) {
340 cc->StartMeasureRoute();
341 return true;
342 } else {
343 cc->CancelMeasureRoute();
344 cc->Refresh(false);
345 return true;
346 }
347 }
348 }
349 return false;
350}
351
352static void EnableDefaultConsole(bool enable) {
353 g_bhide_route_console = !enable;
354}
355
356static wxString NavToHerePI(double lat, double lon) {
357 RoutePoint* pWP_dest =
358 new RoutePoint(lat, lon, g_default_wp_icon, wxEmptyString, wxEmptyString);
359 pSelect->AddSelectableRoutePoint(lat, lon, pWP_dest);
360
361 RoutePoint* pWP_src = new RoutePoint(gLat, gLon, g_default_wp_icon,
362 wxEmptyString, wxEmptyString);
363 pSelect->AddSelectableRoutePoint(gLat, gLon, pWP_src);
364
365 Route* temp_route = new Route();
366 pRouteList->push_back(temp_route);
367
368 temp_route->AddPoint(pWP_src);
369 temp_route->AddPoint(pWP_dest);
370
371 pSelect->AddSelectableRouteSegment(gLat, gLon, lat, lon, pWP_src, pWP_dest,
372 temp_route);
373
374 temp_route->m_RouteNameString = _("Temporary GOTO Route");
375 temp_route->m_RouteStartString = _("Here");
376 temp_route->m_RouteEndString = _("There");
377 temp_route->m_bDeleteOnArrival = true;
378
379 if (g_pRouteMan->GetpActiveRoute()) g_pRouteMan->DeactivateRoute();
380
381 g_pRouteMan->ActivateRoute(temp_route, pWP_dest);
382 return temp_route->m_GUID;
383}
384
385static bool ActivateRoutePI(wxString route_guid, bool activate) {
386 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
387 if (!route) return false;
388
389 if (activate) {
390 if (g_pRouteMan->GetpActiveRoute()) g_pRouteMan->DeactivateRoute();
391 RoutePoint* best_point =
392 g_pRouteMan->FindBestActivatePoint(route, gLat, gLon, gCog, gSog);
393 g_pRouteMan->ActivateRoute(route, best_point);
394 route->m_bRtIsSelected = false;
395 return true;
396 } else {
397 g_pRouteMan->DeactivateRoute();
398 route->m_bRtIsSelected = false;
399 return true;
400 }
401 return false;
402}
403
404static void SetMaxZoomScale(double max_scale) {
405 g_maxzoomin = wxRound(wxMax(max_scale, 100.));
406}
407
408static void EnableDefaultContextMenus(bool enable) {
409 g_bhide_context_menus = !enable;
410}
411
412static void SetMinZoomScale(double min_scale) {
413 for (unsigned int i = 0; i < g_canvasArray.GetCount(); i++) {
414 ChartCanvas* cc = g_canvasArray.Item(i);
415 cc->SetAbsoluteMinScale(min_scale);
416 }
417}
418
419static std::shared_ptr<HostApi121::PiPointContext> GetContextAtPoint(
420 int x, int y, int canvas_index) {
421 ChartCanvas* cc = g_canvasArray.Item(canvas_index);
422 if (cc) {
423 return cc->GetCanvasContextAtPoint(x, y);
424 } else {
425 auto rstruct = std::make_shared<HostApi121::PiPointContext>();
426 rstruct->object_type = HostApi121::PiContextObjectType::kObjectUnknown;
427 rstruct->object_ident = "";
428 return rstruct;
429 }
430}
431
432static wxBitmap GetObjectIcon_PlugIn(const wxString& name) {
433 if (pWayPointMan)
434 return *pWayPointMan->GetIconBitmap(name);
435 else
436 return wxNullBitmap;
437}
438
439static bool IsRouteActive(wxString route_guid) {
440 if (g_pRouteMan->GetpActiveRoute())
441 return (route_guid.IsSameAs(g_pRouteMan->GetpActiveRoute()->m_GUID));
442 else
443 return false;
444}
445
446static void SetBoatPosition(double zlat, double zlon) {
447 gLat = zlat;
448 gLon = zlon;
449 GuiEvents::GetInstance().gframe_update_status_bar.Notify();
450}
451
452static void RouteInsertWaypoint(int canvas_index, wxString route_guid,
453 double zlat, double zlon) {
454 ChartCanvas* parent =
455 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
456 if (!parent) return;
457
458 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
459 if (!route) return;
460
461 if (route->m_bIsInLayer) return;
462
463 int seltype = parent->PrepareContextSelections(zlat, zlon);
464 if ((seltype & SELTYPE_ROUTESEGMENT) != SELTYPE_ROUTESEGMENT) return;
465
466 bool rename = false;
467 route->InsertPointAfter(parent->GetFoundRoutepoint(), zlat, zlon, rename);
468
469 pSelect->DeleteAllSelectableRoutePoints(route);
470 pSelect->DeleteAllSelectableRouteSegments(route);
471 pSelect->AddAllSelectableRouteSegments(route);
472 pSelect->AddAllSelectableRoutePoints(route);
473
474 NavObj_dB::GetInstance().UpdateRoute(route);
475}
476
477static void RouteAppendWaypoint(int canvas_index, wxString route_guid) {
478 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
479 if (!route) return;
480
481 ChartCanvas* parent =
482 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
483 if (!parent) return;
484
485 parent->m_pMouseRoute = route;
486 parent->m_routeState = route->GetnPoints() + 1;
487 parent->m_pMouseRoute->m_lastMousePointIndex = route->GetnPoints();
488 parent->m_pMouseRoute->SetHiLite(50);
489
490 auto pLast = route->GetLastPoint();
491
492 parent->m_prev_rlat = pLast->m_lat;
493 parent->m_prev_rlon = pLast->m_lon;
494 parent->m_prev_pMousePoint = pLast;
495
496 parent->m_bAppendingRoute = true;
497}
498
499static void FinishRoute(int canvas_index) {
500 ChartCanvas* parent =
501 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
502 if (!parent) return;
503
504 parent->FinishRoute();
505}
506
507static bool IsRouteBeingCreated(int canvas_index) {
508 ChartCanvas* parent =
509 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
510 if (!parent) return false;
511 return !(parent->m_pMouseRoute == NULL);
512}
513
514static bool AreRouteWaypointNamesVisible(wxString route_guid) {
515 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
516 if (!route) return false;
517 return route->AreWaypointNamesVisible();
518}
519
520static void ShowRouteWaypointNames(wxString route_guid, bool show) {
521 Route* route = g_pRouteMan->FindRouteByGUID(route_guid);
522 if (!route) return;
523 route->ShowWaypointNames(show);
524}
525
526static void NavigateToWaypoint(wxString waypoint_guid) {
527 RoutePoint* prp = pWayPointMan->FindRoutePointByGUID(waypoint_guid);
528 if (!prp) return;
529
530 RoutePoint* pWP_src = new RoutePoint(gLat, gLon, g_default_wp_icon,
531 wxEmptyString, wxEmptyString);
532 pSelect->AddSelectableRoutePoint(gLat, gLon, pWP_src);
533
534 Route* temp_route = new Route();
535 pRouteList->push_back(temp_route);
536
537 temp_route->AddPoint(pWP_src);
538 temp_route->AddPoint(prp);
539 prp->SetShared(true);
540
541 pSelect->AddSelectableRouteSegment(gLat, gLon, prp->m_lat, prp->m_lon,
542 pWP_src, prp, temp_route);
543
544 wxString name = prp->GetName();
545 if (name.IsEmpty()) name = _("(Unnamed Waypoint)");
546 wxString rteName = _("Go to ");
547 rteName.Append(name);
548 temp_route->m_RouteNameString = rteName;
549 temp_route->m_RouteStartString = _("Here");
550 temp_route->m_RouteEndString = name;
551 temp_route->m_bDeleteOnArrival = true;
552
553 if (g_pRouteMan->GetpActiveRoute()) g_pRouteMan->DeactivateRoute();
554 g_pRouteMan->ActivateRoute(temp_route, prp);
555}
556
557// AIS related
558static bool IsAISTrackVisible(wxString ais_mmsi) {
559 long mmsi = 0;
560 ais_mmsi.ToLong(&mmsi);
561 auto myptarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
562 if (myptarget)
563 return myptarget->b_show_track;
564 else
565 return false;
566}
567
568static void AISToggleShowTrack(wxString ais_mmsi) {
569 long mmsi = 0;
570 ais_mmsi.ToLong(&mmsi);
571 auto myptarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
572 if (myptarget) myptarget->ToggleShowTrack();
573}
574
575static void AISToggleShowCPA(wxString ais_mmsi) {
576 long mmsi = 0;
577 ais_mmsi.ToLong(&mmsi);
578 auto myptarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
579 if (myptarget) myptarget->Toggle_AIS_CPA();
580}
581
582static void ShowAISTargetQueryDialog(int canvas_index, wxString ais_mmsi) {
583 ChartCanvas* parent =
584 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
585 if (!parent) return;
586
587 long mmsi = 0;
588 ais_mmsi.ToLong(&mmsi);
589 ShowAISTargetQueryDialog(parent, mmsi);
590}
591
592static void ShowAISTargetList(int canvas_index) {
593 ChartCanvas* parent =
594 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
595 if (!parent) return;
596 parent->ShowAISTargetList();
597}
598
599static bool IsMeasureActive(int canvas_index) {
600 ChartCanvas* parent =
601 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
602 if (!parent) return false;
603 return parent->m_bMeasure_Active;
604}
605
606static void CancelMeasure(int canvas_index) {
607 ChartCanvas* parent =
608 static_cast<ChartCanvas*>(GetCanvasByIndex(canvas_index));
609 if (!parent) return;
610 parent->CancelMeasureRoute();
611}
612
613static void SetDepthUnitVisible(bool bviz) { g_bhide_depth_units = !bviz; }
614
615static void SetOverzoomFlagVisible(bool bviz) { g_bhide_overzoom_flag = !bviz; }
616
617// Extended Chart table management support
618static void AddNoShowDirectory(std::string chart_dir) {
619 ChartDirectoryExcludedVector.push_back(chart_dir);
620}
621
622static void RemoveNoShowDirectory(std::string chart_dir) {
623 auto it = std::find(ChartDirectoryExcludedVector.begin(),
624 ChartDirectoryExcludedVector.end(), chart_dir);
625 if (it != ChartDirectoryExcludedVector.end())
626 ChartDirectoryExcludedVector.erase(it); // Erase the element
627}
628
629static void ClearNoShowVector() { ChartDirectoryExcludedVector.clear(); }
630
631static const std::vector<std::string>& GetNoShowVector() {
633}
634
635static bool SelectChartFamily(int CanvasIndex, ChartFamilyEnumPI Family) {
636 auto window = GetCanvasByIndex(CanvasIndex);
637 auto oCanvas = dynamic_cast<ChartCanvas*>(window);
638 if (oCanvas) {
639 // Chose the "best" chart in the new family
640 // Strategy: Chose a chart from the new family that is the same native scale
641 // as the current refernce chart.
642 // If this chart is not present in the new family. chose the next larger
643 // scale chart.
644 // If there are no larger scale charts available in the new family,
645 // chose the next smaller scale chart.
646 int ref_index = oCanvas->GetQuiltReferenceChartIndex();
647 if (ref_index == -1) return false; // No chart loaded yet
648 const ChartTableEntry& cte_ref = ChartData->GetChartTableEntry(ref_index);
649
650 // No action needed if ref chart is already same as target
651 // unless the ref chart is a basemep
652 if (cte_ref.GetChartFamily() == Family) {
653 if (!cte_ref.IsBasemap()) return false;
654 }
655
656 // Special case for switching to ENC
657 int index_smallest_nobasemap = -1;
658 if (Family == PI_CHART_FAMILY_VECTOR) {
659 // Find the smallest scale chart that is not a basemap
660 for (auto index : oCanvas->m_pQuilt->GetFullscreenIndexArray()) {
661 const ChartTableEntry& cte = ChartData->GetChartTableEntry(index);
662 if ((cte.GetChartFamily() == Family) && !cte.IsBasemap())
663 index_smallest_nobasemap = index;
664 }
665 if (index_smallest_nobasemap < 0) {
666 // There is no ENC except basemap
667 // So choose the smallest scale basemap as reference
668 int index_smallest_basemap = -1;
669 int scale_smallest_basemap = 1;
670 for (auto index : oCanvas->m_pQuilt->GetFullscreenIndexArray()) {
671 const ChartTableEntry& cte = ChartData->GetChartTableEntry(index);
672 if ((cte.GetChartFamily() == Family) && cte.IsBasemap()) {
673 if (cte.GetScale() > scale_smallest_basemap) {
674 scale_smallest_basemap = cte.GetScale();
675 index_smallest_basemap = index;
676 }
677 }
678 }
679 if (index_smallest_basemap >= 0) {
680 const ChartTableEntry& cte =
681 ChartData->GetChartTableEntry(index_smallest_basemap);
682 oCanvas->SelectQuiltRefdbChart(index_smallest_basemap, false);
683 // Induce a recomposition of the quilt
684 oCanvas->ZoomCanvasSimple(.9999);
685 oCanvas->DoCanvasUpdate();
686 oCanvas->ReloadVP();
687 return true;
688 }
689 }
690 }
691
692 int target_scale = cte_ref.GetScale();
693
694 int target_index = -1;
695 for (auto index : oCanvas->m_pQuilt->GetFullscreenIndexArray()) {
696 const ChartTableEntry& cte = ChartData->GetChartTableEntry(index);
697 if (cte.GetChartFamily() != Family) continue;
698
699 if (cte.GetScale() == target_scale) {
700 target_index = index;
701 break;
702 }
703 }
704
705 if (target_index < 0) {
706 // Find the largest scale chart that is lower than the reference chart
707 for (auto index : oCanvas->m_pQuilt->GetFullscreenIndexArray()) {
708 const ChartTableEntry& cte = ChartData->GetChartTableEntry(index);
709 if (cte.GetChartFamily() != Family) continue;
710 if (cte.GetScale() <= target_scale) {
711 target_index = index;
712 }
713 }
714 }
715
716 if (target_index < 0) {
717 // Find the largest scale chart that is higher than the reference chart
718 for (auto index : oCanvas->m_pQuilt->GetFullscreenIndexArray()) {
719 const ChartTableEntry& cte = ChartData->GetChartTableEntry(index);
720 if (cte.GetChartFamily() != Family) continue;
721 if (cte.GetScale() > target_scale) {
722 target_index = index;
723 break;
724 }
725 }
726 }
727
728 if (target_index >= 0) {
729 const ChartTableEntry& cte = ChartData->GetChartTableEntry(target_index);
730 // Found a suitable chart in the new family
731 if (oCanvas->IsChartQuiltableRef(target_index)) {
732 oCanvas->SelectQuiltRefdbChart(target_index, false); // no autoscale
733
734 // Induce a recomposition of the quilt
735 oCanvas->ZoomCanvasSimple(.9999);
736 oCanvas->DoCanvasUpdate();
737 oCanvas->ReloadVP();
738 return true;
739 }
740 }
741 }
742 return false;
743}
744
745static void CenterToAisTarget(wxString ais_mmsi) {
746 long mmsi = 0;
747 if (ais_mmsi.ToLong(&mmsi)) {
748 std::shared_ptr<AisTargetData> pAISTarget = nullptr;
749 if (g_pAIS) pAISTarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
750
751 if (pAISTarget)
752 GuiEvents::GetInstance().on_center_ais_target.Notify(pAISTarget);
753 }
754} // same as AISTargetListDialog::CenterToTarget ( false )
755
756static void AisTargetCreateWpt(wxString ais_mmsi) {
757 long mmsi = 0;
758 if (ais_mmsi.ToLong(&mmsi)) {
759 std::shared_ptr<AisTargetData> pAISTarget = NULL;
760 if (g_pAIS) pAISTarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
761
762 if (pAISTarget) {
763 RoutePoint* pWP =
764 new RoutePoint(pAISTarget->Lat, pAISTarget->Lon, g_default_wp_icon,
765 wxEmptyString, wxEmptyString);
766 pWP->m_bIsolatedMark = true; // This is an isolated mark
767 pSelect->AddSelectableRoutePoint(pAISTarget->Lat, pAISTarget->Lon, pWP);
768 NavObj_dB::GetInstance().InsertRoutePoint(pWP);
769
770 GuiEvents::GetInstance().on_routes_update.Notify();
771 }
772 }
773} // same as AISTargetListDialog::OnTargetCreateWpt
774
775static void AisShowAllTracks(bool show) {
776 if (g_pAIS) {
777 for (const auto& it : g_pAIS->GetTargetList()) {
778 auto pAISTarget = it.second;
779 if (NULL != pAISTarget) {
780 pAISTarget->b_show_track = show;
781
782 // Check for any persistently tracked target, force b_show_track_old
783 std::map<int, Track*>::iterator itt;
784 itt = g_pAIS->m_persistent_tracks.find(pAISTarget->MMSI);
785 if (itt != g_pAIS->m_persistent_tracks.end()) {
786 pAISTarget->b_show_track_old = show;
787 }
788 }
789 }
790 } // same as AISTargetListDialog::OnHideAllTracks /
791 // AISTargetListDialog::OnShowAllTracks
792}
793
794static void AisToggleTrack(wxString ais_mmsi) {
795 long mmsi = 0;
796 if (ais_mmsi.ToLong(&mmsi)) {
797 std::shared_ptr<AisTargetData> pAISTarget = NULL;
798 if (g_pAIS) pAISTarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
799
800 if (pAISTarget) {
801 pAISTarget->b_show_track_old =
802 pAISTarget->b_show_track; // Store current state before toggling
803 pAISTarget->b_show_track =
804 !pAISTarget->b_show_track; // Toggle visibility
805 }
806 }
807}
808
809static int GetContextMenuMask() { return g_canvas_context_menu_disable_mask; }
810
811static void SetContextMenuMask(int mask) {
812 g_canvas_context_menu_disable_mask = mask;
813}
814
815static bool IsAIS_CPAVisible(wxString ais_mmsi) {
816 long mmsi = 0;
817 ais_mmsi.ToLong(&mmsi);
818 auto myptarget = g_pAIS->Get_Target_Data_From_MMSI(mmsi);
819 if (myptarget)
820 return myptarget->b_show_AIS_CPA;
821 else
822 return false;
823}
824
825static void SetTrackVisibility(const wxString& track_GUID, bool viz) {
826 for (Track* ptrack : g_TrackList) {
827 if (ptrack->m_GUID == track_GUID) {
828 ptrack->SetVisible(viz);
829 break;
830 }
831 }
832}
833
834// Tide query API for plugins
835
836bool GetNearestTideStation(double lat, double lon,
837 PlugIn_TideStation* station) {
838 if (!ptcmgr || !ptcmgr->IsReady() || !station) return false;
839
840 auto stations = ptcmgr->GetStationsForLL(lat, lon);
841 for (auto& [dist, pIDX] : stations) {
842 if (pIDX->IDX_type == 'T' || pIDX->IDX_type == 't') {
843 // Find the array index for this IDX_entry pointer
844 for (int i = 1; i <= ptcmgr->Get_max_IDX(); i++) {
845#pragma GCC diagnostic push
846#pragma GCC diagnostic ignored "-Wstringop-truncation"
847 if (ptcmgr->GetIDX_entry(i) == pIDX) {
848 station->index = i;
849 strncpy(station->name, pIDX->IDX_station_name, 89);
850 station->name[89] = '\0';
851 station->lat = pIDX->IDX_lat;
852 station->lon = pIDX->IDX_lon;
853 return true;
854 }
855#pragma GCC diagnostic pop
856 }
857 }
858 }
859 return false;
860}
861
862bool GetTideHeight(int stationIndex, time_t time, float* height) {
863 if (!ptcmgr || !ptcmgr->IsReady() || !height) return false;
864 float dir = 0.0f;
865 return ptcmgr->GetTideOrCurrent(time, stationIndex, *height, dir);
866}
867
868std::unique_ptr<HostApi> GetHostApi() {
869 return std::make_unique<HostApi121>(HostApi121());
870}
871
872bool HostApi121::AddRoute(HostApi121::Route* route, bool permanent) {
873 return ::AddPlugInRouteExV3(route, permanent);
874}
875
877 return ::UpdatePlugInRouteExV3(route);
878}
879
880std::unique_ptr<HostApi121::Route> HostApi121::GetRoute(const wxString& guid) {
881 ::Route* route = g_pRouteMan->FindRouteByGUID(guid);
882 if (!route) return nullptr;
883
884 auto dst_route = std::make_unique<HostApi121::Route>();
885
886 for (RoutePoint* src_wp : *route->pRoutePointList) {
888 PlugInExV2FromRoutePoint(dst_wp, src_wp);
889 dst_route->pWaypointList->Append(dst_wp);
890 }
891 dst_route->m_NameString = route->m_RouteNameString;
892 dst_route->m_StartString = route->m_RouteStartString;
893 dst_route->m_EndString = route->m_RouteEndString;
894 dst_route->m_GUID = route->m_GUID;
895 dst_route->m_isActive = g_pRouteMan->GetpActiveRoute() == route;
896 dst_route->m_isVisible = route->IsVisible();
897 dst_route->m_Description = route->m_RouteDescription;
898 dst_route->m_PlannedSpeed = route->m_PlannedSpeed;
899 dst_route->m_Colour = route->m_Colour;
900 dst_route->m_style = route->m_style;
901 dst_route->m_PlannedDeparture = route->m_PlannedDeparture;
902 dst_route->m_TimeDisplayFormat = route->m_TimeDisplayFormat;
903
904 return dst_route;
905}
906
907wxString HostApi121::DropMarkPI(double lat, double lon) {
908 return ::DropMarkPI(lat, lon);
909}
910
911wxString HostApi121::RouteCreatePI(int canvas_index, bool start) {
912 return ::RouteCreatePI(canvas_index, start);
913}
914
915bool HostApi121::DoMeasurePI(int canvas_index, bool start) {
916 return ::DoMeasurePI(canvas_index, start);
917}
918
919wxString HostApi121::NavToHerePI(double lat, double lon) {
920 return ::NavToHerePI(lat, lon);
921}
922
923bool HostApi121::ActivateRoutePI(wxString route_guid, bool activate) {
924 return ::ActivateRoutePI(route_guid, activate);
925}
926
927void HostApi121::EnableDefaultConsole(bool enable) {
928 ::EnableDefaultConsole(enable);
929}
930
931void HostApi121::EnableDefaultContextMenus(bool enable) {
932 ::EnableDefaultContextMenus(enable);
933}
934
935void HostApi121::SetMinZoomScale(double min_scale) {
936 ::SetMinZoomScale(min_scale);
937}
938
939void HostApi121::SetMaxZoomScale(double max_scale) {
940 ::SetMaxZoomScale(max_scale);
941}
942
943std::shared_ptr<HostApi121::PiPointContext> HostApi121::GetContextAtPoint(
944 int x, int y, int canvas_index) {
945 return ::GetContextAtPoint(x, y, canvas_index);
946}
947
948wxBitmap HostApi121::GetObjectIcon_PlugIn(const wxString& name) {
949 return ::GetObjectIcon_PlugIn(name);
950}
951
952bool HostApi121::IsRouteActive(wxString route_guid) {
953 return ::IsRouteActive(route_guid);
954}
955
956void HostApi121::SetBoatPosition(double zlat, double zlon) {
957 ::SetBoatPosition(zlat, zlon);
958}
959
960void HostApi121::RouteInsertWaypoint(int canvas_index, wxString route_guid,
961 double zlat, double zlon) {
962 ::RouteInsertWaypoint(canvas_index, route_guid, zlat, zlon);
963}
964
965void HostApi121::RouteAppendWaypoint(int canvas_index, wxString route_guid) {
966 ::RouteAppendWaypoint(canvas_index, route_guid);
967}
968
969void HostApi121::FinishRoute(int canvas_index) { ::FinishRoute(canvas_index); }
970
971bool HostApi121::IsRouteBeingCreated(int canvas_index) {
972 return ::IsRouteBeingCreated(canvas_index);
973}
974
975bool HostApi121::AreRouteWaypointNamesVisible(wxString route_guid) {
976 return ::AreRouteWaypointNamesVisible(route_guid);
977}
978
979void HostApi121::ShowRouteWaypointNames(wxString route_guid, bool show) {
980 ::ShowRouteWaypointNames(route_guid, show);
981}
982
983void HostApi121::NavigateToWaypoint(wxString waypoint_guid) {
984 ::NavigateToWaypoint(waypoint_guid);
985}
986
987bool HostApi121::IsAISTrackVisible(const wxString& ais_mmsi) const {
988 return ::IsAISTrackVisible(ais_mmsi);
989}
990
991void HostApi121::AISToggleShowTrack(const wxString& ais_mmsi) {
992 ::AISToggleShowTrack(ais_mmsi);
993}
994
995bool HostApi121::IsAIS_CPAVisible(const wxString& ais_mmsi) const {
996 return ::IsAIS_CPAVisible(ais_mmsi);
997}
998
999void HostApi121::AISToggleShowCPA(const wxString& ais_mmsi) {
1000 ::AISToggleShowCPA(ais_mmsi);
1001}
1002
1003void HostApi121::ShowAISTargetQueryDialog(int canvas_index,
1004 const wxString& ais_mmsi) {
1005 ::ShowAISTargetQueryDialog(canvas_index, ais_mmsi);
1006}
1007
1008void HostApi121::ShowAISTargetList(int canvas_index) {
1009 ::ShowAISTargetList(canvas_index);
1010}
1011
1012bool HostApi121::IsMeasureActive(int canvas_index) {
1013 return ::IsMeasureActive(canvas_index);
1014}
1015
1016void HostApi121::CancelMeasure(int canvas_index) {
1017 ::CancelMeasure(canvas_index);
1018}
1019
1020void HostApi121::SetDepthUnitVisible(bool bviz) { ::SetDepthUnitVisible(bviz); }
1021
1022void HostApi121::SetOverzoomFlagVisible(bool viz) {
1023 ::SetOverzoomFlagVisible(viz);
1024}
1025
1026void HostApi121::AddNoShowDirectory(std::string chart_dir) {
1027 ::AddNoShowDirectory(chart_dir);
1028}
1029
1030void HostApi121::RemoveNoShowDirectory(std::string chart_dir) {
1031 ::RemoveNoShowDirectory(chart_dir);
1032}
1033
1034void HostApi121::ClearNoShowVector() { ::ClearNoShowVector(); }
1035
1036const std::vector<std::string>& HostApi121::GetNoShowVector() {
1037 return ::GetNoShowVector();
1038}
1039
1040bool HostApi121::SelectChartFamily(int CanvasIndex, ChartFamilyEnumPI Family) {
1041 return ::SelectChartFamily(CanvasIndex, Family);
1042};
1043
1044// Enhanced AIS Target List support
1045
1046void HostApi121::CenterToAisTarget(wxString ais_mmsi) {
1047 ::CenterToAisTarget(ais_mmsi);
1048}
1049
1050void HostApi121::AisTargetCreateWpt(wxString ais_mmsi) {
1051 ::AisTargetCreateWpt(ais_mmsi);
1052}
1053
1054void HostApi121::AisShowAllTracks(bool show) { ::AisShowAllTracks(show); }
1055
1056void HostApi121::AisToggleTrack(wxString ais_mmsi) {
1057 ::AisToggleTrack(ais_mmsi);
1058}
1059
1060// Context menu enable/disable, by object type
1061int HostApi121::GetContextMenuMask() { return ::GetContextMenuMask(); }
1062
1063void HostApi121::SetContextMenuMask(int mask) { ::SetContextMenuMask(mask); }
1064
1065void HostApi121::SetTrackVisibiiity(const wxString& track_GUID, bool viz) {
1066 ::SetTrackVisibility(track_GUID, viz);
1067}
1068
1069bool HostApi121::GetNearestTideStation(double lat, double lon,
1070 PlugIn_TideStation* station) {
1071 return ::GetNearestTideStation(lat, lon, station);
1072}
1073
1074bool HostApi121::GetTideHeight(int stationIndex, time_t time, float* height) {
1075 return ::GetTideHeight(stationIndex, time, height);
1076}
AisDecoder * g_pAIS
Global instance.
Class AisDecoder and helpers.
AIS target definitions.
std::unique_ptr< HostApi > GetHostApi()
HostApi factory,.
Definition api_121.cpp:868
std::vector< std::string > ChartDirectoryExcludedVector
Global instance.
Definition chartdb.cpp:73
ChartDB * ChartData
Global instance.
Definition chartdb.cpp:71
arrayofCanvasPtr g_canvasArray
Global instance.
Definition chcanv.cpp:173
Generic Chart canvas base.
ChartCanvas - Main chart display and interaction component.
Definition chcanv.h:173
int PrepareContextSelections(double lat, double lon)
Definition chcanv.cpp:8017
void Notify() override
Notify all listeners, no data supplied.
EventVar on_center_ais_target
Notified with a shared_ptr<const AisTargetData> when gFrame should center the given AIS target.
Definition gui_events.h:56
EventVar on_routes_update
Notified when list of routes is updated (no data in event)
Definition gui_events.h:65
EventVar gframe_update_status_bar
Notified when the top level status bas should be updated by gFrame.
Definition gui_events.h:50
virtual bool AddRoute(Route *route, bool permanent=true)
Add route to database, updated version of AddPlugInRouteExV2.
Definition api_121.cpp:872
virtual std::unique_ptr< HostApi121::Route > GetRoute(const wxString &guid)
Retrieve route from database.
Definition api_121.cpp:880
virtual bool UpdateRoute(Route *route)
Update database route, updated version of UpdatePlugInRouteExV2.
Definition api_121.cpp:876
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.
wxString m_GUID
Globally unique identifier.
wxString m_EndString
Description of route end point.
wxDateTime m_ETD
Estimated departure time in UTC, or wxInvalidDateTime if not set.
wxString m_MarkDescription
Optional description text.
wxString m_GUID
Globally unique identifier.
wxString m_TideStation
Tide Station Identifier.
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.
Extended waypoint class with additional navigation features.
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.
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.
bool IsActive
Active state (e.g. destination)
bool IsVisible
Visibility state on chart.
Represents a waypoint or mark within the navigation system.
Definition route_point.h:71
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_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.
Definition route.h:99
bool m_bRtIsSelected
Flag indicating whether this route is currently selected in the UI.
Definition route.h:203
double m_PlannedSpeed
Default planned speed for the route in knots.
Definition route.h:321
wxString m_RouteStartString
Name or description of the route's starting point.
Definition route.h:252
wxString m_RouteDescription
Additional descriptive information about the route.
Definition route.h:262
RoutePointList * pRoutePointList
Ordered list of waypoints (RoutePoints) that make up this route.
Definition route.h:336
wxString m_Colour
Color name for rendering the route on the chart.
Definition route.h:346
bool m_bDeleteOnArrival
Flag indicating whether the route should be deleted once navigation reaches the end.
Definition route.h:268
wxString m_RouteEndString
Name or description of the route's ending point.
Definition route.h:257
bool m_btemp
Flag indicating if this is a temporary route.
Definition route.h:351
wxPenStyle m_style
Style of the route line when rendered on the chart.
Definition route.h:293
wxString m_TimeDisplayFormat
Format for displaying times in the UI.
Definition route.h:331
wxString m_RouteNameString
User-assigned name for the route.
Definition route.h:247
wxString m_GUID
Globally unique identifier for this route.
Definition route.h:273
wxDateTime m_PlannedDeparture
Planned departure time for the route, in UTC.
Definition route.h:326
bool m_bIsInLayer
Flag indicating whether this route belongs to a layer.
Definition route.h:278
int m_lastMousePointIndex
Index of the most recently interacted with route point.
Definition route.h:298
bool DeleteRoute(Route *pRoute)
Definition routeman.cpp:765
bool ActivateRoute(Route *pRouteToActivate, RoutePoint *pStartPoint=NULL)
Activates a route for navigation.
Definition routeman.cpp:222
Represents a track, which is a series of connected track points.
Definition track.h:117
Misc GUI event vars, a singleton.
Miscellaneous globals primarely used by gui layer, not persisted in configuration file.
MySQL based storage for routes, tracks, etc.
User notifications manager.
PlugIn Object Definition/API.
ChartFamilyEnumPI
Enumeration of chart families (broad categories).
@ PI_CHART_FAMILY_VECTOR
Vector chart formats (S-57, CM93, etc.)
wxWindow * GetCanvasByIndex(int canvasIndex)
Gets chart canvas window by index.
double gLat
Vessel's current latitude in decimal degrees.
Definition own_ship.cpp:26
double gCog
Course over ground in degrees (0-359.99).
Definition own_ship.cpp:28
double gSog
Speed over ground in knots.
Definition own_ship.cpp:29
double gLon
Vessel's current longitude in decimal degrees.
Definition own_ship.cpp:27
Position, course, speed, etc.
Route abstraction.
Routeman * g_pRouteMan
Global instance.
Definition routeman.cpp:60
RouteList * pRouteList
Global instance.
Definition routeman.cpp:66
Select * pSelect
Global instance.
Definition select.cpp:36
Represents an entry in the chart table, containing information about a single chart.
Definition chartdbs.h:187
TCMgr * ptcmgr
Global instance.
Definition tcmgr.cpp:42
Tide and Current Manager @TODO Add original author copyright.
std::vector< Track * > g_TrackList
Global instance.
Definition track.cpp:96
Recorded track abstraction.