From bb4564f734532b3d73d8ed45dcdb1b6fb40f5937 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 5 Jan 2024 12:47:50 -0500 Subject: [PATCH] Replace the required calculation of m_xavg, needed for pointing measurements. --- qmap/mainwindow.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/qmap/mainwindow.cpp b/qmap/mainwindow.cpp index 5ed65d882..774fed178 100644 --- a/qmap/mainwindow.cpp +++ b/qmap/mainwindow.cpp @@ -314,12 +314,15 @@ void MainWindow::dataSink(int k) static int ntrz=0; static int nkhz; static int nfsample=96000; + static int nsec0=0; + static int nsum=0; static int ndiskdat; static int nb; static int k0=0; static float px=0.0; static uchar lstrong[1024]; static float slimit; + static double xsum=0.0; if(m_diskData) { ndiskdat=1; @@ -339,6 +342,18 @@ void MainWindow::dataSink(int k) symspec_(&k, &ndiskdat, &nb, &m_NBslider, &nfsample, &px, 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; + if(m_bWTransmitting) px=0.0; QString t; m_pctZap=nzap/178.3;