OpenCPN Partial API docs
Loading...
Searching...
No Matches
GRIBUICtrlBar Class Reference
Inheritance diagram for GRIBUICtrlBar:
GRIBUICtrlBarBase

Public Member Functions

 GRIBUICtrlBar (wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos, const wxSize &size, long style, GribPi *ppi, double scale_factor)
 
void OpenFile (bool newestFile=false)
 
void ContextMenuItemCallback (int id)
 
void SetFactoryOptions ()
 
wxDateTime TimelineTime ()
 Returns the selected time in the GRIB timeline widget.
 
GribTimelineRecordSetGetTimeLineRecordSet (wxDateTime time)
 Retrieves or creates a temporally interpolated GRIB record set for a specific timestamp.
 
void StopPlayBack ()
 
void TimelineChanged ()
 
void CreateActiveFileFromNames (const wxArrayString &filenames)
 
void PopulateComboDataList ()
 
void ComputeBestForecastForNow ()
 
void SetViewPortUnderMouse (PlugIn_ViewPort *vp)
 Set the ViewPort under the mouse.
 
void SetViewPortWithFocus (PlugIn_ViewPort *vp)
 Set the ViewPort that has the focus.
 
void SetTimeLineMax (bool SetValue)
 
void SetCursorLatLon (double lat, double lon)
 
void UpdateTrackingControl ()
 Schedules an update of the GRIB data values display at current cursor position.
 
void SetDialogsStyleSizePosition (bool force_recompute=false)
 
void SetRequestButtonBitmap (int type)
 Set the icon and tooltip for the download request button.
 
GRIBUICDataGetCDataDialog ()
 
bool InDataPlot (int id)
 
void SetScaledBitmap (double factor)
 
void OpenFileFromJSON (wxString json)
 
double getTimeInterpolatedValue (int idx, double lon, double lat, wxDateTime t)
 
bool getTimeInterpolatedValues (double &M, double &A, int idx1, int idx2, double lon, double lat, wxDateTime t)
 
void DoZoomToCenter ()
 
wxString GetGribDir ()
 
void GetProjectedLatLon (int &x, int &y, PlugIn_ViewPort *vp)
 Gets the projected position of vessel based on current course, speed and forecast time.
 
bool ProjectionEnabled ()
 
void DoOnMouseEvent (wxMouseEvent &event)
 
- Public Member Functions inherited from GRIBUICtrlBarBase
 GRIBUICtrlBarBase (wxWindow *parent, wxWindowID id=CONTROL_BAR, const wxString &title=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE|wxSYSTEM_MENU, double scale_factor=1.0)
 
void SetScaleFactor (double factor)
 
double GetScaleFactor () const
 

Public Attributes

wxWindow * pParent
 
GribOverlaySettings m_OverlaySettings
 Settings that control how GRIB data is displayed and overlaid.
 
GribTimelineRecordSetm_pTimelineSet
 Current set of GRIB records for timeline playback.
 
wxTimer m_tPlayStop
 Timer for controlling GRIB animation playback.
 
GribPipPlugIn
 Plugin instance that owns this control bar.
 
GribRequestSettingpReq_Dialog
 
GRIBFilem_bGRIBActiveFile
 Currently active GRIB file being displayed.
 
bool m_bDataPlot [GribOverlaySettings::GEO_ALTITUDE]
 
bool m_CDataIsShown
 
int m_ZoneSelAllowed
 
int m_old_DialogStyle
 
double m_highlight_latmax
 
double m_highlight_lonmax
 
double m_highlight_latmin
 
double m_highlight_lonmin
 
wxString m_grib_dir
 Directory containing GRIB files.
 
wxArrayString m_file_names
 List of GRIB filenames being displayed.
 
- Public Attributes inherited from GRIBUICtrlBarBase
wxBitmapButton * m_bpAltitude
 
wxSlider * m_sTimeline
 

Protected Member Functions

void OnClose (wxCloseEvent &event) override
 
