From 5670bc4709db9ec775b2d7741c01d797c8e49ea0 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 29 Sep 2012 13:02:19 +0000 Subject: [PATCH] Working on wide graph displays. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2609 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- commons.h | 2 +- libm65/symspecx.f90 | 15 +++--- mainwindow.cpp | 10 ++-- mainwindow.h | 1 - plotter.cpp | 113 +++++++++++--------------------------------- soundin.cpp | 2 +- widegraph.cpp | 7 +-- widegraph.ui | 23 --------- 8 files changed, 42 insertions(+), 131 deletions(-) diff --git a/commons.h b/commons.h index a3843004f..634625453 100644 --- a/commons.h +++ b/commons.h @@ -1,7 +1,7 @@ #ifndef COMMONS_H #define COMMONS_H -#define NSMAX 15750 +#define NSMAX 10000 extern "C" { diff --git a/libm65/symspecx.f90 b/libm65/symspecx.f90 index 77ff5708c..9c515ee99 100644 --- a/libm65/symspecx.f90 +++ b/libm65/symspecx.f90 @@ -12,7 +12,7 @@ subroutine symspecx(k,nsps,ndiskdat,nb,nbslider,pxdb,s,nkhz,ihsym, & ! nzap number of samples zero'ed by noise blanker parameter (NMAX=1800*12000) !Total sample intervals per 30 minutes - parameter (NSMAX=15750) !Max length of saved spectra + parameter (NSMAX=10000) !Max length of saved spectra parameter (MAXFFT=262144) !Max length of FFTs integer*2 id2 real*8 ts,hsym @@ -66,20 +66,19 @@ subroutine symspecx(k,nsps,ndiskdat,nb,nbslider,pxdb,s,nkhz,ihsym, & ihsym=ihsym+1 call four2a(x,nfft,1,-1,0) !Forward FFT of symbol length df=12000.0/nfft - nzh=min(nint(500.0/df),2200) - nz=2*nzh - i0=nint(1500.0/df) - nzh - rewind 71 + i0=nint(1000.0/df) + nz=min(NSMAX,nfft/2) +! rewind 71 do i=1,nz sx=real(cx(i0+i))**2 + aimag(cx(i0+i))**2 sx=1.e-8*sx s(i)=sx savg(i)=savg(i) + sx if(ihsym.le.184) ss(ihsym,i)=sx - write(71,3001) (i0+i-1)*df,savg(i),db(savg(i)) -3001 format(f12.6,2f12.3) +! write(71,3001) (i0+i-1)*df,savg(i),db(savg(i)) +!3001 format(f12.6,2f12.3) enddo - flush(71) +! flush(71) nkhz=100 diff --git a/mainwindow.cpp b/mainwindow.cpp index 5d1975cb9..b43eeb55b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -298,7 +298,7 @@ void MainWindow::readSettings() //-------------------------------------------------------------- dataSink() void MainWindow::dataSink(int k) { - static float s[NFFT],splot[NFFT]; + static float s[NSMAX],splot[NSMAX]; static int n=0; static int ihsym=0; static int nzap=0; @@ -336,16 +336,16 @@ void MainWindow::dataSink(int k) //Average over specified number of spectra if (n==0) { - for (int i=0; i=m_waterfallAvg) { - for (int i=0; i254) y2=254; - if (swide[i]>1.e29) y2=255; - if(strong != strong0 or i==w-1) { - painter2D.drawPolyline(LineBuf,j); - j=0; - strong0=strong; - if(strong0) painter2D.setPen(Qt::red); - if(!strong0) painter2D.setPen(Qt::green); - } - LineBuf[j].setX(i); - LineBuf[j].setY(h-y2); - j++; + int y2 = gain*(y + 34 -m_plotZero); + if (y2<0) y2=0; + if (y2>254) y2=254; + if (swide[i]>1.e29) y2=255; + if(strong != strong0 or i==w-1) { + painter2D.drawPolyline(LineBuf,j); + j=0; + strong0=strong; + if(strong0) painter2D.setPen(Qt::red); + if(!strong0) painter2D.setPen(Qt::green); } + LineBuf[j].setX(i); + LineBuf[j].setY(h-y2); + j++; } for(i=0; i0 and x00 and x0 #define FRAMES_PER_BUFFER 1024 -#define NSMAX 15750 +#define NSMAX 10000 extern "C" { #include diff --git a/widegraph.cpp b/widegraph.cpp index fceb7ccb3..018bab7c4 100644 --- a/widegraph.cpp +++ b/widegraph.cpp @@ -1,7 +1,7 @@ #include "widegraph.h" #include "ui_widegraph.h" -#define NSMAX 15750 +#define NSMAX 10000 WideGraph::WideGraph(QWidget *parent) : QDialog(parent), @@ -283,11 +283,6 @@ void WideGraph::initIQplus() { } -void WideGraph::on_cbSpec2d_toggled(bool b) -{ - ui->widePlot->set2Dspec(b); -} - double WideGraph::fGreen() { return ui->widePlot->fGreen(); diff --git a/widegraph.ui b/widegraph.ui index f26e7107e..1ec5c6ba1 100644 --- a/widegraph.ui +++ b/widegraph.ui @@ -324,29 +324,6 @@ - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 20 - 20 - - - - - - - - 2D Spectrum - - -