From 8a4b5b6a40d0936a414d69a5262015dd40524faa Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 31 Dec 2020 15:52:06 -0500 Subject: [PATCH] Various tweaks to the Q65 decoder; new numbering of the end-of-line decoding flags. --- lib/decoder.f90 | 5 +++++ lib/qra/q65/q65_avg.f90 | 1 + lib/qra/q65/q65_sync.f90 | 2 +- lib/test_q65.f90 | 6 +++++- widgets/mainwindow.cpp | 6 +++--- widgets/plotter.cpp | 2 +- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 15ce66989..32ffb9e38 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -785,6 +785,11 @@ contains iaptype=idec/100 navg=mod(idec,100) endif + if(iaptype.eq.1) then + iaptype=3 + else + iaptype=iaptype-2 + endif cflags='q ' write(cflags(2:2),'(i1)') iaptype if(navg.ge.2) write(cflags(3:3),'(i1)') navg diff --git a/lib/qra/q65/q65_avg.f90 b/lib/qra/q65/q65_avg.f90 index d3ac60246..1c2ee8702 100644 --- a/lib/qra/q65/q65_avg.f90 +++ b/lib/qra/q65/q65_avg.f90 @@ -70,6 +70,7 @@ subroutine q65_avg(nutc,ntrperiod,LL,nfqso,ntol,lclearave,xdt,f0,snr1,s3) entry q65_avg2(ntrperiod,ntol,baud,nsubmode,nQSOprogress,lapcqonly, & ibwa,ibwb,codewords,ncw,xdt,f0,snr1,snr2,dat4,idec) + if(nsave.lt.2) go to 900 mode_q65=2**nsubmode ibwa=1.8*log(baud*mode_q65) + 2 ibwb=min(10,ibwa+4) diff --git a/lib/qra/q65/q65_sync.f90 b/lib/qra/q65/q65_sync.f90 index 7721d2cd5..4ea4e5e15 100644 --- a/lib/qra/q65/q65_sync.f90 +++ b/lib/qra/q65/q65_sync.f90 @@ -291,7 +291,7 @@ subroutine q65_dec1(s3,nsubmode,b90ts,codewords,ncw,esnodb,irc,dat4,decoded) else irc=-1 endif - + return end subroutine q65_dec1 diff --git a/lib/test_q65.f90 b/lib/test_q65.f90 index 49a17c678..cf557591d 100644 --- a/lib/test_q65.f90 +++ b/lib/test_q65.f90 @@ -137,7 +137,11 @@ program test_q65 iavg=0 i0=23 if(ntrperiod.le.30) i0=25 - if(line(i0:i0).ne.' ') read(line(60:),*) idec + if(line(i0:i0).ne.' ') then + i1=index(line,'q') + idec=-1 + read(line(i1+1:),*) idec + endif if(idec.lt.0) cycle if(idec.ge.12) then iavg=idec-10 diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 86f85d343..bbdbf50d0 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -3481,11 +3481,13 @@ void MainWindow::readFromStdout() //readFromStdout bool bDisplayRight=bAvgMsg; int audioFreq=decodedtext.frequencyOffset(); if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4" or m_mode=="Q65") { + int ftol=10; + if(m_mode=="Q65") ftol=ui->sbFtol->value(); auto const& parts = decodedtext.string().remove("<").remove(">") .split (' ', SkipEmptyParts); if (parts.size() > 6) { auto for_us = parts[5].contains (m_baseCall) - || ("DE" == parts[5] && qAbs (ui->RxFreqSpinBox->value () - audioFreq) <= 10); + || ("DE" == parts[5] && qAbs (ui->RxFreqSpinBox->value () - audioFreq) <= ftol); if(m_baseCall==m_config.my_callsign() and m_baseCall!=parts[5]) for_us=false; if(m_bCallingCQ && !m_bAutoReply && for_us && ui->cbFirst->isChecked() and SpecOp::FOX > m_config.special_op_id()) { @@ -3498,8 +3500,6 @@ void MainWindow::readFromStdout() //readFromStdout if(SpecOp::FOX==m_config.special_op_id() and for_us and (audioFreq<1000)) bDisplayRight=true; if(SpecOp::FOX!=m_config.special_op_id() and (for_us or (abs(audioFreq - m_wideGraph->rxFreq()) <= 10))) bDisplayRight=true; } - if((abs(audioFreq - m_wideGraph->rxFreq()) <= ui->sbFtol->value()) and - m_mode=="Q65") bDisplayRight=true; } else { if((abs(audioFreq - m_wideGraph->rxFreq()) <= 10) and !m_config.enable_VHF_features()) bDisplayRight=true; diff --git a/widgets/plotter.cpp b/widgets/plotter.cpp index a68ca80b3..9b6b3856b 100644 --- a/widgets/plotter.cpp +++ b/widgets/plotter.cpp @@ -261,7 +261,7 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) Font.setWeight(QFont::Bold); painter2D.setFont(Font); int x1=XfromFreq(m_rxFreq); - y=0.2*m_h2; + y=0.25*m_h2; painter2D.drawText(x1-4,y,"T"); x1=XfromFreq(m_rxFreq+250); painter2D.drawText(x1-4,y,"M");