Fix some bugs for more varied example messages.

This commit is contained in:
Joe Taylor 2018-06-26 21:00:53 -04:00
parent c75a270872
commit acd6d5cab9
6 changed files with 45 additions and 32 deletions

View File

@ -18,8 +18,8 @@ i3.n3 Example message Bits Total Purpose
0.7
1 WA9XYZ/R KA1ABC/R R FN42 28 1 28 1 1 15 74 Standard msg
2 TU; W9XYZ K1ABC R 579 MA 1 28 28 1 3 13 74 ARRL RTTY contest
3 PA3XYZ/P GM4ABC/P R JO22 28 1 28 1 1 15 74 EU VHF contest
2 PA3XYZ/P GM4ABC/P R JO22 28 1 28 1 1 15 74 EU VHF contest
3 TU; W9XYZ K1ABC R 579 MA 1 28 28 1 3 13 74 ARRL RTTY contest
4 <WA9XYZ> PJ4/KA1ABC RR73 13 58 1 2 74 Nonstandard calls
5 ...
6

View File

@ -3,9 +3,15 @@ i3 n3
0 0 FREE TEXT MSG 71 0 71
0 1 K1ABC RR73; W9XYZ <KH1/KH7Z> -12 28 28 10 5 1 71 DXpedition Mode
0 2 PA3XYZ/P R 590003 IO91NP 28 1 1 3 12 25 2 70 EU VHF contest (2)
0 2 PA3XYZ 520093 IO91NP 28 1 1 3 12 25 2 70 EU VHF contest (2)
0 3 WA9XYZ KA1ABC R 16A EMA 28 28 1 4 3 7 3 71 ARRL Field Day
0 3 WA9XYZ KA1ABC 7D EMA 28 28 1 4 3 7 3 71 ARRL Field Day
0 4 WA9XYZ KA1ABC R 32A EMA 28 28 1 4 3 7 4 71 ARRL Field Day
0 5 0123456789ABCDEF01 71 71 Telemetry (18 hex)
0 5 123456789ABCDEF012 71 71 Telemetry (18 hex)
0 5 7123456789ABCDEF01 71 71 Telemetry (18 hex)
0 5 71234567 71 71 Telemetry (18 hex)
0 5 81234567 71 71 Telemetry (18 hex)
0 5 8123456789ABCDEF01 71 71 Telemetry (18 hex)
1 WA9XYZ/R KA1ABC/R R FN42 28 1 28 1 1 15 74 Standard msg
2 TU; W9XYZ K1ABC R 579 MA 1 28 28 1 3 13 74 ARRL RTTY contest
3 <WA9XYZ> PJ4/KA1ABC R-11 13 53 1 1 6 74 Nonstandard calls

View File

@ -2,7 +2,7 @@ subroutine pack77(msg,i3,n3,c77)
use packjt
character*37 msg
! character*22 msg22
character*18 c18
character*13 w(19)
character*77 c77
integer nw(19)
@ -27,33 +27,35 @@ subroutine pack77(msg,i3,n3,c77)
if(i3.ge.0) go to 900
! Check 0.5 (telemetry)
5 if(index(msg,' ').gt.18) then
ntel=-99
read(msg(1:18),1005,err=6) ntel
5 i0=index(msg,' ')
c18=msg(1:i0-1)//' '
c18=adjustr(c18)
ntel=-99
read(c18,1005,err=6) ntel
1005 format(3z6)
6 if(ntel(1).ge.0 .and. ntel(2).ge.0 .and. ntel(3).ge.0) then
i3=0
n3=5
write(c77,1006) ntel,n3
1006 format(b23.23,2b24.24,b3.3)
go to 900
endif
if(ntel(1).ge.2**23) go to 800
6 if(ntel(1).ge.0 .and. ntel(2).ge.0 .and. ntel(3).ge.0) then
i3=0
n3=5
write(c77,1006) ntel,n3
1006 format(b23.23,2b24.24,b3.3)
go to 900
endif
! Check Types 1 and 4 (Standard 77-bit message (type 1) or with "/P" (type 4))
! Check Types 1 and 2 (Standard 77-bit message (type 1) or with "/P" (type 2))
call pack77_1(nwords,w,i3,n3,c77)
if(i3.ge.0) go to 900
! Check Type 2 (ARRL RTTY contest exchange)
! Check Type 3 (ARRL RTTY contest exchange)
call chk77_2(nwords,w,i3,n3)
if(i3.ge.0) go to 900
! Check Type 3 (One nonstandard call and one hashed call)
! Check Type 4 (One nonstandard call and one hashed call)
call chk77_3(nwords,w,i3,n3)
if(i3.ge.0) go to 900
! By default, it's free text
i3=0
800 i3=0
n3=0
msg(14:)=' '
call packtext77(msg(1:13),c77(1:71))

