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

Manages GRIB file request configuration and downloads. More...

#include <grib_request_dlg.h>

Inheritance diagram for GribRequestSetting:
GribRequestSettingBase

Public Member Functions

 GribRequestSetting (GRIBUICtrlBar &parent)
 
void OnClose (wxCloseEvent &event) override
 
void SetVpSize (PlugIn_ViewPort *vp)
 
void OnVpUnderMouseChange (PlugIn_ViewPort *vp)
 Callback invoked when the view port under mouse has changed.
 
void OnVpWithFocusChange (PlugIn_ViewPort *vp)
 Callback invoked when the focused view port has changed, such as in multi-chart mode when user switches viewport focus.
 
bool MouseEventHook (wxMouseEvent &event)
 Intercepts mouse events to handle GRIB area selection.
 
bool RenderZoneOverlay (wxDC &dc)
 Renders the GRIB area selection overlay using standard device context.
 
bool RenderGlZoneOverlay ()
 Renders the GRIB area selection overlay using OpenGL.
 
bool DoRenderZoneOverlay ()
 Draws the GRIB area selection overlay on the chart.
 
void SetRequestDialogSize ()
 
void StopGraphicalZoneSelection ()
 
void UpdateAreaSelectionState ()
 
double GetMinLat () const
 Get the minimum latitude of the bounding box for the download request.
 
double GetMaxLat () const
 Get the maximum latitude of the bounding box for the download request.
 
double GetMinLon () const
 Get the minimum longitude of the bounding box for the download request.
 
double GetMaxLon () const
 Get the maximum longitude of the bounding box for the download request.
 
int GetBoundingBoxCanvasIndex () const
 
void Save ()
 
