From 042ff589fb8d83a3e7781a24dd173635f294498a Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 16 Dec 2022 14:01:22 -0500 Subject: [PATCH] Another fix for communication between Q65W and WSJT-X. --- q65w/mainwindow.cpp | 6 +++--- widgets/mainwindow.cpp | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/q65w/mainwindow.cpp b/q65w/mainwindow.cpp index e9492b304..b0dbcb46f 100644 --- a/q65w/mainwindow.cpp +++ b/q65w/mainwindow.cpp @@ -744,6 +744,9 @@ void MainWindow::decoderFinished() //diskWriteFinished ui->DecodeButton->setStyleSheet(""); decodeBusy(false); decodes_.nQDecoderDone=1; + mem_q65w.lock(); + memcpy((char*)ipc_wsjtx, &decodes_, sizeof(decodes_)); + mem_q65w.unlock(); QString t1; t1=t1.asprintf(" %3d/%d ",decodes_.ndecodes,decodes_.ncand); lab5->setText(t1); @@ -960,9 +963,6 @@ void MainWindow::guiUpdate() ui->decodedTextBrowser->append(t.trimmed()); m_fetched++; } - mem_q65w.lock(); - memcpy((char*)ipc_wsjtx, &decodes_, sizeof(decodes_)); - mem_q65w.unlock(); } if(nsec != m_sec0) { //Once per second diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 8706c0f60..d748f8931 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -4824,7 +4824,7 @@ void MainWindow::guiUpdate() if(m_transmitting) n=1; ipc_q65w[4]=n; if(ipc_q65w[0] > m_fetched) { //ndecodes - memcpy(&q65wcom, (char*)ipc_q65w, sizeof(q65wcom)); + memcpy(&q65wcom, (char*)ipc_q65w, sizeof(q65wcom)); //Fetch the new decode(s) readWidebandDecodes(); } mem_q65w.unlock(); @@ -4832,7 +4832,8 @@ void MainWindow::guiUpdate() //Once per second (onesec) if(nsec != m_sec0) { -// qDebug() << "AAA" << nsec << ipc_q65w[0] << ipc_q65w[1]; +// qDebug() << "AAA" << nsec << ipc_q65w[0] << ipc_q65w[1] << ipc_q65w[2] +// << ipc_q65w[3] << ipc_q65w[4] << m_fetched; if(m_mode=="FST4") chk_FST4_freq_range(); m_currentBand=m_config.bands()->find(m_freqNominal); @@ -9290,7 +9291,11 @@ void MainWindow::readWidebandDecodes() m_ActiveStationsWidget->displayRecentStations(m_mode,t); m_ActiveStationsWidget->setClickOK(true); } - if(q65wcom.nQDecoderDone==1) m_fetched=0; + if(ipc_q65w[2]==1) { + m_fetched=0; + ipc_q65w[0]=0; + ipc_q65w[2]=0; + } } // -------------------------- Code for FT8 DXpedition Mode ---------------------------