void OnSize (wxSizeEvent &event) override
 
void OnPaint (wxPaintEvent &event) override
 
void OnSettings (wxCommandEvent &event) override
 
void OnPlayStop (wxCommandEvent &event) override
 
void OnZoomToCenterClick (wxCommandEvent &event) override
 
void OnPrev (wxCommandEvent &event) override
 
void OnMouseEvent (wxMouseEvent &event) override
 
void OnRecordForecast (wxCommandEvent &event) override
 
void OnNext (wxCommandEvent &event) override
 
void OnNow (wxCommandEvent &event) override
 
void OnAltitude (wxCommandEvent &event) override
 
void OnOpenFile (wxCommandEvent &event) override
 
void OnRequestForecastData (wxCommandEvent &event) override
 Callback invoked when user clicks download/request forecast data.
 
void OnCompositeDialog (wxCommandEvent &event) override
 
void OnTimeline (wxScrollEvent &event) override
 
void OnShowCursorData (wxCommandEvent &event) override
 

Friends

class GribRequestSetting
 

Additional Inherited Members

- Static Public Member Functions inherited from GRIBUICtrlBarBase
static wxBitmap GetScaledBitmap (wxBitmap bitmap, const wxString &svgFileName, double scale_factor)
 
- Protected Attributes inherited from GRIBUICtrlBarBase
wxFlexGridSizer * m_fgCtrlBarSizer
 
wxBitmapButton * m_bpPrev
 
wxChoice * m_cRecordForecast
 
wxBitmapButton * m_bpNext
 
wxBitmapButton * m_bpNow
 
wxBitmapButton * m_bpZoomToCenter
 
wxBitmapButton * m_bpShowCursorData
 
wxBitmapButton * m_bpPlay
 
wxBitmapButton * m_bpOpenFile
 
wxBitmapButton * m_bpSettings
 
wxBitmapButton * m_bpRequest
 
wxFlexGridSizer * m_fgCDataSizer
 
wxFlexGridSizer * m_fgCtrlGrabberSize
 
ProjectBoatPanelm_ProjectBoatPanel
 
double m_ScaledFactor
 

Detailed Description

Definition at line 180 of file grib_ui_dlg.h.

Constructor & Destructor Documentation

◆ GRIBUICtrlBar()

GRIBUICtrlBar::GRIBUICtrlBar ( wxWindow *  parent,
wxWindowID  id,
const wxString &  title,
const wxPoint &  pos,
const wxSize &  size,
long  style,
GribPi ppi,
double  scale_factor 
)

Definition at line 172 of file grib_ui_dlg.cpp.

◆ ~GRIBUICtrlBar()

GRIBUICtrlBar::~GRIBUICtrlBar ( )
override

Definition at line 311 of file grib_ui_dlg.cpp.

Member Function Documentation

◆ ComputeBestForecastForNow()

void GRIBUICtrlBar::ComputeBestForecastForNow ( )

Definition at line 1902 of file grib_ui_dlg.cpp.

◆ ContextMenuItemCallback()

void GRIBUICtrlBar::ContextMenuItemCallback ( int  id)

Definition at line 1042 of file grib_ui_dlg.cpp.

◆ CreateActiveFileFromNames()

void GRIBUICtrlBar::CreateActiveFileFromNames ( const wxArrayString &  filenames)

Definition at line 1731 of file grib_ui_dlg.cpp.

◆ DoOnMouseEvent()

void GRIBUICtrlBar::DoOnMouseEvent ( wxMouseEvent &  event)
inline

Definition at line 330 of file grib_ui_dlg.h.

◆ DoZoomToCenter()

void GRIBUICtrlBar::DoZoomToCenter ( )

Definition at line 1805 of file grib_ui_dlg.cpp.

◆ GetCDataDialog()

GRIBUICData * GRIBUICtrlBar::GetCDataDialog ( )
inline

Definition at line 247 of file grib_ui_dlg.h.

◆ GetGribDir()

wxString GRIBUICtrlBar::GetGribDir ( )
inline

