From fa73b3f50ec6ead52c3371a96f62bc6e666a9ee5 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Sun, 4 Dec 2022 22:15:32 +0100 Subject: New upstream version 2.6.0~rc5+repack --- map65/astro.cpp | 75 ++++++++++++++- map65/astro.h | 6 +- map65/astro.ui | 236 ++++++++++++++++++++++++++++++++++++++++++++--- map65/libm65/decode0.f90 | 5 +- map65/libm65/map65a.f90 | 12 ++- map65/libm65/q65b.f90 | 2 + map65/main.cpp | 2 +- map65/mainwindow.cpp | 47 +++++++++- map65/mainwindow.h | 3 +- 9 files changed, 364 insertions(+), 24 deletions(-) (limited to 'map65') diff --git a/map65/astro.cpp b/map65/astro.cpp index 6282c18e..b9476883 100755 --- a/map65/astro.cpp +++ b/map65/astro.cpp @@ -7,6 +7,7 @@ #include #include "SettingsGroup.hpp" #include "commons.h" +#include extern "C" { void astrosub_ (int* nyear, int* month, int* nday, double* uth, int* nfreq, @@ -44,7 +45,7 @@ Astro::~Astro() } void Astro::astroUpdate(QDateTime t, QString mygrid, QString hisgrid, - int fQSO, int nsetftx, int ntxFreq, QString azelDir) + int fQSO, int nsetftx, int ntxFreq, QString azelDir, double xavg) { static int ntxFreq0=-99; char cc[300]; @@ -86,6 +87,65 @@ void Astro::astroUpdate(QDateTime t, QString mygrid, QString hisgrid, ntsky,xnr,dgrd); ui->astroTextBrowser->setText(" "+ date + "\nUTC: " + utc + "\n" + cc); + double azOffset=0.0; + double elOffset=0.0; + double rad=57.2957795131; + int iCycle=2; +// Are we doing pointing tests? + bool bPointing=ui->cbPointingTests->isChecked(); + ui->gbPointing->setVisible(bPointing); + if(bPointing) { + int nDwell=int(ui->sbDwell->value()); + if(ui->cbAutoCycle->isChecked()) { + iCycle=(t.currentSecsSinceEpoch()%(6*nDwell))/nDwell + 1; + if(iCycle==1) { + azOffset = -ui->sbOffset->value()/cos(elsun/rad); + ui->rb1->setChecked(true); + } + if(iCycle==2 or iCycle==5) { + ui->rb2->setChecked(true); + } + if(iCycle==3) { + azOffset = +ui->sbOffset->value()/cos(elsun/rad); + ui->rb3->setChecked(true); + } + if(iCycle==4) { + elOffset = -ui->sbOffset->value(); + ui->rb4->setChecked(true); + } + if(iCycle==6) { + elOffset = +ui->sbOffset->value(); + ui->rb6->setChecked(true); + } + } + if(ui->cbOnOff->isChecked()) { + iCycle=(t.currentSecsSinceEpoch()%(2*nDwell))/nDwell + 1; + if(iCycle==1) { + azOffset = -ui->sbOffset->value()/cos(elsun/rad); + ui->rb1->setChecked(true); + } + if(iCycle==2) { + ui->rb2->setChecked(true); + } + } + if(ui->cbAutoCycle->isChecked() or ui->cbOnOff->isChecked()) { + QFile f("pointing.out"); + if(f.open(QIODevice::WriteOnly | QIODevice::Append)) { + QTextStream out(&f); + out << t.toString("yyyy-MMM-dd hh:mm:ss"); + sprintf(cc,"%7.1f %7.1f %d %7.1f %7.1f %10.1f %7.2f\n", + azsun,elsun,iCycle,azOffset,elOffset,xavg,10.0*log10(xavg)); + out << cc; + f.close(); + } + } + } else { + ui->rb2->setChecked(true); + ui->cbAutoCycle->setChecked(false); + ui->cbOnOff->setChecked(false); + } + +// Write pointing data to azel.dat QString fname=azelDir+"/azel.dat"; QFile f(fname); if(!f.open(QIODevice::WriteOnly | QIODevice::Text)) { @@ -107,7 +167,7 @@ void Astro::astroUpdate(QDateTime t, QString mygrid, QString hisgrid, "%3d,%1d,fQSO\n" "%3d,%1d,fQSO2\n", nhr,nmin,isec,azmoon,elmoon, - nhr,nmin,isec,azsun,elsun, + nhr,nmin,isec,azsun+azOffset,elsun+elOffset, nhr,nmin,isec,0.0,0.0, nfreq,ndop,ndop00, fQSO,nsetftx, @@ -120,3 +180,14 @@ void Astro::setFontSize(int n) { ui->astroTextBrowser->setFontPointSize(n); } + +void Astro::on_cbAutoCycle_clicked(bool checked) +{ + if(checked) ui->cbOnOff->setChecked(false); +} + +void Astro::on_cbOnOff_clicked(bool checked) +{ + if(checked) ui->cbAutoCycle->setChecked(false); +} + diff --git a/map65/astro.h b/map65/astro.h index 918649e1..c752a2db 100755 --- a/map65/astro.h +++ b/map65/astro.h @@ -15,10 +15,14 @@ class Astro : public QWidget public: explicit Astro (QString const& settings_filename, QWidget *parent = 0); void astroUpdate(QDateTime t, QString mygrid, QString hisgrid, - int fQSO, int nsetftx, int ntxFreq, QString azelDir); + int fQSO, int nsetftx, int ntxFreq, QString azelDir, double xavg); void setFontSize(int n); ~Astro (); +private slots: + void on_cbOnOff_clicked(bool checked); + void on_cbAutoCycle_clicked(bool checked); + private: Ui::Astro *ui; QString m_settings_filename; diff --git a/map65/astro.ui b/map65/astro.ui index df1ce80c..fc31352a 100755 --- a/map65/astro.ui +++ b/map65/astro.ui @@ -6,30 +6,242 @@ 0 0 - 262 + 441 483 Form - + + + + 269 + 19 + 151 + 431 + + + + + + + + + 10 + 100 + 30 + 17 + + + + 1 + + + + + + 60 + 100 + 40 + 17 + + + + 2, 5 + + + true + + + + + + 110 + 100 + 30 + 17 + + + + 3 + + + + + + 60 + 150 + 30 + 17 + + + + 4 + + + + + + 60 + 50 + 30 + 17 + + + + 6 + + + + + + 10 + 230 + 130 + 22 + + + + Qt::AlignCenter + + + Offset + + + deg + + + 1 + + + 0.500000000000000 + + + 20.000000000000000 + + + 0.500000000000000 + + + 2.500000000000000 + + + + + + 30 + 330 + 91 + 17 + + + + Auto Cycle + + + + + + 30 + 380 + 70 + 17 + + + + On Off + + + + + + 10 + 280 + 130 + 22 + + + + Qt::AlignCenter + + + s + + + Dwell + + + 10 + + + 300 + + + 10 + + + + 0 10 - 256 - 451 + 258 + 471 - - - Courier New - 20 - 75 - true - - + + + + + + Courier New + 20 + 75 + true + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Pointing Tests + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + diff --git a/map65/libm65/decode0.f90 b/map65/libm65/decode0.f90 index dec94337..411e38ed 100755 --- a/map65/libm65/decode0.f90 +++ b/map65/libm65/decode0.f90 @@ -14,6 +14,7 @@ subroutine decode0(dd,ss,savg,nstandalone) mcall3,nkeep,ntol,nxant,nrxlog,nfsample,nxpol,nmode, & nfast,nsave,max_drift,nhsym,mycall,mygrid,hiscall,hisgrid,datetime common/early/nhsym1,nhsym2,ldecoded(32768) + common/decodes/ndecodes data neme0/-99/,mcall3b/1/ save @@ -62,8 +63,8 @@ subroutine decode0(dd,ss,savg,nstandalone) call sec0(1,tdec) if(nhsym.eq.nhsym1) write(*,1010) nsum,nsave,nstandalone,nhsym,tdec 1010 format('',3i4,i6,f6.2) - if(nhsym.eq.nhsym2) write(*,1012) nsum,nsave,nstandalone,nhsym,tdec -1012 format('',3i4,i6,f6.2) + if(nhsym.eq.nhsym2) write(*,1012) nsum,nsave,nstandalone,nhsym,tdec,ndecodes +1012 format('',3i4,i6,f6.2,i5) flush(6) return diff --git a/map65/libm65/map65a.f90 b/map65/libm65/map65a.f90 index 552a6a0c..e1f31993 100755 --- a/map65/libm65/map65a.f90 +++ b/map65/libm65/map65a.f90 @@ -34,12 +34,15 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & common/c3com/ mcall3a common/testcom/ifreq common/early/nhsym1,nhsym2,ldecoded(32768) + common/decodes/ndecodes data blank/' '/,cm/'#'/ data shmsg0/'ATT','RO ','RRR','73 '/ data nfile/0/,nutc0/-999/,nid/0/,ip000/1/,ip001/1/,mousefqso0/-999/ save + ndecodes=0 + ! Clean start for Q65 at early decode if(nhsym.eq.nhsym1 .or. nagain.ne.0) ldecoded=.false. if(ndiskdat.eq.1) ldecoded=.false. @@ -50,7 +53,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & mode65=mod(nmode,10) if(mode65.eq.3) mode65=4 mode_q65=nmode/10 - nts_jt65=2**(mode65-1) !JT65 tone separation factor + nts_jt65=mode65 !JT65 tone separation factor nts_q65=2**(mode_q65-1) !Q65 tone separation factor xpol=(nxpol.ne.0) @@ -158,7 +161,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & ssmax=1.e30 call ccf65(ss(1,1,i),nhsym,ssmax,sync1,ipol,jpz,dt, & flipk,syncshort,snr2,ipol2,dt2) - if(dt.lt.-2.6 .or. dt.gt.2.5) sync1=-99.0 !### +!### if(dt.lt.-2.6 .or. dt.gt.2.5) sync1=-99.0 !### call timer('ccf65 ',1) if(mode65.eq.0) syncshort=-99.0 !If "No JT65", don't waste time @@ -410,8 +413,8 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & if(cand(icand)%iflip.ne.0) cycle !Do only Q65 candidates here if(candec(icand)) cycle !Skip if already decoded freq=cand(icand)%f+nkhz_center-48.0-1.27046 -! If here at nqd=1, do only candidates at mousefqso +/- ntol - if(nqd.eq.1 .and. abs(freq-mousefqso).gt.0.001*ntol) cycle +!###! If here at nqd=1, do only candidates at mousefqso +/- ntol +!### if(nqd.eq.1 .and. abs(freq-mousefqso).gt.0.001*ntol) cycle ikhz=nint(freq) f0=cand(icand)%f call timer('q65b ',0) @@ -499,6 +502,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & write(26,1014) f0,ndf,ndf0,ndf1,ndf2,dt,npol,nsync1, & nsync2,nutc,decoded,cp,cmode 1014 format(f8.3,i5,3i3,f5.1,i4,i3,i4,i5.4,4x,a22,2x,a1,3x,a2) + ndecodes=ndecodes+1 write(21,1100) f0,ndf,dt,npol,nsync2,nutc,decoded,cp, & cmode(1:1),cmode(2:2) 1100 format(f8.3,i5,f5.1,2i4,i5.4,2x,a22,2x,a1,3x,a1,1x,a1) diff --git a/map65/libm65/q65b.f90 b/map65/libm65/q65b.f90 index 009a9e73..6e555284 100755 --- a/map65/libm65/q65b.f90 +++ b/map65/libm65/q65b.f90 @@ -35,6 +35,7 @@ subroutine q65b(nutc,nqd,nxant,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol, & character*1 cp,cmode*2 common/cacb/ca,cb common/early/nhsym1,nhsym2,ldecoded(32768) + common/decodes/ndecodes data nutc00/-1/,msg00/' '/ save @@ -179,6 +180,7 @@ subroutine q65b(nutc,nqd,nxant,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol, & ! to map65_rx.log if(nutc.ne.nutc00 .or. msg0(1:28).ne.msg00 .or. freq1.ne.freq1_00) then ! Write to file map65_rx.log: + ndecodes=ndecodes+1 write(21,1110) freq1,ndf,xdt0,npol,nsnr0,nutc,msg0(1:28),cq0 1110 format(f8.3,i5,f5.1,2i4,i5.4,2x,a28,': A',2x,a3) nutc00=nutc diff --git a/map65/main.cpp b/map65/main.cpp index 225713d3..2cc4069c 100755 --- a/map65/main.cpp +++ b/map65/main.cpp @@ -19,7 +19,7 @@ int main(int argc, char *argv[]) QApplication a {argc, argv}; // Override programs executable basename as application name. a.setApplicationName ("MAP65"); - a.setApplicationVersion ("3.0.0"); + a.setApplicationVersion ("3.0.1"); // switch off as we share an Info.plist file with WSJT-X a.setAttribute (Qt::AA_DontUseNativeMenuBar); MainWindow w; diff --git a/map65/mainwindow.cpp b/map65/mainwindow.cpp index 4cd5eebc..f31eec21 100755 --- a/map65/mainwindow.cpp +++ b/map65/mainwindow.cpp @@ -520,6 +520,8 @@ void MainWindow::dataSink(int k) static int nkhz; static int nfsample=96000; static int nxpol=0; + static int nsec0=0; + static int nsum=0; static float fgreen; static int ndiskdat; static int nb; @@ -529,6 +531,7 @@ void MainWindow::dataSink(int k) static float rejectx; static float rejecty; static float slimit; + static double xsum=0.0; if(m_diskData) { ndiskdat=1; @@ -551,8 +554,22 @@ void MainWindow::dataSink(int k) &nfsample, &fgreen, &m_adjustIQ, &m_applyIQcal, &m_gainx, &m_gainy, &m_phasex, &m_phasey, &rejectx, &rejecty, &px, &py, s, &nkhz, &ihsym, &nzap, &slimit, lstrong); + + int nsec=QDateTime::currentSecsSinceEpoch(); + if(nsec==nsec0) { + xsum+=pow(10.0,0.1*px); + nsum+=1; + } else { + m_xavg=0.0; + if(nsum>0) m_xavg=xsum/nsum; + xsum=pow(10.0,0.1*px); + nsum=1; + } + nsec0=nsec; + QString t; m_pctZap=nzap/178.3; + ui->yMeterFrame->setVisible(m_xpol); if(m_xpol) { lab4->setText ( QString {" Rx noise: %1 %2 %3 %% "} @@ -1119,6 +1136,9 @@ void MainWindow::diskDat() //diskDat() //These may be redundant?? m_diskData=true; datcom_.newdat=1; + if(m_wide_graph_window->m_bForceCenterFreq) { + datcom_.fcenter=m_wide_graph_window->m_dForceCenterFreq; + } if(m_fs96000) hsym=2048.0*96000.0/11025.0; //Samples per JT65 half-symbol if(!m_fs96000) hsym=2048.0*95238.1/11025.0; @@ -1396,6 +1416,8 @@ void MainWindow::readFromStdout() //readFromStdout QFile lockFile(m_appDir + "/.lock"); lockFile.open(QIODevice::ReadWrite); if(t.indexOf("") >= 0) { + int ndecodes=t.mid(40,5).toInt(); + lab5->setText(QString::number(ndecodes)); m_map65RxLog=0; m_startAnother=m_loopall; } @@ -1404,6 +1426,8 @@ void MainWindow::readFromStdout() //readFromStdout return; } + read_log(); + if(t.indexOf("!") >= 0) { int n=t.length(); int m=2; @@ -1688,7 +1712,7 @@ void MainWindow::guiUpdate() QDateTime t = QDateTime::currentDateTimeUtc(); int fQSO=m_wide_graph_window->QSOfreq(); m_astro_window->astroUpdate(t, m_myGrid, m_hisGrid, fQSO, m_setftx, - m_txFreq, m_azelDir); + m_txFreq, m_azelDir, m_xavg); m_setftx=0; QString utc = t.date().toString(" yyyy MMM dd \n") + t.time().toString(); ui->labUTC->setText(utc); @@ -2344,3 +2368,24 @@ bool MainWindow::isGrid4(QString g) if(g.mid(3,1)<'0' or g.mid(3,1)>'9') return false; return true; } + +void MainWindow::read_log() +{ + // Update "m_worked" by reading wsjtx.log + m_worked.clear(); //Start from scratch + QFile f("wsjtx.log"); + f.open(QIODevice::ReadOnly); + if(f.isOpen()) { + QTextStream in(&f); + QString line,callsign; + for(int i=0; i<99999; i++) { + line=in.readLine(); + if(line.length()<=0) break; + callsign=line.mid(40,6); + int n=callsign.indexOf(","); + if(n>0) callsign=callsign.left(n); + m_worked[callsign]=true; + } + f.close(); + } +} diff --git a/map65/mainwindow.h b/map65/mainwindow.h index 2f6e6b47..cdd1a6e4 100755 --- a/map65/mainwindow.h +++ b/map65/mainwindow.h @@ -194,12 +194,12 @@ private: qint32 m_RxState; qint32 m_dB; - double m_fAdd; // double m_IQamp; // double m_IQphase; double m_cal570; double m_TxOffset; + double m_xavg; bool m_monitoring; bool m_transmitting; @@ -294,6 +294,7 @@ private: void stub(); bool isGrid4(QString g); bool subProcessFailed (QProcess *, int exit_code, QProcess::ExitStatus); + void read_log(); }; extern void getfile(QString fname, bool xpol, int idInt); -- cgit v1.2.3