OpenCPN Partial API docs
Loading...
Searching...
No Matches
Routeman Class Reference

Public Member Functions

 Routeman (struct RoutePropDlgCtx prop_dlg_ctx, struct RoutemanDlgCtx route_dlg_ctx)
 
bool DeleteTrack (Track *pTrack)
 
bool DeleteRoute (Route *pRoute, NavObjectChanges *nav_obj_changes)
 
void DeleteAllRoutes (NavObjectChanges *nav_obj_changes)
 
bool IsRouteValid (Route *pRoute)
 
RouteFindRouteByGUID (const wxString &guid)
 
TrackFindTrackByGUID (const wxString &guid)
 
RouteFindRouteContainingWaypoint (RoutePoint *pWP)
 
RouteFindVisibleRouteContainingWaypoint (RoutePoint *pWP)
 
wxArrayPtrVoid * GetRouteArrayContaining (RoutePoint *pWP)
 Find all routes that contain the given waypoint.
 
bool DoesRouteContainSharedPoints (Route *pRoute)
 
void RemovePointFromRoute (RoutePoint *point, Route *route, int route_state)
 
bool ActivateRoute (Route *pRouteToActivate, RoutePoint *pStartPoint=NULL)
 Activates a route for navigation.
 
bool ActivateRoutePoint (Route *pA, RoutePoint *pRP)
 Activates a specific waypoint within a route for navigation.
 
bool ActivateNextPoint (Route *pr, bool skipped)
 Activates the next waypoint in a route when the current waypoint is reached.
 
RoutePointFindBestActivatePoint (Route *pR, double lat, double lon, double cog, double sog)
 
bool UpdateAutopilot ()
 
bool DeactivateRoute (bool b_arrival=false)
 
bool IsAnyRouteActive (void)
 
bool GetArrival ()
 
RouteGetpActiveRoute ()
 
RoutePointGetpActiveRouteSegmentBeginPoint ()
 
RoutePointGetpActivePoint ()
 
double GetCurrentRngToActivePoint ()
 
double GetCurrentBrgToActivePoint ()
 
double GetCurrentRngToActiveNormalArrival ()
 
double GetCurrentXTEToActivePoint ()
 
void ZeroCurrentXTEToActivePoint ()
 
double GetCurrentSegmentCourse ()
 
int GetXTEDir ()
 
void SetColorScheme (ColorScheme cs, double displayDPmm)
 
wxPen * GetRoutePen (void)
 
wxPen * GetTrackPen (void)
 
wxPen * GetSelectedRoutePen (void)
 
wxPen * GetActiveRoutePen (void)
 
wxPen * GetActiveRoutePointPen (void)
 
wxPen * GetRoutePointPen (void)
 
wxBrush * GetRouteBrush (void)
 
wxBrush * GetSelectedRouteBrush (void)
 
wxBrush * GetActiveRouteBrush (void)
 
wxBrush * GetActiveRoutePointBrush (void)
 
wxBrush * GetRoutePointBrush (void)
 
wxString GetRouteReverseMessage (void)
 
wxString GetRouteResequenceMessage (void)
 
struct RoutemanDlgCtxGetDlgContext ()
 
NMEA0183 GetNMEA0183 ()
 
EventVarGetMessageSentEventVar ()
 
std::vector< DriverHandleGetOutpuDriverArray ()
 

Public Attributes

bool m_bDataValid
 
EventVar json_msg
 Notified with message targeting all plugins.
 
EventVar json_leg_info
 Notified with a shared_ptr<ActiveLegDat>, leg info to all plugins.
 
EventVar on_message_sent
 Notified when a message available as GetString() is sent to garmin.
 
EventVar on_routes_update
 Notified when list of routes is updated (no data in event)
 

Friends

class RoutemanGui
 

Detailed Description

Definition at line 115 of file routeman.h.

Constructor & Destructor Documentation

◆ Routeman()

