OpenCPN Partial API docs
Loading...
Searching...
No Matches
GribTable.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, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
41#ifndef __GRIBTABLE_H__
42#define __GRIBTABLE_H__
43
44#include "wx/wxprec.h"
45
46#ifndef WX_PRECOMP
47#include "wx/wx.h"
48#endif // precompiled headers
49
50#include "pi_gl.h"
51
52#include <wx/grid.h>
53
54#include "GribUIDialogBase.h"
55#include "grib_pi.h"
56#include "ocpn_plugin.h"
57#include "CustomGrid.h"
58
59class GRIBUICtrlBar;
60
61enum NumericalRows { R_WIND, R_WAVES, R_CURRENT };
62
71class GRIBTable : public GRIBTableBase {
72public:
73 GRIBTable(GRIBUICtrlBar &parent);
74
75 ~GRIBTable() { delete m_pGribTable; }
76
83 void InitGribTable(ArrayOfGribRecordSets *rsa);
84 void InitGribTable(ArrayOfGribRecordSets *rsa, int NowIndex);
91 void SetTableSizePosition(int vpWidth, int vpHeight);
92 wxBitmap GetScaledBitmap(wxBitmap bmp, wxString svgfile, double scfactor) {
93 return m_pGDialog->GetScaledBitmap(bmp, svgfile, scfactor);
94 }
95 void CloseDialog();
96
97private:
98 void AddDataRow(int num_rows, int num_cols, wxString label,
99 wxGridCellAttr *row_attr);
100 void AutoSizeDataRows();
101 int GetVisibleRow(int col);
102 void OnScrollToNowTimer(wxTimerEvent &event);
103
104 wxString GetWind(GribRecord **recordarray, int datatype, double &wdir);
105 wxString GetWindGust(GribRecord **recordarray, int datatype);
106 wxString GetPressure(GribRecord **recordarray);
107 wxString GetWaves(GribRecord **recordarray, int datatype, double &wdir);
108 wxString GetRainfall(GribRecord **recordarray);
109 wxString GetCloudCover(GribRecord **recordarray);
110 wxString GetAirTemp(GribRecord **recordarray);
111 wxString GetSeaTemp(GribRecord **recordarray);
112 wxString GetCAPE(GribRecord **recordarray);
113 wxString GetCompRefl(GribRecord **recordarray);
114 wxString GetCurrent(GribRecord **recordarray, int datatype, double &wdir);
115
116 void OnClose(wxCloseEvent &event);
117 void OnOKButton(wxCommandEvent &event);
118
119 GRIBUICtrlBar *m_pGDialog;
120 wxColour m_pDataCellsColour;
121 wxTimer m_tScrollToNowTimer;
122};
123
124#endif //__GRIBTABLE_H__
Specialized Grid Control for GRIB Data Display.
Base User Interface Components for GRIB Plugin.
Class GRIBTableBase.
Dialog showing GRIB data in a table format.
Definition GribTable.h:71
void SetTableSizePosition(int vpWidth, int vpHeight)
Set the table size and position relative to viewport.
void InitGribTable(ArrayOfGribRecordSets *rsa)
Initialize the GRIB data table.
Represents a meteorological data grid from a GRIB (Gridded Binary) file.
Definition GribRecord.h:182
GRIB Weather Data Plugin for OpenCPN.
PlugIn Object Definition/API.
OpenGL Platform Abstraction Layer.