OpenCPN Partial API docs
Loading...
Searching...
No Matches
baro_history.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2010 by Thomas Rauch *
3 * Copyright (C) 2010 by stedy *
4 * Copyright (C) 2010 by David S. Register *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
18 **************************************************************************/
19
26#ifndef BARO_HISTORY_H__
27#define BARO_HISTORY_H__
28
29// For compilers that support precompilation, includes "wx/wx.h".
30#include <wx/wxprec.h>
31
32// for all others, include the necessary headers (this file is usually all you
33// need because it includes almost all "standard" wxWidgets headers)
34#ifndef WX_PRECOMP
35#include <wx/wx.h>
36#endif
37
38#include "instrument.h"
39#include "dial.h"
40
41// Warn: div by 0 if count == 1
42#define BARO_RECORD_COUNT 2000
43
45public:
46 DashboardInstrument_BaroHistory(wxWindow* parent, wxWindowID id,
47 wxString title,
48 InstrumentProperties* Properties);
49
51
52 void SetData(DASH_CAP, double, wxString);
53 wxSize GetSize(int orient, wxSize hint);
54
55private:
56 int m_solo_in_pane;
57 int m_spd_rec_cnt, m_dir_rec_cnt, m_spd_start_val, m_dir_start_val;
58 int m_is_null;
59 int m_wind_dir_shift;
60
61protected:
62 double alpha;
63 double m_array_baro_history[BARO_RECORD_COUNT];
64 double m_array_press_history[BARO_RECORD_COUNT];
65 double m_exp_smooth_array_pressure[BARO_RECORD_COUNT];
66
67 wxDateTime::Tm m_array_rec_time[BARO_RECORD_COUNT];
68
69 double m_max_press; //...in array
70 double m_min_press; //...in array
71 double m_total_max_press; // since O is started
72 double m_total_min_press;
73 double m_press;
74 double m_max_press_scale;
75 double m_ratio_w;
76
77 bool m_is_running;
78 int m_sample_count;
79 int m_set_new_data;
80 wxRect m_window_rect;
81 wxRect m_draw_area_rect; // the coordinates of the real darwing area
82 int m_drawing_width, m_top_line_height, m_drawing_height;
83 int m_width, m_height;
84 int m_left_legend, m_right_legend;
85 int m_curr_sec, m_last_sec, m_spd_cntper_sec;
86 double m_cnt_spd, m_cnt_dir, m_avg_spd, m_avg_dir;
87
88 void Draw(wxGCDC* dc);
89 void DrawBackground(wxGCDC* dc);
90 void DrawForeground(wxGCDC* dc);
91 void SetMinMaxWindScale();
92
93 void DrawWindSpeedScale(wxGCDC* dc);
94 // wxString GetWindDirStr(wxString WindDir);
95};
96
97#endif // BARO_HISTORY_H__
Dashboard dial instrument.
Dashboard instrument base class.
DASH_CAP
Definition instrument.h:77