2012-11-15 11:34:14 -05:00
|
|
|
program jt9code
|
|
|
|
|
|
|
|
! Generate simulated data for testing of WSJT-X
|
|
|
|
|
2014-10-18 21:29:30 -04:00
|
|
|
character*22 testmsg(21)
|
2014-10-18 20:56:41 -04:00
|
|
|
character msg*22,msg0*22,decoded*22,bad*1,msgtype*10
|
2013-05-20 10:09:02 -04:00
|
|
|
integer*4 i4tone(85) !Channel symbols (values 0-8)
|
2012-11-15 11:34:14 -05:00
|
|
|
include 'jt9sync.f90'
|
|
|
|
|
|
|
|
nargs=iargc()
|
|
|
|
if(nargs.ne.1) then
|
|
|
|
print*,'Usage: jt9code "message"'
|
2014-10-18 21:31:17 -04:00
|
|
|
print*,' jt9code -t'
|
2012-11-15 11:34:14 -05:00
|
|
|
go to 999
|
|
|
|
endif
|
|
|
|
|
2014-10-18 20:56:41 -04:00
|
|
|
call getarg(1,msg)
|
2014-10-18 21:29:30 -04:00
|
|
|
nmsg=1
|
|
|
|
if(msg(1:2).eq."-t") then
|
|
|
|
testmsg(1)="KA1ABC WB9XYZ EN34"
|
|
|
|
testmsg(2)="KA1ABC WB9XYZ EN34 OOO"
|
|
|
|
testmsg(3)="KA1ABC WB9XYZ RO"
|
|
|
|
testmsg(4)="KA1ABC WB9XYZ -21"
|
|
|
|
testmsg(5)="KA1ABC WB9XYZ R-19"
|
|
|
|
testmsg(6)="KA1ABC WB9XYZ RRR"
|
|
|
|
testmsg(7)="KA1ABC WB9XYZ 73"
|
|
|
|
testmsg(8)="KA1ABC WB9XYZ"
|
|
|
|
testmsg(9)="ZL/KA1ABC WB9XYZ"
|
|
|
|
testmsg(10)="KA1ABC ZL/WB9XYZ"
|
|
|
|
testmsg(11)="KA1ABC/4 WB9XYZ"
|
|
|
|
testmsg(12)="KA1ABC WB9XYZ/4"
|
|
|
|
testmsg(13)="CQ ZL4/KA1ABC"
|
|
|
|
testmsg(14)="DE ZL4/KA1ABC"
|
|
|
|
testmsg(15)="QRZ ZL4/KA1ABC"
|
|
|
|
testmsg(16)="CQ WB9XYZ/VE4"
|
|
|
|
testmsg(17)="HELLO WORLD"
|
|
|
|
testmsg(18)="ZL4/KA1ABC 73"
|
|
|
|
testmsg(19)="KA1ABC XL/WB9XYZ"
|
|
|
|
testmsg(20)="KA1ABC WB9XYZ/W4"
|
|
|
|
testmsg(21)="123456789ABCDEFGH"
|
|
|
|
nmsg=21
|
|
|
|
endif
|
2014-10-18 20:56:41 -04:00
|
|
|
|
|
|
|
write(*,1010)
|
2014-10-18 21:04:58 -04:00
|
|
|
1010 format("Message Decoded Err?"/ &
|
2014-10-18 20:56:41 -04:00
|
|
|
"-----------------------------------------------------------------")
|
2014-10-18 21:29:30 -04:00
|
|
|
do imsg=1,nmsg
|
|
|
|
if(nmsg.gt.1) msg=testmsg(imsg)
|
|
|
|
call fmtmsg(msg,iz) !To upper, collapse mult blanks
|
|
|
|
msg0=msg !Input message
|
|
|
|
|
|
|
|
ichk=0
|
|
|
|
call genjt9(msg,ichk,decoded,i4tone,itype) !Encode message into tone #s
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
bad=" "
|
|
|
|
if(decoded.ne.msg0) bad="*"
|
|
|
|
write(*,1020) msg0,decoded,bad,itype,msgtype
|
2014-10-18 20:56:41 -04:00
|
|
|
1020 format(a22,2x,a22,3x,a1,i3,": ",a10)
|
2014-10-18 21:29:30 -04:00
|
|
|
enddo
|
2014-10-18 20:56:41 -04:00
|
|
|
|
2014-10-18 21:29:30 -04:00
|
|
|
if(nmsg.eq.1) write(*,1030) i4tone
|
2014-10-18 20:56:41 -04:00
|
|
|
1030 format(/'Channel symbols'/(30i2))
|
2012-11-15 11:34:14 -05:00
|
|
|
|
|
|
|
999 end program jt9code
|