View File

@ -22,16 +22,6 @@ subroutine pack77_03(nwords,w,i3,n3,c77)
call chkcall(w(1),bcall_1,ok1)
call chkcall(w(2),bcall_2,ok2)
if(.not.ok1 .or. .not.ok2) return
ntx=-1
j=len(trim(w(nwords-1)))-1
if(j.ge.2) read(w(nwords-1)(1:j),*,err=1) ntx !Number of transmitters
1 if(ntx.lt.1 .or. ntx.gt.32) return
nclass=ichar(w(nwords-1)(j+1:j+1))-ichar('A')
m=len(trim(w(nwords))) !Length of section abbreviation
if(m.lt.2 .or. m.gt.3) return
isec=-1
do i=1,NSEC
if(csec(i).eq.w(nwords)) then
@ -40,7 +30,17 @@ subroutine pack77_03(nwords,w,i3,n3,c77)
endif
enddo
if(isec.eq.-1) return
if(nwords.eq.5 .and. trim(w(3)).ne.'R') return
ntx=-1
j=len(trim(w(nwords-1)))-1
read(w(nwords-1)(1:j),*,err=1) ntx !Number of transmitters
1 if(ntx.lt.1 .or. ntx.gt.32) return
nclass=ichar(w(nwords-1)(j+1:j+1))-ichar('A')
m=len(trim(w(nwords))) !Length of section abbreviation
if(m.lt.2 .or. m.gt.3) return
! 0.3 WA9XYZ KA1ABC R 16A EMA 28 28 1 4 3 7 71 ARRL Field Day
! 0.4 WA9XYZ KA1ABC R 32A EMA 28 28 1 4 3 7 71 ARRL Field Day

View File

@ -1,5 +1,5 @@
subroutine pack77_1(nwords,w,i3,n3,c77)
! Check Type 1 (Standard 77-bit message) and Type 3 (ditto, with a "/P" call)
! Check Type 1 (Standard 77-bit message) and Type 2 (ditto, with a "/P" call)
character*13 w(19),c13
character*77 c77
@ -20,12 +20,12 @@ subroutine pack77_1(nwords,w,i3,n3,c77)
if(.not.is_grid4(w(nwords)(1:4))) return
! 1 WA9XYZ/R KA1ABC/R R FN42 28 1 28 1 1 15 74 Standard msg
! 3 PA3XYZ/P GM4ABC/P R JO22 28 1 28 1 1 15 74 EU VHF contest
! 2 PA3XYZ/P GM4ABC/P R JO22 28 1 28 1 1 15 74 EU VHF contest
if(nwords.eq.3 .or. (nwords.eq.4 .and. w(3)(1:2).eq.'R ')) then
n3=0
i3=1 !Type 1: Standard message
if(index(w(1),'/P').ge.4 .or. index(w(2),'/P').ge.4) i3=3
i3=1 !Type 1: Standard message, possibly with "/R"
if(index(w(1),'/P').ge.4 .or. index(w(2),'/P').ge.4) i3=2 !Type 2, with "/P"
endif
c13=bcall_1//' '
call pack28(c13,n28a)

View File

@ -96,6 +96,11 @@ subroutine unpack77(c77,msg)
1006 format(b23,2b24)
write(msg,1007) ntel
1007 format(3z6.6)
do i=1,18
if(msg(i:i).ne.'0') exit
msg(i:i)=' '
enddo
msg=adjustl(msg)
else if(i3.eq.1 .or. i3.eq.3) then
!### Here and elsewhere, must enable rpt/RRR/RR73/73 in igrid4