Routeman::Routeman ( struct RoutePropDlgCtx  prop_dlg_ctx,
struct RoutemanDlgCtx  route_dlg_ctx 
)

Definition at line 107 of file routeman.cpp.

◆ ~Routeman()

Routeman::~Routeman ( )

Definition at line 122 of file routeman.cpp.

Member Function Documentation

◆ ActivateNextPoint()

bool Routeman::ActivateNextPoint ( Route pr,
bool  skipped 
)

Activates the next waypoint in a route when the current waypoint is reached.

This function handles the transition between waypoints by:

  1. Deactivating the current waypoint
  2. Sending arrival notifications to plugins
  3. Finding and activating the next waypoint in sequence
  4. Setting up visual indicators for the new active waypoint
  5. Resetting arrival detection parameters

This function is called automatically when a waypoint arrival is detected, or manually when skipping a waypoint.

Parameters
prPointer to the active route
skippedBoolean indicating if this is a manual skip (true) or normal arrival (false)
Returns
true if successfully activated the next waypoint, false if at the end of the route

if (pRoutePropDialog && pRoutePropDialog->IsShown()) { if (pRoutePropDialog->GetRoute() == pr) { pRoutePropDialog->SetEnroutePoint(pActivePoint); } }

Definition at line 394 of file routeman.cpp.

◆ ActivateRoute()

bool Routeman::ActivateRoute ( Route pRouteToActivate,
RoutePoint pStartPoint = NULL 
)

Activates a route for navigation.

This function sets up a route for active navigation by:

  1. Setting up the route for plugin notifications
  2. Configuring output drivers for navigation data
  3. Creating a "virtual" waypoint at the vessel's current position if starting at the beginning of the route
  4. Activating the first/selected waypoint as the active navigation target
  5. Initializing arrival detection parameters

When a route is activated, OpenCPN starts providing navigation data to autopilot systems and plugins, updating the display to show the active route, and monitoring for waypoint arrivals.

Parameters
pRouteToActivatePointer to the Route object to activate
pStartPointOptional pointer to a specific RoutePoint to start from (if NULL, starts from the first point in the route)
Returns
true if route was successfully activated

Definition at line 260 of file routeman.cpp.

◆ ActivateRoutePoint()

bool Routeman::ActivateRoutePoint ( Route pA,
RoutePoint pRP 
)

Activates a specific waypoint within a route for navigation.

This function sets up navigation to a specific waypoint by:

  1. Setting up waypoint plugin notifications
  2. Establishing the active waypoint and its preceding segment
  3. Creating a "virtual" waypoint at the vessel's current position if this is the first point in the route
  4. Setting up visual indicators (making the active point blink)
  5. Initializing arrival detection parameters

This function is called by ActivateRoute() and is also used when manually changing the active waypoint during navigation.

Parameters
pAPointer to the route containing the waypoint
pRP_targetPointer to the RoutePoint to set as the active target
Returns
true if waypoint was successfully activated

if (pRoutePropDialog && pRoutePropDialog->IsShown()) { if (pRoutePropDialog->GetRoute() == pA) { pRoutePropDialog->SetEnroutePoint(pActivePoint); } }

Definition at line 319 of file routeman.cpp.

◆ DeactivateRoute()

bool Routeman::DeactivateRoute ( bool  b_arrival = false)

Definition at line 446 of file routeman.cpp.

◆ DeleteAllRoutes()

void Routeman::DeleteAllRoutes ( NavObjectChanges nav_obj_changes)

Definition at line 911 of file routeman.cpp.

◆ DeleteRoute()

bool Routeman::DeleteRoute ( Route pRoute,
NavObjectChanges nav_obj_changes 
)

if (pRoutePropDialog && (pRoutePropDialog->IsShown()) && (pRoute == pRoutePropDialog->GetRoute())) { pRoutePropDialog->Hide(); }

Definition at line 835 of file routeman.cpp.

◆ DeleteTrack()

bool Routeman::DeleteTrack ( Track pTrack)

