From 86e9ecb651f3de9b2b301b1461d1075adfe4fcd1 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 6 Dec 2022 10:21:52 -0500 Subject: [PATCH] Be sure to set m_TRperiod! --- q65w/mainwindow.cpp | 6 +++--- q65w/soundin.cpp | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/q65w/mainwindow.cpp b/q65w/mainwindow.cpp index 3ac43daae..0bf2d33b7 100644 --- a/q65w/mainwindow.cpp +++ b/q65w/mainwindow.cpp @@ -187,6 +187,7 @@ MainWindow::MainWindow(QWidget *parent) : soundInThread.setBufSize(10*7056); soundInThread.setNetwork(m_network); soundInThread.setPort(m_udpPort); + soundInThread.setPeriod(m_TRperiod); soundInThread.start(QThread::HighestPriority); m_monitoring=true; // Start with Monitoring ON @@ -448,7 +449,7 @@ void MainWindow::dataSink(int k) ui->yMeterFrame->setVisible(false); lab4->setText ( - QString {" Rx: %1 %2 %% "} + QString {" Rx: %1 %2 % "} .arg (px, 5, 'f', 1) .arg (m_pctZap, 5, 'f', 1) ); @@ -1080,7 +1081,6 @@ void MainWindow::readFromStdout() //readFromStdout #ifdef WIN32 m=3; #endif -// qDebug() << "aa" << n << m << t.trimmed(); if(n>=30 or t.indexOf("Best-fit")>=0) ui->decodedTextBrowser->append(t.mid(1,n-m).trimmed()); n=ui->decodedTextBrowser->verticalScrollBar()->maximum(); ui->decodedTextBrowser->verticalScrollBar()->setValue(n); @@ -1130,7 +1130,7 @@ void MainWindow::guiUpdate() } if(nsec != m_sec0) { //Once per second -// qDebug() << "AAA" << nsec%60 << m_modeQ65; +// qDebug() << "AAA" << nsec%60 << m_TRperiod; soundInThread.setForceCenterFreqMHz(m_wide_graph_window->m_dForceCenterFreq); soundInThread.setForceCenterFreqBool(m_wide_graph_window->m_bForceCenterFreq); diff --git a/q65w/soundin.cpp b/q65w/soundin.cpp index 76edfcb4c..1bc02a4ac 100644 --- a/q65w/soundin.cpp +++ b/q65w/soundin.cpp @@ -202,7 +202,8 @@ void SoundInThread::inputUDP() qe = quitExecution; if (qe) break; if (!udpSocket->hasPendingDatagrams()) { - msleep(2); // Sleep if no packet available +// msleep(2); // Sleep if no packet available + QObject().thread()->usleep(2000); } else { int nBytesRead = udpSocket->readDatagram((char *)&b,1416); if (nBytesRead != 1416) qDebug() << "UDP Read Error:" << nBytesRead; @@ -217,6 +218,7 @@ void SoundInThread::inputUDP() nhsym0=0; m_TRperiod0=m_TRperiod; } + ntr0=ntr; if(m_monitoring) {