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

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

#include <GribRequestDialog.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
 

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 GribRequestDialog.h.

Constructor & Destructor Documentation

◆ GribRequestSetting()

GribRequestSetting::GribRequestSetting ( GRIBUICtrlBar parent)

Definition at line 58 of file GribRequestDialog.cpp.

◆ ~GribRequestSetting()

GribRequestSetting::~GribRequestSetting ( )

Definition at line 146 of file GribRequestDialog.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 1231 of file GribRequestDialog.cpp.

◆ GetBoundingBoxCanvasIndex()

int GribRequestSetting::GetBoundingBoxCanvasIndex ( ) const
inline

Definition at line 195 of file GribRequestDialog.h.

◆ GetMaxLat()

double GribRequestSetting::GetMaxLat ( ) const

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

The bouding 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 2769 of file GribRequestDialog.cpp.

◆ GetMaxLon()

double GribRequestSetting::GetMaxLon ( ) const

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

The bouding 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 2783 of file GribRequestDialog.cpp.

◆ GetMinLat()

double GribRequestSetting::GetMinLat ( ) const

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

The bouding 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 2762 of file GribRequestDialog.cpp.

◆ GetMinLon()

double GribRequestSetting::GetMinLon ( ) const

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

The bouding 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 2776 of file GribRequestDialog.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 411 of file GribRequestDialog.cpp.

◆ OnClose()

void GribRequestSetting::OnClose ( wxCloseEvent &  event)
overridevirtual

Reimplemented from GribRequestSettingBase.

Definition at line 318 of file GribRequestDialog.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 1029 of file GribRequestDialog.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 1036 of file GribRequestDialog.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 1362 of file GribRequestDialog.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 1368 of file GribRequestDialog.cpp.

◆ Save()

void GribRequestSetting::Save ( )
inline

Definition at line 197 of file GribRequestDialog.h.

◆ SetRequestDialogSize()

void GribRequestSetting::SetRequestDialogSize ( )

Definition at line 343 of file GribRequestDialog.cpp.

◆ SetVpSize()

void GribRequestSetting::SetVpSize ( PlugIn_ViewPort vp)

Definition at line 382 of file GribRequestDialog.cpp.

◆ StopGraphicalZoneSelection()

void GribRequestSetting::StopGraphicalZoneSelection ( )

Definition at line 1022 of file GribRequestDialog.cpp.

◆ UpdateAreaSelectionState()

void GribRequestSetting::UpdateAreaSelectionState ( )

Definition at line 1191 of file GribRequestDialog.cpp.

Member Data Documentation

◆ m_Lat

double GribRequestSetting::m_Lat

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

Definition at line 232 of file GribRequestDialog.h.

◆ m_Lon

double GribRequestSetting::m_Lon

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

Definition at line 234 of file GribRequestDialog.h.

◆ m_MailToAddresses

wxString GribRequestSetting::m_MailToAddresses

Definition at line 203 of file GribRequestDialog.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 209 of file GribRequestDialog.h.

◆ m_RequestConfigBase

wxString GribRequestSetting::m_RequestConfigBase

Definition at line 202 of file GribRequestDialog.h.

◆ m_StartLat

double GribRequestSetting::m_StartLat

The latitude at the starting point of the bounding box.

Definition at line 218 of file GribRequestDialog.h.

◆ m_StartLon

double GribRequestSetting::m_StartLon

The longitude at the starting point of the bounding box.

Definition at line 220 of file GribRequestDialog.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 216 of file GribRequestDialog.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 228 of file GribRequestDialog.h.

◆ m_VpMouse

PlugIn_ViewPort* GribRequestSetting::m_VpMouse

The viewport under the mouse.

Definition at line 230 of file GribRequestDialog.h.


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