From 139478b865f1fd74194f80eab71821f17f3e2c7b Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 16 Jul 2021 09:22:35 -0400 Subject: [PATCH 1/4] Revert "Implement mock real-time input for MAP65: read data from a .tf2 file, with" This reverts commit 60b0c5b98442d0da7529069ff2d598d345e9f89c. --- map65/libm65/CMakeLists.txt | 1 - map65/soundin.cpp | 68 ++----------------------------------- map65/soundin.h | 3 -- 3 files changed, 3 insertions(+), 69 deletions(-) diff --git a/map65/libm65/CMakeLists.txt b/map65/libm65/CMakeLists.txt index 826459094..fe5ee170c 100644 --- a/map65/libm65/CMakeLists.txt +++ b/map65/libm65/CMakeLists.txt @@ -62,7 +62,6 @@ set (libm65_FSRCS packjt.f90 pfxdump.f90 polfit.f90 - read_tf2.f90 recvpkt.f90 rfile3a.f90 s3avg.f90 diff --git a/map65/soundin.cpp b/map65/soundin.cpp index d82efb5d7..0e50f2935 100644 --- a/map65/soundin.cpp +++ b/map65/soundin.cpp @@ -164,16 +164,10 @@ void SoundInThread::run() //SoundInThread::run() { quitExecution = false; - QFile f("mockRTfiles.txt"); - m_mockRT=f.exists(); - - if(m_mockRT) { - inputMockRT(); //"Mock realtime" input from a .tf2 file - return; - } - if (m_net) { - inputUDP(); //Network input from Linrad (or equivalent) +// qDebug() << "Start inputUDP()"; + inputUDP(); +// qDebug() << "Finished inputUDP()"; return; } @@ -455,59 +449,3 @@ void SoundInThread::inputUDP() } delete udpSocket; } - - -//--------------------------------------------------------------- inputMockRT() -void SoundInThread::inputMockRT() -{ - bool qe = quitExecution; - int ntr0=99; - int k=0; - int nsec; - int ntr; - int nhsym0=0; - int iz=174; - int nBusy=0; - int mstr=0; - int mswait=0; - - // Main loop for mock realtime input of data from .tf2 files - while (!qe) { - qe = quitExecution; - if (qe) break; - qint64 ms = QDateTime::currentMSecsSinceEpoch(); // Time according to this computer - mstr = ms % (1000*m_TRperiod); - nsec = (ms % 86400000l) / 1000; - ntr = nsec % m_TRperiod; - -// Reset buffer pointer and symbol number at start of minute - if(ntr < ntr0 or !m_monitoring or m_TRperiod!=m_TRperiod0) { - k=0; - nhsym0=0; - m_TRperiod0=m_TRperiod; - } - ntr0=ntr; - - if(m_monitoring) { - // If buffer will not overflow, move data into datcom_ - if ((k+iz) <= 60*96000) { - if(k>mstr*96) { - mswait=(k-mstr*96)/96; - msleep(mswait); - } - read_tf2_(&k); - } - m_hsym=(k-2048)*11025.0/(2048.0*m_rate); - if(m_hsym != nhsym0) { - if(m_dataSinkBusy) { - nBusy++; - } else { - m_dataSinkBusy=true; - emit readyForFFT(k); //Signal to compute new FFTs - } - nhsym0=m_hsym; - } - } - } -} - diff --git a/map65/soundin.h b/map65/soundin.h index 98261e05e..369cf1d71 100644 --- a/map65/soundin.h +++ b/map65/soundin.h @@ -56,7 +56,6 @@ public slots: private: void inputUDP(); - void inputMockRT(); double m_fAdd; bool m_net; @@ -64,7 +63,6 @@ private: bool m_bForceCenterFreq; bool m_IQswap; bool m_10db; - bool m_mockRT; double m_dForceCenterFreq; qint32 m_nrx; qint32 m_hsym; @@ -79,7 +77,6 @@ private: extern "C" { void recvpkt_(int* nsam, quint16* iblk, qint8* nrx, int* k, double s1[], double s2[], double s3[]); - void read_tf2_(int* k); } #endif // SOUNDIN_H From 775a204a6898c0df080b5e1453652641fbf81bf0 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 16 Jul 2021 09:37:37 -0400 Subject: [PATCH 2/4] Re-apply three good commits from before. --- map65/libm65/map65a.f90 | 9 +++------ map65/libm65/recvpkt.f90 | 2 +- map65/libm65/symspec.f90 | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/map65/libm65/map65a.f90 b/map65/libm65/map65a.f90 index ee73004b9..8db456529 100644 --- a/map65/libm65/map65a.f90 +++ b/map65/libm65/map65a.f90 @@ -400,7 +400,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & close(16) endif call sec0(1,tsec0) - if(nhsym.eq.nhsym1 .and. tsec0.gt.3.0) go to 900 + if(nhsym.eq.nhsym1 .and. tsec0.gt.3.0) go to 700 if(nqd.eq.1 .and. nagain.eq.1) go to 900 if(nqd.eq.0 .and. bq65) then @@ -427,11 +427,8 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & ! Trim the list and produce a sorted index and sizes of groups. ! (Should trimlist remove all but best SNR for given UTC and message content?) - call trimlist(sig,km,ftol,indx,nsiz,nz) - - do i=1,km - done(i)=.false. - enddo +700 call trimlist(sig,km,ftol,indx,nsiz,nz) + done(1:km)=.false. j=0 ilatest=-1 do n=1,nz diff --git a/map65/libm65/recvpkt.f90 b/map65/libm65/recvpkt.f90 index 6b686a245..085b9c05e 100644 --- a/map65/libm65/recvpkt.f90 +++ b/map65/libm65/recvpkt.f90 @@ -11,7 +11,7 @@ subroutine recvpkt(nsam,nblock2,userx_no,k,buf4,buf8,buf16) integer*2 jd(4),kd(2),nblock2 real*4 xd(4),yd(2) real*8 fcenter - common/datcom/dd(4,5760000),ss(4,322,NFFT),savg(4,NFFT),fcenter,nutc,junk(36) + common/datcom/dd(4,5760000),ss(4,322,NFFT),savg(4,NFFT),fcenter,nutc,junk(38) equivalence (kd,d4) equivalence (jd,d8,yd) equivalence (xd,c16) diff --git a/map65/libm65/symspec.f90 b/map65/libm65/symspec.f90 index f7652ca06..2c21940f9 100644 --- a/map65/libm65/symspec.f90 +++ b/map65/libm65/symspec.f90 @@ -22,7 +22,7 @@ subroutine symspec(k,nxpol,ndiskdat,nb,nbslider,idphi,nfsample, & parameter (NFFT=32768) !Length of FFTs real*8 ts,hsym real*8 fcenter - common/datcom/dd(4,5760000),ss(4,322,NFFT),savg(4,NFFT),fcenter,nutc,junk(36) + common/datcom/dd(4,5760000),ss(4,322,NFFT),savg(4,NFFT),fcenter,nutc,junk(38) real*4 ssz5a(NFFT),w(NFFT),w2a(NFFT),w2b(NFFT) complex z,zfac complex zsumx,zsumy From 3a28992c7ffdb4a8b9c45353179c090a1a12aaee Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 16 Jul 2021 10:07:28 -0400 Subject: [PATCH 3/4] Enable early decode with data read from disk. --- map65/mainwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/map65/mainwindow.cpp b/map65/mainwindow.cpp index 0daccecee..dd04b3c3e 100644 --- a/map65/mainwindow.cpp +++ b/map65/mainwindow.cpp @@ -620,7 +620,7 @@ void MainWindow::dataSink(int k) n=0; } - if(ihsym == 280 and !m_diskData) { //Early decode, t=52 s + if(ihsym == 280) { //Early decode, t=52 s datcom_.newdat=1; datcom_.nagain=0; datcom_.nhsym=ihsym; @@ -1126,6 +1126,9 @@ 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 } } From 82de949a8cd496df148bd653727f5b5b00ed11bc Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 16 Jul 2021 11:26:17 -0400 Subject: [PATCH 4/4] Disable a diagnostic write. --- lib/qra/q65/q65.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90 index ece95ac45..0f77cea66 100644 --- a/lib/qra/q65/q65.f90 +++ b/lib/qra/q65/q65.f90 @@ -165,8 +165,8 @@ subroutine q65_dec0(iavg,nutc,iwave,ntrperiod,nfqso,ntol,ndepth,lclearave, & call timer('list_dec',0) call q65_dec_q3(s1,iz,jz,s3,LL,ipk,jpk,snr2,dat4,idec,decoded) call timer('list_dec',1) - if(idec.ge.0) write(70,3070) idec,better,trim(decoded) -3070 format(i3,f8.2,2x,a) +! if(idec.ge.0) write(70,3070) idec,better,trim(decoded) +!3070 format(i3,f8.2,2x,a) endif ! If idec=3 we have a q3 decode. Continue to compute sync curve for plotting. endif