Definition at line 279 of file grib_ui_dlg.h.

◆ GetProjectedLatLon()

void GRIBUICtrlBar::GetProjectedLatLon ( int &  x,
int &  y,
PlugIn_ViewPort vp 
)

Gets the projected position of vessel based on current course, speed and forecast time.

Calculates the projected latitude/longitude position by advancing the vessel's current position along its course at the specified speed for the time difference between the current forecast time and the vessel's position time.

The projected position is then converted to canvas (x,y) coordinates for use in UI overlays and cursor tracking.

Parameters
[out]xThe projected x-coordinate on canvas in pixels
[out]yThe projected y-coordinate on canvas in pixels
[in]vpViewport for coordinate transformation. If NULL, returns (0,0)

Definition at line 1530 of file grib_ui_dlg.cpp.

◆ getTimeInterpolatedValue()

double GRIBUICtrlBar::getTimeInterpolatedValue ( int  idx,
double  lon,
double  lat,
wxDateTime  t 
)

Definition at line 1547 of file grib_ui_dlg.cpp.

◆ getTimeInterpolatedValues()

bool GRIBUICtrlBar::getTimeInterpolatedValues ( double &  M,
double &  A,
int  idx1,
int  idx2,
double  lon,
double  lat,
wxDateTime  t 
)

Definition at line 1590 of file grib_ui_dlg.cpp.

◆ GetTimeLineRecordSet()

GribTimelineRecordSet * GRIBUICtrlBar::GetTimeLineRecordSet ( wxDateTime  time)

Retrieves or creates a temporally interpolated GRIB record set for a specific timestamp.

This function performs temporal interpolation between two known timestamps to estimate values at the requested time. The actual data values at each lat/lon point are either:

  1. Linearly interpolated in time for scalar values
  2. Vector interpolated (2D) for wind and current vectors to maintain physical consistency
Note
This function does NOT perform spatial (lat/lon) interpolation.
Timestamp handling:
  • For timestamps between forecast times (e.g. 1AM between 12AM and 3AM forecasts), data is interpolated between the bracketing forecasts.
  • For timestamps exactly matching forecast times (e.g. 12AM, 3AM), the original GRIB record is used directly without interpolation to avoid unnecessary computation and maintain precision.
Parameters
timeThe target datetime for which to interpolate GRIB records.
Returns
Pointer to GribTimelineRecordSet containing temporally interpolated data, or NULL if no valid data.

Definition at line 1445 of file grib_ui_dlg.cpp.

◆ InDataPlot()

bool GRIBUICtrlBar::InDataPlot ( int  id)
inline

Definition at line 248 of file grib_ui_dlg.h.

◆ OnAltitude()

void GRIBUICtrlBar::OnAltitude ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 839 of file grib_ui_dlg.cpp.

◆ OnClose()

