Improve the way messages with compound calls are automatically generated.

Routine packmsg now tries the shortlist (Type 1 prefix or suffix) first.
Then it tries to to make a valid message using a Type 2 prefix or suffix.
If both fail, it packs the first 13 characters as a free-text message.

The GUI now generates the most useful messages with compound callsigns
of all valid types.



git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4533 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor
2014-10-19 00:56:41 +00:00
parent 5e64ed790a
commit e4927efd62
10 changed files with 139 additions and 105 deletions
+37 -21
View File
@@ -4,9 +4,8 @@ program JT65code
! Reed Solomon encoding, and other necessary details of the JT65
! protocol.
character*22 msg0,msg,decoded,cok*3
character*22 msg,msg0,msg1,decoded,cok*3,bad*1,msgtype*10
integer dgen(12),sent(63),recd(12),era(51)
logical text
nargs=iargc()
if(nargs.ne.1) then
@@ -14,36 +13,53 @@ program JT65code
go to 999
endif
call getarg(1,msg0) !Get message from command line
msg=msg0
call chkmsg(msg,cok,nspecial,flip) !See if it includes "OOO" report
call getarg(1,msg) !Get message from command line
call fmtmsg(msg,iz) !To upper, collapse mult blanks
msg0=msg !Input message
call chkmsg(msg,cok,nspecial,flip) !See if it includes "OOO" report
msg1=msg !Message without "OOO"
if(nspecial.gt.0) then !or is a shorthand message
write(*,1010)
1010 format('Shorthand message.')
go to 999
if(nspecial.eq.2) decoded="RO"
if(nspecial.eq.3) decoded="RRR"
if(nspecial.eq.4) decoded="73"
itype=-1
msgtype="Shorthand"
go to 10
endif
call packmsg(msg,dgen,text) !Pack message into 12 six-bit bytes
write(*,1020) msg0
1020 format('Message: ',a22) !Echo input message
if(iand(dgen(10),8).ne.0) write(*,1030) !Is plain text bit set?
1030 format('Plain text.')
write(*,1040) dgen
1040 format('Packed message, 6-bit symbols: ',12i3) !Display packed symbols
call packmsg(msg1,dgen,itype) !Pack message into 12 six-bit bytes
msgtype=""
if(itype.eq.1) msgtype="Std Msg"
if(itype.eq.2) msgtype="Type 1 pfx"
if(itype.eq.3) msgtype="Type 1 sfx"
if(itype.eq.4) msgtype="Type 2 pfx"
if(itype.eq.5) msgtype="Type 2 sfx"
if(itype.eq.6) msgtype="Free text"
call rs_encode(dgen,sent) !RS encode
call interleave63(sent,1) !Interleave channel symbols
call graycode(sent,63,1,sent) !Apply Gray code
write(*,1050) sent
1050 format('Information-carrying channel symbols:'/(i5,20i3))
call graycode(sent,63,-1,sent)
call interleave63(sent,-1)
call rs_decode(sent,era,0,recd,nerr)
call unpackmsg(recd,decoded) !Unpack the user message
write(*,1060) decoded,cok
1060 format('Decoded message: ',a22,2x,a3)
if(cok.eq."OOO") decoded(20:22)=cok
call fmtmsg(decoded,iz)
10 write(*,1010)
1010 format("Message Decoded Err"/ &
"-----------------------------------------------------------------")
bad=" "
if(decoded.ne.msg0) bad="*"
write(*,1020) msg0,decoded,bad,itype,msgtype
1020 format(a22,2x,a22,3x,a1,i3,": ",a10)
if(nspecial.gt.0) go to 999
write(*,1030) dgen
1030 format(/'Packed message, 6-bit symbols ',12i3) !Display packed symbols
write(*,1040) sent
1040 format(/'Information-carrying channel symbols'/(i5,20i3))
999 end program JT65code