OpenCPN Partial API docs
Loading...
Searching...
No Matches
dashboard_pi Class Reference
Inheritance diagram for dashboard_pi:
opencpn_plugin_18

Public Member Functions

 dashboard_pi (void *ppimgr)
 
int Init () override
 Initialize the plugin and declare its capabilities.
 
bool DeInit () override
 Clean up plugin resources.
 
void Notify () override
 
int GetAPIVersionMajor () override
 Returns the major version number of the plugin API that this plugin supports.
 
int GetAPIVersionMinor () override
 Returns the minor version number of the plugin API that this plugin supports.
 
int GetPlugInVersionMajor () override
 Returns the major version number of the plugin itself.
 
int GetPlugInVersionMinor () override
 Returns the minor version number of the plugin itself.
 
wxBitmap * GetPlugInBitmap () override
 Get the plugin's icon bitmap.
 
wxString GetCommonName () override
 Get the plugin's common (short) name.
 
wxString GetShortDescription () override
 Get a brief description of the plugin.
 
wxString GetLongDescription () override
 Get detailed plugin information.
 
void SetNMEASentence (wxString &sentence) override
 Receive all NMEA 0183 sentences from OpenCPN.
 
void SetPositionFixEx (PlugIn_Position_Fix_Ex &pfix) override
 Updates plugin with extended position fix data at regular intervals.
 
void SetCursorLatLon (double lat, double lon) override
 Receives cursor lat/lon position updates.
 
int GetToolbarToolCount () override
 Returns the number of toolbar tools this plugin provides.
 
void OnToolbarToolCallback (int id) override
 Handles toolbar tool clicks.
 
void ShowPreferencesDialog (wxWindow *parent) override
 Shows the plugin preferences dialog.
 
void SetColorScheme (PI_ColorScheme cs) override
 Updates plugin color scheme.
 
void OnPaneClose (wxAuiManagerEvent &event)
 
void UpdateAuiStatus () override
 Updates AUI manager status.
 
bool SaveConfig ()
 
void PopulateContextMenu (wxMenu *menu)
 
void ShowDashboard (size_t id, bool visible)
 
int GetToolbarItemId () const
 
int GetDashboardWindowShownCount ()
 
void SetPluginMessage (wxString &message_id, wxString &message_body) override
 
void UpdateSumLog (bool)
 

Detailed Description

Definition at line 198 of file dashboard_pi.h.

Constructor & Destructor Documentation

◆ dashboard_pi()

dashboard_pi::dashboard_pi ( void *  ppimgr)

Definition at line 491 of file dashboard_pi.cpp.

◆ ~dashboard_pi()

dashboard_pi::~dashboard_pi ( )
override

Definition at line 501 of file dashboard_pi.cpp.

Member Function Documentation

◆ DeInit()

bool dashboard_pi::DeInit ( void  )
overridevirtual

Clean up plugin resources.

Called by OpenCPN when plugin is disabled. Shall release any resources allocated by the plugin. Good place to persist plugin configuration.

Returns
True if cleanup successful, False if error

Reimplemented from opencpn_plugin.

Definition at line 709 of file dashboard_pi.cpp.

◆ GetAPIVersionMajor()

int dashboard_pi::GetAPIVersionMajor ( )
overridevirtual

Returns the major version number of the plugin API that this plugin supports.

This method must be implemented by all plugins to declare compatibility with a specific major version of the OpenCPN plugin API.

Returns
Integer value representing the major API version (e.g., 1)
Note
Major version changes indicate incompatible API changes
Current API major version is defined by API_VERSION_MAJOR

Reimplemented from opencpn_plugin.

Definition at line 955 of file dashboard_pi.cpp.

◆ GetAPIVersionMinor()

int dashboard_pi::GetAPIVersionMinor ( )
overridevirtual

Returns the minor version number of the plugin API that this plugin supports.

This method must be implemented by all plugins to declare compatibility with a specific minor version of the OpenCPN plugin API.

Returns
Integer value representing the minor API version (e.g., 19)
Note
Minor version changes indicate backward-compatible API additions
Current API minor version is defined by API_VERSION_MINOR

Reimplemented from opencpn_plugin.

Definition at line 957 of file dashboard_pi.cpp.

◆ GetCommonName()

wxString dashboard_pi::GetCommonName ( )
overridevirtual

Get the plugin's common (short) name.

This required method should return a short name used to identify the plugin in lists and menus.

Returns
wxString containing plugin name (e.g., "Dashboard")
Note
Should be valid and meaningful even before Init() is called
Used by the plugin manager GUI

Reimplemented from opencpn_plugin.

Definition at line 965 of file dashboard_pi.cpp.

◆ GetDashboardWindowShownCount()

int dashboard_pi::GetDashboardWindowShownCount ( )

Definition at line 3338 of file dashboard_pi.cpp.

◆ GetLongDescription()

wxString dashboard_pi::GetLongDescription ( )
overridevirtual

Get detailed plugin information.

This required method should return a longer description including:

  • Detailed feature list
  • Version information
  • Author/copyright details
