Modem property grid now shows interactive settings

- Not yet applied
This commit is contained in:
Charles J. Cliffe 2015-11-23 22:03:14 -05:00
parent 5303f329df
commit c5bccb4211
4 changed files with 18 additions and 2 deletions

View File

@ -94,8 +94,9 @@ AppFrame::AppFrame() :
demodModeSelectorAdv->setHelpTip("Choose advanced modulation types."); demodModeSelectorAdv->setHelpTip("Choose advanced modulation types.");
demodTray->Add(demodModeSelectorAdv, 3, wxEXPAND | wxALL, 0); demodTray->Add(demodModeSelectorAdv, 3, wxEXPAND | wxALL, 0);
modemPropertiesUpdated.store(false);
modemProps = new ModemProperties(demodPanel, wxID_ANY); modemProps = new ModemProperties(demodPanel, wxID_ANY);
demodTray->Add(modemProps, 10, wxEXPAND | wxALL, 0); demodTray->Add(modemProps, 15, wxEXPAND | wxALL, 0);
#endif #endif
wxGetApp().getDemodSpectrumProcessor()->setup(1024); wxGetApp().getDemodSpectrumProcessor()->setup(1024);
@ -1046,6 +1047,10 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
wproc->setCenterFrequency(waterfallCanvas->getCenterFrequency()); wproc->setCenterFrequency(waterfallCanvas->getCenterFrequency());
wxGetApp().getSDRPostThread()->setIQVisualRange(waterfallCanvas->getCenterFrequency(), waterfallCanvas->getBandwidth()); wxGetApp().getSDRPostThread()->setIQVisualRange(waterfallCanvas->getCenterFrequency(), waterfallCanvas->getBandwidth());
if (modemPropertiesUpdated.load()) {
modemProps->initProperties(newModemArgs);
modemPropertiesUpdated.store(false);
}
// waterfallCanvas->processInputQueue(); // waterfallCanvas->processInputQueue();
// waterfallCanvas->Refresh(); // waterfallCanvas->Refresh();
// demodWaterfallCanvas->processInputQueue(); // demodWaterfallCanvas->processInputQueue();
@ -1246,3 +1251,8 @@ FFTVisualDataThread *AppFrame::getWaterfallDataThread() {
return waterfallDataThread; return waterfallDataThread;
} }
void AppFrame::updateModemProperties(ModemArgInfoList args) {
newModemArgs = args;
modemPropertiesUpdated.store(true);
}

View File

@ -68,6 +68,8 @@ public:
FFTVisualDataThread *getWaterfallDataThread(); FFTVisualDataThread *getWaterfallDataThread();
void updateModemProperties(ModemArgInfoList args);
private: private:
void OnMenu(wxCommandEvent& event); void OnMenu(wxCommandEvent& event);
void OnClose(wxCloseEvent& event); void OnClose(wxCloseEvent& event);
@ -123,6 +125,8 @@ private:
std::atomic_bool deviceChanged; std::atomic_bool deviceChanged;
ModemProperties *modemProps; ModemProperties *modemProps;
std::atomic_bool modemPropertiesUpdated;
ModemArgInfoList newModemArgs;
wxDECLARE_EVENT_TABLE(); wxDECLARE_EVENT_TABLE();
}; };

View File

@ -9,7 +9,7 @@ ModemProperties::ModemProperties(wxWindow *parent, wxWindowID winid,
bSizer = new wxBoxSizer( wxVERTICAL ); bSizer = new wxBoxSizer( wxVERTICAL );
bSizer->Add(m_propertyGrid, wxEXPAND ); bSizer->Add(m_propertyGrid, 1, wxEXPAND | wxALL, 5);
this->SetSizer(bSizer); this->SetSizer(bSizer);
} }

View File

@ -1,5 +1,6 @@
#include "DemodulatorWorkerThread.h" #include "DemodulatorWorkerThread.h"
#include "CubicSDRDefs.h" #include "CubicSDRDefs.h"
#include "CubicSDR.h"
#include <vector> #include <vector>
DemodulatorWorkerThread::DemodulatorWorkerThread() : IOThread(), DemodulatorWorkerThread::DemodulatorWorkerThread() : IOThread(),
@ -52,6 +53,7 @@ void DemodulatorWorkerThread::run() {
cModem = Modem::makeModem(demodCommand.demodType); cModem = Modem::makeModem(demodCommand.demodType);
cModemType = demodCommand.demodType; cModemType = demodCommand.demodType;
result.sampleRate = demodCommand.sampleRate; result.sampleRate = demodCommand.sampleRate;
wxGetApp().getAppFrame()->updateModemProperties(cModem->getSettings());
} }
result.modem = cModem; result.modem = cModem;