MSK144 fixes: Click on lower panel of Fast Graph decodes from previous file; clicking beyond available data does not crash program.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6964 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-07-29 16:10:55 +00:00
parent 78a03a4926
commit 2b6ff14e4b
4 changed files with 37 additions and 13 deletions

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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