Updated FSF address in all files. Fixes ticket:51
[debian/gnuradio] / ezdop / src / host / hunter / src / hunter.h
1 /*
2  Copyright 2006 Johnathan Corgan.
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 version 2
6  as published by the Free Software Foundation.
7  
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.
12  
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.
17 */
18
19 // Application level includes
20 #include "sample.h"
21 #include "known.h"
22 #include "search.h"
23
24 // wxWidgets includes
25 #include <wx/frame.h>
26 #include <wx/spinbutt.h>  // Unknown why these two aren't in wx.h
27 #include <wx/splitter.h>
28
29 // Forward declarations
30 class EZDoppler;
31 class EZDopplerUpdate;
32 class GPS;
33 class GPSUpdate;
34 class HunterSettings;
35 class TacticalPanel;
36 class HistogramPanel;
37 class Spherical;
38 class SampleLog;
39 class KnownTransmitter;
40
41 class HunterFrame : public wxFrame
42 {
43 public:
44         // Constructor
45         HunterFrame();
46     void DoCalibrationStep(int which);
47     
48 private:
49         // Initialization routines
50     void InitializeSettings();    
51         void InitializeWindows();
52         void InitializeDoppler();
53     void InitializeGPS();
54     void InitializeCalibration();
55     void InitializeSearch();
56     void InitializeDisplay();
57
58     // System related functions
59         void OnClose(wxCloseEvent &event);
60     
61     // Status related functions
62     void OnHistogramSourceChg(wxCommandEvent &event);
63     void OnHistogramCoordsChg(wxCommandEvent &event);
64
65     // Search related functions
66     void EnableSearchItems(bool enable);
67     void MakeNewLogAndSearch();
68     void CalcSolution();
69     void StartCaptureAutomatic();
70     void StartCaptureOnce();
71     void StopCapture();
72     void UpdateSearchStatus(bool display);
73     void UpdateSearchLocation(bool display);
74     void UpdateSearchDirection(bool display);
75     void OnSearchNewSave(wxCommandEvent &event);
76     void OnSearchOpenClose(wxCommandEvent &event);
77     void OnSearchToggle(wxCommandEvent &event);
78     void OnSearchOnce(wxCommandEvent &event);
79     void OnSearchUpdate(SearchUpdate &event);                
80     
81     // Doppler related functions
82     void SetDopplerParams();
83     void StartDoppler();
84     void StopDoppler();
85     void UpdateDopplerStatus(bool display);
86         void OnDopplerToggle(wxCommandEvent &event);
87         void OnDopplerAutostart(wxCommandEvent &event);
88         void OnDopplerReset(wxCommandEvent &event);
89         void OnDopplerFilterChg(wxScrollEvent &event);
90         void OnDopplerRotationChg(wxCommandEvent &event);
91     void OnDopplerUpdate(EZDopplerUpdate &event);                
92
93     // GPS related functions
94     void StartGPS();
95     void StopGPS();
96     void UpdateGPSStatus(bool dipslay);
97     void UpdateGPSValidity(bool valid);
98     void OnGPSToggle(wxCommandEvent &event);
99     void OnGPSAutostart(wxCommandEvent &event);
100     void OnGPSDeviceSelect(wxCommandEvent &event);
101     void OnGPSUpdate(GPSUpdate &event);                
102                 
103     // Calibration related functions
104     void CalcKnownStatistics();
105     void UpdateKnownLocation();
106     void UpdateKnownDirection();
107     void UpdateKnownStatistics();
108     void OnCalibrationEqualize(wxCommandEvent &event);
109     void OnCalibrationZero(wxCommandEvent &event);
110     void OnCalibrationAdjustLeft(wxSpinEvent &event);
111     void OnCalibrationAdjustRight(wxSpinEvent &event);
112     void OnCalibrationAffectAllRates(wxCommandEvent &event);
113     void OnKnownTransmitterUpdate(wxCommandEvent &event);
114     void OnUseKnownTransmitter(wxCommandEvent &event);
115         
116     // Tactical display related functions
117     void OnDisplayOrientation(wxCommandEvent &event);
118     void OnDisplayDoppler(wxCommandEvent &event);
119     void OnDisplayKnown(wxCommandEvent &event);
120     void OnDisplayEstimated(wxCommandEvent &event);
121     
122         // Menu event handlers
123         void OnExit(wxCommandEvent &event);
124         void OnAbout(wxCommandEvent &event);
125     void OnFileNew(wxCommandEvent &event);
126     void OnFileOpen(wxCommandEvent &event);
127     void OnFileClose(wxCommandEvent &event);
128     void OnFileSave(wxCommandEvent &event);
129     void OnCalibrationSaveToFile(wxCommandEvent &event);
130     void OnCalibrationLoadFromFile(wxCommandEvent &event);
131     void OnCalibrationLoadTransmitter(wxCommandEvent &event);
132     void OnCalibrationSaveTransmitter(wxCommandEvent &event);
133             
134         // Member data
135     HunterSettings *m_settings;         // Configuration file
136         EZDoppler *m_doppler;               // Attached Doppler device
137     GPS *m_gps;                         // Attached GPS device
138     SampleLog *m_log;                   // Accumulated sample points
139     KnownTransmitter m_known;           // Identified known transmitter location for calibration
140     TransmitterSearch m_search;         // Search being conducted
141     
142         bool m_doppler_started;             // Tracks start/stop of doppler device
143     bool m_gps_started;                 // Tracks start/stop of GPS device
144     bool m_capture;                     // Tracks start/stop of bearing capture
145     bool m_one_shot;                    // Tracks whether capture is one bearing only
146     int  m_histogram_source;            // Tracks histogram data source (0=estimated, 1=actual);
147     
148     Sample m_sample;                    // Current sample being updated by doppler and GPS
149                     
150     // Child windows that need remembering
151     TacticalPanel *m_tactical_panel;
152     HistogramPanel *m_error_histogram_panel;
153     
154         // This class handles events
155         DECLARE_EVENT_TABLE();
156 };