Skip to content

Commit

Permalink
Merge pull request #216 from cjcliffe/sproc_v2
Browse files Browse the repository at this point in the history
SpectrumVisualProcessor Zoom rework
  • Loading branch information
cjcliffe committed Dec 13, 2015
2 parents 68f0a98 + fb66df9 commit dbfedf5
Show file tree
Hide file tree
Showing 9 changed files with 210 additions and 70 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.8)

SET(CUBICSDR_VERSION_MAJOR "0")
SET(CUBICSDR_VERSION_MINOR "1")
SET(CUBICSDR_VERSION_PATCH "18")
SET(CUBICSDR_VERSION_PATCH "19")
SET(CUBICSDR_VERSION_REL "alpha")
SET(CUBICSDR_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}-${CUBICSDR_VERSION_REL}")

Expand Down
21 changes: 10 additions & 11 deletions src/AppFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ AppFrame::AppFrame() :
scopeCanvas->setHelpTip("Audio Visuals, drag left/right to toggle Scope or Spectrum.");
scopeCanvas->SetMinSize(wxSize(128,-1));
demodScopeTray->Add(scopeCanvas, 8, wxEXPAND | wxALL, 0);
wxGetApp().getScopeProcessor()->setup(2048);
wxGetApp().getScopeProcessor()->setup(1024);
wxGetApp().getScopeProcessor()->attachOutput(scopeCanvas->getInputQueue());

demodScopeTray->AddSpacer(1);
Expand Down Expand Up @@ -969,17 +969,22 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
// basic demodulators
if (dSelection != "" && dSelection != mgr->getLastDemodulatorType()) {
mgr->setLastDemodulatorType(dSelection);
mgr->setLastBandwidth(Modem::getModemDefaultSampleRate(dSelection));
demodTuner->setHalfBand(dSelection=="USB" || dSelection=="LSB");
demodModeSelectorAdv->setSelection(-1);
}
// advanced demodulators
else if(dSelectionadv != "" && dSelectionadv != mgr->getLastDemodulatorType()) {
mgr->setLastDemodulatorType(dSelectionadv);
mgr->setLastBandwidth(Modem::getModemDefaultSampleRate(dSelectionadv));
demodTuner->setHalfBand(false);
demodModeSelector->setSelection(-1);
}
#else
// basic demodulators
if (dSelection != "" && dSelection != mgr->getLastDemodulatorType()) {
mgr->setLastDemodulatorType(dSelection);
demodTuner->setHalfBand(dSelection=="USB" || dSelection=="LSB");
}
#endif
demodGainMeter->setLevel(mgr->getLastGain());
Expand Down Expand Up @@ -1045,15 +1050,9 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
GetStatusBar()->SetStatusText(wxString::Format(wxT("Spectrum averaging speed changed to %0.2f%%."),val*100.0));
}

proc->setView(waterfallCanvas->getViewState());
proc->setBandwidth(waterfallCanvas->getBandwidth());
proc->setCenterFrequency(waterfallCanvas->getCenterFrequency());

SpectrumVisualProcessor *dproc = wxGetApp().getDemodSpectrumProcessor();

dproc->setView(demodWaterfallCanvas->getViewState());
dproc->setBandwidth(demodWaterfallCanvas->getBandwidth());
dproc->setCenterFrequency(demodWaterfallCanvas->getCenterFrequency());
dproc->setView(demodWaterfallCanvas->getViewState(), demodWaterfallCanvas->getCenterFrequency(),demodWaterfallCanvas->getBandwidth());

SpectrumVisualProcessor *wproc = waterfallDataThread->getProcessor();

Expand All @@ -1065,11 +1064,11 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
GetStatusBar()->SetStatusText(wxString::Format(wxT("Waterfall max speed changed to %d lines per second."),(int)ceil(val*val)));
}

wproc->setView(waterfallCanvas->getViewState());
wproc->setBandwidth(waterfallCanvas->getBandwidth());
wproc->setCenterFrequency(waterfallCanvas->getCenterFrequency());
wproc->setView(waterfallCanvas->getViewState(), waterfallCanvas->getCenterFrequency(), waterfallCanvas->getBandwidth());
wxGetApp().getSDRPostThread()->setIQVisualRange(waterfallCanvas->getCenterFrequency(), waterfallCanvas->getBandwidth());

proc->setView(wproc->isView(), wproc->getCenterFrequency(), wproc->getBandwidth());

demod = wxGetApp().getDemodMgr().getLastActiveDemodulator();

if (modemPropertiesUpdated.load() && demod && demod->isModemInitialized()) {
Expand Down
5 changes: 3 additions & 2 deletions src/process/FFTVisualDataThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ void FFTVisualDataThread::run() {
DemodulatorThreadInputQueue *pipeIQDataIn = (DemodulatorThreadInputQueue *)getInputQueue("IQDataInput");
SpectrumVisualDataQueue *pipeFFTDataOut = (SpectrumVisualDataQueue *)getOutputQueue("FFTDataOutput");

pipeFFTDataOut->set_max_num_items(512);
fftDistrib.setInput(pipeIQDataIn);
fftDistrib.attachOutput(&fftQueue);
wproc.setInput(&fftQueue);
wproc.attachOutput(pipeFFTDataOut);
wproc.setup(2048);
wproc.setup(DEFAULT_FFT_SIZE);

std::cout << "FFT visual data thread started." << std::endl;

Expand All @@ -45,7 +46,7 @@ void FFTVisualDataThread::run() {
if (fftSize) {
fftDistrib.setFFTSize(fftSize);
} else {
fftDistrib.setFFTSize(DEFAULT_FFT_SIZE);
fftDistrib.setFFTSize(DEFAULT_FFT_SIZE * SPECTRUM_VZM);
}

if (lpsChanged.load()) {
Expand Down
Loading

0 comments on commit dbfedf5

Please sign in to comment.