fix for center freq. save/load

This commit is contained in:
Charles J. Cliffe 2015-07-21 00:04:04 -04:00
parent 9843f85086
commit 2b86176625
4 changed files with 7 additions and 9 deletions

View File

@ -66,14 +66,14 @@ AppFrame::AppFrame() :
demodSpectrumCanvas = new SpectrumCanvas(this, attribList);
demodSpectrumCanvas->setup(1024);
demodSpectrumCanvas->setView(DEFAULT_FREQ, 300000);
demodSpectrumCanvas->setView(wxGetApp().getConfig()->getCenterFreq(), 300000);
demodVisuals->Add(demodSpectrumCanvas, 3, wxEXPAND | wxALL, 0);
demodVisuals->AddSpacer(1);
demodWaterfallCanvas = new WaterfallCanvas(this, attribList);
demodWaterfallCanvas->setup(1024, 128);
demodWaterfallCanvas->setView(DEFAULT_FREQ, 300000);
demodWaterfallCanvas->setView(wxGetApp().getConfig()->getCenterFreq(), 300000);
demodWaterfallCanvas->attachSpectrumCanvas(demodSpectrumCanvas);
demodSpectrumCanvas->attachWaterfallCanvas(demodWaterfallCanvas);
demodVisuals->Add(demodWaterfallCanvas, 6, wxEXPAND | wxALL, 0);
@ -324,15 +324,13 @@ AppFrame::AppFrame() :
wxGetApp().setFrequencySnap(freqSnap);
ThemeMgr::mgr.setTheme(wxGetApp().getConfig()->getTheme());
wxGetApp().setFrequency(wxGetApp().getConfig()->getCenterFreq());
Show();
#ifdef _WIN32
SetIcon(wxICON(frame_icon));
#endif
GetStatusBar()->SetStatusText(wxString::Format(wxT("Set center frequency: %i"), DEFAULT_FREQ));
GetStatusBar()->SetStatusText(wxString::Format(wxT("Set center frequency: %i"), wxGetApp().getConfig()->getCenterFreq()));
wxAcceleratorEntry entries[3];
entries[0].Set(wxACCEL_CTRL, (int) 'O', wxID_OPEN);
@ -423,7 +421,7 @@ void AppFrame::OnMenu(wxCommandEvent& event) {
saveSession(saveFileDialog.GetPath().ToStdString());
} else if (event.GetId() == wxID_RESET) {
wxGetApp().getDemodMgr().terminateAll();
wxGetApp().setFrequency(DEFAULT_FREQ);
wxGetApp().setFrequency(100000000);
wxGetApp().setOffset(0);
SetTitle(CUBICSDR_TITLE);
currentSessionFile = "";
@ -539,6 +537,7 @@ void AppFrame::OnClose(wxCloseEvent& event) {
wxGetApp().getConfig()->setWindowMaximized(this->IsMaximized());
wxGetApp().getConfig()->setTheme(ThemeMgr::mgr.getTheme());
wxGetApp().getConfig()->setSnap(wxGetApp().getFrequencySnap());
wxGetApp().getConfig()->setCenterFreq(wxGetApp().getFrequency());
wxGetApp().getConfig()->save();
event.Skip();
}

View File

@ -40,7 +40,7 @@ bool CubicSDR::OnInit() {
wxApp::SetAppName("CubicSDR");
frequency = DEFAULT_FREQ;
frequency = wxGetApp().getConfig()->getCenterFreq();
offset = 0;
ppm = 0;
directSamplingMode = 0;

View File

@ -24,7 +24,7 @@
class CubicSDR: public wxApp {
public:
CubicSDR() :
appframe(NULL), m_glContext(NULL), frequency(DEFAULT_FREQ), sdrThread(NULL), sdrPostThread(NULL), threadCmdQueueSDR(NULL), iqVisualQueue(NULL), iqPostDataQueue(NULL), audioVisualQueue(NULL), t_SDR(NULL), t_PostSDR(NULL), sampleRate(DEFAULT_SAMPLE_RATE), offset(0), snap(1), directSamplingMode(0), ppm(0) {
appframe(NULL), m_glContext(NULL), frequency(0), sdrThread(NULL), sdrPostThread(NULL), threadCmdQueueSDR(NULL), iqVisualQueue(NULL), iqPostDataQueue(NULL), audioVisualQueue(NULL), t_SDR(NULL), t_PostSDR(NULL), sampleRate(DEFAULT_SAMPLE_RATE), offset(0), snap(1), directSamplingMode(0), ppm(0) {
}

View File

@ -30,7 +30,6 @@ const char filePathSeparator =
#define DEFAULT_SAMPLE_RATE 2400000
#define DEFAULT_FFT_SIZE 2048
#define DEFAULT_FREQ 100000000
#define DEFAULT_DEMOD_TYPE 1
#define DEFAULT_DEMOD_BW 200000