From 2f461041409d073d51b2690978c3c1b74f440185 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 15 Jan 2024 15:47:57 -0500 Subject: [PATCH] Basically operational with save_qm called in the decoder thread. Needs testing! --- qmap/commons.h | 8 ++++---- qmap/libqmap/decode0.f90 | 2 +- qmap/libqmap/q65c.f90 | 40 +++++++++++++++++++++++++++++----------- qmap/libqmap/save_qm.f90 | 13 ++++++------- qmap/mainwindow.cpp | 2 ++ 5 files changed, 42 insertions(+), 23 deletions(-) diff --git a/qmap/commons.h b/qmap/commons.h index 8549e44f3..2e6b142a8 100644 --- a/qmap/commons.h +++ b/qmap/commons.h @@ -29,9 +29,9 @@ extern struct { //This is "common/datcom/..." in Fortran int n60; //nsecs%60 int junk4; // int nfsample; //Input sample rate - int junk3; // + int ndop58; //EME Self Doppler at t=58 int nBaseSubmode; //Base submode for Q65-60x (aka m_modeQ65) - int ndop00; //EME Self Doppler + int ndop00; //EME Self Doppler at t=0 int nsave; //0=None, 1=SaveDecoded, 2=SaveAll int max_drift; //Maximum Q65 drift: units symbol_rate/TxT int offset; //Offset in Hz @@ -70,9 +70,9 @@ extern struct { //This is "common/datcom/..." in Fortran int n60; //nsecs%60 int junk4; // int nfsample; //Input sample rate - int junk3; // + int ndop58; //EME Self Doppler at t=58 int nBaseSubmode; //Base submode for Q65-60x (aka m_modeQ65) - int ndop00; //EME Self Doppler + int ndop00; //EME Self Doppler at t=0 int nsave; //0=None, 1=SaveDecoded, 2=SaveAll int max_drift; //Maximum Q65 drift: units symbol_rate/TxT int offset; //Offset in Hz diff --git a/qmap/libqmap/decode0.f90 b/qmap/libqmap/decode0.f90 index 41bbe0349..271ed54f8 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,ntx60,newdat,nfa,nfb,nfcal,nfshift, & - ntx30a,ntx30b,ntol,n60,nCFOM,nfsample,nxpol,nmode, & + ntx30a,ntx30b,ntol,n60,nCFOM,nfsample,ndop58,nmode, & ndop00,nsave,max_drift,offset,nhsym,mycall,mygrid, & hiscall,hisgrid,datetime,junk1,junk2,bAlso30 save diff --git a/qmap/libqmap/q65c.f90 b/qmap/libqmap/q65c.f90 index 2b58ae84f..f699e6210 100644 --- a/qmap/libqmap/q65c.f90 +++ b/qmap/libqmap/q65c.f90 @@ -1,4 +1,4 @@ -subroutine q65c(fname,revision) +subroutine q65c(fname0,revision0) use timer_module, only: timer use timer_impl, only: fini_timer !, limtrace @@ -12,9 +12,12 @@ subroutine q65c(fname,revision) real*8 fcenter real*4 pdb(4) integer nparams0(NJUNK+3),nparams(NJUNK+3) + integer values(8) logical first logical*1 bAlso30 - character*(*) fname,revision + character*(*) fname0,revision0 + character*120 fname + character*22 revision character*12 mycall,hiscall character*6 mygrid,hisgrid character*20 datetime @@ -25,19 +28,26 @@ subroutine q65c(fname,revision) !### REMEMBER that /npar/ is not updated until nparams=nparams0 is executed. ### common/npar/fcenter,nutc,fselected,mousedf,mousefqso,nagain, & ndepth,ndiskdat,ntx60,newdat,nn1,nn2,nfcal,nfshift, & - ntx30a,ntx30b,ntol,n60,nCFOM,nfsample,nxpol,nmode, & + ntx30a,ntx30b,ntol,n60,nCFOM,nfsample,ndop58,nmode, & ndop00,nsave,nn3,nn4,nhsym,mycall,mygrid,hiscall,hisgrid, & datetime,junk1,junk2,bAlso30 equivalence (nparams,fcenter) data first/.true./ save first + fname=fname0 + revision=revision0 nparams=nparams0 !Copy parameters into common/npar/ datetime(12:)='00 ' - npatience=1 newdat=1 !Always on ?? + if(ndiskdat.eq.0) then + if(nhsym.eq.200 .and. n60.ne.30) go to 999 + if(nhsym.eq.330 .and. n60.ne.49) go to 999 + if(nhsym.eq.390 .and. n60.ne.58) go to 999 + endif + if(ndiskdat.eq.1) then call chkstat(dd,nhsym,pdb) if((abs(pdb(1)-pdb(2)).gt.3.0 .and. pdb(1).gt.1.0) .or. & @@ -48,9 +58,6 @@ subroutine q65c(fname,revision) ntx30a=0 !Older 56s files have no Tx ntx30b=0 !Older 56s files have no Tx endif - -! write(*,3001) nutc,nhsym,pdb,ntx30a,ntx30b -!3001 format(i4.4,i6,4f7.1,2i6) endif if(ntx30a.gt.5) then @@ -71,11 +78,22 @@ subroutine q65c(fname,revision) call timer('decode0 ',0) call decode0(dd,ss,savg) call timer('decode0 ',1) - - write(*,3001) n60,datetime(1:11),nutc,newdat,nsave,ntx30a,ntx30b,ndecodes -3001 format('A',i3,1x,a11,i6.4,5i5) - return + call date_and_time(VALUES=values) + n60b=values(7) + nd=n60b-n60 + if(nd.lt.0) nd=nd+60 + write(*,3002) nutc,nagain,nhsym,n60,n60b,nd,ntx30a,ntx30b,ndecodes,revision +3002 format('A',i5.4,8i5,2x,a22) + + if(nsave.eq.2 .or. (nsave.eq.1 .and. ndecodes.ge.1)) then + call timer('save_qm ',0) + call save_qm(fname,revision,mycall,mygrid,dd,ntx30a,ntx30b,fcenter, & + nutc,ndop00,ndop58) + call timer('save_qm ',1) + endif + +999 return end subroutine q65c subroutine all_done diff --git a/qmap/libqmap/save_qm.f90 b/qmap/libqmap/save_qm.f90 index 1811c4569..41948598a 100644 --- a/qmap/libqmap/save_qm.f90 +++ b/qmap/libqmap/save_qm.f90 @@ -1,9 +1,11 @@ -subroutine save_qm(fname,prog_id,mycall,mygrid,dd,ntx30a,ntx30b,fcenter, & +subroutine save_qm(fname,revision,mycall,mygrid,dd,ntx30a,ntx30b,fcenter, & nutc,ndop00,ndop58) parameter(NMAX=60*96000) - character*(*) fname,prog_id,mycall,mygrid - character prog_id_24*24,mycall_12*12,mygrid_6*6 + character*120 fname + character*22 revision + character*12 mycall + character*6 mygrid real*4 dd(2,NMAX) real*8 fcenter integer nxtra(15) !For possible future additions @@ -49,11 +51,8 @@ subroutine save_qm(fname,prog_id,mycall,mygrid,dd,ntx30a,ntx30b,fcenter, & if(ib.eq.30*96000) id1(1:2,ib+1:60*96000)=0 open(29,file=trim(fname),status='unknown',access='stream') - prog_id_24=prog_id//" " - mycall_12=mycall - mygrid_6=mygrid nxtra=0 - write(29) prog_id_24,mycall_12,mygrid_6,fcenter,nutc,ntx30a,ntx30b, & + write(29) revision//' ',mycall_12,mygrid_6,fcenter,nutc,ntx30a,ntx30b, & ndop00,ndop58,ia,ib,fac0,nxtra !Write header to disk write(29) id1(1:2,ia:ib) !Write 8-bit data to disk close(29) diff --git a/qmap/mainwindow.cpp b/qmap/mainwindow.cpp index f3869f264..774b58cfe 100644 --- a/qmap/mainwindow.cpp +++ b/qmap/mainwindow.cpp @@ -900,6 +900,8 @@ void MainWindow::decode() //decode() datcom_.junk1=1234; //Check for these values in m65 datcom_.junk2=5678; datcom_.bAlso30=m_bAlso30; + datcom_.ndop00=m_dop00; + datcom_.ndop58=m_dop58; char *to = (char*) datcom2_.d4; char *from = (char*) datcom_.d4;