1
0
mirror of https://github.com/saitohirga/WSJT-X.git synced 2024-12-18 08:55:53 -05:00

Fix a bug that can arise as a result of a false decode.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3660 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2014-01-25 16:53:34 +00:00
parent 2589347c01
commit 6541c1da85
7 changed files with 42 additions and 21 deletions

View File

@ -51,7 +51,7 @@ OBJS1 = pctile.o graycode.o sort.o ssort.o \
extract.o fchisq65.o demod64a.o chkhist.o interleave63.o ccf2.o \
move.o indexx.o graycode65.o twkfreq65.o smo121.o \
wrapkarn.o init_rs.o encode_rs.o decode_rs.o gen65.o fil4.o \
flat3.o polfit.o determ.o
flat3.o polfit.o determ.o badmsg.o
libjt9.a: $(OBJS1)
ar cr libjt9.a $(OBJS1)

View File

@ -42,7 +42,7 @@ OBJS1 = pctile.o graycode.o sort.o ssort.o \
extract.o fchisq65.o demod64a.o chkhist.o interleave63.o ccf2.o \
move.o indexx.o graycode65.o twkfreq65.o smo121.o \
wrapkarn.o init_rs.o encode_rs.o decode_rs.o gen65.o fil4.o \
flat3.o polfit.o determ.o
flat3.o polfit.o determ.o badmsg.o
libjt9.a: $(OBJS1)
ar cr libjt9.a $(OBJS1)

18
lib/badmsg.f90 Normal file
View File

@ -0,0 +1,18 @@
logical function badmsg(msg)
character*22 msg
character*42 c
data c/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ +-./?'/
do i=1,22
do j=1,42
if(msg(i:i).eq.c(j:j)) go to 10
enddo
badmsg=.true.
return
10 continue
enddo
badmsg=.false.
return
end function badmsg

View File

@ -4,7 +4,7 @@ subroutine extract(s3,nadd,ncount,nhist,decoded,ltext,nbmkv)
character decoded*22
integer era(51),dat4(12),indx(64)
integer mrsym(63),mr2sym(63),mrprob(63),mr2prob(63)
logical nokv,ltext
logical nokv,ltext,badmsg
data nokv/.false./,nsec1/0/
save
@ -81,9 +81,9 @@ subroutine extract(s3,nadd,ncount,nhist,decoded,ltext,nbmkv)
#endif
call timer('kvasd ',1)
if(iret.ne.0) then
if(.not.nokv) write(*,1000)
1000 format('Error in KV decoder, or no KV decoder present.')
nokv=.true.
if(.not.nokv) write(*,1000) iret
1000 format('Error in KV decoder, or no KV decoder present.',i12)
! nokv=.true.
go to 900
endif
@ -93,6 +93,10 @@ subroutine extract(s3,nadd,ncount,nhist,decoded,ltext,nbmkv)
ltext=.false.
if(ncount.ge.0) then
call unpackmsg(dat4,decoded) !Unpack the user message
if(badmsg(decoded)) then
ncount=-1
go to 900
endif
if(iand(dat4(10),8).ne.0) ltext=.true.
nbmkv=2
endif

View File

@ -9,7 +9,7 @@ subroutine unpackcall(ncall,word,iv2,psfx)
iv2=0
if(n.ge.262177560) go to 20
word='......'
if(n.ge.262177560) go to 999 !Plain text message ...
! if(n.ge.262177560) go to 999 !Plain text message ...
i=mod(n,27)+11
word(6:6)=c(i:i)
n=n/27
@ -37,7 +37,7 @@ subroutine unpackcall(ncall,word,iv2,psfx)
20 if(n.ge.267796946) go to 999
! We have a JT65v2 message
if((n.ge.262178563) .and. (n.le.264002071)) Then
if((n.ge.262178563) .and. (n.le.264002071)) then
! CQ with prefix
iv2=1
n=n-262178563
@ -52,9 +52,8 @@ subroutine unpackcall(ncall,word,iv2,psfx)
n=n/37
i=n+1
psfx(1:1)=c(i:i)
endif
if((n.ge.264002072) .and. (n.le.265825580)) Then
else if((n.ge.264002072) .and. (n.le.265825580)) then
! QRZ with prefix
iv2=2
n=n-264002072
@ -69,9 +68,8 @@ subroutine unpackcall(ncall,word,iv2,psfx)
n=n/37
i=n+1
psfx(1:1)=c(i:i)
endif
if((n.ge.265825581) .and. (n.le.267649089)) Then
else if((n.ge.265825581) .and. (n.le.267649089)) then
! DE with prefix
iv2=3
n=n-265825581
@ -86,9 +84,8 @@ subroutine unpackcall(ncall,word,iv2,psfx)
n=n/37
i=n+1
psfx(1:1)=c(i:i)
endif
if((n.ge.267649090) .and. (n.le.267698374)) Then
else if((n.ge.267649090) .and. (n.le.267698374)) then
! CQ with suffix
iv2=4
n=n-267649090
@ -100,9 +97,8 @@ subroutine unpackcall(ncall,word,iv2,psfx)
n=n/37
i=n+1
psfx(1:1)=c(i:i)
endif
if((n.ge.267698375) .and. (n.le.267747659)) Then
else if((n.ge.267698375) .and. (n.le.267747659)) then
! QRZ with suffix
iv2=5
n=n-267698375
@ -114,9 +110,8 @@ subroutine unpackcall(ncall,word,iv2,psfx)
n=n/37
i=n+1
psfx(1:1)=c(i:i)
endif
if((n.ge.267747660) .and. (n.le.267796944)) Then
else if((n.ge.267747660) .and. (n.le.267796944)) then
! DE with suffix
iv2=6
n=n-267747660
@ -128,12 +123,15 @@ subroutine unpackcall(ncall,word,iv2,psfx)
n=n/37
i=n+1
psfx(1:1)=c(i:i)
endif
if(n.eq.267796945) Then
else if(n.eq.267796945) then
! DE with no prefix or suffix
iv2=7
psfx = ' '
else
iv2=8
word=' '
psfx=' '
endif
999 if(word(1:3).eq.'3D0') word='3DA0'//word(4:)

View File

@ -52,6 +52,7 @@ subroutine unpackmsg(dat,msg)
if(iv2.eq.5) msg='QRZ '//c2(:n2)//'/'//psfx(:n1)//' '//grid
if(iv2.eq.6) msg='DE '//c2(:n2)//'/'//psfx(:n1)//' '//grid
if(iv2.eq.7) msg='DE '//c2(:n2)//' '//grid
if(iv2.eq.8) msg=' '
go to 100
else

View File

@ -1,4 +1,4 @@
//------------------------------------------------------------ MainWindow
//----------------------------------------------------------- MainWindow
#include "mainwindow.h"
#include "ui_mainwindow.h"