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
84 void InitGribTable(int zone, ArrayOfGribRecordSets *rsa);
85 void InitGribTable(int zone, ArrayOfGribRecordSets *rsa, int NowIndex);
92 void SetTableSizePosition(int vpWidth, int vpHeight);
93 wxBitmap GetScaledBitmap(wxBitmap bmp, wxString svgfile, double scfactor) {
94 return m_pGDialog->GetScaledBitmap(bmp, svgfile, scfactor);
95 }
96 void CloseDialog();
97
98private:
99 void AddDataRow(int num_rows, int num_cols, wxString label,
100 wxGridCellAttr *row_attr);
101 void AutoSizeDataRows();
102 int GetVisibleRow(int col);
103 void OnScrollToNowTimer(wxTimerEvent &event);
104
105 wxString GetWind(GribRecord **recordarray, int datatype, double &wdir);
106 wxString GetWindGust(GribRecord **recordarray, int datatype);
107 wxString GetPressure(GribRecord **recordarray);
108 wxString GetWaves(GribRecord **recordarray, int datatype, double &wdir);
109 wxString GetRainfall(GribRecord **recordarray);
110 wxString GetCloudCover(GribRecord **recordarray);
111 wxString GetAirTemp(GribRecord **recordarray);
112 wxString GetSeaTemp(GribRecord **recordarray);
113 wxString GetCAPE(GribRecord **recordarray);
114 wxString GetCompRefl(GribRecord **recordarray);
115 wxString GetCurrent(GribRecord **recordarray, int datatype, double &wdir);
116 wxString GetTimeRowsStrings(wxDateTime date_time, int time_zone, int type);
117
118 void OnClose(wxCloseEvent &event);
119 void OnOKButton(wxCommandEvent &event);
120
121 GRIBUICtrlBar *m_pGDialog;
122 wxColour m_pDataCellsColour;
123 wxTimer m_tScrollToNowTimer;
124};
125
126#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(int zone, 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.