Trim leading blanks and multiple blanks from Tx messages.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@2452 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2011-09-29 16:18:26 +00:00
parent 4783dfbb90
commit 4c9692d977
4 changed files with 43 additions and 18 deletions

View File

@ -19,7 +19,7 @@ SRCF90 = a2d.f90 astro0.f90 audio_init.f90 azdist0.f90 \
runqqq.f90 fivehz.f90 flushqqq.f90 \ runqqq.f90 fivehz.f90 flushqqq.f90 \
rfile.f90 rfile3a.F90 spec.f90 map65a.F90 display.F90 \ rfile.f90 rfile3a.F90 spec.f90 map65a.F90 display.F90 \
getfile.f90 getfile2.f90 recvpkt.f90 savetf2.F90 \ getfile.f90 getfile2.f90 recvpkt.f90 savetf2.F90 \
symspec.f90 sec_midn.F90 getdphi.f90 thnix.f90 four2a.f90 symspec.f90 sec_midn.F90 getdphi.f90 thnix.f90 msgtrim.f90
SRCCOM = datcom.f90 gcom1.f90 gcom2.f90 gcom3.f90 gcom4.f90 spcom.f90 SRCCOM = datcom.f90 gcom1.f90 gcom2.f90 gcom3.f90 gcom4.f90 spcom.f90
@ -35,7 +35,7 @@ SRCF77 = indexx.f gen65.f chkmsg.f \
ccf65.f trimlist.f chkhist.f decode1a.f f77_wisdom.f \ ccf65.f trimlist.f chkhist.f decode1a.f f77_wisdom.f \
fil6521.f twkfreq.f decode65b.f afc65b.f fchisq.f ccf2.f fil6521.f twkfreq.f decode65b.f afc65b.f fchisq.f ccf2.f
SRC2F77 = filbig.f SRC2F77 = four2a.f filbig.f
SRCS2C = ptt.c igray.c wrapkarn.c cutil.c start_portaudio.c fthread.c SRCS2C = ptt.c igray.c wrapkarn.c cutil.c start_portaudio.c fthread.c
@ -47,7 +47,7 @@ MAP65.EXE: Audio.pyd map65.spec
Audio.pyd: $(OBJC1) $(OBJF77) $(SRCF90) $(SRC2F77) $(SRCS2C) $(SRCCOM) Makefile Audio.pyd: $(OBJC1) $(OBJF77) $(SRCF90) $(SRC2F77) $(SRCS2C) $(SRCCOM) Makefile
c:/Python25/python C:/python25/scripts/f2py.py -c -I. \ c:/Python25/python C:/python25/scripts/f2py.py -c -I. \
--quiet --fcompiler=g95 \ --quiet --fcompiler=g95 \
--opt="-fbounds-check -O2 -cpp -DUSE_PORTAUDIO" \ --opt="-fbounds-check -O0 -cpp" \
--compiler=mingw32 \ --compiler=mingw32 \
$(OBJC1) $(OBJF77) libfftw3f_win.a \ $(OBJC1) $(OBJF77) libfftw3f_win.a \
libportaudio.a libpthreadGC2.a -lwinmm -lws2_32 \ libportaudio.a libpthreadGC2.a -lwinmm -lws2_32 \

View File

@ -1,4 +1,4 @@
#-------------------------------------------------------------------- MAP65 #--------------------------------------------------------------------- MAP65
# $Date$ $Revision$ # $Date$ $Revision$
# #
from Tkinter import * from Tkinter import *

37
msgtrim.f90 Normal file
View File

@ -0,0 +1,37 @@
subroutine msgtrim(msg,msglen)
character*28 msg
! Remove leading blanks
do i=1,28
if(msg(1:1).ne.' ') go to 2
msg=msg(2:)
enddo
2 do i=28,1,-1
if(msg(i:i).ne.' ') go to 3
enddo
i=1
3 iz=i
! Collapse multiple blanks to one
ib2=index(msg,' ')
if(ib2.eq.0 .or. ib2.eq.iz+1) go to 10
msg=msg(:ib2-1)//msg(ib2+1:)
iz=iz-1
go to 2
! Convert letters to upper case
10 do i=1,22
if(msg(i:i).ge.'a' .and. msg(i:i).le.'z') &
msg(i:i)= char(ichar(msg(i:i))+ichar('A')-ichar('a'))
enddo
do i=28,1,-1
if(msg(i:i).ne.' ') go to 20
enddo
i=28
20 msglen=i
return
end subroutine msgtrim

View File

@ -40,21 +40,9 @@ subroutine wsjtgen
endif endif
msg=txmsg msg=txmsg
ntxnow=ntxreq call msgtrim(msg,nmsg)
! Convert all letters to upper case
do i=1,28
if(msg(i:i).ge.'a' .and. msg(i:i).le.'z') &
msg(i:i)= char(ichar(msg(i:i))+ichar('A')-ichar('a'))
enddo
txmsg=msg txmsg=msg
ntxnow=ntxreq
! Find message length
do i=NMSGMAX,1,-1
if(msg(i:i).ne.' ') go to 10
enddo
i=1
10 nmsg=i
nmsg0=nmsg nmsg0=nmsg
if(msg(1:1).eq.'@') then if(msg(1:1).eq.'@') then