From 6f02c86d9a1ac11e58b305efafdd4332a4cb576a Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 16 Jan 2023 17:45:14 -0500 Subject: [PATCH] Multi-decodes and nagain decodes now basically functional. Needs cleanup! --- q65w/commons.h | 4 ++-- q65w/libq65/decode0.f90 | 4 ++-- q65w/libq65/q65c.f90 | 21 +++++++++------------ q65w/libq65/q65wa.f90 | 9 +++++++-- q65w/mainwindow.cpp | 10 ++-------- q65w/mainwindow.h | 3 +-- q65w/soundin.cpp | 2 +- 7 files changed, 24 insertions(+), 29 deletions(-) diff --git a/q65w/commons.h b/q65w/commons.h index c5244be57..26cc2d7ca 100644 --- a/q65w/commons.h +++ b/q65w/commons.h @@ -11,7 +11,7 @@ extern struct { //This is "common/datcom/..." in Fortran float savg[NFFT]; //Avg spectra at 0,45,90,135 deg pol double fcenter; //Center freq from Linrad (MHz) int nutc; //UTC as integer, HHMM - int idphi; //Phase correction for Y pol'n, degrees + float fselected; //Selected frequency for nagain decodes int mousedf; //User-selected DF int mousefqso; //User-selected QSO freq (kHz) int nagain; //1 ==> decode only at fQSO +/- Tol @@ -50,7 +50,7 @@ extern struct { //This is "common/datcom/..." in Fortran float savg[NFFT]; //Avg spectra at 0,45,90,135 deg pol double fcenter; //Center freq from Linrad (MHz) int nutc; //UTC as integer, HHMM - int idphi; //Phase correction for Y pol'n, degrees + float fselected; //Selected frequency for nagain decodes int mousedf; //User-selected DF int mousefqso; //User-selected QSO freq (kHz) int nagain; //1 ==> decode only at fQSO +/- Tol diff --git a/q65w/libq65/decode0.f90 b/q65w/libq65/decode0.f90 index 22421ca31..058472890 100644 --- a/q65w/libq65/decode0.f90 +++ b/q65w/libq65/decode0.f90 @@ -11,7 +11,7 @@ subroutine decode0(dd,ss,savg) character*60 result common/decodes/ndecodes,ncand,nQDecoderDone,nWDecoderBusy, & nWTransmitting,result(50) - common/npar/fcenter,nutc,idphi,mousedf,mousefqso,nagain, & + common/npar/fcenter,nutc,fselected,mousedf,mousefqso,nagain, & ndepth,ndiskdat,neme,newdat,nfa,nfb,nfcal,nfshift, & mcall3,nkeep,ntol,nxant,nrxlog,nfsample,nxpol,nmode, & ndop00,nsave,max_drift,nhsym,mycall,mygrid,hiscall,hisgrid,datetime @@ -45,7 +45,7 @@ subroutine decode0(dd,ss,savg) call q65wa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & mousedf,mousefqso,nagain,nfshift,max_drift, & nfcal,mycall,hiscall,hisgrid,nfsample,nmode,ndepth, & - datetime,ndop00) + datetime,ndop00,fselected) call timer('q65wa ',1) return diff --git a/q65w/libq65/q65c.f90 b/q65w/libq65/q65c.f90 index d37a751a9..8a6f550e5 100644 --- a/q65w/libq65/q65c.f90 +++ b/q65w/libq65/q65c.f90 @@ -19,7 +19,7 @@ subroutine q65c(itimer) common/datcom2/dd(2,5760000),ss(322,NFFT),savg(NFFT),nparams0 !### REMEMBER that /npar/ is not updated until nparams=nparams0 is executed. ### - common/npar/fcenter,nutc,idphi,mousedf,mousefqso,nagain, & + common/npar/fcenter,nutc,fselected,mousedf,mousefqso,nagain, & ndepth,ndiskdat,neme,newdat,nfa,nfb,nfcal,nfshift, & mcall3,nkeep,ntol,nxant,nrxlog,nfsample,nxpol,nmode, & ndop00,nsave,max_drift,nhsym,mycall,mygrid,hiscall,hisgrid, & @@ -35,21 +35,18 @@ subroutine q65c(itimer) return endif -! newdat=1 -! nagain=0 - write(*,3001) 'aa',newdat,nagain,nfa,nfb,ntol -3001 format(a2,5i6) - datetime(18:20)=':00' npatience=1 -! if(newdat.eq.0 .and. nagain.eq.1) then -! nfa=nint(mousefqso+0.001*mousedf) - 1 !Minimal solution for -! nfb=nint(mousefqso+0.001*mousedf) + 1 !double-click decodes -! newdat=1 + if(nagain.eq.1) then +! nfa=127 +! nfb=128 + newdat=1 ! nagain=0 -! endif - write(*,3001) 'bb',newdat,nagain,nfa,nfb,ntol + endif + write(*,3001) 'aa',newdat,nagain,nfa,nfb,ntol,fselected +3001 format(a2,5i6,f10.3) + write(*,3001) 'bb',newdat,nagain,nfa,nfb,ntol,fselected call timer('decode0 ',0) call decode0(dd,ss,savg) diff --git a/q65w/libq65/q65wa.f90 b/q65w/libq65/q65wa.f90 index 778d72792..6c5d3e406 100644 --- a/q65w/libq65/q65wa.f90 +++ b/q65w/libq65/q65wa.f90 @@ -1,6 +1,6 @@ subroutine q65wa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & mousedf,mousefqso,nagain,nfshift,max_drift,nfcal,mycall, & - hiscall,hisgrid,nfsample,nmode,ndepth,datetime,ndop00) + hiscall,hisgrid,nfsample,nmode,ndepth,datetime,ndop00,fselected) ! Processes timf2 data received from Linrad to find and decode Q65 signals. @@ -55,13 +55,18 @@ subroutine q65wa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & do icand=1,ncand !Attempt to decode each candidate f0=cand(icand)%f +! if(f0-mfa.lt.0.0 .or. f0-mfb.gt.0.0) cycle + print*,'cc',nagain,ntol,fselected,f0+nkhz_center-48.0 + if(nagain.eq.1 .and. abs(f0+nkhz_center-48.0 - fselected).gt.0.001*ntol) cycle + nagain2=0 + print*,'dd',nagain,ntol,fselected,f0+nkhz_center-48.0 freq=cand(icand)%f+nkhz_center-48.0-1.27046 ikhz=nint(freq) idec=-1 call timer('q65b ',0) call q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & mycall,hiscall,hisgrid,mode_q65,f0,fqso,nkhz_center,newdat, & - nagain,max_drift,ndepth,datetime,ndop00,idec) + nagain2,max_drift,ndepth,datetime,ndop00,idec) call timer('q65b ',1) tsec=sec_midn() - tsec0 if(tsec.gt.30.0) exit !Don't start another decode attempt after t=30 s. diff --git a/q65w/mainwindow.cpp b/q65w/mainwindow.cpp index 39abd4700..70ced7083 100644 --- a/q65w/mainwindow.cpp +++ b/q65w/mainwindow.cpp @@ -229,7 +229,6 @@ void MainWindow::writeSettings() settings.setValue("SaveDir",m_saveDir); settings.setValue("AzElDir",m_azelDir); settings.setValue("Timeout",m_timeout); - settings.setValue("dPhi",m_dPhi); settings.setValue("Fcal",m_fCal); settings.setValue("Fadd",m_fAdd); settings.setValue("NetworkInput", m_network); @@ -277,7 +276,6 @@ void MainWindow::readSettings() m_saveDir=settings.value("SaveDir",m_appDir + "/save").toString(); m_azelDir=settings.value("AzElDir",m_appDir).toString(); m_timeout=settings.value("Timeout",20).toInt(); - m_dPhi=settings.value("dPhi",0).toInt(); m_fCal=settings.value("Fcal",0).toInt(); m_fAdd=settings.value("FAdd",0).toDouble(); soundInThread.setFadd(m_fAdd); @@ -456,7 +454,6 @@ void MainWindow::on_actionSettings_triggered() dlg.m_saveDir=m_saveDir; dlg.m_azelDir=m_azelDir; dlg.m_timeout=m_timeout; - dlg.m_dPhi=m_dPhi; dlg.m_fCal=m_fCal; dlg.m_fAdd=m_fAdd; dlg.m_network=m_network; @@ -474,7 +471,6 @@ void MainWindow::on_actionSettings_triggered() m_saveDir=dlg.m_saveDir; m_azelDir=dlg.m_azelDir; m_timeout=dlg.m_timeout; - m_dPhi=dlg.m_dPhi; m_fCal=dlg.m_fCal; m_fAdd=dlg.m_fAdd; m_wide_graph_window->setFcal(m_fCal); @@ -841,10 +837,8 @@ void MainWindow::freezeDecode(int n) //freezeDecode() void MainWindow::decode() //decode() { - //Don't attempt to decode if decoder is already busy, or if we transmitted for 10 s or more. if(m_decoderBusy or m_nTransmitted>10) return; - QString fname=" "; ui->DecodeButton->setStyleSheet(m_pbdecoding_style1); @@ -856,9 +850,9 @@ void MainWindow::decode() //decode() datcom_.nutc=100*ihr + imin; } - datcom_.idphi=m_dPhi; datcom_.mousedf=m_wide_graph_window->DF(); datcom_.mousefqso=m_wide_graph_window->QSOfreq(); + datcom_.fselected=datcom_.mousefqso + 0.001*datcom_.mousedf; datcom_.ndepth=m_ndepth+1; datcom_.ndiskdat=0; if(m_diskData) { @@ -891,7 +885,7 @@ void MainWindow::decode() //decode() datcom_.nfa=nfa; datcom_.nfb=nfb; - qDebug() << "bbb" << datcom_.fcenter << datcom_.nfa << datcom_.nfb; + qDebug() << "bbb" << datcom_.fcenter << datcom_.nfa << datcom_.nfb << datcom_.fselected; datcom_.nfcal=m_fCal; datcom_.nfshift=nfshift; datcom_.mcall3=0; diff --git a/q65w/mainwindow.h b/q65w/mainwindow.h index d5e79393f..84abc349f 100644 --- a/q65w/mainwindow.h +++ b/q65w/mainwindow.h @@ -103,7 +103,6 @@ private: qint32 m_QSOfreq0; qint32 m_astroFont; qint32 m_timeout; - qint32 m_dPhi; qint32 m_fCal; qint32 m_txFreq; qint32 m_setftx; @@ -130,7 +129,7 @@ private: bool m_monitoring; bool m_diskData; bool m_loopall; - bool m_decoderBusy; + bool m_decoderBusy=false; bool m_restart; bool m_call3Modified; bool m_startAnother; diff --git a/q65w/soundin.cpp b/q65w/soundin.cpp index cc854424f..54fbc5955 100644 --- a/q65w/soundin.cpp +++ b/q65w/soundin.cpp @@ -19,7 +19,7 @@ extern "C" float savg[NFFT]; double fcenter; int nutc; - int idphi; //Phase correction for Y pol'n, degrees + float fselected; //Selected frequency for nagain decodes int mousedf; //User-selected DF int mousefqso; //User-selected QSO freq (kHz) int nagain; //1 ==> decode only at fQSO +/- Tol