reduce excessive re-saving of config
This commit is contained in:
parent
db434348a4
commit
927de58e4e
|
@ -376,16 +376,21 @@ void AppFrame::OnMenu(wxCommandEvent& event) {
|
|||
"Frequency Offset", wxGetApp().getOffset(), -2000000000, 2000000000, this);
|
||||
if (ofs != -1) {
|
||||
wxGetApp().setOffset(ofs);
|
||||
wxGetApp().saveConfig();
|
||||
}
|
||||
} else if (event.GetId() == wxID_SET_DS_OFF) {
|
||||
wxGetApp().setDirectSampling(0);
|
||||
wxGetApp().saveConfig();
|
||||
} else if (event.GetId() == wxID_SET_DS_I) {
|
||||
wxGetApp().setDirectSampling(1);
|
||||
wxGetApp().saveConfig();
|
||||
} else if (event.GetId() == wxID_SET_DS_Q) {
|
||||
wxGetApp().setDirectSampling(2);
|
||||
wxGetApp().saveConfig();
|
||||
} else if (event.GetId() == wxID_SET_SWAP_IQ) {
|
||||
bool swap_state = !wxGetApp().getSwapIQ();
|
||||
wxGetApp().setSwapIQ(swap_state);
|
||||
wxGetApp().saveConfig();
|
||||
iqSwapMenuItem->Check(swap_state);
|
||||
} else if (event.GetId() == wxID_SET_PPM) {
|
||||
long ofs = wxGetNumberFromUser("Frequency correction for device in PPM.\ni.e. -51 for -51 PPM\n\nNote: you can adjust PPM interactively\nby holding ALT over the frequency tuning bar.\n", "Parts per million (PPM)",
|
||||
|
|
|
@ -193,7 +193,6 @@ void CubicSDR::setOffset(long long ofs) {
|
|||
|
||||
SDRDeviceInfo *dev = (*getDevices())[getDevice()];
|
||||
config.getDevice(dev->getDeviceId())->setOffset(ofs);
|
||||
config.save();
|
||||
}
|
||||
|
||||
void CubicSDR::setDirectSampling(int mode) {
|
||||
|
@ -204,7 +203,6 @@ void CubicSDR::setDirectSampling(int mode) {
|
|||
|
||||
SDRDeviceInfo *dev = (*getDevices())[getDevice()];
|
||||
config.getDevice(dev->getDeviceId())->setDirectSampling(mode);
|
||||
config.save();
|
||||
}
|
||||
|
||||
int CubicSDR::getDirectSampling() {
|
||||
|
@ -215,7 +213,6 @@ void CubicSDR::setSwapIQ(bool swapIQ) {
|
|||
sdrPostThread->setSwapIQ(swapIQ);
|
||||
SDRDeviceInfo *dev = (*getDevices())[getDevice()];
|
||||
config.getDevice(dev->getDeviceId())->setIQSwap(swapIQ);
|
||||
config.save();
|
||||
}
|
||||
|
||||
bool CubicSDR::getSwapIQ() {
|
||||
|
@ -309,7 +306,6 @@ void CubicSDR::setPPM(int ppm_in) {
|
|||
SDRDeviceInfo *dev = (*getDevices())[getDevice()];
|
||||
|
||||
config.getDevice(dev->getDeviceId())->setPPM(ppm_in);
|
||||
config.save();
|
||||
}
|
||||
|
||||
int CubicSDR::getPPM() {
|
||||
|
|
Loading…
Reference in New Issue