OpenCPN Partial API docs
Loading...
Searching...
No Matches
depth.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2010 by Jean-Eudes Onfray *
3 * Copyright (C) 2010 by David S. Register *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
25#ifndef DEPTH_H_
26#define DEPTH_H_
27
28#include <wx/wxprec.h>
29
30#ifndef WX_PRECOMP
31#include <wx/wx.h>
32#endif
33
34#include "instrument.h"
35
36// Warn: div by 0 if count == 1
37#define DEPTH_RECORD_COUNT 30
38
40public:
41 DashboardInstrument_Depth(wxWindow* parent, wxWindowID id, wxString title,
42 InstrumentProperties* Properties);
43
44 ~DashboardInstrument_Depth() override = default;
45
46 wxSize GetSize(int orient, wxSize hint) override;
47 void SetData(DASH_CAP, double, wxString) override;
48
49private:
50 int w_label, h_label, m_plotdown, m_plotup, m_plotheight;
51
52protected:
53 double m_array_depth[DEPTH_RECORD_COUNT];
54 double m_max_depth;
55 double m_depth;
56 wxString m_depth_unit;
57 wxString m_temp;
58
59 void Draw(wxGCDC* dc) override;
60 void DrawBackground(wxGCDC* dc);
61 void DrawForeground(wxGCDC* dc);
62};
63
64#endif // DEPTH_H_
Dashboard instrument base class.
DASH_CAP
Definition instrument.h:77