diff --git a/lib/Makefile.MinGW b/lib/Makefile.MinGW index cb933aaad..e171f08cf 100644 --- a/lib/Makefile.MinGW +++ b/lib/Makefile.MinGW @@ -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) diff --git a/lib/Makefile.linux b/lib/Makefile.linux index 1764b6109..164b02520 100644 --- a/lib/Makefile.linux +++ b/lib/Makefile.linux @@ -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) diff --git a/lib/badmsg.f90 b/lib/badmsg.f90 new file mode 100644 index 000000000..30afa638b --- /dev/null +++ b/lib/badmsg.f90 @@ -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 + diff --git a/lib/extract.F90 b/lib/extract.F90 index 2b580f63e..6768cbf4c 100644 --- a/lib/extract.F90 +++ b/lib/extract.F90 @@ -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 diff --git a/lib/unpackcall.f90 b/lib/unpackcall.f90 index f738926ca..d047114d3 100644 --- a/lib/unpackcall.f90 +++ b/lib/unpackcall.f90 @@ -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:) diff --git a/lib/unpackmsg.f90 b/lib/unpackmsg.f90 index aca7cfc6b..531bb300a 100644 --- a/lib/unpackmsg.f90 +++ b/lib/unpackmsg.f90 @@ -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 diff --git a/mainwindow.cpp b/mainwindow.cpp index 276121419..83f95035d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,4 +1,4 @@ -//------------------------------------------------------------ MainWindow +//----------------------------------------------------------- MainWindow #include "mainwindow.h" #include "ui_mainwindow.h"