From aa5a162888787ee81b3d0db76d70d43ef9fdfb11 Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Thu, 10 Sep 2015 23:42:22 -0400 Subject: [PATCH] Cleanup --- src/CubicSDR.cpp | 2 +- src/visual/ScopeCanvas.cpp | 4 ---- src/visual/SpectrumCanvas.cpp | 4 ---- src/visual/WaterfallCanvas.cpp | 34 ++++------------------------------ 4 files changed, 5 insertions(+), 39 deletions(-) diff --git a/src/CubicSDR.cpp b/src/CubicSDR.cpp index fcb3b52..15d187f 100644 --- a/src/CubicSDR.cpp +++ b/src/CubicSDR.cpp @@ -66,7 +66,7 @@ bool CubicSDR::OnInit() { pipeSpectrumIQVisualData->set_max_num_items(1); pipeWaterfallIQVisualData = new DemodulatorThreadInputQueue(); - pipeWaterfallIQVisualData->set_max_num_items(DEFAULT_WATERFALL_LPS); + pipeWaterfallIQVisualData->set_max_num_items(128); spectrumDistributor.attachOutput(pipeDemodIQVisualData); spectrumDistributor.attachOutput(pipeSpectrumIQVisualData); diff --git a/src/visual/ScopeCanvas.cpp b/src/visual/ScopeCanvas.cpp index 6c22dc7..9dfaced 100644 --- a/src/visual/ScopeCanvas.cpp +++ b/src/visual/ScopeCanvas.cpp @@ -102,10 +102,6 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); const wxSize ClientSize = GetClientSize(); -//#ifdef __APPLE__ -// glFinish(); -//#endif - while (!inputData.empty()) { ScopeRenderData *avData; inputData.pop(avData); diff --git a/src/visual/SpectrumCanvas.cpp b/src/visual/SpectrumCanvas.cpp index 557398c..adcc96c 100644 --- a/src/visual/SpectrumCanvas.cpp +++ b/src/visual/SpectrumCanvas.cpp @@ -45,10 +45,6 @@ SpectrumCanvas::~SpectrumCanvas() { void SpectrumCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); const wxSize ClientSize = GetClientSize(); -//#ifdef __APPLE__ -// glFinish(); -//#endif - if (!visualDataQueue.empty()) { SpectrumVisualData *vData; diff --git a/src/visual/WaterfallCanvas.cpp b/src/visual/WaterfallCanvas.cpp index 7b02d96..c7d8dad 100644 --- a/src/visual/WaterfallCanvas.cpp +++ b/src/visual/WaterfallCanvas.cpp @@ -78,21 +78,7 @@ void WaterfallCanvas::processInputQueue() { } glContext->SetCurrent(*this); - bool processed = false; -// int numVis = visualDataQueue.size(); - gTimer.update(); -// if (linesPerSecond >= 30) { -// if ((visualDataQueue.size() < (linesPerSecond/5)) && !preBuf) { -// return; -// } else { -// if (visualDataQueue.size() < (linesPerSecond/10)) { -// preBuf = false; -// } else { -// preBuf = true; -// } -// } -// } double targetVis = 1.0 / (double)linesPerSecond; lpsIndex += gTimer.lastUpdateSeconds(); @@ -109,7 +95,6 @@ void WaterfallCanvas::processInputQueue() { waterfallPanel.setPoints(vData->spectrum_points); waterfallPanel.step(); vData->decRefCount(); - processed = true; } lpsIndex-=targetVis; } else { @@ -118,21 +103,11 @@ void WaterfallCanvas::processInputQueue() { } tex_update.unlock(); } - } - if (processed) { -// Refresh(); - } -} + }} void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { -// wxClientDC dc(this); -// testTimer.timerTestFunc(); wxPaintDC dc(this); -//#ifdef __APPLE__ -// glFinish(); -//#endif - processInputQueue(); const wxSize ClientSize = GetClientSize(); @@ -318,7 +293,6 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { glContext->EndDraw(); -// glFlush(); SwapBuffers(); } @@ -436,11 +410,11 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) { } void WaterfallCanvas::OnIdle(wxIdleEvent &event) { -// Refresh(); -// processInputQueue(); Refresh(); event.RequestMore(); -// event.Skip(); + if (visualDataQueue.size() > linesPerSecond) { + processInputQueue(); + } } void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) {