Definition at line 802 of file routeman.cpp.

◆ DoesRouteContainSharedPoints()

bool Routeman::DoesRouteContainSharedPoints ( Route pRoute)

Definition at line 764 of file routeman.cpp.

◆ FindBestActivatePoint()

RoutePoint * Routeman::FindBestActivatePoint ( Route pR,
double  lat,
double  lon,
double  cog,
double  sog 
)

Definition at line 229 of file routeman.cpp.

◆ FindRouteByGUID()

Route * Routeman::FindRouteByGUID ( const wxString &  guid)

Definition at line 995 of file routeman.cpp.

◆ FindRouteContainingWaypoint()

Route * Routeman::FindRouteContainingWaypoint ( RoutePoint pWP)

Definition at line 136 of file routeman.cpp.

◆ FindTrackByGUID()

Track * Routeman::FindTrackByGUID ( const wxString &  guid)

Definition at line 1007 of file routeman.cpp.

◆ FindVisibleRouteContainingWaypoint()

Route * Routeman::FindVisibleRouteContainingWaypoint ( RoutePoint pWP)

Definition at line 155 of file routeman.cpp.

◆ GetActiveRouteBrush()

wxBrush * Routeman::GetActiveRouteBrush ( void  )
inline

Definition at line 243 of file routeman.h.

◆ GetActiveRoutePen()

wxPen * Routeman::GetActiveRoutePen ( void  )
inline

Definition at line 238 of file routeman.h.

◆ GetActiveRoutePointBrush()

wxBrush * Routeman::GetActiveRoutePointBrush ( void  )
inline

Definition at line 244 of file routeman.h.

◆ GetActiveRoutePointPen()

wxPen * Routeman::GetActiveRoutePointPen ( void  )
inline

Definition at line 239 of file routeman.h.

◆ GetArrival()

bool Routeman::GetArrival ( )
inline

Definition at line 216 of file routeman.h.

◆ GetCurrentBrgToActivePoint()

double Routeman::GetCurrentBrgToActivePoint ( )
inline

Definition at line 225 of file routeman.h.

◆ GetCurrentRngToActiveNormalArrival()

double Routeman::GetCurrentRngToActiveNormalArrival ( )
inline

Definition at line 226 of file routeman.h.

◆ GetCurrentRngToActivePoint()

double Routeman::GetCurrentRngToActivePoint ( )
inline

Definition at line 224 of file routeman.h.

◆ GetCurrentSegmentCourse()

double Routeman::GetCurrentSegmentCourse ( )
inline

Definition at line 231 of file routeman.h.

◆ GetCurrentXTEToActivePoint()

double Routeman::GetCurrentXTEToActivePoint ( )
inline

Definition at line 229 of file routeman.h.

◆ GetDlgContext()

struct RoutemanDlgCtx & Routeman::GetDlgContext ( )
inline

Definition at line 249 of file routeman.h.

◆ GetMessageSentEventVar()

EventVar & Routeman::GetMessageSentEventVar ( )
inline

Definition at line 251 of file routeman.h.

◆ GetNMEA0183()

NMEA0183 Routeman::GetNMEA0183 ( )
inline

Definition at line 250 of file routeman.h.

◆ GetOutpuDriverArray()

std::vector< DriverHandle > Routeman::GetOutpuDriverArray ( )
inline

Definition at line 252 of file routeman.h.

◆ GetpActivePoint()

RoutePoint * Routeman::GetpActivePoint ( )
inline

Definition at line 223 of file routeman.h.

◆ GetpActiveRoute()

Route * Routeman::GetpActiveRoute ( )
inline

Definition at line 218 of file routeman.h.

◆ GetpActiveRouteSegmentBeginPoint()

RoutePoint * Routeman::GetpActiveRouteSegmentBeginPoint ( )
inline

Definition at line 219 of file routeman.h.

◆ GetRouteArrayContaining()

