diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index 02d2c5e..f336473 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -1496,8 +1496,12 @@ void AppFrame::OnIdle(wxIdleEvent& event) { demod = wxGetApp().getDemodMgr().getLastActiveDemodulator(); if (modemPropertiesUpdated.load() && demod && demod->isModemInitialized()) { - modemProps->initProperties(demod->getModemArgs()); + + //reset notification flag modemPropertiesUpdated.store(false); + + modemProps->initProperties(demod->getModemArgs()); + demodTray->Layout(); modemProps->fitColumns(); #if ENABLE_DIGITAL_LAB @@ -1509,7 +1513,7 @@ void AppFrame::OnIdle(wxIdleEvent& event) { } demod->showOutput(); } -#endif +#endif } if (modemProps->isCollapsed() && modemProps->GetMinWidth() > 22) { @@ -1873,8 +1877,8 @@ FFTVisualDataThread *AppFrame::getWaterfallDataThread() { return waterfallDataThread; } -void AppFrame::updateModemProperties(ModemArgInfoList args) { - newModemArgs = args; +void AppFrame::notifyUpdateModemProperties() { + modemPropertiesUpdated.store(true); } diff --git a/src/AppFrame.h b/src/AppFrame.h index 5c9774b..991b37a 100644 --- a/src/AppFrame.h +++ b/src/AppFrame.h @@ -83,7 +83,7 @@ public: FFTVisualDataThread *getWaterfallDataThread(); - void updateModemProperties(ModemArgInfoList args); + void notifyUpdateModemProperties(); void setMainWaterfallFFTSize(int fftSize); void gkNudgeLeft(DemodulatorInstance *demod, int snap); @@ -163,7 +163,6 @@ private: ModemProperties *modemProps; std::atomic_bool modemPropertiesUpdated; - ModemArgInfoList newModemArgs; wxMenuItem *showTipMenuItem; bool lowPerfMode; diff --git a/src/demod/DemodulatorWorkerThread.cpp b/src/demod/DemodulatorWorkerThread.cpp index c5c59e8..35efd62 100644 --- a/src/demod/DemodulatorWorkerThread.cpp +++ b/src/demod/DemodulatorWorkerThread.cpp @@ -61,7 +61,7 @@ void DemodulatorWorkerThread::run() { cModem->writeSettings(demodCommand.settings); } result.sampleRate = demodCommand.sampleRate; - wxGetApp().getAppFrame()->updateModemProperties(cModem->getSettings()); + wxGetApp().getAppFrame()->notifyUpdateModemProperties(); } result.modem = cModem;