diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 7fdc1bd02..e86f993da 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -15,6 +15,9 @@ subroutine decoder(ntrSeconds,c0) complex c0(NDMAX) common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX),nutc,ndiskdat, & ntr,nfqso,nagain,newdat,npts8,nfb,ntol,kin + logical first + data first/.true./ + save ntrMinutes=ntrSeconds/60 newdat=1 @@ -47,16 +50,21 @@ subroutine decoder(ntrSeconds,c0) call spec9(c0,npts8,nsps,fpk0,fpk,xdt,i1SoftSymbols) call decode9(i1SoftSymbols,msg) - open(13,file='decoded.txt',status='unknown') - rewind 13 -! write(*,1010) nutc,sync,xdt,1000.0+fpk,msg nsync=sync nsnr=nint(snr) width=0.0 + open(13,file='decoded.txt',status='unknown') + rewind 13 write(13,1010) nutc,nsync,nsnr,xdt,1000.0+fpk,width,msg 1010 format(i4.4,i4,i5,f6.1,f8.2,f6.2,3x,a22) call flush(13) close(13) + if(first) then + open(14,file='wsjtx_rx.log',status='unknown',position='append') + first=.false. + endif + write(14,1010) nutc,nsync,nsnr,xdt,1000.0+fpk,width,msg + call flush(14) return end subroutine decoder diff --git a/mainwindow.cpp b/mainwindow.cpp index f2dde999a..3f834c725 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -371,6 +371,8 @@ void MainWindow::dataSink(int k) // This is a bit strange. Why do we need the "-3" ??? if(ihsym == m_hsymStop-3) { jt9com_.npts8=(ihsym*m_nsps)/16; + jt9com_.newdat=1; + jt9com_.nagain=0; QDateTime t = QDateTime::currentDateTimeUtc(); m_dateTime=t.toString("yyyy-MMM-dd hh:mm"); decode(); //Start the decoder @@ -821,23 +823,42 @@ void MainWindow::on_actionAvailable_suffixes_and_add_on_prefixes_triggered() void MainWindow::on_DecodeButton_clicked() //Decode request { - decode(); + if(!m_decoderBusy) { + jt9com_.newdat=0; + jt9com_.nagain=1; + decode(); + } } void MainWindow::freezeDecode(int n) //freezeDecode() { - decode(); + if(!m_decoderBusy) { + jt9com_.newdat=0; + jt9com_.nagain=1; + decode(); + } } void MainWindow::decode() //decode() { decodeBusy(true); ui->DecodeButton->setStyleSheet(m_pbdecoding_style1); - jt9com_.newdat=1; - jt9com_.nagain=0; + + if(jt9com_.nagain==0 && (!m_diskData)) { + qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000; + int imin=ms/60000; + int ihr=imin/60; + imin=imin%60; + if(m_TRperiod>60) imin=imin - imin%(m_TRperiod/60); + jt9com_.nutc=100*ihr + imin; + } + +// jt9com_.newdat=1; +// jt9com_.nagain=0; jt9com_.nfqso=g_pWideGraph->QSOfreq(); m_tol=g_pWideGraph->Tol(); jt9com_.ntol=m_tol; + qDebug() << "A" << jt9com_.newdat << jt9com_.nagain; *future3 = QtConcurrent::run(decoder_, &m_TRperiod, &c0[0]); watcher3->setFuture(*future3); }