wxArrayPtrVoid * Routeman::GetRouteArrayContaining ( RoutePoint pWP)

Find all routes that contain the given waypoint.

This function searches through all routes in the route list and returns an array of route pointers for each route that contains the specified waypoint.

Parameters
pWPPointer to the waypoint to search for.
Returns
Pointer to wxArrayPtrVoid containing routes, or nullptr if no routes contain the waypoint. The caller is responsible for deleting the returned array when done with it.

Definition at line 174 of file routeman.cpp.

◆ GetRouteBrush()

wxBrush * Routeman::GetRouteBrush ( void  )
inline

Definition at line 241 of file routeman.h.

◆ GetRoutePen()

wxPen * Routeman::GetRoutePen ( void  )
inline

Definition at line 235 of file routeman.h.

◆ GetRoutePointBrush()

wxBrush * Routeman::GetRoutePointBrush ( void  )
inline

Definition at line 245 of file routeman.h.

◆ GetRoutePointPen()

wxPen * Routeman::GetRoutePointPen ( void  )
inline

Definition at line 240 of file routeman.h.

◆ GetRouteResequenceMessage()

wxString Routeman::GetRouteResequenceMessage ( void  )

Definition at line 989 of file routeman.cpp.

◆ GetRouteReverseMessage()

wxString Routeman::GetRouteReverseMessage ( void  )

Definition at line 983 of file routeman.cpp.

◆ GetSelectedRouteBrush()

wxBrush * Routeman::GetSelectedRouteBrush ( void  )
inline

Definition at line 242 of file routeman.h.

◆ GetSelectedRoutePen()

wxPen * Routeman::GetSelectedRoutePen ( void  )
inline

Definition at line 237 of file routeman.h.

◆ GetTrackPen()

wxPen * Routeman::GetTrackPen ( void  )
inline

Definition at line 236 of file routeman.h.

◆ GetXTEDir()

int Routeman::GetXTEDir ( )
inline

Definition at line 232 of file routeman.h.

◆ IsAnyRouteActive()

bool Routeman::IsAnyRouteActive ( void  )
inline

Definition at line 215 of file routeman.h.

◆ IsRouteValid()

bool Routeman::IsRouteValid ( Route pRoute)

Definition at line 126 of file routeman.cpp.

◆ RemovePointFromRoute()

void Routeman::RemovePointFromRoute ( RoutePoint point,
Route route,
int  route_state 
)

Definition at line 205 of file routeman.cpp.

◆ SetColorScheme()

void Routeman::SetColorScheme ( ColorScheme  cs,
double  displayDPmm 
)

Definition at line 938 of file routeman.cpp.

◆ UpdateAutopilot()

bool Routeman::UpdateAutopilot ( )

Definition at line 482 of file routeman.cpp.

◆ ZeroCurrentXTEToActivePoint()

void Routeman::ZeroCurrentXTEToActivePoint ( )

Definition at line 1015 of file routeman.cpp.

Friends And Related Symbol Documentation

◆ RoutemanGui

friend class RoutemanGui
friend

Definition at line 116 of file routeman.h.

Member Data Documentation

◆ json_leg_info

EventVar Routeman::json_leg_info

Notified with a shared_ptr<ActiveLegDat>, leg info to all plugins.


Definition at line 262 of file routeman.h.

◆ json_msg

EventVar Routeman::json_msg

Notified with message targeting all plugins.

Contains a message type string and a wxJSONValue shared_ptr.

Definition at line 259 of file routeman.h.

◆ m_bDataValid

bool Routeman::m_bDataValid

Definition at line 253 of file routeman.h.

◆ on_message_sent

EventVar Routeman::on_message_sent

Notified when a message available as GetString() is sent to garmin.

Definition at line 265 of file routeman.h.

◆ on_routes_update

EventVar Routeman::on_routes_update

Notified when list of routes is updated (no data in event)

Definition at line 268 of file routeman.h.


The documentation for this class was generated from the following files: