diff --git a/lib/decoder.f90 b/lib/decoder.f90
index 63324b813..1870ed2ab 100644
--- a/lib/decoder.f90
+++ b/lib/decoder.f90
@@ -15,10 +15,21 @@ subroutine decoder(ntrSeconds,ndepth,nRxLog,c00)
common/jt9com/ss0(184,NSMAX),savg(NSMAX),id2(NMAX),nutc0,ndiskdat, &
ntr,nfqso,newdat,npts80,nfb,ntol,kin,nsynced,ndecoded
common/jt9comB/ss(184,NSMAX),c0
+ common/tracer/limtrace,lu
logical first
data first/.true./
save
+ if(first) then
+ limtrace=0
+ lu=12
+ open(12,file='timer.out',status='unknown')
+ open(14,file='wsjtx_rx.log',status='unknown',position='append')
+ first=.false.
+ endif
+
+ call timer('decoder ',0)
+
if(newdat.ne.0) then
ss=ss0
c0=c00
@@ -38,7 +49,7 @@ subroutine decoder(ntrSeconds,ndepth,nRxLog,c00)
if(ntrMinutes.eq.1) then
nsps=6912
df3=1500.0/2048.0
- fmt='(i4.4,i4,i5,f6.1,f8.0,f6.2,3x,a22)'
+ fmt='(i4.4,i4,i5,f6.1,f8.0,f6.1,3x,a22)'
else if(ntrMinutes.eq.2) then
nsps=15360
df3=1500.0/2048.0
@@ -61,14 +72,12 @@ subroutine decoder(ntrSeconds,ndepth,nRxLog,c00)
kstep=nsps/2
tstep=kstep/12000.0
+ call timer('sync9 ',0)
call sync9(ss,tstep,df3,ntol,nfqso,ccfred,ia,ib,ipk) ! Get sync, approx freq
+ call timer('sync9 ',1)
open(13,file='decoded.txt',status='unknown')
rewind 13
- if(first) then
- open(14,file='wsjtx_rx.log',status='unknown',position='append')
- first=.false.
- endif
if(iand(nRxLog,2).ne.0) rewind 14
if(iand(nRxLog,1).ne.0) then
! Write date and time to lu 14
@@ -80,8 +89,13 @@ subroutine decoder(ntrSeconds,ndepth,nRxLog,c00)
do i=ia,ib
f=(i-1)*df3
if((i.eq.ipk .or. ccfred(i).ge.3.0) .and. f.gt.fgood+10.0*df8) then
+ call timer('spec9 ',0)
call spec9(c0,npts8,nsps,f,fpk,xdt,snr,i1SoftSymbols)
+ call timer('spec9 ',1)
+
+ call timer('decode9 ',0)
call decode9(i1SoftSymbols,limit,nlim,msg)
+ call timer('decode9 ',1)
sync=ccfred(i) - 2.0
if(sync.lt.0.0) sync=0.0
nsync=sync
@@ -115,5 +129,8 @@ subroutine decoder(ntrSeconds,ndepth,nRxLog,c00)
call flush(14)
close(13)
+ call timer('decoder ',1)
+ call timer('decoder ',101)
+
return
end subroutine decoder
diff --git a/lib/peakdt9.f90 b/lib/peakdt9.f90
index a5581f40d..2aabc3f95 100644
--- a/lib/peakdt9.f90
+++ b/lib/peakdt9.f90
@@ -15,15 +15,14 @@ subroutine peakdt9(c0,npts8,nsps8,istart,foffset,idtpk)
i0=istart + 0.0625*nsps8*idt
sum=0.
do j=1,16
- i1=(ii(j)-1)*nsps8 + i0
+ i1=max(0,(ii(j)-1)*nsps8 + i0)
+ i2=min(npts8-1,i1+nsps8-1)
phi=0.
zsum=0.
- do i=i1,i1+nsps8-1
+ do i=i1,i2
if(i.lt.0 .or. i.gt.npts8-1) cycle
phi=phi + dphi
- if(i.ge.0 .and. i.le.npts8-1) then
- zsum=zsum + c0(i)*cmplx(cos(phi),-sin(phi))
- endif
+ zsum=zsum + c0(i)*cmplx(cos(phi),-sin(phi))
enddo
sum=sum + real(zsum)**2 + aimag(zsum)**2
enddo
diff --git a/lib/spec9.f90 b/lib/spec9.f90
index 2bc7ed3a3..c68a5957b 100644
--- a/lib/spec9.f90
+++ b/lib/spec9.f90
@@ -35,13 +35,19 @@ subroutine spec9(c0,npts8,nsps,fpk0,fpk,xdt,snrdb,i1SoftSymbols)
foffset=fpk0
istart=1520
+ call timer('peakdt9 ',0)
call peakdt9(c1,npts8,nsps8,istart,foffset,idt)
+ call timer('peakdt9 ',1)
istart=istart + 0.0625*nsps8*idt
xdt=istart/1500.0 - 1.0
+ call timer('peakdf9 ',0)
call peakdf9(c1,npts8,nsps8,istart,foffset,idf)
+ call timer('peakdf9 ',1)
+
fpk=fpk0 + idf*0.1*1500.0/nsps8
foffset=foffset + idf*0.1*1500.0/nsps8
+
twopi=8.0*atan(1.0)
dphi=twopi*foffset/1500.0
nfft=nsps8
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 34ea0609f..b43ebe69e 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -27,6 +27,7 @@ MainWindow::MainWindow(QWidget *parent) :
{
ui->setupUi(this);
+ freopen("wsjtx.log","w",stderr);
on_EraseButton_clicked();
ui->labUTC->setStyleSheet( \
"QLabel { background-color : black; color : yellow; }");
@@ -1151,6 +1152,7 @@ void MainWindow::doubleClickOnCall(QString hiscall, bool ctrl)
m_txFirst=(nmod!=0);
ui->txFirstCheckBox->setChecked(m_txFirst);
QString rpt=t2.mid(10,3);
+ if(rpt.indexOf(" ")==0) rpt=rpt.mid(1,2);
if(ctrl) {
int i4=t.mid(i2,20).indexOf(" ");
QString hisgrid=t.mid(i2,20).mid(i4+1,4);
diff --git a/mainwindow.ui b/mainwindow.ui
index c9665ea7f..dd2a9f495 100644
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -66,7 +66,7 @@
- UTC Sync dB DT Freq Drift
+ UTC Sync dB DT Freq Drift
-
@@ -292,7 +292,7 @@ p, li { white-space: pre-wrap; }
16777215
- 190
+ 170
@@ -510,6 +510,22 @@ p, li { white-space: pre-wrap; }
+ -
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 5
+
+
+
+
-
diff --git a/plotter.cpp b/plotter.cpp
index cf360dc37..b1d43cdef 100644
--- a/plotter.cpp
+++ b/plotter.cpp
@@ -162,6 +162,7 @@ void CPlotter::UTCstr()
imin=ms/60000;
ihr=imin/60;
imin=imin % 60;
+ imin=imin - (imin % (m_TRperiod/60));
}
if(isec<30) isec=0;
if(isec>=30) isec=30;
@@ -551,9 +552,10 @@ double CPlotter::fGreen()
return m_fGreen;
}
-void CPlotter::setNsps(int n) //setNSpan()
+void CPlotter::setNsps(int ntrperiod, int nsps) //setNSpan()
{
- m_nsps=n;
+ m_TRperiod=ntrperiod;
+ m_nsps=nsps;
m_fftBinWidth=1500.0/2048.0;
if(m_nsps==15360) m_fftBinWidth=1500.0/2048.0;
if(m_nsps==40960) m_fftBinWidth=1500.0/6144.0;
diff --git a/plotter.h b/plotter.h
index 1dcd08ab3..78cbde2fe 100644
--- a/plotter.h
+++ b/plotter.h
@@ -61,11 +61,10 @@ public:
int autoZero();
void setPalette(QString palette);
void setFsample(int n);
- void setNsps(int n);
+ void setNsps(int ntrperiod, int nsps);
double fGreen();
void SetPercent2DScreen(int percent){m_Percent2DScreen=percent;}
-
signals:
void freezeDecode0(int n);
void freezeDecode1(int n);
@@ -115,6 +114,7 @@ private:
qint32 m_h1;
qint32 m_h2;
qint32 m_tol;
+ qint32 m_TRperiod;
private slots:
void mousePressEvent(QMouseEvent *event);
diff --git a/soundin.h b/soundin.h
index 02655844c..955f08d79 100644
--- a/soundin.h
+++ b/soundin.h
@@ -47,10 +47,4 @@ private:
qint32 m_nsps;
bool m_monitoring;
};
-
-extern "C" {
- void recvpkt_(int* nsam, quint16* iblk, qint8* nrx, int* k, double s1[],
- double s2[], double s3[]);
-}
-
#endif // SOUNDIN_H
diff --git a/widegraph.cpp b/widegraph.cpp
index 73b093ff6..209b67ffa 100644
--- a/widegraph.cpp
+++ b/widegraph.cpp
@@ -259,7 +259,7 @@ void WideGraph::setPeriod(int ntrperiod, int nsps)
{
m_TRperiod=ntrperiod;
m_nsps=nsps;
- ui->widePlot->setNsps(nsps);
+ ui->widePlot->setNsps(ntrperiod, nsps);
}
void WideGraph::on_rbCurrent_clicked()
diff --git a/widegraph.ui b/widegraph.ui
index 5768adf94..ba9839e94 100644
--- a/widegraph.ui
+++ b/widegraph.ui
@@ -322,6 +322,9 @@
-
+
+ false
+
USB Dial Freq (kHz)
@@ -330,7 +333,7 @@
-
- true
+ false
diff --git a/wsjtx.pro b/wsjtx.pro
index 2e002504b..a3826a0f0 100644
--- a/wsjtx.pro
+++ b/wsjtx.pro
@@ -6,7 +6,7 @@
QT += core gui network
CONFIG += qwt thread
-CONFIG += console
+#CONFIG += console
TARGET = wsjtx
VERSION = 0.2