diff --git a/fastplot.cpp b/fastplot.cpp index 02ad944e5..c9934f9f2 100644 --- a/fastplot.cpp +++ b/fastplot.cpp @@ -205,7 +205,7 @@ void FPlotter::draw() //draw() update(); //trigger a new paintEvent } -void FPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent +void FPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent { int x=event->x(); int y=event->y(); @@ -221,7 +221,7 @@ void FPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent if(y >= 120) y0+=100; if(m_x0+m_x1 != 0) { painter.setPen(Qt::black); - painter.drawLine(m_x0,m_y0,m_x1,m_y0); //Erase previous yellow line + painter.drawLine(m_x0,m_y0,m_x1,m_y0); //Erase previous yellow line painter.drawLine(m_x0,m_y0-3,m_x0,m_y0+3); painter.drawLine(m_x1,m_y0-3,m_x1,m_y0+3); } @@ -229,7 +229,7 @@ void FPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent painter.drawLine(x0,y0,x1,y0); //Draw yellow line painter.drawLine(x0,y0-3,x0,y0+3); painter.drawLine(x1,y0-3,x1,y0+3); - update(); //trigger a new paintEvent + update(); //trigger a new paintEvent m_x0=x0; m_x1=x1; m_y0=y0; diff --git a/lib/fast_decode.f90 b/lib/fast_decode.f90 index f00d93000..3bdad537b 100644 --- a/lib/fast_decode.f90 +++ b/lib/fast_decode.f90 @@ -1,19 +1,29 @@ -subroutine fast_decode(id2,narg,bShMsgs,line,pchk_file,mycall_12,hiscall_12) +subroutine fast_decode(id2,narg,ntrperiod,bShMsgs,line,pchk_file, & + mycall_12,hiscall_12) parameter (NMAX=30*12000) integer*2 id2(NMAX) + integer*2 id2a(NMAX) + integer*2 id2b(NMAX) integer narg(0:14) logical*1 bShMsgs real dat(30*12000) complex cdat(262145),cdat2(262145) real psavg(450) - logical pick + logical pick,first character*6 cfile6 character*80 line(100) character*512 pchk_file character*12 mycall_12,hiscall_12 character*6 mycall,hiscall - save npts + data first/.true./ + save npts,cdat,cdat2,id2a,id2b + + if(first) then + id2a=0 + id2b=0 + first=.false. + endif mycall=mycall_12(1:6) hiscall=hiscall_12(1:6) @@ -31,6 +41,9 @@ subroutine fast_decode(id2,narg,bShMsgs,line,pchk_file,mycall_12,hiscall_12) ntol=narg(11) nhashcalls=narg(12) + line(1:100)(1:1)=char(0) + if(t0.gt.float(ntrperiod)) go to 900 + if(nmode.eq.102) then call fast9(id2,narg,line) go to 900 @@ -38,11 +51,20 @@ subroutine fast_decode(id2,narg,bShMsgs,line,pchk_file,mycall_12,hiscall_12) call jtmsk_decode(id2,narg,line) go to 900 else if(nmode.eq.104) then + if(newdat.eq.1) then + id2b=id2a + id2a=id2 + endif ia=max(1,nint(t0*12000.0)) ib=min(ndat0,nint(t1*12000.0)) nz=ib-ia+1 - call msk144_decode(id2(ia),nz,nutc,0,pchk_file,mycall,hiscall,bShMsgs, & - ntol,t0,line) + if(newdat.eq.1 .or. npick.le.1) then + call msk144_decode(id2(ia),nz,nutc,0,pchk_file,mycall,hiscall, & + bShMsgs,ntol,t0,line) + else + call msk144_decode(id2b(ia),nz,nutc,0,pchk_file,mycall,hiscall, & + bShMsgs,ntol,t0,line) + endif go to 900 endif diff --git a/lib/msk144_decode.f90 b/lib/msk144_decode.f90 index fdb328338..d0ef4e843 100644 --- a/lib/msk144_decode.f90 +++ b/lib/msk144_decode.f90 @@ -15,6 +15,7 @@ subroutine msk144_decode(id2,npts,nutc,nprint,pchk_file,mycall,hiscall, & logical*1 bShMsgs line(1:100)(1:1)=char(0) + if(maxval(id2(1:npts)).eq.0 .and. minval(id2(1:npts)).eq.0) go to 900 hist=0 do i=0,npts-1 @@ -56,5 +57,6 @@ subroutine msk144_decode(id2,npts,nutc,nprint,pchk_file,mycall,hiscall, & endif if(line(1)(1:6).eq.' ') line(1)(1:1)=char(0) - return + +900 return end subroutine msk144_decode diff --git a/mainwindow.cpp b/mainwindow.cpp index d69f0d767..7bbcc0370 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -107,8 +107,8 @@ extern "C" { float* level, float* sigdb, float* snr, float* dfreq, float* width); - void fast_decode_(short id2[], int narg[], bool* bShMsgs, char msg[], - char pchkFile[], char mycall[], char hiscall[], + void fast_decode_(short id2[], int narg[], int* ntrperiod, bool* bShMsgs, + char msg[], char pchkFile[], char mycall[], char hiscall[], int len1, int len2, int len3, int len4); void hash_calls_(char calls[], int* ih9, int len); void degrade_snr_(short d2[], int* n, float* db, float* bandwidth); @@ -2210,8 +2210,8 @@ void MainWindow::decode() //decode() narg[14]=m_config.aggressive(); memcpy(d2b,dec_data.d2,2*360000); watcher3.setFuture (QtConcurrent::run (std::bind (fast_decode_,&d2b[0], - &narg[0],&m_bShMsgs,&m_msg[0][0],&m_pchkFile[0],dec_data.params.mycall, - dec_data.params.hiscall,80,512,12,12))); + &narg[0],&m_TRperiod,&m_bShMsgs,&m_msg[0][0],&m_pchkFile[0], + dec_data.params.mycall,dec_data.params.hiscall,80,512,12,12))); } else { memcpy(to, from, qMin(mem_jt9->size(), size)); QFile {m_config.temp_dir ().absoluteFilePath (".lock")}.remove (); // Allow jt9 to start