mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-27 06:08:37 -05:00
waterfall jitter and general refresh improvements
This commit is contained in:
parent
ed2dd5e5d4
commit
11121d8a0e
@ -49,7 +49,7 @@ AppFrame::AppFrame() :
|
||||
wxBoxSizer *demodTray = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer *demodScopeTray = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
int attribList[] = { WX_GL_RGBA, WX_GL_STENCIL_SIZE, 8, WX_GL_BUFFER_SIZE, 24, WX_GL_DOUBLEBUFFER, 0 };
|
||||
int attribList[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
|
||||
|
||||
demodModeSelector = new ModeSelectorCanvas(this, attribList);
|
||||
demodModeSelector->addChoice(DEMOD_TYPE_FM, "FM");
|
||||
@ -840,7 +840,9 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
|
||||
wproc->setCenterFrequency(waterfallCanvas->getCenterFrequency());
|
||||
|
||||
waterfallCanvas->processInputQueue();
|
||||
// waterfallCanvas->Refresh();
|
||||
demodWaterfallCanvas->processInputQueue();
|
||||
// demodWaterfallCanvas->Refresh();
|
||||
|
||||
if (!this->IsActive()) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(25));
|
||||
|
@ -90,7 +90,7 @@ bool CubicSDR::OnInit() {
|
||||
sdrThread->setOutputQueue("IQDataOutput",pipeSDRIQData);
|
||||
|
||||
sdrPostThread = new SDRPostThread();
|
||||
sdrPostThread->setNumVisSamples(BUF_SIZE);
|
||||
// sdrPostThread->setNumVisSamples(BUF_SIZE);
|
||||
sdrPostThread->setInputQueue("IQDataInput", pipeSDRIQData);
|
||||
sdrPostThread->setOutputQueue("IQVisualDataOutput", pipeIQVisualData);
|
||||
sdrPostThread->setOutputQueue("IQDataOutput", pipeWaterfallIQVisualData);
|
||||
@ -427,6 +427,10 @@ void CubicSDR::showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetM
|
||||
fdialog.ShowModal();
|
||||
}
|
||||
|
||||
AppFrame *CubicSDR::getAppFrame() {
|
||||
return appframe;
|
||||
}
|
||||
|
||||
void CubicSDR::setFrequencySnap(int snap) {
|
||||
if (snap > 1000000) {
|
||||
snap = 1000000;
|
||||
|
@ -80,7 +80,8 @@ public:
|
||||
int getPPM();
|
||||
|
||||
void showFrequencyInput(FrequencyDialog::FrequencyDialogTarget targetMode = FrequencyDialog::FDIALOG_TARGET_DEFAULT);
|
||||
|
||||
AppFrame *getAppFrame();
|
||||
|
||||
private:
|
||||
AppFrame *appframe;
|
||||
AppConfig config;
|
||||
|
@ -37,7 +37,8 @@ void FFTVisualDataThread::run() {
|
||||
|
||||
while(!terminated) {
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
// std::this_thread::yield();
|
||||
|
||||
int fftSize = wproc.getDesiredInputSize();
|
||||
|
||||
@ -49,7 +50,7 @@ void FFTVisualDataThread::run() {
|
||||
|
||||
if (lpsChanged.load()) {
|
||||
fftDistrib.setLinesPerSecond(linesPerSecond.load());
|
||||
pipeIQDataIn->set_max_num_items(linesPerSecond.load());
|
||||
// pipeIQDataIn->set_max_num_items(linesPerSecond.load());
|
||||
lpsChanged.store(false);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,8 @@ void SpectrumVisualDataThread::run() {
|
||||
std::cout << "Spectrum visual data thread started." << std::endl;
|
||||
|
||||
while(!terminated) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
// std::this_thread::yield();
|
||||
sproc.run();
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ MeterCanvas::~MeterCanvas() {
|
||||
|
||||
void MeterCanvas::setLevel(float level_in) {
|
||||
level = level_in;
|
||||
Refresh();
|
||||
}
|
||||
float MeterCanvas::getLevel() {
|
||||
return level;
|
||||
@ -43,10 +44,12 @@ float MeterCanvas::getLevel() {
|
||||
|
||||
void MeterCanvas::setMax(float max_in) {
|
||||
level_max = max_in;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MeterCanvas::setInputValue(float slider_in) {
|
||||
userInputValue = inputValue = slider_in;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
bool MeterCanvas::inputChanged() {
|
||||
@ -60,6 +63,7 @@ float MeterCanvas::getInputValue() {
|
||||
|
||||
void MeterCanvas::setShowUserInput(bool showUserInput) {
|
||||
this->showUserInput = showUserInput;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MeterCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
@ -87,8 +91,7 @@ void MeterCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
}
|
||||
|
||||
void MeterCanvas::OnIdle(wxIdleEvent &event) {
|
||||
Refresh();
|
||||
event.RequestMore();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void MeterCanvas::OnMouseMoved(wxMouseEvent& event) {
|
||||
@ -101,21 +104,25 @@ void MeterCanvas::OnMouseMoved(wxMouseEvent& event) {
|
||||
setStatusText(helpTip);
|
||||
}
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MeterCanvas::OnMouseDown(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseDown(event);
|
||||
userInputValue = mouseTracker.getMouseY() * level_max;
|
||||
mouseTracker.setHorizDragLock(true);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MeterCanvas::OnMouseWheelMoved(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseWheelMoved(event);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MeterCanvas::OnMouseReleased(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseReleased(event);
|
||||
userInputValue = mouseTracker.getMouseY() * level_max;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MeterCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
|
||||
@ -127,6 +134,7 @@ void MeterCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
|
||||
void MeterCanvas::OnMouseEnterWindow(wxMouseEvent& event) {
|
||||
InteractiveCanvas::mouseTracker.OnMouseEnterWindow(event);
|
||||
SetCursor(wxCURSOR_CROSS);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MeterCanvas::setHelpTip(std::string tip) {
|
||||
|
@ -79,18 +79,19 @@ void ModeSelectorCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
}
|
||||
|
||||
void ModeSelectorCanvas::OnIdle(wxIdleEvent &event) {
|
||||
Refresh();
|
||||
event.RequestMore();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void ModeSelectorCanvas::OnMouseMoved(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseMoved(event);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void ModeSelectorCanvas::OnMouseDown(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseDown(event);
|
||||
mouseTracker.setHorizDragLock(true);
|
||||
mouseTracker.setVertDragLock(true);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void ModeSelectorCanvas::OnMouseWheelMoved(wxMouseEvent& event) {
|
||||
@ -120,6 +121,7 @@ void ModeSelectorCanvas::OnMouseReleased(wxMouseEvent& event) {
|
||||
currentSelection = selectedButton;
|
||||
|
||||
SetCursor (wxCURSOR_HAND);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void ModeSelectorCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
|
||||
@ -134,6 +136,7 @@ void ModeSelectorCanvas::OnMouseEnterWindow(wxMouseEvent& event) {
|
||||
if (!helpTip.empty()) {
|
||||
setStatusText(helpTip);
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void ModeSelectorCanvas::setHelpTip(std::string tip) {
|
||||
@ -142,6 +145,7 @@ void ModeSelectorCanvas::setHelpTip(std::string tip) {
|
||||
|
||||
void ModeSelectorCanvas::setNumChoices(int numChoices_in) {
|
||||
numChoices = numChoices_in;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void ModeSelectorCanvas::addChoice(int value, std::string label) {
|
||||
@ -157,6 +161,7 @@ void ModeSelectorCanvas::setSelection(int value) {
|
||||
}
|
||||
}
|
||||
currentSelection = -1;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
int ModeSelectorCanvas::getSelection() {
|
||||
|
@ -102,6 +102,10 @@ 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);
|
||||
|
@ -45,6 +45,10 @@ SpectrumCanvas::~SpectrumCanvas() {
|
||||
void SpectrumCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
wxPaintDC dc(this);
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
#ifdef __APPLE__
|
||||
glFinish();
|
||||
#endif
|
||||
|
||||
|
||||
if (!visualDataQueue.empty()) {
|
||||
SpectrumVisualData *vData;
|
||||
|
@ -74,6 +74,7 @@ void WaterfallCanvas::processInputQueue() {
|
||||
}
|
||||
glContext->SetCurrent(*this);
|
||||
|
||||
bool processed = false;
|
||||
while (!visualDataQueue.empty()) {
|
||||
SpectrumVisualData *vData;
|
||||
|
||||
@ -83,14 +84,24 @@ void WaterfallCanvas::processInputQueue() {
|
||||
waterfallPanel.setPoints(vData->spectrum_points);
|
||||
waterfallPanel.step();
|
||||
vData->decRefCount();
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
if (processed) {
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
// wxClientDC dc(this);
|
||||
wxPaintDC dc(this);
|
||||
|
||||
//#ifdef __APPLE__
|
||||
// glFinish();
|
||||
//#endif
|
||||
|
||||
// processInputQueue();
|
||||
|
||||
const wxSize ClientSize = GetClientSize();
|
||||
long double currentZoom = zoom;
|
||||
|
||||
@ -272,6 +283,7 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
||||
|
||||
glContext->EndDraw();
|
||||
|
||||
glFlush();
|
||||
SwapBuffers();
|
||||
}
|
||||
|
||||
@ -389,9 +401,11 @@ void WaterfallCanvas::OnKeyDown(wxKeyEvent& event) {
|
||||
|
||||
}
|
||||
void WaterfallCanvas::OnIdle(wxIdleEvent &event) {
|
||||
Refresh();
|
||||
event.RequestMore();
|
||||
// event.Skip();
|
||||
// Refresh();
|
||||
// processInputQueue();
|
||||
// Refresh();
|
||||
// event.RequestMore();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) {
|
||||
|
Loading…
Reference in New Issue
Block a user