diff --git a/qmap/commons.h b/qmap/commons.h index 85b4d2539..ea51864be 100644 --- a/qmap/commons.h +++ b/qmap/commons.h @@ -27,7 +27,7 @@ extern struct { //This is "common/datcom/..." in Fortran int ntimeout; //Max for timeouts in Messages and BandMap int ntol; //+/- decoding range around fQSO (Hz) int nxant; //1 ==> add 45 deg to measured pol angle - int junk_1; + int nCFOM; //1 ==> CFOM already done, 0 otherwise int nfsample; //Input sample rate int nxpol; //1 if using xpol antennas, 0 otherwise int nBaseSubmode; //Base submode for Q65-60x (aka m_modeQ65) @@ -68,7 +68,7 @@ extern struct { //This is "common/datcom/..." in Fortran int ntimeout; //Max for timeouts in Messages and BandMap int ntol; //+/- decoding range around fQSO (Hz) int nxant; //1 ==> add 45 deg to measured pol angle - int junk_1; + int nCFOM; //1 ==> CFOM already done, 0 otherwise int nfsample; //Input sample rate int nxpol; //1 if using xpol antennas, 0 otherwise int nBaseSubmode; //Base submode for Q65-60x (aka m_modeQ65) diff --git a/qmap/getfile.cpp b/qmap/getfile.cpp index cea79afbd..e2afc6451 100644 --- a/qmap/getfile.cpp +++ b/qmap/getfile.cpp @@ -40,15 +40,15 @@ void getfile(QString fname, bool xpol, int dbDgrd) } n = fread(datcom_.mygrid,sizeof(datcom_.mygrid),1,fp); short int one=0; - fread(&one,2,1,fp); + n= fread(&one,2,1,fp); Q_UNUSED(n); -// if(n>0) qDebug() << "bb" << datcom_.mygrid << one; + datcom_.nCFOM=one; fclose(fp); datcom_.ndiskdat=1; int nfreq=(int)datcom_.fcenter; - if(nfreq!=144 and nfreq != 432 and nfreq != 1296) datcom_.fcenter=1296.080; + if(nfreq!=144 and nfreq != 432 and nfreq != 1296) datcom_.fcenter=1296.090; int i0=fname.indexOf(".iq"); datcom_.nutc=0; if(i0>0) { @@ -60,7 +60,6 @@ void getfile(QString fname, bool xpol, int dbDgrd) void save_iq(QString fname, bool bCFOM) { int npts=2*60*96000; - if(bCFOM) npts=2*npts; qint16* buf=(qint16*)malloc(2*npts); char name[80]; diff --git a/qmap/libqmap/cfom.f90 b/qmap/libqmap/cfom.f90 index f3ab7e55d..d44ebd538 100644 --- a/qmap/libqmap/cfom.f90 +++ b/qmap/libqmap/cfom.f90 @@ -28,3 +28,13 @@ subroutine cfom(dd,k0,k,ndop0) return end subroutine cfom + +subroutine zaptx(dd,k0,k) + + parameter(NMAX=60*96000) + real dd(2,NMAX) + + dd(1:2,k0+1:k)=0. + + return +end subroutine zaptx diff --git a/qmap/libqmap/decode0.f90 b/qmap/libqmap/decode0.f90 index 5ae21732c..fc74109a1 100644 --- a/qmap/libqmap/decode0.f90 +++ b/qmap/libqmap/decode0.f90 @@ -15,7 +15,7 @@ subroutine decode0(dd,ss,savg) nWTransmitting,result(50) common/npar/fcenter,nutc,fselected,mousedf,mousefqso,nagain, & ndepth,ndiskdat,neme,newdat,nfa,nfb,nfcal,nfshift, & - mcall3,nkeep,ntol,nxant,nrxlog,nfsample,nxpol,nmode, & + mcall3,nkeep,ntol,nxant,nCFOM,nfsample,nxpol,nmode, & ndop00,nsave,max_drift,offset,nhsym,mycall,mygrid, & hiscall,hisgrid,datetime,junk1,junk2,bAlso30 data neme0/-99/ @@ -48,7 +48,7 @@ subroutine decode0(dd,ss,savg) call qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & mousedf,mousefqso,nagain,nfshift,max_drift,offset, & nfcal,mycall,hiscall,hisgrid,nfsample,nmode,ndepth, & - datetime,ndop00,fselected,bAlso30,nhsym) + datetime,ndop00,fselected,bAlso30,nhsym,NCFOM) call timer('qmapa ',1) return diff --git a/qmap/libqmap/q65b.f90 b/qmap/libqmap/q65b.f90 index f35c12df0..2aec55ce4 100644 --- a/qmap/libqmap/q65b.f90 +++ b/qmap/libqmap/q65b.f90 @@ -1,7 +1,7 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & ntrperiod,iseq, & mycall0,hiscall0,hisgrid,mode_q65,f0,fqso,nkhz_center, newdat,nagain, & - max_drift,offset,ndepth,datetime,ndop00,idec) + max_drift,offset,ndepth,datetime,nCFOM,ndop00,idec) ! This routine provides an interface between QMAP and the Q65 decoder ! in WSJT-X. All arguments are input data obtained from the QMAP GUI. @@ -130,6 +130,7 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & freq1=freq0 + 0.001d0*(ikhz1-ikhz) frx=0.001*k0*df+nkhz_center-48.0+1.0 - 0.001*nfcal fsked=frx - 0.001*ndop00/2.0 - 0.001*offset +! write(*,'("A",i5,i8,f10.3,f10.1)') nCFOM,ndop00,frx,fsked ctmp=csubmode//' '//trim(msg0) ndecodes=min(ndecodes+1,50) write(result(ndecodes),1120) nhhmmss,frx,fsked,xdt0,nsnr0,trim(ctmp) diff --git a/qmap/libqmap/q65c.f90 b/qmap/libqmap/q65c.f90 index 6729df22c..678d504b3 100644 --- a/qmap/libqmap/q65c.f90 +++ b/qmap/libqmap/q65c.f90 @@ -22,7 +22,7 @@ subroutine q65c(itimer) !### REMEMBER that /npar/ is not updated until nparams=nparams0 is executed. ### common/npar/fcenter,nutc,fselected,mousedf,mousefqso,nagain, & ndepth,ndiskdat,neme,newdat,nn1,nn2,nfcal,nfshift, & - mcall3,nkeep,ntol,nxant,nrxlog,nfsample,nxpol,nmode, & + mcall3,nkeep,ntol,nxant,nCFOM,nfsample,nxpol,nmode, & ndop00,nsave,nn3,nn4,max_nhsym,mycall,mygrid,hiscall,hisgrid, & datetime,junk1,junk2,bAlso30 equivalence (nparams,fcenter) diff --git a/qmap/libqmap/qmapa.f90 b/qmap/libqmap/qmapa.f90 index 1abc37175..5301b9769 100644 --- a/qmap/libqmap/qmapa.f90 +++ b/qmap/libqmap/qmapa.f90 @@ -1,7 +1,7 @@ subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & mousedf,mousefqso,nagain,nfshift,max_drift,offset,nfcal,mycall, & hiscall,hisgrid,nfsample,nBaseSubmode,ndepth,datetime,ndop00, & - fselected,bAlso30,nhsym) + fselected,bAlso30,nhsym,nCFOM) ! Processes timf2 data received from Linrad to find and decode Q65 signals. @@ -72,7 +72,7 @@ subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & call q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & ntrperiod,iseq, & mycall,hiscall,hisgrid,mode_q65_tmp,f0,fqso,nkhz_center,newdat, & - nagain2,max_drift,offset,ndepth,datetime,ndop00,idec) + nagain2,max_drift,offset,ndepth,datetime,nCFOM,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/qmap/mainwindow.cpp b/qmap/mainwindow.cpp index 3f70675ce..a97070cb5 100644 --- a/qmap/mainwindow.cpp +++ b/qmap/mainwindow.cpp @@ -348,12 +348,13 @@ void MainWindow::dataSink(int k) nfsample=96000; if(!m_fs96000) nfsample=95238; - if(ui->cbCFOM->isChecked()) { int ndop00=0; if(m_astro_window) ndop00=m_astro_window->getSelfDop(); cfom_(datcom_.d4, &k0, &k, &ndop00); } + + if(m_bWTransmitting) zaptx_(datcom_.d4, &k0, &k); k0=k; symspec_(&k, &ndiskdat, &nb, &m_NBslider, &nfsample, @@ -426,7 +427,7 @@ void MainWindow::dataSink(int k) QDateTime t = QDateTime::currentDateTimeUtc(); m_dateTime=t.toString("yyMMdd_hhmm"); decode(); //Start the decoder - if(m_saveAll and !m_diskData and (m_nTx30<5 and m_nTx60<10) and ihsym==m_hsymStop) { + if(m_saveAll and !m_diskData and m_nTx60<10 and ihsym==m_hsymStop) { QDir dir(m_saveDir); if (!dir.exists()) dir.mkpath("."); QString fname=m_saveDir + "/" + t.date().toString("yyMMdd") + "_" + @@ -436,8 +437,8 @@ void MainWindow::dataSink(int k) *future2 = QtConcurrent::run(save_iq, fname, bCFOM); watcher2->setFuture(*future2); } - m_nTx30=0; - m_nTx60=0; + if(ihsym==200) m_nTx30=0; + if(ihsym==m_hsymStop) m_nTx60=0; } soundInThread.m_dataSinkBusy=false; } @@ -852,10 +853,11 @@ void MainWindow::decode() //decode() double uth=nhr + nmin/60.0; int nfreq=(int)datcom_.fcenter; int ndop00=0; - if(ui->cbCFOM->isChecked()) { +// if(ui->cbCFOM->isChecked()) { + if(datcom_.nCFOM==0) { astrosub00_(&nyear, &month, &nday, &uth, &nfreq, m_myGrid.toLatin1(),&ndop00,6); } - datcom_.ndop00=ndop00; //Send self Doppler (or 0, if using CFOM) to decoder + datcom_.ndop00=ndop00; //Send self Doppler (or 0, if disk data had CFOM already) to decoder fname=m_path.mid(i0-11,11); } } @@ -879,7 +881,6 @@ void MainWindow::decode() //decode() datcom_.ntol=m_tol; datcom_.nxant=0; m_nutc0=datcom_.nutc; - datcom_.junk_1=0; datcom_.nfsample=96000; if(!m_fs96000) datcom_.nfsample=95238; datcom_.nxpol=0; @@ -1007,13 +1008,19 @@ void MainWindow::guiUpdate() mem_qmap.unlock(); if(itest[4]>0) { m_WSJTX_TRperiod=itest[4]; + m_bWTransmitting=true; if(m_WSJTX_TRperiod==30) m_nTx30++; if(m_WSJTX_TRperiod==60) m_nTx60++; + } else { + m_bWTransmitting=false; } if(n6030.0) { diff --git a/qmap/mainwindow.h b/qmap/mainwindow.h index df3b879d8..ecf368033 100644 --- a/qmap/mainwindow.h +++ b/qmap/mainwindow.h @@ -141,6 +141,7 @@ private: bool m_decode_called=false; bool m_bAlso30=false; bool m_bDiskDatBusy=false; + bool m_bWTransmitting=false; float m_pctZap; @@ -209,6 +210,8 @@ extern "C" { void cfom_(float d4[], int* k0, int* k, int* ndop0); + void zaptx_(float d4[], int* k0, int* k); + } #endif // MAINWINDOW_H