From 2af2d8131d266edbcff3be3631c3537be1e1b0c0 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 4 Aug 2021 14:38:34 -0400 Subject: [PATCH] Don't use early decoding when data are read from disk. --- map65/libm65/map65a.f90 | 10 ++++------ map65/mainwindow.cpp | 16 ++++++---------- map65/mainwindow.h | 2 ++ 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/map65/libm65/map65a.f90 b/map65/libm65/map65a.f90 index 9e2a77930..01c4e54fa 100644 --- a/map65/libm65/map65a.f90 +++ b/map65/libm65/map65a.f90 @@ -42,6 +42,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & ! Clean start for Q65 at early decode if(nhsym.eq.nhsym1 .or. nagain.ne.0) ldecoded=.false. + if(ndiskdat.eq.1) ldecoded=.false. nkhz_center=nint(1000.0*(fcenter-int(fcenter))) mfa=nfa-nkhz_center+48 @@ -54,9 +55,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & xpol=(nxpol.ne.0) ! No second decode for JT65? -! if(nhsym.eq.nhsym2 .and. (nstandalone.eq.1 .or. ndiskdat.eq.0)) mode65=0 - if(nhsym.eq.nhsym2 .and. nagain.eq.0) mode65=0 -! print*,'=a',nhsym,nagain,mode65 + if(nhsym.eq.nhsym2 .and. nagain.eq.0 .and.ndiskdat.eq.0) mode65=0 if(nagain.eq.0) then call timer('get_cand',0) @@ -110,6 +109,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & ib=nint(fb/df) + 16385 ia=max(51,ia) ib=min(32768-51,ib) + if(ndiskdat.eq.1 .and. mode65.eq.0) ib=ia km=0 nkm=1 @@ -122,7 +122,6 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & short=0. !Zero the whole short array jpz=1 if(xpol) jpz=4 - if(mode65.eq.0) go to 50 ! First steps for JT65 decoding do i=ia,ib !Search over freq range @@ -156,7 +155,6 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & if(smax.gt.1.1 .or. ia.eq.ib) then ! Look for JT65 sync patterns and shorthand square-wave patterns. call timer('ccf65 ',0) - ! ssmax=smax ssmax=1.e30 call ccf65(ss(1,1,i),nhsym,ssmax,sync1,ipol,jpz,dt, & flipk,syncshort,snr2,ipol2,dt2) @@ -291,7 +289,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & endif enddo !i=ia,ib -50 if(nqd.eq.1) then + if(nqd.eq.1) then nwrite=0 if(mode65.eq.0) km=0 do k=1,km diff --git a/map65/mainwindow.cpp b/map65/mainwindow.cpp index 3e74168c7..48eaf9463 100644 --- a/map65/mainwindow.cpp +++ b/map65/mainwindow.cpp @@ -520,7 +520,6 @@ void MainWindow::dataSink(int k) static int nkhz; static int nfsample=96000; static int nxpol=0; - static int iRxState=0; static float fgreen; static int ndiskdat; static int nb; @@ -620,10 +619,10 @@ void MainWindow::dataSink(int k) n=0; } - if(ihsym<280) iRxState=0; + if(ihsym<280) m_RxState=0; - if(iRxState==0 and ihsym>=280) { //Early decode, t=52 s - iRxState=1; + if(m_RxState==0 and ihsym>=280 and !m_diskData) { //Early decode, t=52 s + m_RxState=1; datcom_.newdat=1; datcom_.nagain=0; datcom_.nhsym=ihsym; @@ -632,8 +631,8 @@ void MainWindow::dataSink(int k) decode(); //Start the decoder } - if(iRxState<=1 and ihsym>=302) { //Decode at t=56 s (for Q65 and data from disk) - iRxState=2; + if(m_RxState<=1 and ihsym>=302) { //Decode at t=56 s (for Q65 and data from disk) + m_RxState=2; datcom_.newdat=1; datcom_.nagain=0; datcom_.nhsym=ihsym; @@ -1126,10 +1125,7 @@ void MainWindow::diskDat() //diskDat() for(int i=0; i<304; i++) { // Do the half-symbol FFTs int k = i*hsym + 2048.5; dataSink(k); - while(m_decoderBusy) { - qApp->processEvents(); - } - if(i%10 == 0) qApp->processEvents(); //Keep the GUI responsive + qApp->processEvents(); // Allow the waterfall to update } } diff --git a/map65/mainwindow.h b/map65/mainwindow.h index d03028de4..8b85e7611 100644 --- a/map65/mainwindow.h +++ b/map65/mainwindow.h @@ -191,6 +191,8 @@ private: qint32 m_TRperiod; qint32 m_modeJT65; qint32 m_modeQ65; + qint32 m_RxState; + double m_fAdd; // double m_IQamp;