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
22 HunterSettings::HunterSettings()
24 cfg = new wxConfig(_T("TransmitterHunter"));
27 HunterSettings::~HunterSettings()
35 wxSize HunterSettings::GetWindowSize()
39 cfg->Read(wxT("Application/Width"), &width, 1024);
40 cfg->Read(wxT("Application/Height"), &height, 768);
43 return wxSize((int)width, (int)height);
46 void HunterSettings::SetWindowSize(wxSize size)
49 cfg->Write(wxT("Application/Width"), size.GetWidth());
50 cfg->Write(wxT("Application/Height"), size.GetHeight());
54 int HunterSettings::GetWindowXPos()
58 cfg->Read(wxT("Application/XPos"), &x, 0);
63 void HunterSettings::SetWindowXPos(int x)
66 cfg->Write(wxT("Application/XPos"), (long)x);
69 int HunterSettings::GetWindowYPos()
73 cfg->Read(wxT("Application/YPos"), &y, 0);
78 void HunterSettings::SetWindowYPos(int y)
81 cfg->Write(wxT("Application/YPos"), (long)y);
84 bool HunterSettings::GetDopplerAutostart()
88 cfg->Read(wxT("Doppler/Autostart"), &start, false);
93 void HunterSettings::SetDopplerAutostart(bool start)
96 cfg->Write(wxT("Doppler/Autostart"), start);
99 int HunterSettings::GetDopplerFilter()
103 cfg->Read(wxT("Doppler/FilterLevel"), &filtering, 20);
105 return (int)filtering;
108 void HunterSettings::SetDopplerFilter(int level)
111 cfg->Write(wxT("Doppler/FilterLevel"), (long)level);
114 int HunterSettings::GetDopplerRotation()
118 cfg->Read(wxT("Doppler/Rotation"), &rate, 4);
123 void HunterSettings::SetDopplerRotation(int rate)
126 cfg->Write(wxT("Doppler/Rotation"), (long)rate);
129 float HunterSettings::GetDopplerCalibration(int rate)
134 key.Printf(_T("Doppler/Rate%iCalibration"), rate);
136 cfg->Read(key, &calibration, 0.0);
137 return (float)calibration;
140 void HunterSettings::SetDopplerCalibration(int rate, float offset)
143 key.Printf(_T("Doppler/Rate%iCalibration"), rate);
145 cfg->Write(key, offset);
148 bool HunterSettings::GetGPSAutostart()
152 cfg->Read(wxT("GPS/Autostart"), &start, false);
157 void HunterSettings::SetGPSAutostart(bool start)
160 cfg->Write(wxT("GPS/Autostart"), start);
163 wxString HunterSettings::GetGPSDeviceName()
167 cfg->Read(wxT("GPS/DeviceName"), &name);
172 void HunterSettings::SetGPSDeviceName(wxString &name)
175 cfg->Write(wxT("GPS/DeviceName"), name);
178 bool HunterSettings::GetCalibrationAffectAllRates()
182 cfg->Read(wxT("Calibration/AffectAllRates"), &val, false);
187 void HunterSettings::SetCalibrationAffectAllRates(bool val)
190 cfg->Write(wxT("Calibration/AffectAllRates"), val);
193 double HunterSettings::GetKnownTransmitterLongitude()
197 cfg->Read(wxT("KnownTransmitter/Longitude"), &lon);
202 void HunterSettings::SetKnownTransmitterLongitude(double lon)
205 cfg->Write(wxT("KnownTransmitter/Longitude"), lon);
208 double HunterSettings::GetKnownTransmitterLatitude()
212 cfg->Read(wxT("KnownTransmitter/Latitude"), &lat);
217 void HunterSettings::SetKnownTransmitterLatitude(double lat)
220 cfg->Write(wxT("KnownTransmitter/Latitude"), lat);
223 bool HunterSettings::GetUseKnownTransmitter()
227 cfg->Read(wxT("KnownTransmitter/Use"), &use, false);
232 void HunterSettings::SetUseKnownTransmitter(bool use)
235 cfg->Write(wxT("KnownTransmitter/Use"), use);
238 int HunterSettings::GetDisplayOrientation()
242 cfg->Read(wxT("Display/Orientation"), &x, 0);
247 void HunterSettings::SetDisplayOrientation(int orientation)
250 cfg->Write(wxT("Display/Orientation"), (long)orientation);
253 bool HunterSettings::GetDisplayDoppler()
257 cfg->Read(wxT("Display/DopplerPointer"), &val, false);
262 void HunterSettings::SetDisplayDoppler(bool val)
265 cfg->Write(wxT("Display/DopplerPointer"), val);
268 bool HunterSettings::GetDisplayKnown()
272 cfg->Read(wxT("Display/KnownPointer"), &val, false);
277 void HunterSettings::SetDisplayKnown(bool val)
280 cfg->Write(wxT("Display/KnownPointer"), val);
283 bool HunterSettings::GetDisplayEstimated()
287 cfg->Read(wxT("Display/EstimatedPointer"), &val, false);
292 void HunterSettings::SetDisplayEstimated(bool val)
295 cfg->Write(wxT("Display/EstimatedPointer"), val);
298 wxString HunterSettings::GetWorkingDirectory()
300 wxString str(_T("."));
302 return cfg->Read(wxT("Application/WorkingDirectory"), str);
306 void HunterSettings::SetWorkingDirectory(const wxString &dir)
309 cfg->Write(wxT("Application/WorkingDirectory"), dir);