From c188f8ee89f64de322c3c592c05dbfb0a819ee46 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 9 Apr 2020 13:56:35 -0400 Subject: [PATCH] More cleanup of the display of special JT65 decoding modes: avg, deep, AP. --- lib/decode65a.f90 | 1 + lib/decoder.f90 | 23 ++++++++++++++++------- lib/jt65_decode.f90 | 11 ++++------- widgets/mainwindow.cpp | 33 ++++++++++++++++----------------- 4 files changed, 37 insertions(+), 31 deletions(-) diff --git a/lib/decode65a.f90 b/lib/decode65a.f90 index b307bc330..ec9fbd311 100644 --- a/lib/decode65a.f90 +++ b/lib/decode65a.f90 @@ -151,6 +151,7 @@ subroutine decode65a(dd,npts,newdat,nqd,f0,nflip,mode65,ntrials, & nsmo=nsmobest param(9)=nsmo nn=nnbest + nft=nftbest endif call timer('dec65b ',1) diff --git a/lib/decoder.f90 b/lib/decoder.f90 index a5025f04a..9e06c649d 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -407,7 +407,9 @@ contains 1011 format(i4.4,i4,i5,f6.2,f8.0,i4,3x,a22,' QRA64',i3) go to 100 endif - + +! write(*,3001) ft,nsum,qual,sync,bVHF +!3001 format('a',3i3,f5.1,L3) if(ft.eq.0 .and. minsync.ge.0 .and. int(sync).lt.minsync) then write(*,1010) params%nutc,snr,dt,freq else @@ -415,18 +417,19 @@ contains if(bVHF .and. ft.gt.0) then cflags='f ' if(is_deep) then - cflags(1:2)='d1' - write(cflags(3:3),'(i1)') min(qual,9) - if(qual.ge.10) cflags(3:3)='*' + cflags='d ' + write(cflags(2:2),'(i1)') min(qual,9) + if(qual.ge.10) cflags(2:2)='*' if(qual.lt.3) decoded(22:22)='?' endif if(is_average) then - write(cflags(2:2),'(i1)') min(nsum,9) - if(nsum.ge.10) cflags(2:2)='*' + write(cflags(3:3),'(i1)') min(nsum,9) + if(nsum.ge.10) cflags(3:3)='*' endif nap=ishft(ft,-2) if(nap.ne.0) then - write(cflags(1:3),'(a1,2i1)') 'a',nap,nsum + if(nsum.lt.2) write(cflags(1:3),'(a1,i1," ")') 'a',nap + if(nsum.ge.2) write(cflags(1:3),'(a1,2i1)') 'a',nap,min(nsum,9) endif endif csync='# ' @@ -445,6 +448,12 @@ contains endif endif endif + n=len(trim(decoded)) + if(n.eq.2 .or. n.eq.3) csync='# ' + if(cflags(1:1).eq.'f') then + cflags(2:2)=cflags(3:3) + cflags(3:3)=' ' + endif write(*,1010) params%nutc,snr,dt,freq,csync,decoded,cflags 1010 format(i4.4,i4,f5.1,i5,1x,a2,1x,a22,1x,a3) endif diff --git a/lib/jt65_decode.f90 b/lib/jt65_decode.f90 index dcf5120c7..551577db3 100644 --- a/lib/jt65_decode.f90 +++ b/lib/jt65_decode.f90 @@ -235,14 +235,11 @@ contains naggressive,ndepth,ntol,mycall,hiscall,hisgrid,nQSOProgress, & ljt65apon,bVHF,sync2,a,dtx,nft,nspecial,qual, & nhist,nsmo,decoded) + call timer('decod65a',1) + if(nspecial.eq.0 .and. sync1.eq.5.0 .and. dtx.eq.2.5) cycle if(nspecial.eq.2) decoded='RO' if(nspecial.eq.3) decoded='RRR' if(nspecial.eq.4) decoded='73' - if(nspecial.eq.0 .and. sync1.eq.5.0 .and. dtx.eq.2.5) then - nft=0 - decoded=' ' - endif - call timer('decod65a',1) if(sync1.lt.float(minsync) .and. & decoded.eq.' ') nflip=0 if(nft.ne.0) nsum=1 @@ -449,7 +446,6 @@ contains enddo if(nsum.lt.2) go to 900 - nftt=0 df=1378.125/512.0 ! Do the smoothing loop @@ -462,6 +458,7 @@ contains endif nn=0 do ismo=minsmo,maxsmo + nftt=0 if(ismo.gt.0) then do j=1,126 call smo121(s1b(-255,j),512) @@ -499,7 +496,7 @@ contains nsmo=ismo param(9)=nsmo go to 900 - else if(nftt.eq.2) then + else if(nftt.ge.2) then if(qual.gt.qualbest) then deepbest=avemsg qualbest=qual diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 54e7bfa36..5e27f2fb5 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -3128,27 +3128,26 @@ void MainWindow::readFromStdout() //readFromStdout m_nDecodes+=1; ndecodes_label.setText(QString::number(m_nDecodes)); if(m_mode=="JT4" or m_mode=="JT65" or m_mode=="QRA64") { - int n=line_read.indexOf("f"); - if(n<0) n=line_read.indexOf("d"); - if(n>0) { - QString tt=line_read.mid(n+1,1); - navg=tt.toInt(); - if(navg==0) { - char c = tt.data()->toLatin1(); - if(int(c)>=65 and int(c)<=90) navg=int(c)-54; - } - if(navg>1 or line_read.indexOf("f*")>0) bAvgMsg=true; + int nf=line_read.indexOf("f"); + if(nf>0) { + navg=line_read.mid(nf+1,1).toInt(); + if(line_read.indexOf("f*")>0) navg=10; + } + int nd=-1; + if(nf<0) nd=line_read.indexOf("d"); + if(nd>0) { + navg=line_read.mid(nd+2,1).toInt(); + if(line_read.mid(nd+2,1)=="*") navg=10; } if(m_mode=="JT65") { - if(n<0) n=line_read.indexOf("a"); - if(n>0) { - int i=line_read.mid(n+1,2).toInt(); -// int nap=i/10; - navg=0; - if(i>10) navg=i%10; - if(navg >= 2) bAvgMsg=true; + int na=-1; + if(nf<0 and nd<0) na=line_read.indexOf("a"); + if(na>0) { + navg=line_read.mid(na+2,1).toInt(); + if(line_read.mid(na+2,1)=="*") navg=10; } } + if(navg>=2) bAvgMsg=true; } write_all("Rx",line_read.trimmed()); if (m_config.insert_blank () && m_blankLine && SpecOp::FOX != m_config.special_op_id()) {