Make msk144code work. Rename msk144d2 to msk144d and make it work too.

This commit is contained in:
Steve Franke 2018-10-19 19:42:31 -05:00
parent 0df09b1d2d
commit 6483e80c35
4 changed files with 94 additions and 36 deletions

View File

@ -496,7 +496,7 @@ set (wsjt_FSRCS
lib/moondopjpl.f90 lib/moondopjpl.f90
lib/morse.f90 lib/morse.f90
lib/move.f90 lib/move.f90
lib/msk144d2.f90 lib/msk144d.f90
lib/msk40decodeframe.f90 lib/msk40decodeframe.f90
lib/msk144decodeframe.f90 lib/msk144decodeframe.f90
lib/msk144sd.f90 lib/msk144sd.f90
@ -1255,8 +1255,8 @@ target_link_libraries (msk144sd wsjt_fort wsjt_cxx)
add_executable (msk144sim lib/msk144sim.f90 wsjtx.rc) add_executable (msk144sim lib/msk144sim.f90 wsjtx.rc)
target_link_libraries (msk144sim wsjt_fort wsjt_cxx) target_link_libraries (msk144sim wsjt_fort wsjt_cxx)
add_executable (msk144d2 lib/msk144d2.f90 wsjtx.rc) add_executable (msk144d lib/msk144d.f90 wsjtx.rc)
target_link_libraries (msk144d2 wsjt_fort wsjt_cxx) target_link_libraries (msk144d wsjt_fort wsjt_cxx)
endif(WSJT_BUILD_UTILS) endif(WSJT_BUILD_UTILS)
# build the main application # build the main application

47
lib/msk144_testmsg.f90 Normal file
View File

@ -0,0 +1,47 @@
parameter (MAXTEST=75,NTEST=43)
character*37 testmsg(MAXTEST)
data testmsg(1:NTEST)/ &
"CQ K1ABC FN42", &
"K1ABC W9XYZ EN37", &
"W9XYZ K1ABC -11", &
"K1ABC W9XYZ R-09", &
"W9XYZ K1ABC RRR", &
"K1ABC W9XYZ 73", &
"K1ABC W9XYZ RR73", &
"CQ KH1/KH7Z", &
"CQ TEST K1ABC/R FN42", &
"K1ABC/R W9XYZ EN37", &
"W9XYZ K1ABC/R R FN42", &
"K1ABC/R W9XYZ RR73", &
"CQ TEST K1ABC FN42", &
"K1ABC/R W9XYZ/R R FN42", &
"CQ G4ABC/P IO91", &
"G4ABC/P PA9XYZ JO22", &
"PA9XYZ 590003 IO91NP", &
"G4ABC/P R 570007 JO22DB", &
"PA9XYZ G4ABC/P RR73", &
"CQ PJ4/K1ABC", &
"PJ4/K1ABC <W9XYZ>", &
"W9XYZ <PJ4/K1ABC> -11", &
"<PJ4/K1ABC> W9XYZ R-09", &
"<W9XYZ> PJ4/K1ABC RRR", &
"PJ4/K1ABC <W9XYZ> 73", &
"CQ W9XYZ EN37", &
"<W9XYZ> YW18FIFA", &
"<YW18FIFA> W9XYZ -11", &
"W9XYZ <YW18FIFA> R-09", &
"YW18FIFA <W9XYZ> RRR", &
"<W9XYZ> YW18FIFA 73", &
"TNX BOB 73 GL", &
"CQ YW18FIFA", &
"<YW18FIFA> KA1ABC", &
"KA1ABC <YW18FIFA> -11", &
"<YW18FIFA> KA1ABC R-17", &
"<KA1ABC> YW18FIFA RR73", &
"<YW18FIFA> KA1ABC 73", &
"123456789ABCDEF012", &
"<KA1ABC WB9XYZ> -03", &
"<KA1ABC WB9XYZ> R+03", &
"<KA1ABC WB9XYZ> RRR", &
"<KA1ABC WB9XYZ> 73"/

View File

@ -3,11 +3,11 @@ program msk144code
! Provides examples of message packing, bit and symbol ordering, ! Provides examples of message packing, bit and symbol ordering,
! LDPC encoding, and other necessary details of the MSK144 protocol. ! LDPC encoding, and other necessary details of the MSK144 protocol.
use packjt use packjt77
character msg*37,msgsent*37,decoded,bad*1,msgtype*13 character*77 c77
character msg*37,msgsent*37,decoded,bad*1,msgtype*16
integer*4 i4tone(144) integer*4 i4tone(144)
logical*1 bcontest include 'msk144_testmsg.f90'
include 'testmsg.f90'
nargs=iargc() nargs=iargc()
if(nargs.ne.1) then if(nargs.ne.1) then
@ -24,44 +24,57 @@ program msk144code
call getarg(1,msg) call getarg(1,msg)
nmsg=1 nmsg=1
if(msg(1:2).eq."-t") then if(msg(1:2).eq."-t") then
testmsg(NTEST+1)="<KA1ABC WB9XYZ> -03" nmsg=NTEST
testmsg(NTEST+2)="<KA1ABC WB9XYZ> R+03"
testmsg(NTEST+3)="<KA1ABC WB9XYZ> RRR"
testmsg(NTEST+4)="<KA1ABC WB9XYZ> 73"
testmsg(NTEST+5)="KA1ABC WB9XYZ R EN37"
nmsg=NTEST+5
endif endif
write(*,1010) write(*,1010)
1010 format(" Message Decoded Err? Type"/ & 1010 format(4x,"Message",31x,"Decoded",29x,"Err i3.n3"/100("-"))
74("-"))
do imsg=1,nmsg do imsg=1,nmsg
if(nmsg.gt.1) msg=testmsg(imsg) if(nmsg.gt.1) msg=testmsg(imsg)
call fmtmsg(msg,iz) !To upper case, collapse multiple blanks call fmtmsg(msg,iz) !To upper case, collapse multiple blanks
i1=len(trim(msg))-5 call genmsk_128_90(msg,ichk,msgsent,i4tone,itype)
bcontest=.false. i3=-1
if(msg(i1:i1+1).eq.'R ') bcontest=.true. n3=-1
ichk=0 call pack77(msg,i3,n3,c77)
call genmsk_128_90(msg,ichk,bcontest,msgsent,i4tone,itype)
msgtype="" msgtype=""
if(itype.eq.1) msgtype="Std Msg" if(i3.eq.0) then
if(itype.eq.2) msgtype="Type 1 prefix" if(n3.eq.0) msgtype="Free text"
if(itype.eq.3) msgtype="Type 1 suffix" if(n3.eq.1) msgtype="DXpedition mode"
if(itype.eq.4) msgtype="Type 2 prefix" if(n3.eq.2) msgtype="EU VHF Contest"
if(itype.eq.5) msgtype="Type 2 suffix" if(n3.eq.3) msgtype="ARRL Field Day"
if(itype.eq.6) msgtype="Free text" if(n3.eq.4) msgtype="ARRL Field Day"
if(itype.eq.7) msgtype="Hashed calls" if(n3.eq.5) msgtype="Telemetry"
if(n3.ge.6) msgtype="Undefined type"
endif
if(i3.eq.1) msgtype="Standard msg"
if(i3.eq.2) msgtype="EU VHF Contest"
if(i3.eq.3) msgtype="ARRL RTTY Roundup"
if(i3.eq.4) msgtype="Nonstandard calls"
if(i3.ge.5) msgtype="Undefined msg type"
if(i3.ge.1) n3=-1
if(i4tone(41).lt.0) then
msgtype="Sh msg"
i3=-1
endif
bad=" " bad=" "
if(msgsent.ne.msg) bad="*" if(msg.ne.msgsent) bad="*"
write(*,1020) imsg,msg,msgsent,bad,itype,msgtype if(i3.eq.0.and.n3.ge.0) then
1020 format(i2,'.',2x,a37,2x,a37,3x,a1,i3,": ",a13) write(*,1020) imsg,msg,msgsent,bad,i3,n3,msgtype
1020 format(i2,'.',1x,a37,1x,a37,1x,a1,2x,i1,'.',i1,1x,a16)
elseif(i3.ge.1) then
write(*,1022) imsg,msg,msgsent,bad,i3,msgtype
1022 format(i2,'.',1x,a37,1x,a37,1x,a1,2x,i1,'.',1x,1x,a16)
elseif(i3.lt.0) then
write(*,1024) imsg,msg,msgsent,bad,msgtype
1024 format(i2,'.',1x,a37,1x,a37,1x,a1,6x,a16)
endif
enddo enddo
if(nmsg.eq.1) then if(nmsg.eq.1) then
n=144 n=144
if(msg(1:1).eq."<") n=40 if(i4tone(41).lt.0) n=40
write(*,1030) i4tone(1:n) write(*,1030) i4tone(1:n)
1030 format(/'Channel symbols'/(72i1)) 1030 format(/'Channel symbols'/(72i1))
endif endif

View File

@ -17,7 +17,6 @@ program msk144d2
logical :: display_help=.false. logical :: display_help=.false.
logical*1 bShMsgs logical*1 bShMsgs
logical*1 bcontest
logical*1 btrain logical*1 btrain
logical*1 bswl logical*1 bswl
@ -47,7 +46,6 @@ program msk144d2
mygrid='EN50WC' mygrid='EN50WC'
hiscall='' hiscall=''
bShMsgs=.false. bShMsgs=.false.
bcontest=.false.
btrain=.false. btrain=.false.
bswl=.false. bswl=.false.
datadir='.' datadir='.'
@ -116,7 +114,7 @@ program msk144d2
tt=sum(float(abs(id2(i:i+7*512-1)))) tt=sum(float(abs(id2(i:i+7*512-1))))
if( tt .ne. 0.0 ) then if( tt .ne. 0.0 ) then
call mskrtd(ichunk,nutc,tsec,ntol,nrxfreq,ndepth,mycall,mygrid,hiscall,bShMsgs, & call mskrtd(ichunk,nutc,tsec,ntol,nrxfreq,ndepth,mycall,mygrid,hiscall,bShMsgs, &
bcontest,btrain,pcoeffs,bswl,datadir,line) btrain,pcoeffs,bswl,datadir,line)
if( index(line,"&") .ne. 0 .or. & if( index(line,"&") .ne. 0 .or. &
index(line,"^") .ne. 0 .or. & index(line,"^") .ne. 0 .or. &
index(line,"!") .ne. 0 .or. & index(line,"!") .ne. 0 .or. &