void GRIBUICtrlBar::OnClose ( wxCloseEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 1075 of file grib_ui_dlg.cpp.

◆ OnCompositeDialog()

void GRIBUICtrlBar::OnCompositeDialog ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 1202 of file grib_ui_dlg.cpp.

◆ OnMouseEvent()

void GRIBUICtrlBar::OnMouseEvent ( wxMouseEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 949 of file grib_ui_dlg.cpp.

◆ OnNext()

void GRIBUICtrlBar::OnNext ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 1874 of file grib_ui_dlg.cpp.

◆ OnNow()

void GRIBUICtrlBar::OnNow ( wxCommandEvent &  event)
inlineoverrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 348 of file grib_ui_dlg.h.

◆ OnOpenFile()

void GRIBUICtrlBar::OnOpenFile ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 1663 of file grib_ui_dlg.cpp.

◆ OnPaint()

void GRIBUICtrlBar::OnPaint ( wxPaintEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 1097 of file grib_ui_dlg.cpp.

◆ OnPlayStop()

void GRIBUICtrlBar::OnPlayStop ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 1274 of file grib_ui_dlg.cpp.

◆ OnPrev()

void GRIBUICtrlBar::OnPrev ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 1851 of file grib_ui_dlg.cpp.

◆ OnRecordForecast()

void GRIBUICtrlBar::OnRecordForecast ( wxCommandEvent &  event)
inlineoverrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 341 of file grib_ui_dlg.h.

◆ OnRequestForecastData()

void GRIBUICtrlBar::OnRequestForecastData ( wxCommandEvent &  event)
overrideprotectedvirtual

Callback invoked when user clicks download/request forecast data.

Reimplemented from GRIBUICtrlBarBase.

Definition at line 1123 of file grib_ui_dlg.cpp.

◆ OnSettings()

void GRIBUICtrlBar::OnSettings ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 1141 of file grib_ui_dlg.cpp.

◆ OnShowCursorData()

void GRIBUICtrlBar::OnShowCursorData ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 685 of file grib_ui_dlg.cpp.

◆ OnSize()

void GRIBUICtrlBar::OnSize ( wxSizeEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 1089 of file grib_ui_dlg.cpp.

◆ OnTimeline()

void GRIBUICtrlBar::OnTimeline ( wxScrollEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 1654 of file grib_ui_dlg.cpp.

◆ OnZoomToCenterClick()

void GRIBUICtrlBar::OnZoomToCenterClick ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GRIBUICtrlBarBase.

Definition at line 1754 of file grib_ui_dlg.cpp.

◆ OpenFile()

void GRIBUICtrlBar::OpenFile ( bool  newestFile = false)

Definition at line 424 of file grib_ui_dlg.cpp.

◆ OpenFileFromJSON()

void GRIBUICtrlBar::OpenFileFromJSON ( wxString  json)

Definition at line 1252 of file grib_ui_dlg.cpp.

◆ PopulateComboDataList()

void GRIBUICtrlBar::PopulateComboDataList ( )

Definition at line 1739 of file grib_ui_dlg.cpp.

◆ ProjectionEnabled()

bool GRIBUICtrlBar::ProjectionEnabled ( )
inline

Definition at line 316 of file grib_ui_dlg.h.

◆ SetCursorLatLon()

void GRIBUICtrlBar::SetCursorLatLon ( double  lat,
double  lon 
)

Definition at line 659 of file grib_ui_dlg.cpp.

◆ SetDialogsStyleSizePosition()

void GRIBUICtrlBar::SetDialogsStyleSizePosition ( bool  force_recompute = false)

Definition at line 693 of file grib_ui_dlg.cpp.

◆ SetFactoryOptions()

void GRIBUICtrlBar::SetFactoryOptions ( )

Definition at line 1979 of file grib_ui_dlg.cpp.

◆ SetRequestButtonBitmap()

void GRIBUICtrlBar::SetRequestButtonBitmap ( int  type)

Set the icon and tooltip for the download request button.

Definition at line 417 of file grib_ui_dlg.cpp.

◆ SetScaledBitmap()

void GRIBUICtrlBar::SetScaledBitmap ( double  factor)

Definition at line 379 of file grib_ui_dlg.cpp.

◆ SetTimeLineMax()

void GRIBUICtrlBar::SetTimeLineMax ( bool  SetValue)

Definition at line 1955 of file grib_ui_dlg.cpp.

◆ SetViewPortUnderMouse()

void GRIBUICtrlBar::SetViewPortUnderMouse ( PlugIn_ViewPort vp)

Set the ViewPort under the mouse.

Definition at line 1062 of file grib_ui_dlg.cpp.

◆ SetViewPortWithFocus()

void GRIBUICtrlBar::SetViewPortWithFocus ( PlugIn_ViewPort vp)

Set the ViewPort that has the focus.

Definition at line 1071 of file grib_ui_dlg.cpp.

◆ StopPlayBack()

void GRIBUICtrlBar::StopPlayBack ( )

Definition at line 1315 of file grib_ui_dlg.cpp.

◆ TimelineChanged()

void GRIBUICtrlBar::TimelineChanged ( )

Definition at line 1324 of file grib_ui_dlg.cpp.

◆ TimelineTime()

wxDateTime GRIBUICtrlBar::TimelineTime ( )

Returns the selected time in the GRIB timeline widget.

Definition at line 1419 of file grib_ui_dlg.cpp.

◆ UpdateTrackingControl()

void GRIBUICtrlBar::UpdateTrackingControl ( )

Schedules an update of the GRIB data values display at current cursor position.

When the cursor moves over the chart or timeline changes occur, this method schedules a refresh of the data values panel that shows weather parameters (wind, pressure, temperature etc.) at the cursor location.

The update is throttled using a 50ms timer to prevent excessive updates during rapid cursor movement or timeline playback.

Definition at line 668 of file grib_ui_dlg.cpp.

Friends And Related Symbol Documentation

◆ GribRequestSetting

friend class GribRequestSetting
friend

Definition at line 181 of file grib_ui_dlg.h.

Member Data Documentation

◆ m_bDataPlot

bool GRIBUICtrlBar::m_bDataPlot[GribOverlaySettings::GEO_ALTITUDE]

Definition at line 273 of file grib_ui_dlg.h.

◆ m_bGRIBActiveFile

GRIBFile* GRIBUICtrlBar::m_bGRIBActiveFile

Currently active GRIB file being displayed.

Definition at line 272 of file grib_ui_dlg.h.

◆ m_CDataIsShown

bool GRIBUICtrlBar::m_CDataIsShown

Definition at line 275 of file grib_ui_dlg.h.

◆ m_file_names

wxArrayString GRIBUICtrlBar::m_file_names

List of GRIB filenames being displayed.

Definition at line 329 of file grib_ui_dlg.h.

◆ m_grib_dir

wxString GRIBUICtrlBar::m_grib_dir

Directory containing GRIB files.

Definition at line 327 of file grib_ui_dlg.h.

◆ m_highlight_latmax

double GRIBUICtrlBar::m_highlight_latmax

Definition at line 322 of file grib_ui_dlg.h.

◆ m_highlight_latmin

double GRIBUICtrlBar::m_highlight_latmin

Definition at line 324 of file grib_ui_dlg.h.

◆ m_highlight_lonmax

double GRIBUICtrlBar::m_highlight_lonmax

Definition at line 323 of file grib_ui_dlg.h.

◆ m_highlight_lonmin

double GRIBUICtrlBar::m_highlight_lonmin

Definition at line 325 of file grib_ui_dlg.h.

◆ m_old_DialogStyle

int GRIBUICtrlBar::m_old_DialogStyle

Definition at line 277 of file grib_ui_dlg.h.

◆ m_OverlaySettings

GribOverlaySettings GRIBUICtrlBar::m_OverlaySettings

Settings that control how GRIB data is displayed and overlaid.

Definition at line 262 of file grib_ui_dlg.h.

◆ m_pTimelineSet

GribTimelineRecordSet* GRIBUICtrlBar::m_pTimelineSet

Current set of GRIB records for timeline playback.

Definition at line 264 of file grib_ui_dlg.h.

◆ m_tPlayStop

wxTimer GRIBUICtrlBar::m_tPlayStop

Timer for controlling GRIB animation playback.

Definition at line 267 of file grib_ui_dlg.h.

◆ m_ZoneSelAllowed

int GRIBUICtrlBar::m_ZoneSelAllowed

Definition at line 276 of file grib_ui_dlg.h.

◆ pParent

wxWindow* GRIBUICtrlBar::pParent

Definition at line 260 of file grib_ui_dlg.h.

◆ pPlugIn

GribPi* GRIBUICtrlBar::pPlugIn

Plugin instance that owns this control bar.

Definition at line 269 of file grib_ui_dlg.h.

◆ pReq_Dialog

GribRequestSetting* GRIBUICtrlBar::pReq_Dialog

Definition at line 270 of file grib_ui_dlg.h.


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