Be sure to set m_TRperiod!

This commit is contained in:
Joe Taylor 2022-12-06 10:21:52 -05:00
parent df96e8dee3
commit 86e9ecb651
2 changed files with 6 additions and 4 deletions

View File

@ -187,6 +187,7 @@ MainWindow::MainWindow(QWidget *parent) :
soundInThread.setBufSize(10*7056); soundInThread.setBufSize(10*7056);
soundInThread.setNetwork(m_network); soundInThread.setNetwork(m_network);
soundInThread.setPort(m_udpPort); soundInThread.setPort(m_udpPort);
soundInThread.setPeriod(m_TRperiod);
soundInThread.start(QThread::HighestPriority); soundInThread.start(QThread::HighestPriority);
m_monitoring=true; // Start with Monitoring ON m_monitoring=true; // Start with Monitoring ON
@ -448,7 +449,7 @@ void MainWindow::dataSink(int k)
ui->yMeterFrame->setVisible(false); ui->yMeterFrame->setVisible(false);
lab4->setText ( lab4->setText (
QString {" Rx: %1 %2 %% "} QString {" Rx: %1 %2 % "}
.arg (px, 5, 'f', 1) .arg (px, 5, 'f', 1)
.arg (m_pctZap, 5, 'f', 1) .arg (m_pctZap, 5, 'f', 1)
); );
@ -1080,7 +1081,6 @@ void MainWindow::readFromStdout() //readFromStdout
#ifdef WIN32 #ifdef WIN32
m=3; m=3;
#endif #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()); if(n>=30 or t.indexOf("Best-fit")>=0) ui->decodedTextBrowser->append(t.mid(1,n-m).trimmed());
n=ui->decodedTextBrowser->verticalScrollBar()->maximum(); n=ui->decodedTextBrowser->verticalScrollBar()->maximum();
ui->decodedTextBrowser->verticalScrollBar()->setValue(n); ui->decodedTextBrowser->verticalScrollBar()->setValue(n);
@ -1130,7 +1130,7 @@ void MainWindow::guiUpdate()
} }
if(nsec != m_sec0) { //Once per second 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.setForceCenterFreqMHz(m_wide_graph_window->m_dForceCenterFreq);
soundInThread.setForceCenterFreqBool(m_wide_graph_window->m_bForceCenterFreq); soundInThread.setForceCenterFreqBool(m_wide_graph_window->m_bForceCenterFreq);

View File

@ -202,7 +202,8 @@ void SoundInThread::inputUDP()
qe = quitExecution; qe = quitExecution;
if (qe) break; if (qe) break;
if (!udpSocket->hasPendingDatagrams()) { if (!udpSocket->hasPendingDatagrams()) {
msleep(2); // Sleep if no packet available // msleep(2); // Sleep if no packet available
QObject().thread()->usleep(2000);
} else { } else {
int nBytesRead = udpSocket->readDatagram((char *)&b,1416); int nBytesRead = udpSocket->readDatagram((char *)&b,1416);
if (nBytesRead != 1416) qDebug() << "UDP Read Error:" << nBytesRead; if (nBytesRead != 1416) qDebug() << "UDP Read Error:" << nBytesRead;
@ -217,6 +218,7 @@ void SoundInThread::inputUDP()
nhsym0=0; nhsym0=0;
m_TRperiod0=m_TRperiod; m_TRperiod0=m_TRperiod;
} }
ntr0=ntr; ntr0=ntr;
if(m_monitoring) { if(m_monitoring) {