Returns
wxString containing detailed plugin information
Note
Should be valid before Init() is called
Used in plugin manager details view

Reimplemented from opencpn_plugin.

Definition at line 971 of file dashboard_pi.cpp.

◆ GetPlugInBitmap()

wxBitmap * dashboard_pi::GetPlugInBitmap ( )
overridevirtual

Get the plugin's icon bitmap.

FIXME static wxBitmap* LoadSVG(const wxString filename, unsigned int width, unsigned int height) { if (!gFrame) return new wxBitmap(width, height); // We are headless.

This method should return a wxBitmap containing the plugin's icon for display in the plugin manager and other UI elements.

Returns
Pointer to wxBitmap containing icon, NULL for default icon
Note
The bitmap should be square, typically 32x32 pixels
Ownership of the bitmap remains with the plugin
Icon should be visible on both light and dark backgrounds

#ifdef ANDROID return loadAndroidSVG(filename, width, height); #elif defined(ocpnUSE_SVG) wxSVGDocument svgDoc; if (svgDoc.Load(filename)) return new wxBitmap(svgDoc.Render(width, height, NULL, true, true)); else return new wxBitmap(width, height); #else return new wxBitmap(width, height); #endif }

wxBitmap* opencpn_plugin::GetPlugInBitmap() { auto bitmap = PluginLoader::GetInstance()->GetPluginDefaultIcon(); return const_cast<wxBitmap*>(bitmap); }

Reimplemented from opencpn_plugin.

Definition at line 963 of file dashboard_pi.cpp.

◆ GetPlugInVersionMajor()

int dashboard_pi::GetPlugInVersionMajor ( )
overridevirtual

Returns the major version number of the plugin itself.

This method should return the plugin's own major version number, which is used by OpenCPN for plugin version management and display.

Returns
Integer value representing the plugin's major version
Note
Part of semantic version (major.minor.patch)
Major version changes indicate incompatible API changes

Reimplemented from opencpn_plugin.

Definition at line 959 of file dashboard_pi.cpp.

◆ GetPlugInVersionMinor()

int dashboard_pi::GetPlugInVersionMinor ( )
overridevirtual

Returns the minor version number of the plugin itself.

This method should return the plugin's own minor version number, which is used by OpenCPN for plugin version management and display.

Returns
Integer value representing the plugin's minor version
Note
Part of semantic version (major.minor.patch)
Minor version changes indicate backward-compatible feature additions

Reimplemented from opencpn_plugin.

Definition at line 961 of file dashboard_pi.cpp.

◆ GetShortDescription()

wxString dashboard_pi::GetShortDescription ( )
overridevirtual

Get a brief description of the plugin.

This required method should return a short description (1-2 sentences) explaining the plugin's basic functionality.

Returns
wxString containing brief description
Note
Should be valid before Init() is called
Used in plugin manager list view

Reimplemented from opencpn_plugin.

Definition at line 967 of file dashboard_pi.cpp.

◆ GetToolbarItemId()

int dashboard_pi::GetToolbarItemId ( ) const
inline

Definition at line 231 of file dashboard_pi.h.

◆ GetToolbarToolCount()

int dashboard_pi::GetToolbarToolCount ( void  )
overridevirtual

Returns the number of toolbar tools this plugin provides.

This method should return how many toolbar buttons/tools the plugin will add. Must be implemented if plugin sets INSTALLS_TOOLBAR_TOOL capability flag.

Returns
Number of toolbar items to be added
Note
Return 0 if no toolbar items
Each tool needs unique ID for callbacks
Called during plugin initialization

Reimplemented from opencpn_plugin.

Definition at line 3256 of file dashboard_pi.cpp.

◆ Init()

int dashboard_pi::Init ( void  )
overridevirtual

Initialize the plugin and declare its capabilities.

This required method is called by OpenCPN during plugin loading. It should:

  • Set up any required plugin resources
  • Register capabilities by returning a bitwise OR of WANTS_ and INSTALLS_ flags
Returns
Integer capability flags indicating plugin features:
  • WANTS_OVERLAY_CALLBACK
  • WANTS_CURSOR_LATLON
  • WANTS_TOOLBAR_CALLBACK
  • etc. (see enum definitions)

Reimplemented from opencpn_plugin.

Definition at line 510 of file dashboard_pi.cpp.

◆ Notify()

void dashboard_pi::Notify ( )
override

Definition at line 751 of file dashboard_pi.cpp.

◆ OnPaneClose()

void dashboard_pi::OnPaneClose ( wxAuiManagerEvent &  event)

Definition at line 3352 of file dashboard_pi.cpp.

◆ OnToolbarToolCallback()

void dashboard_pi::OnToolbarToolCallback ( int  id)
overridevirtual

Handles toolbar tool clicks.

Called when the user clicks a plugin's toolbar button. Must be implemented if plugin declares WANTS_TOOLBAR_CALLBACK capability.

Parameters
idThe tool ID assigned when tool was added via InsertPlugInTool()

Reimplemented from opencpn_plugin.

Definition at line 3374 of file dashboard_pi.cpp.

◆ PopulateContextMenu()

void dashboard_pi::PopulateContextMenu ( wxMenu *  menu)

Definition at line 4094 of file dashboard_pi.cpp.

◆ SaveConfig()

bool dashboard_pi::SaveConfig ( )

Definition at line 3822 of file dashboard_pi.cpp.

◆ SetColorScheme()

void dashboard_pi::SetColorScheme ( PI_ColorScheme  cs)
overridevirtual

Updates plugin color scheme.

Called when OpenCPN's color scheme changes between day, dusk and night modes. Plugins should update their UI colors to match the new scheme.

Parameters
csNew color scheme to use:
  • PI_GLOBAL_COLOR_SCHEME_RGB: Unmodified RGB colors
  • PI_GLOBAL_COLOR_SCHEME_DAY: Optimized for bright conditions
  • PI_GLOBAL_COLOR_SCHEME_DUSK: Optimized for low light
  • PI_GLOBAL_COLOR_SCHEME_NIGHT: Optimized for dark conditions
Note
Follow the patterns documented in the PI_ColorScheme enum.

Reimplemented from opencpn_plugin.

Definition at line 3329 of file dashboard_pi.cpp.

◆ SetCursorLatLon()

void dashboard_pi::SetCursorLatLon ( double  lat,
double  lon 
)
overridevirtual

Receives cursor lat/lon position updates.

This method is called when the cursor moves over the chart. Must be implemented if plugin sets WANTS_CURSOR_LATLON flag.

Parameters
latCursor latitude in decimal degrees
lonCursor longitude in decimal degrees
Note
High frequency updates - keep processing quick
Only called when cursor over chart window

Reimplemented from opencpn_plugin.

Definition at line 3219 of file dashboard_pi.cpp.

◆ SetNMEASentence()

void dashboard_pi::SetNMEASentence ( wxString &  sentence)
overridevirtual

Receive all NMEA 0183 sentences from OpenCPN.

Plugins can implement this method to receive all NMEA 0183 sentences. They must set the WANTS_NMEA_SENTENCES capability flag to receive updates.

Parameters
sentenceThe NMEA 0183 sentence
Note
For handling NMEA/SignalK messages, a newer recommended message API is available: Plugin Message API Documentation

Reimplemented from opencpn_plugin.

Definition at line 1016 of file dashboard_pi.cpp.

◆ SetPluginMessage()

void dashboard_pi::SetPluginMessage ( wxString &  message_id,
wxString &  message_body 
)
overridevirtual

Reimplemented from opencpn_plugin_18.

Definition at line 3224 of file dashboard_pi.cpp.

◆ SetPositionFixEx()

void dashboard_pi::SetPositionFixEx ( PlugIn_Position_Fix_Ex pfix)
overridevirtual

Updates plugin with extended position fix data at regular intervals.

Called by OpenCPN approximately once per second (1 Hz), regardless of how frequently new position data is actually received from GPS/NMEA sources. This provides plugins with a steady, predictable update rate for navigation calculations and display updates.

Extends SetPositionFix() by adding magnetic and true heading information when available from HDM/HDT NMEA sentences.

Parameters
pfixExtended position fix data containing:
  • All basic position fix fields from SetPositionFix()
  • Hdm: Magnetic heading in degrees (0-360°, NaN if unavailable)
  • Hdt: True heading in degrees (0-360°, NaN if unavailable)
Note
Only called if plugin declares WANTS_NMEA_EVENTS capability
See also
SetPositionFix() for basic position data without heading

Reimplemented from opencpn_plugin_18.

Definition at line 3132 of file dashboard_pi.cpp.

◆ ShowDashboard()

void dashboard_pi::ShowDashboard ( size_t  id,
bool  visible 
)

Definition at line 4109 of file dashboard_pi.cpp.

◆ ShowPreferencesDialog()

void dashboard_pi::ShowPreferencesDialog ( wxWindow *  parent)
overridevirtual

Shows the plugin preferences dialog.

This method is called when the user requests the plugin preferences through the OpenCPN options dialog. Must be implemented if plugin sets WANTS_PREFERENCES flag.

Parameters
parentParent window to use for dialog
Note
Different from toolbox panel preferences
Use for simple plugin-specific settings
Modal dialog recommended

Reimplemented from opencpn_plugin.

Definition at line 3258 of file dashboard_pi.cpp.

◆ UpdateAuiStatus()

void dashboard_pi::UpdateAuiStatus ( void  )
overridevirtual

Updates AUI manager status.

Called to notify plugins using wxAUI interface that they should update their AUI managed windows and panes. Must be implemented if plugin declares USES_AUI_MANAGER capability.

Reimplemented from opencpn_plugin.

Definition at line 3462 of file dashboard_pi.cpp.

◆ UpdateSumLog()

void dashboard_pi::UpdateSumLog ( bool  write)

Definition at line 6602 of file dashboard_pi.cpp.


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