Some cleanup of GUI.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/jtms3@2510 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-07-13 15:00:23 +00:00
parent 2b562ddfe4
commit 9c786a42d2
4 changed files with 36 additions and 10 deletions

View File

@ -37,6 +37,12 @@ subroutine specjtms(k,px,pxsmo,spk0,f0)
rms=sqrt(sq)
px=db(sq) - 23.0
pxsmo=db(sqsmo) - 23.0
do i=i0,ia-1
d=id(i)
sq=sq + d*d
enddo
sq0=sq
! write(13,1010) t,rms,sq,px,pxsmo
!1010 format(5f12.3)
if(k.lt.nfft) return
@ -65,20 +71,25 @@ subroutine specjtms(k,px,pxsmo,spk0,f0)
call four2a(cx2,nfft,1,-1,1) !Forward c2c FFT of cx2
spk0=0.
j0=nint(2.0*1428.57/df)
ja=j0-107
jb=j0+107
do j=ja,jb
sq=1.e-4*(real(cx2(j))**2 + aimag(cx2(j))**2)
s2(j-ja+1)=sq
if(sq.gt.spk0) then
spk0=sq
f=(j-1)*df
s2(j-ja+1)=1.e-4*(real(cx2(j))**2 + aimag(cx2(j))**2)
enddo
spk0=0.
fac=(5e8/sq0)**2
s2=fac*s2
do j=1,215
if(s2(j).gt.spk0) then
spk0=s2(j)
f=(j+ja-1)*df
f0=0.5*(f-3000.0)
phi0=0.5*atan2(aimag(cx2(j)),real(cx2(j)))
endif
enddo
spk0=0.5*db(spk0) - 7.0
kline=k/2048
! write(14,3001) k/2048,spk0,f0,phi0

View File

@ -420,8 +420,22 @@ 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;
QString t;
if(spk0 > 2.0) {
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
int isec=ms/1000;
int imin=ms/60000;
int ihr=imin/60;
imin=imin % 60;
isec=isec % 60;
if(isec<30) isec=0;
if(isec>30) isec=30;
int nutc=10000*ihr + 100*imin + isec;
t.sprintf("%6.6d %4.1f %4.1f %4d",nutc,(k-2048.0)/48000.0,
spk0,int(f0));
ui->decodedTextBrowser->append(t);
}
t.sprintf(" Rx noise: %5.1f ",pxave);
lab2->setText(t);
ui->xThermo->setValue((double)px); //Update the Thermo

View File

@ -53,7 +53,7 @@
</size>
</property>
<property name="title">
<string> Freq DF Pol UTC DT dB KV DS TxPol</string>
<string> UTC T dB DF</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>

View File

@ -1,6 +1,7 @@
#include "plotter.h"
#include <math.h>
#include <QDebug>
#include <algorithm>
#define MAX_SCREENSIZE 2048
@ -141,9 +142,9 @@ void CPlotter::draw(float green[], int ig) //draw()
if(2*i < 215) {
if(m_2Dspec) {
y=10.0*log10(0.5*(mscom_.s2[2*i-1] + mscom_.s2[2*i]));
y1 = 5.0*gain*(y + 13 - m_plotZero);
y1 = 5.0*gain*(y + 20 - m_plotZero);
} else {
y=10.0*log10(0.5*(mscom_.s1[2*i-1] + mscom_.s1[2*i]));
y=10.0*log10(std::max(mscom_.s1[2*i-1],mscom_.s1[2*i]));
y1 = 5.0*gain*(y + 55 - m_plotZero);
}
} else {