windows fix-up

This commit is contained in:
Charles J. Cliffe 2015-08-12 22:36:29 -04:00
commit c77d2c9408
17 changed files with 107 additions and 76 deletions

View File

@ -35,11 +35,10 @@ EVT_CLOSE(AppFrame::OnClose)
EVT_MENU(wxID_ANY, AppFrame::OnMenu) EVT_MENU(wxID_ANY, AppFrame::OnMenu)
EVT_COMMAND(wxID_ANY, wxEVT_THREAD, AppFrame::OnThread) EVT_COMMAND(wxID_ANY, wxEVT_THREAD, AppFrame::OnThread)
EVT_IDLE(AppFrame::OnIdle) EVT_IDLE(AppFrame::OnIdle)
EVT_TIMER(FRAME_TIMER_ID, AppFrame::OnTimer)
wxEND_EVENT_TABLE() wxEND_EVENT_TABLE()
AppFrame::AppFrame() : AppFrame::AppFrame() :
wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL), frame_timer(this, FRAME_TIMER_ID) { wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {
#ifdef __linux__ #ifdef __linux__
SetIcon(wxICON(cubicsdr)); SetIcon(wxICON(cubicsdr));
@ -107,6 +106,7 @@ AppFrame::AppFrame() :
demodGainMeter = new MeterCanvas(this, attribList); demodGainMeter = new MeterCanvas(this, attribList);
demodGainMeter->setMax(2.0); demodGainMeter->setMax(2.0);
demodGainMeter->setHelpTip("Current Demodulator Gain Level. Click / Drag to set Gain level."); demodGainMeter->setHelpTip("Current Demodulator Gain Level. Click / Drag to set Gain level.");
demodGainMeter->setShowUserInput(false);
demodTray->Add(demodGainMeter, 1, wxEXPAND | wxALL, 0); demodTray->Add(demodGainMeter, 1, wxEXPAND | wxALL, 0);
vbox->Add(demodTray, 12, wxEXPAND | wxALL, 0); vbox->Add(demodTray, 12, wxEXPAND | wxALL, 0);
@ -118,9 +118,10 @@ AppFrame::AppFrame() :
wxGetApp().getSpectrumProcesor()->attachOutput(spectrumCanvas->getVisualDataQueue()); wxGetApp().getSpectrumProcesor()->attachOutput(spectrumCanvas->getVisualDataQueue());
spectrumAvgMeter = new MeterCanvas(this, attribList); spectrumAvgMeter = new MeterCanvas(this, attribList);
spectrumAvgMeter->setMax(3.0); spectrumAvgMeter->setMax(1.0);
spectrumAvgMeter->setInputValue(1.0); spectrumAvgMeter->setLevel(0.65);
spectrumAvgMeter->setShowUserInput(false);
spectrumSizer->Add(spectrumCanvas, 63, wxEXPAND | wxALL, 0); spectrumSizer->Add(spectrumCanvas, 63, wxEXPAND | wxALL, 0);
spectrumSizer->AddSpacer(1); spectrumSizer->AddSpacer(1);
spectrumSizer->Add(spectrumAvgMeter, 1, wxEXPAND | wxALL, 0); spectrumSizer->Add(spectrumAvgMeter, 1, wxEXPAND | wxALL, 0);
@ -143,7 +144,8 @@ AppFrame::AppFrame() :
waterfallSpeedMeter = new MeterCanvas(this, attribList); waterfallSpeedMeter = new MeterCanvas(this, attribList);
waterfallSpeedMeter->setMax(sqrt(1024)); waterfallSpeedMeter->setMax(sqrt(1024));
waterfallSpeedMeter->setInputValue(sqrt(DEFAULT_WATERFALL_LPS)); waterfallSpeedMeter->setLevel(sqrt(DEFAULT_WATERFALL_LPS));
waterfallSpeedMeter->setShowUserInput(false);
wfSizer->Add(waterfallCanvas, 63, wxEXPAND | wxALL, 0); wfSizer->Add(waterfallCanvas, 63, wxEXPAND | wxALL, 0);
wfSizer->AddSpacer(1); wfSizer->AddSpacer(1);
@ -261,7 +263,7 @@ AppFrame::AppFrame() :
// sampleRateMenuItems[wxID_BANDWIDTH_3000M] = menu->AppendRadioItem(wxID_BANDWIDTH_3000M, "3.0M"); // sampleRateMenuItems[wxID_BANDWIDTH_3000M] = menu->AppendRadioItem(wxID_BANDWIDTH_3000M, "3.0M");
sampleRateMenuItems[wxID_BANDWIDTH_3200M] = menu->AppendRadioItem(wxID_BANDWIDTH_3200M, "3.2M"); sampleRateMenuItems[wxID_BANDWIDTH_3200M] = menu->AppendRadioItem(wxID_BANDWIDTH_3200M, "3.2M");
sampleRateMenuItems[wxID_BANDWIDTH_2400M]->Check(true); sampleRateMenuItems[wxID_BANDWIDTH_2048M]->Check(true);
menuBar->Append(menu, wxT("&Input Bandwidth")); menuBar->Append(menu, wxT("&Input Bandwidth"));
@ -402,11 +404,6 @@ void AppFrame::initDeviceParams(std::string deviceId) {
if (devConfig->getIQSwap()) { if (devConfig->getIQSwap()) {
iqSwapMenuItem->Check(); iqSwapMenuItem->Check();
} }
if (!frame_timer.IsRunning()) {
// frame rate = 1000 / 30 = 33ms
frame_timer.Start(25);
}
} }
@ -601,10 +598,6 @@ void AppFrame::OnThread(wxCommandEvent& event) {
} }
void AppFrame::OnIdle(wxIdleEvent& event) { void AppFrame::OnIdle(wxIdleEvent& event) {
event.Skip();
}
void AppFrame::OnTimer(wxTimerEvent& event) {
DemodulatorInstance *demod = wxGetApp().getDemodMgr().getLastActiveDemodulator(); DemodulatorInstance *demod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
@ -719,9 +712,15 @@ void AppFrame::OnTimer(wxTimerEvent& event) {
wxGetApp().getScopeProcessor()->run(); wxGetApp().getScopeProcessor()->run();
wxGetApp().getSpectrumDistributor()->run(); wxGetApp().getSpectrumDistributor()->run();
SpectrumVisualProcessor *proc = wxGetApp().getSpectrumProcesor(); SpectrumVisualProcessor *proc = wxGetApp().getSpectrumProcesor();
if (spectrumAvgMeter->inputChanged()) {
float val = spectrumAvgMeter->getInputValue();
spectrumAvgMeter->setLevel(val);
proc->setFFTAverageRate(val);
}
proc->setView(spectrumCanvas->getViewState()); proc->setView(spectrumCanvas->getViewState());
proc->setBandwidth(spectrumCanvas->getBandwidth()); proc->setBandwidth(spectrumCanvas->getBandwidth());
proc->setCenterFrequency(spectrumCanvas->getCenterFrequency()); proc->setCenterFrequency(spectrumCanvas->getCenterFrequency());
@ -747,7 +746,8 @@ void AppFrame::OnTimer(wxTimerEvent& event) {
} }
if (waterfallSpeedMeter->inputChanged()) { if (waterfallSpeedMeter->inputChanged()) {
int val = (int)waterfallSpeedMeter->getInputValue(); float val = waterfallSpeedMeter->getInputValue();
waterfallSpeedMeter->setLevel(val);
fftDistrib.setLinesPerSecond((int)ceil(val*val)); fftDistrib.setLinesPerSecond((int)ceil(val*val));
wxGetApp().getWaterfallVisualQueue()->set_max_num_items((int)ceil(val*val)); wxGetApp().getWaterfallVisualQueue()->set_max_num_items((int)ceil(val*val));
} }
@ -761,33 +761,15 @@ void AppFrame::OnTimer(wxTimerEvent& event) {
while (!wproc->isInputEmpty()) { while (!wproc->isInputEmpty()) {
wproc->run(); wproc->run();
} }
waterfallCanvas->processInputQueue();
demodWaterfallCanvas->processInputQueue();
#ifndef _WIN32
usleep(5000);
#endif
scopeCanvas->Refresh(); event.RequestMore();
waterfallCanvas->Refresh();
spectrumCanvas->Refresh();
demodWaterfallCanvas->Refresh();
demodSpectrumCanvas->Refresh();
demodSignalMeter->Refresh();
demodGainMeter->Refresh();
if (demodTuner->getMouseTracker()->mouseInView() || demodTuner->changed()) {
demodTuner->Refresh();
}
if (demodModeSelector->getMouseTracker()->mouseInView()) {
demodModeSelector->Refresh();
}
if (waterfallSpeedMeter->getMouseTracker()->mouseInView()) {
waterfallSpeedMeter->Refresh();
}
if (spectrumAvgMeter->getMouseTracker()->mouseInView()) {
spectrumAvgMeter->Refresh();
}
event.Skip();
} }
void AppFrame::saveSession(std::string fileName) { void AppFrame::saveSession(std::string fileName) {

View File

@ -50,8 +50,6 @@
#define wxID_AUDIO_BANDWIDTH_BASE 9000 #define wxID_AUDIO_BANDWIDTH_BASE 9000
#define wxID_AUDIO_DEVICE_MULTIPLIER 50 #define wxID_AUDIO_DEVICE_MULTIPLIER 50
#define FRAME_TIMER_ID 1000
// Define a new frame type // Define a new frame type
class AppFrame: public wxFrame { class AppFrame: public wxFrame {
public: public:
@ -69,7 +67,6 @@ private:
void OnClose(wxCloseEvent& event); void OnClose(wxCloseEvent& event);
void OnNewWindow(wxCommandEvent& event); void OnNewWindow(wxCommandEvent& event);
void OnIdle(wxIdleEvent& event); void OnIdle(wxIdleEvent& event);
void OnTimer(wxTimerEvent& event);
ScopeCanvas *scopeCanvas; ScopeCanvas *scopeCanvas;
SpectrumCanvas *spectrumCanvas; SpectrumCanvas *spectrumCanvas;
@ -96,7 +93,6 @@ private:
wxMenuItem *iqSwapMenuItem; wxMenuItem *iqSwapMenuItem;
std::string currentSessionFile; std::string currentSessionFile;
wxTimer frame_timer;
FFTDataDistributor fftDistrib; FFTDataDistributor fftDistrib;
DemodulatorThreadInputQueue fftQueue; DemodulatorThreadInputQueue fftQueue;

View File

@ -78,9 +78,11 @@ bool CubicSDR::OnInit() {
scopeProcessor.setInput(pipeAudioVisualData); scopeProcessor.setInput(pipeAudioVisualData);
// I/Q Data // I/Q Data
pipeSDRIQData = new SDRThreadIQDataQueue; pipeSDRIQData = new SDRThreadIQDataQueue();
pipeSDRCommand = new SDRThreadCommandQueue(); pipeSDRCommand = new SDRThreadCommandQueue();
pipeSDRIQData->set_max_num_items(1);
sdrThread = new SDRThread(); sdrThread = new SDRThread();
sdrThread->setInputQueue("SDRCommandQueue",pipeSDRCommand); sdrThread->setInputQueue("SDRCommandQueue",pipeSDRCommand);
sdrThread->setOutputQueue("IQDataOutput",pipeSDRIQData); sdrThread->setOutputQueue("IQDataOutput",pipeSDRIQData);

View File

@ -27,10 +27,10 @@ const char filePathSeparator =
#define BUF_SIZE (16384*6) #define BUF_SIZE (16384*6)
#define DEFAULT_SAMPLE_RATE 2400000 #define DEFAULT_SAMPLE_RATE 2048000
#define DEFAULT_FFT_SIZE 2048 #define DEFAULT_FFT_SIZE 2048
#define DEFAULT_DEMOD_TYPE 1 #define DEFAULT_DEMOD_TYPE 1
#define DEFAULT_DEMOD_BW 200000 #define DEFAULT_DEMOD_BW 200000
#define DEFAULT_WATERFALL_LPS 24 #define DEFAULT_WATERFALL_LPS 30

View File

@ -5,6 +5,7 @@
#include <deque> #include <deque>
#include <map> #include <map>
#include <string> #include <string>
#include <iostream>
#include "ThreadQueue.h" #include "ThreadQueue.h"
@ -63,6 +64,10 @@ public:
return buf; return buf;
} }
// if (outputBuffers.size() > 100) {
// std::cout << "Buffer over 100.." << std::endl;
// }
buf = new BufferType(); buf = new BufferType();
outputBuffers.push_back(buf); outputBuffers.push_back(buf);

View File

@ -94,7 +94,7 @@ void DemodulatorThread::run() {
while (!terminated) { while (!terminated) {
DemodulatorThreadPostIQData *inp; DemodulatorThreadPostIQData *inp;
iqInputQueue->pop(inp); iqInputQueue->pop(inp);
std::lock_guard < std::mutex > lock(inp->m_mutex); // std::lock_guard < std::mutex > lock(inp->m_mutex);
int bufSize = inp->data.size(); int bufSize = inp->data.size();

View File

@ -15,6 +15,7 @@ SpectrumVisualProcessor::SpectrumVisualProcessor() : lastInputBandwidth(0), last
fft_ceil_ma = fft_ceil_maa = 100.0; fft_ceil_ma = fft_ceil_maa = 100.0;
fft_floor_ma = fft_floor_maa = 0.0; fft_floor_ma = fft_floor_maa = 0.0;
desiredInputSize = 0; desiredInputSize = 0;
fft_average_rate = 0.65;
} }
SpectrumVisualProcessor::~SpectrumVisualProcessor() { SpectrumVisualProcessor::~SpectrumVisualProcessor() {
@ -29,6 +30,9 @@ void SpectrumVisualProcessor::setView(bool bView) {
is_view.store(bView); is_view.store(bView);
} }
void SpectrumVisualProcessor::setFFTAverageRate(float fftAverageRate) {
this->fft_average_rate = fftAverageRate;
}
void SpectrumVisualProcessor::setCenterFrequency(long long centerFreq_in) { void SpectrumVisualProcessor::setCenterFrequency(long long centerFreq_in) {
centerFreq.store(centerFreq_in); centerFreq.store(centerFreq_in);
@ -260,11 +264,11 @@ void SpectrumVisualProcessor::process() {
for (int i = 0, iMax = fftSize; i < iMax; i++) { for (int i = 0, iMax = fftSize; i < iMax; i++) {
if (is_view.load()) { if (is_view.load()) {
fft_result_maa[i] += (fft_result_ma[i] - fft_result_maa[i]) * 0.65; fft_result_maa[i] += (fft_result_ma[i] - fft_result_maa[i]) * fft_average_rate;
fft_result_ma[i] += (fft_result[i] - fft_result_ma[i]) * 0.65; fft_result_ma[i] += (fft_result[i] - fft_result_ma[i]) * fft_average_rate;
} else { } else {
fft_result_maa[i] += (fft_result_ma[i] - fft_result_maa[i]) * 0.65; fft_result_maa[i] += (fft_result_ma[i] - fft_result_maa[i]) * fft_average_rate;
fft_result_ma[i] += (fft_result[i] - fft_result_ma[i]) * 0.65; fft_result_ma[i] += (fft_result[i] - fft_result_ma[i]) * fft_average_rate;
} }
if (fft_result_maa[i] > fft_ceil) { if (fft_result_maa[i] > fft_ceil) {

View File

@ -21,6 +21,8 @@ public:
bool isView(); bool isView();
void setView(bool bView); void setView(bool bView);
void setFFTAverageRate(float fftAverageRate);
void setCenterFrequency(long long centerFreq_in); void setCenterFrequency(long long centerFreq_in);
long long getCenterFrequency(); long long getCenterFrequency();
@ -50,6 +52,7 @@ private:
double fft_ceil_ma, fft_ceil_maa; double fft_ceil_ma, fft_ceil_maa;
double fft_floor_ma, fft_floor_maa; double fft_floor_ma, fft_floor_maa;
float fft_average_rate;
std::vector<double> fft_result; std::vector<double> fft_result;
std::vector<double> fft_result_ma; std::vector<double> fft_result_ma;

View File

@ -86,11 +86,14 @@ void SDRPostThread::run() {
std::vector<liquid_float_complex> fpData; std::vector<liquid_float_complex> fpData;
std::vector<liquid_float_complex> dataOut; std::vector<liquid_float_complex> dataOut;
iqDataInQueue->set_max_num_items(0);
while (!terminated) { while (!terminated) {
SDRThreadIQData *data_in; SDRThreadIQData *data_in;
iqDataInQueue->pop(data_in); iqDataInQueue->pop(data_in);
// std::lock_guard < std::mutex > lock(data_in->m_mutex); // std::lock_guard < std::mutex > lock(data_in->m_mutex);
int num_vis_samples = this->num_vis_samples;
if (data_in && data_in->data.size()) { if (data_in && data_in->data.size()) {
int dataSize = data_in->data.size()/2; int dataSize = data_in->data.size()/2;
@ -120,6 +123,10 @@ void SDRPostThread::run() {
visualDataOut->busy_rw.lock(); visualDataOut->busy_rw.lock();
visualDataOut->setRefCount(1); visualDataOut->setRefCount(1);
if (num_vis_samples > dataOut.size()) {
num_vis_samples = dataOut.size();
}
if (visualDataOut->data.size() < num_vis_samples) { if (visualDataOut->data.size() < num_vis_samples) {
if (visualDataOut->data.capacity() < num_vis_samples) { if (visualDataOut->data.capacity() < num_vis_samples) {
visualDataOut->data.reserve(num_vis_samples); visualDataOut->data.reserve(num_vis_samples);
@ -198,8 +205,12 @@ void SDRPostThread::run() {
} }
if (iqDataOutQueue != NULL) { if (iqDataOutQueue != NULL) {
iqDataOutQueue->push(demodDataOut); if (!iqDataOutQueue->full()) {
pushedData = true; iqDataOutQueue->push(demodDataOut);
pushedData = true;
} else {
demodDataOut->decRefCount();
}
} }
if (!pushedData && iqDataOutQueue == NULL) { if (!pushedData && iqDataOutQueue == NULL) {

View File

@ -25,7 +25,7 @@ EVT_ENTER_WINDOW(MeterCanvas::OnMouseEnterWindow)
wxEND_EVENT_TABLE() wxEND_EVENT_TABLE()
MeterCanvas::MeterCanvas(wxWindow *parent, int *attribList) : MeterCanvas::MeterCanvas(wxWindow *parent, int *attribList) :
InteractiveCanvas(parent, attribList), level(0), level_max(1), inputValue(0), userInputValue(0) { InteractiveCanvas(parent, attribList), level(0), level_max(1), inputValue(0), userInputValue(0), showUserInput(true) {
glContext = new MeterContext(this, &wxGetApp().GetContext(this)); glContext = new MeterContext(this, &wxGetApp().GetContext(this));
} }
@ -58,6 +58,10 @@ float MeterCanvas::getInputValue() {
return userInputValue; return userInputValue;
} }
void MeterCanvas::setShowUserInput(bool showUserInput) {
this->showUserInput = showUserInput;
}
void MeterCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { void MeterCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
wxPaintDC dc(this); wxPaintDC dc(this);
const wxSize ClientSize = GetClientSize(); const wxSize ClientSize = GetClientSize();
@ -68,18 +72,23 @@ void MeterCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
glViewport(0, 0, ClientSize.x, ClientSize.y); glViewport(0, 0, ClientSize.x, ClientSize.y);
glContext->DrawBegin(); glContext->DrawBegin();
glContext->Draw(ThemeMgr::mgr.currentTheme->generalBackground.r, ThemeMgr::mgr.currentTheme->generalBackground.g, ThemeMgr::mgr.currentTheme->generalBackground.b, 0.5, 1.0);
if (mouseTracker.mouseInView()) { if (mouseTracker.mouseInView()) {
glContext->Draw(0.4, 0.4, 0.4, 0.5, mouseTracker.getMouseY()); glContext->Draw(0.4, 0.4, 0.4, 0.5, mouseTracker.getMouseY());
} }
glContext->Draw(ThemeMgr::mgr.currentTheme->meterLevel.r, ThemeMgr::mgr.currentTheme->meterLevel.g, ThemeMgr::mgr.currentTheme->meterLevel.b, 0.5, level / level_max); glContext->Draw(ThemeMgr::mgr.currentTheme->meterLevel.r, ThemeMgr::mgr.currentTheme->meterLevel.g, ThemeMgr::mgr.currentTheme->meterLevel.b, 0.5, level / level_max);
glContext->Draw(ThemeMgr::mgr.currentTheme->meterValue.r, ThemeMgr::mgr.currentTheme->meterValue.g, ThemeMgr::mgr.currentTheme->meterValue.b, 0.5, userInputValue / level_max); if (showUserInput) {
glContext->Draw(ThemeMgr::mgr.currentTheme->meterValue.r, ThemeMgr::mgr.currentTheme->meterValue.g, ThemeMgr::mgr.currentTheme->meterValue.b, 0.5, userInputValue / level_max);
}
glContext->DrawEnd(); glContext->DrawEnd();
SwapBuffers(); SwapBuffers();
} }
void MeterCanvas::OnIdle(wxIdleEvent &event) { void MeterCanvas::OnIdle(wxIdleEvent &event) {
event.Skip(); Refresh();
event.RequestMore();
} }
void MeterCanvas::OnMouseMoved(wxMouseEvent& event) { void MeterCanvas::OnMouseMoved(wxMouseEvent& event) {

View File

@ -26,6 +26,7 @@ public:
void setInputValue(float slider_in); void setInputValue(float slider_in);
bool inputChanged(); bool inputChanged();
float getInputValue(); float getInputValue();
void setShowUserInput(bool showUserInput);
void setHelpTip(std::string tip); void setHelpTip(std::string tip);
@ -48,6 +49,8 @@ private:
float inputValue; float inputValue;
float userInputValue; float userInputValue;
bool showUserInput;
std::string helpTip; std::string helpTip;
// //
wxDECLARE_EVENT_TABLE(); wxDECLARE_EVENT_TABLE();

View File

@ -72,7 +72,8 @@ void ModeSelectorCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
} }
void ModeSelectorCanvas::OnIdle(wxIdleEvent &event) { void ModeSelectorCanvas::OnIdle(wxIdleEvent &event) {
event.Skip(); Refresh();
event.RequestMore();
} }
void ModeSelectorCanvas::OnMouseMoved(wxMouseEvent& event) { void ModeSelectorCanvas::OnMouseMoved(wxMouseEvent& event) {

View File

@ -87,7 +87,8 @@ void ScopeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
} }
void ScopeCanvas::OnIdle(wxIdleEvent &event) { void ScopeCanvas::OnIdle(wxIdleEvent &event) {
event.Skip(); Refresh();
event.RequestMore();
} }
ScopeRenderDataQueue *ScopeCanvas::getInputQueue() { ScopeRenderDataQueue *ScopeCanvas::getInputQueue() {

View File

@ -85,7 +85,8 @@ void SpectrumCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
void SpectrumCanvas::OnIdle(wxIdleEvent &event) { void SpectrumCanvas::OnIdle(wxIdleEvent &event) {
event.Skip(); Refresh();
event.RequestMore();
} }

View File

@ -252,6 +252,10 @@ void TuningCanvas::OnIdle(wxIdleEvent &event) {
dragging = false; dragging = false;
} }
} }
if (mouseTracker.mouseInView() || changed()) {
Refresh();
}
event.RequestMore();
} }
void TuningCanvas::OnMouseMoved(wxMouseEvent& event) { void TuningCanvas::OnMouseMoved(wxMouseEvent& event) {

View File

@ -68,6 +68,25 @@ void WaterfallCanvas::attachSpectrumCanvas(SpectrumCanvas *canvas_in) {
spectrumCanvas = canvas_in; spectrumCanvas = canvas_in;
} }
void WaterfallCanvas::processInputQueue() {
if (!glContext) {
return;
}
glContext->SetCurrent(*this);
while (!visualDataQueue.empty()) {
SpectrumVisualData *vData;
visualDataQueue.pop(vData);
if (vData) {
waterfallPanel.setPoints(vData->spectrum_points);
waterfallPanel.step();
vData->decRefCount();
}
}
}
void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
wxPaintDC dc(this); wxPaintDC dc(this);
@ -139,18 +158,6 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
glContext->SetCurrent(*this); glContext->SetCurrent(*this);
initGLExtensions(); initGLExtensions();
glViewport(0, 0, ClientSize.x, ClientSize.y); glViewport(0, 0, ClientSize.x, ClientSize.y);
while (!visualDataQueue.empty()) {
SpectrumVisualData *vData;
visualDataQueue.pop(vData);
if (vData) {
waterfallPanel.setPoints(vData->spectrum_points);
waterfallPanel.step();
vData->decRefCount();
}
}
glContext->BeginDraw(0,0,0); glContext->BeginDraw(0,0,0);
@ -347,7 +354,8 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
} }
} }
void WaterfallCanvas::OnIdle(wxIdleEvent &event) { void WaterfallCanvas::OnIdle(wxIdleEvent &event) {
event.Skip(); Refresh();
event.RequestMore();
} }
void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) { void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) {

View File

@ -26,6 +26,7 @@ public:
DragState getNextDragState(); DragState getNextDragState();
void attachSpectrumCanvas(SpectrumCanvas *canvas_in); void attachSpectrumCanvas(SpectrumCanvas *canvas_in);
void processInputQueue();
SpectrumVisualDataQueue *getVisualDataQueue(); SpectrumVisualDataQueue *getVisualDataQueue();
private: private: