mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-11 18:28:57 -04:00
fix for center freq. save/load
This commit is contained in:
+5
-6
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user