diff --git a/commons.h b/commons.h index 90ed351bd..e1b7f73bf 100644 --- a/commons.h +++ b/commons.h @@ -6,9 +6,12 @@ extern "C" { extern struct { //This is "common/mscom/..." in Fortran - short int d2[30*48000]; //Raw data + short int d2[30*48000]; //Raw data from soundcard + float s1[215]; + float s2[215]; int kin; int ndiskdat; + int kline; } mscom_; } diff --git a/libm65/specjtms.f90 b/libm65/specjtms.f90 index 9d2c2ed74..8da7ed3fb 100644 --- a/libm65/specjtms.f90 +++ b/libm65/specjtms.f90 @@ -8,7 +8,7 @@ subroutine specjtms(k,px,pxsmo,spk0,f0) real x(MAXFFT) complex cx(MAXFFT),cx2(MAXFFT) logical first - common/mscom/id(1440000),s1(215),s2(215) + common/mscom/id(1440000),s1(215),s2(215),kin,ndiskdat,kline data first/.true./ save @@ -80,9 +80,10 @@ subroutine specjtms(k,px,pxsmo,spk0,f0) endif enddo spk0=0.5*db(spk0) - 7.0 + kline=k/2048 ! write(14,3001) k/2048,spk0,f0,phi0 !3001 format(i8,3f12.3) - call flush(14) +! call flush(14) return end subroutine specjtms diff --git a/mainwindow.cpp b/mainwindow.cpp index 0825ab8ba..d30482bb8 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -420,7 +420,7 @@ void MainWindow::dataSink(int k) float pxave=10.0*log10(sqave/2048.0) - 23.0; specjtms_(&k,&px,&pxsmo,&spk0,&f0); - if(spk0 > 3.0) qDebug() << (k-2048.0)/48000.0 << spk0 << f0; +// if(spk0 > 3.0) qDebug() << (k-2048.0)/48000.0 << spk0 << f0; QString t; t.sprintf(" Rx noise: %5.1f ",pxave); lab2->setText(t); diff --git a/plotter.cpp b/plotter.cpp index 46ceffcfc..6ff50f95a 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -77,8 +77,7 @@ void CPlotter::paintEvent(QPaintEvent *) // paintEvent() int h = (m_Size.height()-60)/2; painter.drawPixmap(0,0,m_ScalePixmap); painter.drawPixmap(0,30,m_WaterfallPixmap); - m_2Dspec=true; - if(m_2Dspec) { + if(true) { // painter.drawPixmap(0,h+30,m_ScalePixmap); painter.drawPixmap(0,h+60,m_2DPixmap); m_paintEventBusy=false; @@ -111,26 +110,54 @@ void CPlotter::draw(float green[], int ig) //draw() { int i,j,w,h; float y; + int y1; w = m_WaterfallPixmap.width(); h = m_WaterfallPixmap.height(); double gain = pow(10.0,0.05*(m_plotGain+7)); - //move current data down one line - //(must do this before attaching a QPainter object) - m_WaterfallPixmap.scroll(0,1,0,0,w,h); - m_ZoomWaterfallPixmap.scroll(0,1,0,0, w, h); - memmove(&m_zwf[32768],m_zwf,32768*(h-1)); +//move current data down one line +//(must do this before attaching a QPainter object) +// m_WaterfallPixmap.scroll(0,1,0,0,w,h); +// m_ZoomWaterfallPixmap.scroll(0,1,0,0, w, h); +// memmove(&m_zwf[32768],m_zwf,32768*(h-1)); + QPainter painter1(&m_WaterfallPixmap); QPainter painter2D(&m_2DPixmap); - painter2D.setPen(Qt::green); QRect tmp(0,0,w,h); painter2D.fillRect(tmp,Qt::black); QPoint LineBuf[MAX_SCREENSIZE]; - j=0; + + for(i=0; i<256; i++) { //Zero the histograms + m_hist1[i]=0; + m_hist2[i]=0; + } + + + int kline=mscom_.kline; + + for(i=0; i254) y1=254; + m_hist1[y1]++; + painter1.setPen(m_ColorTbl[y1]); + painter1.drawPoint(kline,h-i); + } painter2D.setPen(Qt::green); + j=0; for(i=0; i extern struct { short int d2[30*48000]; //This is "common/mscom/..." in fortran + float s1[215]; + float s2[215]; int kin; + int ndiskdat; + int kline; } mscom_; } diff --git a/widegraph.ui b/widegraph.ui index 92c6c1716..873c0faad 100644 --- a/widegraph.ui +++ b/widegraph.ui @@ -283,7 +283,7 @@ - 2D Spectrum + PSK Spectrum