From 51dd025a8bb324883641045c000820c7fba0a9cb Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 14 May 2021 19:37:14 -0400 Subject: [PATCH] Don't display Q65 decodes twice in Messages window (if decoded with nqd=1). --- map65/libm65/map65a.f90 | 25 +++++++++++++++---------- map65/libm65/q65b.f90 | 4 +++- map65/libm65/wideband_sync.f90 | 2 +- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/map65/libm65/map65a.f90 b/map65/libm65/map65a.f90 index 5ac275c0c..50b1c6560 100644 --- a/map65/libm65/map65a.f90 +++ b/map65/libm65/map65a.f90 @@ -23,6 +23,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & integer indx(MAXMSG),nsiz(MAXMSG) logical done(MAXMSG) logical xpol,bq65,first_loop + logical candec(MAX_CANDIDATES) character decoded*22,blank*22,cmode*2 real short(3,NFFT) !SNR dt ipol for potential shorthands real qphi(12) @@ -48,6 +49,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & call timer('get_cand',0) call get_candidates(ss,savg,mfa,mfb,nts_jt65,nts_q65,cand,ncand) call timer('get_cand',1) + candec=.false. endif !### ! do k=1,ncand @@ -355,17 +357,18 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & endif enddo ! k=1,km - do n=1,ncand - if(cand(n)%iflip.ne.0) cycle - freq=cand(n)%f+nkhz_center-48.0-1.27046 + do icand=1,ncand + if(cand(icand)%iflip.ne.0) cycle + freq=cand(icand)%f+nkhz_center-48.0-1.27046 if(nqd.eq.1 .and. abs(freq-mousefqso).gt.0.001*ntol) cycle ikhz=nint(freq) ! write(*,3201) nqd,freq,mousefqso,mousedf,ntol,mycall,hiscall,hisgrid !3201 format('=A',i3,f10.3,3i5,2a12,a6) call timer('q65b ',0) call q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz, & - mousedf,ntol,xpol,mycall,hiscall,hisgrid,mode_q65) + mousedf,ntol,xpol,mycall,hiscall,hisgrid,mode_q65,idec) call timer('q65b ',1) + if(idec.ge.0) candec(icand)=.true. enddo if(nwrite.eq.0 .and. nwrite_q65.eq.0) then @@ -380,7 +383,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & endif if(ndphi.eq.1 .and.iloop.eq.12) call getdphi(qphi) - if(nqd.ge.1) then + if(nqd.eq.1) then write(*,1013) nsum,nsave 1013 format('',2i4) flush(6) @@ -388,18 +391,20 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & if(nqd.eq.1 .and. nagain.eq.1) go to 900 if(nqd.eq.0) then - do n=1,ncand - if(cand(n)%iflip.ne.0) cycle - freq=cand(n)%f+nkhz_center-48.0-1.27046 + do icand=1,ncand + if(cand(icand)%iflip.ne.0) cycle + if(candec(icand)) cycle + freq=cand(icand)%f+nkhz_center-48.0-1.27046 if(nqd.eq.1 .and. abs(freq-mousefqso).gt.0.001*ntol) cycle ikhz=nint(freq) ! write(*,3202) nqd,freq,mousefqso,mousedf,ntol !3202 format('=B',i3,f10.3,3i5) call timer('q65b ',0) call q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz, & - mousedf,ntol,xpol,mycall,hiscall,hisgrid,mode_q65) + mousedf,ntol,xpol,mycall,hiscall,hisgrid,mode_q65,idec) call timer('q65b ',1) - enddo + if(idec.ge.0) candec(icand)=.true. + enddo ! icand endif enddo ! nqd diff --git a/map65/libm65/q65b.f90 b/map65/libm65/q65b.f90 index ac2e6ad18..e77fecabd 100644 --- a/map65/libm65/q65b.f90 +++ b/map65/libm65/q65b.f90 @@ -1,5 +1,5 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol, & - mycall0,hiscall0,hisgrid,mode_q65) + mycall0,hiscall0,hisgrid,mode_q65,idec) ! This routine provides an interface between MAP65 and the Q65 decoder ! in WSJT-X. All arguments are input data obtained from the MAP65 GUI. @@ -162,6 +162,8 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol, & 900 close(13) close(17) call flush(6) + idec=-1 + read(cq0(2:2),*) idec return end subroutine q65b diff --git a/map65/libm65/wideband_sync.f90 b/map65/libm65/wideband_sync.f90 index 1de191102..61d9b06c1 100644 --- a/map65/libm65/wideband_sync.f90 +++ b/map65/libm65/wideband_sync.f90 @@ -16,7 +16,7 @@ module wideband_sync end type sync_dat parameter (NFFT=32768) - parameter (MAX_CANDIDATES=20) + parameter (MAX_CANDIDATES=50) type(sync_dat) :: sync(NFFT) integer nkhz_center