- Public Member Functions inherited from GribRequestSettingBase
 GribRequestSettingBase (GRIBUICtrlBarBase *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Get forecast..."), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1, -1), long style=wxDEFAULT_DIALOG_STYLE)
 

Public Attributes

wxString m_RequestConfigBase
 
wxString m_MailToAddresses
 
ZoneSelectionRenderState m_RenderSelectionZoneState
 Current state of the bounding box overlay rendering.
 
wxPoint m_StartPoint
 Starting point of the bounding box in physical pixels.
 
double m_StartLat
 The latitude at the starting point of the bounding box.
 
double m_StartLon
 The longitude at the starting point of the bounding box.
 
PlugIn_ViewPortm_VpFocus
 The viewport currently in focus.
 
PlugIn_ViewPortm_VpMouse
 The viewport under the mouse.
 
double m_Lat
 The latitude at the mouse cursor while drawing a bounding box.
 
double m_Lon
 The longitude at the mouse cursor while drawing a bounding box.
 
- Public Attributes inherited from GribRequestSettingBase
wxScrolledWindow * m_sScrolledDialog
 

Protected Member Functions

void OnTopChange (wxCommandEvent &event) override
 
void OnMovingClick (wxCommandEvent &event) override
 
void OnAnyChange (wxCommandEvent &event) override
 
void OnAnySpinChange (wxSpinEvent &event) override
 
void OnNotebookPageChanged (wxNotebookEvent &event) override
 Save the "download" configuration to disk.
 
void OnTimeRangeChange (wxCommandEvent &event) override
 
void OnSendMaiL (wxCommandEvent &event) override
 Callback invoked when the user clicks the "Send" button in the "e-mail" tab.
 
void OnOK (wxCommandEvent &event) override
 Callback invoked when the user clicks the "OK" button in the "download" dialog.
 
void OnZoneSelectionModeChange (wxCommandEvent &event) override
 
void OnCancel (wxCommandEvent &event) override
 Callback invoked when the user clicks the "Cancel" button in the "download" dialog.
 
void OnWorldLengthChoice (wxCommandEvent &event) override
 
void OnWorldResolutionChoice (wxCommandEvent &event) override
 
void OnWorldDownload (wxCommandEvent &event) override
 
void OnLocalTreeItemExpanded (wxTreeEvent &event) override
 
void OnLocalTreeSelChanged (wxTreeEvent &event) override
 
void OnUpdateLocalCatalog (wxCommandEvent &event) override
 
void OnXyGribDownloadButton (wxCommandEvent &event) override
 
void OnXyGribAtmModelChoice (wxCommandEvent &event) override
 Handle action of changing atmospheric model selection.
 
void OnXyGribWaveModelChoice (wxCommandEvent &event) override
 Handle action of changing wave model selection.
 
void OnXyGribConfigChange (wxCommandEvent &event) override
 Handle action of changing a GRIB configuration parameter.
 
void OnDownloadLocal (wxCommandEvent &event) override
 
void OnCoordinatesChange (wxSpinEvent &event) override
 
void SaveConfig () override
 

Additional Inherited Members

- Protected Attributes inherited from GribRequestSettingBase
wxNotebook * m_notebookGetGrib
 
wxPanel * m_panelWorld
 
wxHtmlWindow * m_htmlWinWorld
 
wxStaticText * m_staticTextInfo
 
wxStaticText * m_stForecastLength
 
wxChoice * m_chForecastLength
 
wxStaticText * m_stECMWFResolution
 
wxChoice * m_chECMWFResolution
 
wxButton * m_btnDownloadWorld
 
wxPanel * m_panelLocalModels
 
wxTreeCtrl * m_SourcesTreeCtrl1
 
wxStaticText * m_stLocalDownloadInfo
 
wxHtmlWindow * m_htmlInfoWin
 
wxButton * m_buttonUpdateCatalog
 
wxButton * m_btnDownloadLocal
 
wxPanel * m_panelEmail
 
wxFlexGridSizer * m_fgScrollSizer
 
wxFlexGridSizer * m_pSenderSizer
 
wxTextCtrl * m_pSenderAddress
 
wxChoice * m_pMailTo
 
wxChoice * m_pModel
 
wxCheckBox * m_cMovingGribEnabled
 
wxFlexGridSizer * m_fgMovingParams
 
wxSpinCtrl * m_sMovingSpeed
 
wxSpinCtrl * m_sMovingCourse
 
wxStaticText * m_sCourseUnit
 
wxFlexGridSizer * m_fgLog
 
wxTextCtrl * m_pLogin
 
wxTextCtrl * m_pCode
 
wxChoice * m_pResolution
 
wxStaticText * m_tResUnit
 
wxChoice * m_pInterval
 
wxChoice * m_pTimeRange
 
wxStaticText * m_staticText21
 
wxRadioButton * m_rbCurrentView
 Radio button selected to indicate the download area is based on the visible area of the chart in the canvas which is currently in focus.
 
wxRadioButton * m_rbManualSelect
 Radio button selected to indicate the download area is based on the area selected by the user.
 
wxBitmapToggleButton * m_bpManualSelection
 
wxFlexGridSizer * fgZoneCoordinatesSizer
 
wxCheckBox * m_cUseSavedZone
 
wxSpinCtrl * m_spMaxLat
 A spinner for the max latitude of the bounding box for downloads.
 
wxStaticText * m_stMaxLatNS
 
wxStaticText * m_staticText36
 
wxSpinCtrl * m_spMaxLon
 A spinner for the max longitude of the bounding box for downloads.
 
wxStaticText * m_stMaxLonEW
 
wxSpinCtrl * m_spMinLat
 A spinner for the min latitude of the bounding box for downloads.
 
wxStaticText * m_stMinLatNS
 
wxSpinCtrl * m_spMinLon
 A spinner for the min longitude of the bounding box for downloads.
 
wxStaticText * m_stMinLonEW
 
wxCheckBox * m_pWind
 
wxCheckBox * m_pPress
 
wxCheckBox * m_pWindGust
 
wxCheckBox * m_pRainfall
 
wxCheckBox * m_pCloudCover
 
wxCheckBox * m_pAirTemp
 
wxCheckBox * m_pCAPE
 
wxCheckBox * m_pReflectivity
 
wxCheckBox * m_pSeaTemp
 
wxCheckBox * m_pCurrent
 
wxCheckBox * m_pWaves
 
wxChoice * m_pWModel
 
wxCheckBox * m_pAltitudeData
 
wxFlexGridSizer * m_fgAltitudeData
 
wxCheckBox * m_p850hpa
 
wxCheckBox * m_p700hpa
 
wxCheckBox * m_p500hpa
 
wxCheckBox * m_p300hpa
 
wxTextCtrl * m_MailImage
 
wxFlexGridSizer * m_fgFixedSizer
 
wxStaticText * m_tFileSize
 
wxStaticText * m_tLimit
 
wxButton * m_rButtonYes
 Button to Send a download request through e-mail.
 
wxButton * m_rButtonApply
 Button to Save the "download request" configuration.
 
wxButton * m_rButtonCancel
 Button to Cancel a request to download, close the dialog without saving the configuration.
 
XyGribPanelm_xygribPanel
 

Detailed Description

Manages GRIB file request configuration and downloads.

This class provides:

  • User interface for request configuration
  • Geographic zone selection
  • Multiple download source support
  • File size estimation
  • Request validation
  • Visual feedback during selection

Definition at line 93 of file grib_request_dlg.h.

Constructor & Destructor Documentation

◆ GribRequestSetting()

GribRequestSetting::GribRequestSetting ( GRIBUICtrlBar parent)

Definition at line 65 of file grib_request_dlg.cpp.

◆ ~GribRequestSetting()

GribRequestSetting::~GribRequestSetting ( )
override

Definition at line 153 of file grib_request_dlg.cpp.

Member Function Documentation

◆ DoRenderZoneOverlay()

bool GribRequestSetting::DoRenderZoneOverlay ( )

Draws the GRIB area selection overlay on the chart.

This includes the rectangular selection zone and an information label showing the coordinates and estimated file size. Supports both standard wxDC and OpenGL rendering paths.

Returns
true if drawing was successful

Definition at line 1234 of file grib_request_dlg.cpp.

◆ GetBoundingBoxCanvasIndex()

int GribRequestSetting::GetBoundingBoxCanvasIndex ( ) const
inline

Definition at line 195 of file grib_request_dlg.h.

◆ GetMaxLat()

double GribRequestSetting::GetMaxLat ( ) const

Get the maximum latitude of the bounding box for the download request.

The bounding box is defined by the user during manual zone selection or by the visible area of the chart in focus.

Returns
The maximum latitude of the bounding box.

Definition at line 2783 of file grib_request_dlg.cpp.

◆ GetMaxLon()

double GribRequestSetting::GetMaxLon ( ) const

Get the maximum longitude of the bounding box for the download request.

The bounding box is defined by the user during manual zone selection or by the visible area of the chart in focus.

Returns
The maximum longitude of the bounding box.

Definition at line 2797 of file grib_request_dlg.cpp.

◆ GetMinLat()

double GribRequestSetting::GetMinLat ( ) const

Get the minimum latitude of the bounding box for the download request.

The bounding box is defined by the user during manual zone selection or by the visible area of the chart in focus.

Returns
The minimum latitude of the bounding box.

Definition at line 2776 of file grib_request_dlg.cpp.

◆ GetMinLon()

double GribRequestSetting::GetMinLon ( ) const

Get the minimum longitude of the bounding box for the download request.

The bounding box is defined by the user during manual zone selection or by the visible area of the chart in focus.

Returns
The minimum longitude of the bounding box.

Definition at line 2790 of file grib_request_dlg.cpp.

◆ MouseEventHook()

bool GribRequestSetting::MouseEventHook ( wxMouseEvent &  event)

Intercepts mouse events to handle GRIB area selection.

We only handle mouse events when the Shift key is pressed to avoid conflicting with OpenCPN core chart panning, which uses normal left-click drag. This lets users:

  • Pan the chart normally with left-click drag.
  • Select GRIB download area with Shift + left-click drag.

The selection states flow:

  1. User holds Shift and left-clicks: Start selection (DRAW_SELECTION)
  2. User drags with Shift still held: Update selection rectangle
  3. User releases left button: Complete selection (COMPLETE_SELECTION)
Parameters
eventThe intercepted mouse event.
Returns
true if event was handled, false to pass event to chart.

Definition at line 413 of file grib_request_dlg.cpp.

◆ OnAnyChange()

void GribRequestSetting::OnAnyChange ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 1397 of file grib_request_dlg.cpp.

◆ OnAnySpinChange()

void GribRequestSetting::OnAnySpinChange ( wxSpinEvent &  event)
inlineoverrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 242 of file grib_request_dlg.h.

◆ OnCancel()

void GribRequestSetting::OnCancel ( wxCommandEvent &  event)
inlineoverrideprotectedvirtual

Callback invoked when the user clicks the "Cancel" button in the "download" dialog.

Reimplemented from GribRequestSettingBase.

Definition at line 254 of file grib_request_dlg.h.

◆ OnClose()

void GribRequestSetting::OnClose ( wxCloseEvent &  event)
overridevirtual

Reimplemented from GribRequestSettingBase.

Definition at line 320 of file grib_request_dlg.cpp.

◆ OnCoordinatesChange()

void GribRequestSetting::OnCoordinatesChange ( wxSpinEvent &  event)
overrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 1387 of file grib_request_dlg.cpp.

◆ OnDownloadLocal()

void GribRequestSetting::OnDownloadLocal ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 846 of file grib_request_dlg.cpp.

◆ OnLocalTreeItemExpanded()

void GribRequestSetting::OnLocalTreeItemExpanded ( wxTreeEvent &  event)
inlineoverrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 261 of file grib_request_dlg.h.

◆ OnLocalTreeSelChanged()

void GribRequestSetting::OnLocalTreeSelChanged ( wxTreeEvent &  event)
overrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 776 of file grib_request_dlg.cpp.

◆ OnMovingClick()

void GribRequestSetting::OnMovingClick ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 1377 of file grib_request_dlg.cpp.

◆ OnNotebookPageChanged()

void GribRequestSetting::OnNotebookPageChanged ( wxNotebookEvent &  event)
inlineoverrideprotectedvirtual

Save the "download" configuration to disk.

Reimplemented from GribRequestSettingBase.

Definition at line 247 of file grib_request_dlg.h.

◆ OnOK()

void GribRequestSetting::OnOK ( wxCommandEvent &  event)
overrideprotectedvirtual

Callback invoked when the user clicks the "OK" button in the "download" dialog.

Reimplemented from GribRequestSettingBase.

Definition at line 1432 of file grib_request_dlg.cpp.

◆ OnSendMaiL()

void GribRequestSetting::OnSendMaiL ( wxCommandEvent &  event)
overrideprotectedvirtual

Callback invoked when the user clicks the "Send" button in the "e-mail" tab.

Reimplemented from GribRequestSettingBase.

Definition at line 1816 of file grib_request_dlg.cpp.

◆ OnTimeRangeChange()

void GribRequestSetting::OnTimeRangeChange ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 1407 of file grib_request_dlg.cpp.

◆ OnTopChange()

void GribRequestSetting::OnTopChange ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 1173 of file grib_request_dlg.cpp.

◆ OnUpdateLocalCatalog()

void GribRequestSetting::OnUpdateLocalCatalog ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 793 of file grib_request_dlg.cpp.

◆ OnVpUnderMouseChange()

void GribRequestSetting::OnVpUnderMouseChange ( PlugIn_ViewPort vp)

Callback invoked when the view port under mouse has changed.

This is the viewport where the mouse cursor is currently located.

Definition at line 1032 of file grib_request_dlg.cpp.

◆ OnVpWithFocusChange()

void GribRequestSetting::OnVpWithFocusChange ( PlugIn_ViewPort vp)

Callback invoked when the focused view port has changed, such as in multi-chart mode when user switches viewport focus.

Definition at line 1039 of file grib_request_dlg.cpp.

◆ OnWorldDownload()

void GribRequestSetting::OnWorldDownload ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 588 of file grib_request_dlg.cpp.

◆ OnWorldLengthChoice()

void GribRequestSetting::OnWorldLengthChoice ( wxCommandEvent &  event)
inlineoverrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 258 of file grib_request_dlg.h.

◆ OnWorldResolutionChoice()

void GribRequestSetting::OnWorldResolutionChoice ( wxCommandEvent &  event)
inlineoverrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 259 of file grib_request_dlg.h.

◆ OnXyGribAtmModelChoice()

void GribRequestSetting::OnXyGribAtmModelChoice ( wxCommandEvent &  event)
overrideprotectedvirtual

Handle action of changing atmospheric model selection.

This function update the GUI according to the selected atmospheric model

Parameters
eventEvent data from the GUI loop

Reimplemented from GribRequestSettingBase.

Definition at line 2258 of file grib_request_dlg.cpp.

◆ OnXyGribConfigChange()

void GribRequestSetting::OnXyGribConfigChange ( wxCommandEvent &  event)
overrideprotectedvirtual

Handle action of changing a GRIB configuration parameter.

The function stores the new configuration and updates GRIB size estimate.

Parameters
eventEvent data from the GUI loop

Reimplemented from GribRequestSettingBase.

Definition at line 2412 of file grib_request_dlg.cpp.

◆ OnXyGribDownloadButton()

void GribRequestSetting::OnXyGribDownloadButton ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 2063 of file grib_request_dlg.cpp.

◆ OnXyGribWaveModelChoice()

void GribRequestSetting::OnXyGribWaveModelChoice ( wxCommandEvent &  event)
overrideprotectedvirtual

Handle action of changing wave model selection.

This function update the GUI according to the selected wave model

Parameters
eventEvent data from the GUI loop

Reimplemented from GribRequestSettingBase.

Definition at line 2369 of file grib_request_dlg.cpp.

◆ OnZoneSelectionModeChange()

void GribRequestSetting::OnZoneSelectionModeChange ( wxCommandEvent &  event)
overrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 1203 of file grib_request_dlg.cpp.

◆ RenderGlZoneOverlay()

bool GribRequestSetting::RenderGlZoneOverlay ( )

Renders the GRIB area selection overlay using OpenGL.

Called by OpenCPN when in OpenGL mode. Sets up OpenGL context and delegates actual rendering to DoRenderZoneOverlay().

Returns
true if overlay should be rendered, false if nothing to draw

Definition at line 1365 of file grib_request_dlg.cpp.

◆ RenderZoneOverlay()

bool GribRequestSetting::RenderZoneOverlay ( wxDC &  dc)

Renders the GRIB area selection overlay using standard device context.

Called by OpenCPN when in standard graphics mode. Passes the DC to DoRenderZoneOverlay() for actual rendering.

Parameters
dcDevice context to draw on
Returns
true if overlay should be rendered, false if nothing to draw

Definition at line 1371 of file grib_request_dlg.cpp.

◆ Save()

void GribRequestSetting::Save ( )
inline

Definition at line 199 of file grib_request_dlg.h.

◆ SaveConfig()

void GribRequestSetting::SaveConfig ( )
overrideprotectedvirtual

Reimplemented from GribRequestSettingBase.

Definition at line 167 of file grib_request_dlg.cpp.

◆ SetRequestDialogSize()

void GribRequestSetting::SetRequestDialogSize ( )

Definition at line 345 of file grib_request_dlg.cpp.

◆ SetVpSize()

void GribRequestSetting::SetVpSize ( PlugIn_ViewPort vp)

Definition at line 384 of file grib_request_dlg.cpp.

◆ StopGraphicalZoneSelection()

void GribRequestSetting::StopGraphicalZoneSelection ( )

Definition at line 1025 of file grib_request_dlg.cpp.

◆ UpdateAreaSelectionState()

void GribRequestSetting::UpdateAreaSelectionState ( )

Definition at line 1194 of file grib_request_dlg.cpp.

Member Data Documentation

◆ m_Lat

double GribRequestSetting::m_Lat

The latitude at the mouse cursor while drawing a bounding box.

Definition at line 234 of file grib_request_dlg.h.

◆ m_Lon

double GribRequestSetting::m_Lon

The longitude at the mouse cursor while drawing a bounding box.

Definition at line 236 of file grib_request_dlg.h.

◆ m_MailToAddresses

wxString GribRequestSetting::m_MailToAddresses

Definition at line 205 of file grib_request_dlg.h.

◆ m_RenderSelectionZoneState

ZoneSelectionRenderState GribRequestSetting::m_RenderSelectionZoneState

Current state of the bounding box overlay rendering.

Controls whether and how the selection zone is displayed on the chart.

See also
ZoneSelectionRenderState

Definition at line 211 of file grib_request_dlg.h.

◆ m_RequestConfigBase

wxString GribRequestSetting::m_RequestConfigBase

Definition at line 204 of file grib_request_dlg.h.

◆ m_StartLat

double GribRequestSetting::m_StartLat

The latitude at the starting point of the bounding box.

Definition at line 220 of file grib_request_dlg.h.

◆ m_StartLon

double GribRequestSetting::m_StartLon

The longitude at the starting point of the bounding box.

Definition at line 222 of file grib_request_dlg.h.

◆ m_StartPoint

wxPoint GribRequestSetting::m_StartPoint

Starting point of the bounding box in physical pixels.

Set when user begins dragging to select a bounding box. Acts as the anchor point for drawing the bounding box rectangle.

Definition at line 218 of file grib_request_dlg.h.

◆ m_VpFocus

PlugIn_ViewPort* GribRequestSetting::m_VpFocus

The viewport currently in focus.

Note
In multi-canvas mode, this may be different from the viewport under the mouse cursor.

Definition at line 230 of file grib_request_dlg.h.

◆ m_VpMouse

PlugIn_ViewPort* GribRequestSetting::m_VpMouse

The viewport under the mouse.

Definition at line 232 of file grib_request_dlg.h.


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