From fea274ed57b62fc38450290b3de450263373b15b Mon Sep 17 00:00:00 2001 From: Uwe Risse Date: Tue, 29 Aug 2023 13:17:20 +0200 Subject: [PATCH] QMAP: make offset adjustable. --- qmap/commons.h | 2 + qmap/libqmap/decode0.f90 | 6 +- qmap/libqmap/q65b.f90 | 4 +- qmap/libqmap/qmapa.f90 | 4 +- qmap/mainwindow.cpp | 3 + qmap/mainwindow.ui | 208 ++++++++++++++++++++++----------------- 6 files changed, 131 insertions(+), 96 deletions(-) diff --git a/qmap/commons.h b/qmap/commons.h index 511ab7ae8..2daaced9f 100644 --- a/qmap/commons.h +++ b/qmap/commons.h @@ -34,6 +34,7 @@ extern struct { //This is "common/datcom/..." in Fortran int ndop00; //EME Self Doppler int nsave; //Number of s3(64,63) spectra saved int max_drift; //Maximum Q65 drift: units symbol_rate/TxT + int offset; //Offset in Hz int nhsym; //Number of available JT65 half-symbols char mycall[12]; char mygrid[6]; @@ -73,6 +74,7 @@ extern struct { //This is "common/datcom/..." in Fortran int ndop00; //EME Self Doppler int nsave; //Number of s3(64,63) spectra saved int max_drift; //Maximum Q65 drift: units symbol_rate/TxT + int offset; //Offset in Hz int nhsym; //Number of available JT65 half-symbols char mycall[12]; char mygrid[6]; diff --git a/qmap/libqmap/decode0.f90 b/qmap/libqmap/decode0.f90 index 56bf392bf..ada6d4cf3 100644 --- a/qmap/libqmap/decode0.f90 +++ b/qmap/libqmap/decode0.f90 @@ -11,10 +11,10 @@ subroutine decode0(dd,ss,savg) character*60 result common/decodes/ndecodes,ncand,nQDecoderDone,nWDecoderBusy, & nWTransmitting,result(50) - common/npar/fcenter,nutc,fselected,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 + ndop00,nsave,max_drift,offset,nhsym,mycall,mygrid,hiscall,hisgrid,datetime data neme0/-99/ save @@ -43,7 +43,7 @@ subroutine decode0(dd,ss,savg) call timer('qmapa ',0) call qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & - mousedf,mousefqso,nagain,nfshift,max_drift, & + mousedf,mousefqso,nagain,nfshift,max_drift,offset, & nfcal,mycall,hiscall,hisgrid,nfsample,nmode,ndepth, & datetime,ndop00,fselected) call timer('qmapa ',1) diff --git a/qmap/libqmap/q65b.f90 b/qmap/libqmap/q65b.f90 index 84b9485a3..7406b4b09 100644 --- a/qmap/libqmap/q65b.f90 +++ b/qmap/libqmap/q65b.f90 @@ -1,6 +1,6 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & mycall0,hiscall0,hisgrid,mode_q65,f0,fqso,nkhz_center, newdat,nagain, & - max_drift,ndepth,datetime,ndop00,idec) + max_drift,offset,ndepth,datetime,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. @@ -111,7 +111,7 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & freq1=freq0 + 0.001d0*(ikhz1-ikhz) ndecodes=ndecodes+1 frx=0.001*k0*df+nkhz_center-48.0+1.0 - 0.001*nfcal - fsked=frx - 0.001*ndop00/2.0 - 1.5 + fsked=frx - 0.001*ndop00/2.0 - 0.001*offset write(result(ndecodes),1120) nutc,frx,fsked,xdt0,nsnr0,trim(msg0) 1120 format(i4.4,f9.3,f7.1,f7.2,i5,2x,a) write(12,1130) datetime,trim(result(ndecodes)(5:)) diff --git a/qmap/libqmap/qmapa.f90 b/qmap/libqmap/qmapa.f90 index 0515487a7..a611364a8 100644 --- a/qmap/libqmap/qmapa.f90 +++ b/qmap/libqmap/qmapa.f90 @@ -1,5 +1,5 @@ subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & - mousedf,mousefqso,nagain,nfshift,max_drift,nfcal,mycall, & + mousedf,mousefqso,nagain,nfshift,max_drift,offset,nfcal,mycall, & hiscall,hisgrid,nfsample,nmode,ndepth,datetime,ndop00,fselected) ! Processes timf2 data received from Linrad to find and decode Q65 signals. @@ -64,7 +64,7 @@ subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & call timer('q65b ',0) call q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & mycall,hiscall,hisgrid,mode_q65,f0,fqso,nkhz_center,newdat, & - nagain2,max_drift,ndepth,datetime,ndop00,idec) + nagain2,max_drift,offset,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/qmap/mainwindow.cpp b/qmap/mainwindow.cpp index 4acf6f7c4..d89390a44 100644 --- a/qmap/mainwindow.cpp +++ b/qmap/mainwindow.cpp @@ -247,6 +247,7 @@ void MainWindow::writeSettings() settings.setValue("PhaseX",(double)m_phasex); settings.setValue("PhaseY",(double)m_phasey); settings.setValue("MaxDrift",ui->sbMaxDrift->value()); + settings.setValue("Offset",ui->sbOffset->value()); } //---------------------------------------------------------- readSettings() @@ -297,6 +298,7 @@ void MainWindow::readSettings() m_NB=settings.value("NB",false).toBool(); ui->NBcheckBox->setChecked(m_NB); ui->sbMaxDrift->setValue(settings.value("MaxDrift",0).toInt()); + ui->sbOffset->setValue(settings.value("Offset",1500).toInt()); m_NBslider=settings.value("NBslider",40).toInt(); ui->NBslider->setValue(m_NBslider); m_gainx=settings.value("GainX",1.0).toFloat(); @@ -857,6 +859,7 @@ void MainWindow::decode() //decode() datcom_.nmode=10*m_modeQ65; datcom_.nsave=m_nsave; datcom_.max_drift=ui->sbMaxDrift->value(); + datcom_.offset=ui->sbOffset->value(); datcom_.ndepth=1; if(datcom_.nagain==1) datcom_.ndepth=3; diff --git a/qmap/mainwindow.ui b/qmap/mainwindow.ui index c4be33829..5c7cf71e7 100644 --- a/qmap/mainwindow.ui +++ b/qmap/mainwindow.ui @@ -53,46 +53,10 @@ - - - - Maximum drift rate in units of symbol rate per transmissiion. - - - Qt::AlignCenter - - - Max Drift - - - 50 - - - 5 - - - - - - - - 16777215 - 35 - - - - - 16 - - - - QFrame::Panel - + + - 1296.080 - - - Qt::AlignCenter + NB @@ -109,14 +73,7 @@ - - - - NB - - - - + @@ -147,47 +104,6 @@ - - - - - 50 - 150 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - 0 - 0 - - - - - 50 - 0 - - - - - 16777215 - 16777215 - - - - &Monitor - - - @@ -273,7 +189,72 @@ - + + + + + 16777215 + 35 + + + + + 16 + + + + QFrame::Panel + + + 1296.080 + + + Qt::AlignCenter + + + + + + + + 50 + 150 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 16777215 + 16777215 + + + + &Monitor + + + + false @@ -304,6 +285,53 @@ + + + + Maximum drift rate in units of symbol rate per transmissiion. + + + Qt::AlignCenter + + + Max Drift + + + 50 + + + 5 + + + + + + + <html><head/><body><p>Offset.</p></body></html> + + + Qt::AlignCenter + + + Hz + + + Offset + + + 500 + + + 2000 + + + 100 + + + 1500 + + + @@ -373,6 +401,8 @@ <html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css"> p, li { white-space: pre-wrap; } hr { height: 1px; border-width: 0; } +li.unchecked::marker { content: "\2610"; } +li.checked::marker { content: "\2612"; } </style></head><body style=" font-family:'Courier New'; font-size:10pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>