OpenCPN Partial API docs
Loading...
Searching...
No Matches
grib_table.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2010 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
16 ***************************************************************************/
17
42#ifndef GRIBTABLE_H_
43#define GRIBTABLE_H_
44
45#include <wx/wxprec.h>
46
47#ifndef WX_PRECOMP
48#include <wx/wx.h>
49#endif
50#include <wx/grid.h>
51
52#include "custom_grid.h"
53#include "grib_pi.h"
54#include "grib_ui_dlg_base.h"
55#include "ocpn_plugin.h"
56#include "pi_gl.h"
57
58class GRIBUICtrlBar;
59
60enum NumericalRows { R_WIND, R_WAVES, R_CURRENT };
61
70class GRIBTable : public GRIBTableBase {
71public:
72 GRIBTable(GRIBUICtrlBar &parent);
73
74 ~GRIBTable() override { delete m_pGribTable; }
75
82 void InitGribTable(ArrayOfGribRecordSets *rsa);
83 void InitGribTable(ArrayOfGribRecordSets *rsa, int NowIndex);
90 void SetTableSizePosition(int vpWidth, int vpHeight);
91 wxBitmap GetScaledBitmap(wxBitmap bmp, wxString svgfile, double scfactor) {
92 return m_pGDialog->GetScaledBitmap(bmp, svgfile, scfactor);
93 }
94 void CloseDialog();
95
96protected:
97 void OnClose(wxCloseEvent &event) override;
98 void OnOKButton(wxCommandEvent &event) override;
99
100private:
101 void AddDataRow(int num_rows, int num_cols, wxString label,
102 wxGridCellAttr *row_attr);
103 void AutoSizeDataRows();
104 void OnScrollToNowTimer(wxTimerEvent &event);
105
106 wxString GetWind(GribRecord **recordarray, int datatype, double &wdir);
107 wxString GetWindGust(GribRecord **recordarray, int datatype);
108 wxString GetPressure(GribRecord **recordarray);
109 wxString GetWaves(GribRecord **recordarray, int datatype, double &wdir);
110 wxString GetRainfall(GribRecord **recordarray);
111 wxString GetCloudCover(GribRecord **recordarray);
112 wxString GetAirTemp(GribRecord **recordarray);
113 wxString GetSeaTemp(GribRecord **recordarray);
114 wxString GetCAPE(GribRecord **recordarray);
115 wxString GetCompRefl(GribRecord **recordarray);
116 wxString GetCurrent(GribRecord **recordarray, int datatype, double &wdir);
117 int GetVisibleRow(int col);
118
119 GRIBUICtrlBar *m_pGDialog;
120 wxColour m_pDataCellsColour;
121 wxTimer m_tScrollToNowTimer;
122};
123
124#endif // GRIBTABLE_H_
Class GRIBTableBase.
Dialog showing GRIB data in a table format.
Definition grib_table.h:70
void SetTableSizePosition(int vpWidth, int vpHeight)
Set the table size and position relative to viewport.
void InitGribTable(ArrayOfGribRecordSets *rsa)
Initialize the GRIB data table.
A meteorological data grid from a GRIB (Gridded Binary) file.
Specialized Grid Control for GRIB Data Display.
GRIB Weather Data Plugin for OpenCPN.
Base User Interface Components for GRIB Plugin.
PlugIn Object Definition/API.
OpenGL Platform Abstraction Layer.