OpenCPN Partial API docs
Loading...
Searching...
No Matches
baro_history.h
1/******************************************************************************
2 * $Id: baro_history.h, v1.0 2014/02/10 tom-r Exp $
3 *
4 * Project: OpenCPN
5 * Purpose: Dashboard Plugin
6 * Author: stedy
7 * Based on code from Thomas Rauch
8 ***************************************************************************
9 * Copyright (C) 2010 by David S. Register *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * GNU General Public License for more details. *
20 * *
21 * You should have received a copy of the GNU General Public License *
22 * along with this program; if not, write to the *
23 * Free Software Foundation, Inc., *
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
25 ***************************************************************************
26 */
27
28#ifndef __BARO_HISTORY_H__
29#define __BARO_HISTORY_H__
30
31// For compilers that support precompilation, includes "wx/wx.h".
32#include <wx/wxprec.h>
33
34#ifdef __BORLANDC__
35#pragma hdrstop
36#endif
37
38// for all others, include the necessary headers (this file is usually all you
39// need because it includes almost all "standard" wxWidgets headers)
40#ifndef WX_PRECOMP
41#include <wx/wx.h>
42#endif
43
44// Warn: div by 0 if count == 1
45#define BARO_RECORD_COUNT 2000
46
47#include "instrument.h"
48#include "dial.h"
49
51public:
52 DashboardInstrument_BaroHistory(wxWindow* parent, wxWindowID id,
53 wxString title,
54 InstrumentProperties* Properties);
55
57
58 void SetData(DASH_CAP, double, wxString);
59 wxSize GetSize(int orient, wxSize hint);
60
61private:
62 int m_soloInPane;
63 int m_SpdRecCnt, m_DirRecCnt, m_SpdStartVal, m_DirStartVal;
64 int m_isNULL;
65 int m_WindDirShift;
66
67protected:
68 double alpha;
69 double m_ArrayBaroHistory[BARO_RECORD_COUNT];
70 double m_ArrayPressHistory[BARO_RECORD_COUNT];
71 double m_ExpSmoothArrayPressure[BARO_RECORD_COUNT];
72
73 wxDateTime::Tm m_ArrayRecTime[BARO_RECORD_COUNT];
74
75 double m_MaxPress; //...in array
76 double m_MinPress; //...in array
77 double m_TotalMaxPress; // since O is started
78 double m_TotalMinPress;
79 double m_Press;
80 double m_MaxPressScale;
81 double m_ratioW;
82
83 bool m_IsRunning;
84 int m_SampleCount;
85 int m_SetNewData;
86 wxRect m_WindowRect;
87 wxRect m_DrawAreaRect; // the coordinates of the real darwing area
88 int m_DrawingWidth, m_TopLineHeight, m_DrawingHeight;
89 int m_width, m_height;
90 int m_LeftLegend, m_RightLegend;
91 int m_currSec, m_lastSec, m_SpdCntperSec;
92 double m_cntSpd, m_cntDir, m_avgSpd, m_avgDir;
93
94 void Draw(wxGCDC* dc);
95 void DrawBackground(wxGCDC* dc);
96 void DrawForeground(wxGCDC* dc);
97 void SetMinMaxWindScale();
98
99 void DrawWindSpeedScale(wxGCDC* dc);
100 // wxString GetWindDirStr(wxString WindDir);
101};
102
103#endif // __BARO_HISTORY_H__