2 Copyright 2006 Johnathan Corgan.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License version 2
6 as published by the Free Software Foundation.
8 This software is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with GNU Radio; see the file COPYING. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street,
16 Boston, MA 02110-1301, USA.
19 #ifndef __HISTOGRAM_H__
20 #define __HISTOGRAM_H__
22 // Application level includes
28 // System level includes
37 void Calc(const std::vector<Sample> &samples, const Spherical &location);
38 void Add(float angle, float magnitude, float ierror, float qerror); // analytic errors are -pi to pi
41 int Count() const { return m_count; }
42 int Mode() const { return m_mode; }
43 float ModalFrequency() const { return m_modal_frequency; }
44 float Mean() const { return m_mean; }
45 float Concentration() const { return m_conc; }
46 const std::vector<float> &Data() const { return m_bins; }
50 float m_modal_frequency;
57 std::vector<float> m_bins;
60 class HistogramPanel : public wxPanel
63 enum Mode { Rectangular, Polar };
65 HistogramPanel(wxWindow *parent);
66 void SetData(const ErrorHistogram &histogram);
67 void SetMode(Mode mode) { m_mode = mode; Refresh(); }
70 void OnPaint(wxPaintEvent &event);
71 void OnSize(wxSizeEvent &event);
74 void draw_panel(wxDC &dc);
75 ErrorHistogram m_histogram;
80 // Window size derived parameters
86 DECLARE_EVENT_TABLE();