From 5f94a115f738a1921b6ae1c405276bd1041bcba6 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 15 Dec 2022 15:26:48 -0500 Subject: [PATCH] Q65W waterfall should not scroll if WSJT-X is transmitting. --- q65w/commons.h | 2 ++ q65w/mainwindow.cpp | 7 ++++--- widgets/mainwindow.cpp | 22 ++++++++++++++-------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/q65w/commons.h b/q65w/commons.h index e145c2693..405d44fd9 100644 --- a/q65w/commons.h +++ b/q65w/commons.h @@ -86,6 +86,8 @@ extern struct { //This is "common/datcom/..." in Fortran extern struct { int ndecodes; int ncand; + int nQDecoderBusy; + int nWTransmitting; char result[50][60]; } decodes_; diff --git a/q65w/mainwindow.cpp b/q65w/mainwindow.cpp index 2c57f0ce7..46885a83e 100644 --- a/q65w/mainwindow.cpp +++ b/q65w/mainwindow.cpp @@ -382,8 +382,9 @@ void MainWindow::dataSink(int k) ); xSignalMeter->setValue(px); // Update the signal meters - if(m_monitoring || m_diskData) { - m_wide_graph_window->dataSink2(s,nkhz,ihsym,m_diskData,lstrong); + //Suppress scrolling if WSJT-X is transmitting + if((m_monitoring and ipc_wsjtx[4] != 1) or m_diskData) { + m_wide_graph_window->dataSink2(s,nkhz,ihsym,m_diskData,lstrong); } //Average over specified number of spectra @@ -963,7 +964,7 @@ void MainWindow::guiUpdate() } if(nsec != m_sec0) { //Once per second -// qDebug() << "AAA" << nsec%60 << ipc_wsjtx[0] << ipc_wsjtx[1]; +// qDebug() << "AAA" << nsec%60 << ipc_wsjtx[3] << ipc_wsjtx[4]<< m_monitoring; if(m_pctZap>30.0) { lab4->setStyleSheet("QLabel{background-color: #ff0000}"); diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 45cbaee7d..8706c0f60 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -473,7 +473,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, } ipc_q65w = (int*)mem_q65w.data(); mem_q65w.lock(); - memset(ipc_q65w,0,memSize); //Zero all of shared memory + memset(ipc_q65w,0,memSize); //Zero all of Q65W shared memory mem_q65w.unlock(); // Closedown. @@ -1134,6 +1134,7 @@ MainWindow::~MainWindow() m_audioThread.quit (); m_audioThread.wait (); remove_child_from_event_filter (this); + memset(ipc_q65w,0,4096); //Zero all of Q65W shared memory } //-------------------------------------------------------- writeSettings() @@ -3685,7 +3686,6 @@ void MainWindow::callSandP2(int n) m_deGrid=w[3]; m_txFirst=(w[4]=="0"); // ui->TxFreqSpinBox->setValue(1500); -// qDebug() << "aa" << n << w; } else { m_deCall=w[0]; m_deGrid=w[1]; @@ -4815,12 +4815,18 @@ void MainWindow::guiUpdate() } if(m_mode=="Echo" and !m_monitoring and !m_auto and !m_diskData) m_echoRunning=false; - mem_q65w.lock(); - if(m_mode=="Q65" and (ipc_q65w[0] > m_fetched)) { //ndecodes - memcpy(&q65wcom, (char*)ipc_q65w, sizeof(q65wcom)); - mem_q65w.unlock(); - readWidebandDecodes(); - } else { + if(m_mode=="Q65") { + mem_q65w.lock(); + int n=0; + if(m_decoderBusy) n=1; + ipc_q65w[3]=n; + n=0; + if(m_transmitting) n=1; + ipc_q65w[4]=n; + if(ipc_q65w[0] > m_fetched) { //ndecodes + memcpy(&q65wcom, (char*)ipc_q65w, sizeof(q65wcom)); + readWidebandDecodes(); + } mem_q65w.unlock(); }