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 // Application level includes
26 #include <wx/spinbutt.h> // Unknown why these two aren't in wx.h
27 #include <wx/splitter.h>
29 // Forward declarations
31 class EZDopplerUpdate;
39 class KnownTransmitter;
41 class HunterFrame : public wxFrame
46 void DoCalibrationStep(int which);
49 // Initialization routines
50 void InitializeSettings();
51 void InitializeWindows();
52 void InitializeDoppler();
54 void InitializeCalibration();
55 void InitializeSearch();
56 void InitializeDisplay();
58 // System related functions
59 void OnClose(wxCloseEvent &event);
61 // Status related functions
62 void OnHistogramSourceChg(wxCommandEvent &event);
63 void OnHistogramCoordsChg(wxCommandEvent &event);
65 // Search related functions
66 void EnableSearchItems(bool enable);
67 void MakeNewLogAndSearch();
69 void StartCaptureAutomatic();
70 void StartCaptureOnce();
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);
81 // Doppler related functions
82 void SetDopplerParams();
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);
93 // GPS related functions
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);
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);
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);
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);
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
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);
148 Sample m_sample; // Current sample being updated by doppler and GPS
150 // Child windows that need remembering
151 TacticalPanel *m_tactical_panel;
152 HistogramPanel *m_error_histogram_panel;
154 // This class handles events
155 DECLARE_EVENT_TABLE();