Replace the required calculation of m_xavg, needed for pointing measurements.

This commit is contained in:
Joe Taylor 2024-01-05 12:47:50 -05:00
parent 9e0425ef40
commit bb4564f734

View File

@ -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;