1. Center frequency send by Linrad is now used to set frequency scale in

SpecJT and frequency labels on lines of decoded text.  (Needs checking!)
2. Corrected logic for Rx buffer assignment on program startup, and
   for when a transmission is started late.  (Needs checking!)
3. Diagnostic display of kbuf, kk, and kxp/96000 in status-bar msg7.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@943 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2008-07-12 18:11:36 +00:00
parent 950b87d893
commit 5f66aff299
6 changed files with 65 additions and 42 deletions

View File

@ -94,7 +94,7 @@ C i0 is the bin number in ca and cb closest to f0.
enddo enddo
do i=nh+1,NFFT2 do i=nh+1,NFFT2
j=i0+i-1-NFFT2 j=i0+i-1-NFFT2
if(j.lt.1) j=j+NFFT1 if(j.lt.1) j=j+NFFT1 !NFFT1 was NFFT2
c4a(i)=rfilt(i)*ca(j) c4a(i)=rfilt(i)*ca(j)
c4b(i)=rfilt(i)*cb(j) c4b(i)=rfilt(i)*cb(j)
enddo enddo

View File

@ -1,5 +1,6 @@
! Variable Purpose Set in Thread ! Variable Purpose Set in Thread
!------------------------------------------------------------------------- !-------------------------------------------------------------------------
real*8 fcenter !Linrad center freq, from pkt header recvpkt
real ps0 !Spectrum of best ping, FSK441/JT6m Decoder real ps0 !Spectrum of best ping, FSK441/JT6m Decoder
real psavg !Average spectrum Decoder real psavg !Average spectrum Decoder
real s2 !2d spectrum for horizontal waterfall GUI real s2 !2d spectrum for horizontal waterfall GUI
@ -7,7 +8,6 @@ real ccf !CCF in time (blue curve) Decoder
real green !Data for green line GUI real green !Data for green line GUI
real fselect !Specified QSO frequency GUI real fselect !Specified QSO frequency GUI
real pctlost !Percent of lost packets Decoder real pctlost !Percent of lost packets Decoder
real fcenter !Linrad center freq, from pkt header recvpkt
real rxnoise !Rx noise in dB recvpkt real rxnoise !Rx noise in dB recvpkt
real dphi !Phase shift between pol'n channels GUI,Decoder real dphi !Phase shift between pol'n channels GUI,Decoder
integer ngreen !Length of green GUI integer ngreen !Length of green GUI
@ -104,8 +104,8 @@ character*80 filetokillb
character*12 pttport character*12 pttport
character*8 utcdata !HHMM UTC for the processed data Decoder character*8 utcdata !HHMM UTC for the processed data Decoder
common/gcom2/ps0(431),psavg(450),s2(64,3100),ccf(-5:540), & common/gcom2/fcenter,ps0(431),psavg(450),s2(64,3100),ccf(-5:540), &
green(500),fselect,pctlost,fcenter,rxnoise,dphi,ngreen,dgain,iter, & green(500),fselect,pctlost,rxnoise,dphi,ngreen,dgain,iter, &
ndecoding,ndecoding0,mousebutton,multicast, & ndecoding,ndecoding0,mousebutton,multicast, &
ndecdone,npingtime,ierr,lauto,mantx,nrestart,ntr,nmsg,nsave,nadd5, & ndecdone,npingtime,ierr,lauto,mantx,nrestart,ntr,nmsg,nsave,nadd5, &
dftolerance,LDecoded,rxdone,monitoring,nzap,minsigdb, & dftolerance,LDecoded,rxdone,monitoring,nzap,minsigdb, &

View File

@ -979,6 +979,8 @@ def update():
msg4.configure(text=t) msg4.configure(text=t)
t="Drop: %.2f %%" % Audio.gcom2.pctlost t="Drop: %.2f %%" % Audio.gcom2.pctlost
msg5.configure(text=t) msg5.configure(text=t)
t="%d %d %d" % (Audio.datcom.kbuf,Audio.datcom.kk,Audio.datcom.kxp/96000)
msg7.configure(text=t)
root_geom=root.geometry() root_geom=root.geometry()
try: try:
bm_geom=bm.geometry() bm_geom=bm.geometry()
@ -1125,7 +1127,7 @@ def update():
else: else:
bgcolor='green' bgcolor='green'
t='Receiving' t='Receiving'
msg7.configure(text=t,bg=bgcolor) msg8.configure(text=t,bg=bgcolor)
if Audio.gcom2.ndecdone>0 or g.cmap != cmap0: if Audio.gcom2.ndecdone>0 or g.cmap != cmap0:
if Audio.gcom2.ndecdone==1: if Audio.gcom2.ndecdone==1:
@ -1714,8 +1716,10 @@ msg5=Message(iframe6, text="", width=300,relief=SUNKEN)
msg5.pack(side=LEFT, fill=X, padx=1) msg5.pack(side=LEFT, fill=X, padx=1)
msg6=Message(iframe6, text="", width=300,relief=SUNKEN) msg6=Message(iframe6, text="", width=300,relief=SUNKEN)
msg6.pack(side=LEFT, fill=X, padx=1) msg6.pack(side=LEFT, fill=X, padx=1)
msg7=Message(iframe6, text=' ', width=300,relief=SUNKEN) msg7=Message(iframe6, text="", width=300,relief=SUNKEN)
msg7.pack(side=RIGHT, fill=X, padx=1) msg7.pack(side=LEFT, fill=X, padx=1)
msg8=Message(iframe6, text=' ', width=300,relief=SUNKEN)
msg8.pack(side=RIGHT, fill=X, padx=1)
iframe6.pack(expand=1, fill=X, padx=4) iframe6.pack(expand=1, fill=X, padx=4)
frame.pack() frame.pack()
ldate.after(100,update) ldate.after(100,update)

View File

@ -23,6 +23,7 @@ subroutine map65a(newdat)
data nfile/0/,nutc0/-999/,nid/0/,ip000/1/,ip001/1/,mousefqso0/-999/ data nfile/0/,nutc0/-999/,nid/0/,ip000/1/,ip001/1/,mousefqso0/-999/
save save
nfoffset=nint(1000*(fcenter-144.125d0))
if(mousefqso.ne.mousefqso0 .and. nagain.eq.1) newspec=2 if(mousefqso.ne.mousefqso0 .and. nagain.eq.1) newspec=2
mousefqso0=mousefqso mousefqso0=mousefqso
@ -253,7 +254,7 @@ subroutine map65a(newdat)
stop 'Error in message format' stop 'Error in message format'
8 if(i.le.18) decoded(i+2:i+4)='OOO' 8 if(i.le.18) decoded(i+2:i+4)='OOO'
endif endif
nkHz=nint(freq-foffset) nkHz=nint(freq-foffset) + nfoffset
f0=144.0+0.001*nkHz f0=144.0+0.001*nkHz
ndf=nint(1000.0*(freq-foffset-nkHz)) ndf=nint(1000.0*(freq-foffset-nkHz))
@ -280,7 +281,8 @@ subroutine map65a(newdat)
endif endif
enddo enddo
if(nwrite.eq.0) then if(nwrite.eq.0) then
write(11,1012) mousefqso,nutc nfqso=mousefqso + nfoffset
write(11,1012) nfqso,nutc
1012 format(i3,9x,i5.4) 1012 format(i3,9x,i5.4)
endif endif
@ -349,7 +351,7 @@ subroutine map65a(newdat)
stop 'Error in message format' stop 'Error in message format'
10 if(i.le.18) decoded(i+2:i+4)='OOO' 10 if(i.le.18) decoded(i+2:i+4)='OOO'
endif endif
nkHz=nint(freq-foffset) nkHz=nint(freq-foffset) + nfoffset
f0=144.0+0.001*nkHz f0=144.0+0.001*nkHz
ndf=nint(1000.0*(freq-foffset-nkHz)) ndf=nint(1000.0*(freq-foffset-nkHz))
ndf0=nint(a(1)) ndf0=nint(a(1))

View File

@ -1,12 +1,7 @@
!----------------------------------------------------- recvpkt
subroutine recvpkt(iarg) subroutine recvpkt(iarg)
! Receive timf2 packets from Linrad, stuff data into id(). ! Receive timf2 packets from Linrad and stuff data into array id().
! This routine runs in a background thread and will never return. ! (This routine runs in a background thread and will never return.)
!#ifdef CVF
! use dflib
!#endif
parameter (NSZ=2*60*96000) parameter (NSZ=2*60*96000)
real*8 d8(NSZ) real*8 d8(NSZ)
@ -20,7 +15,7 @@ subroutine recvpkt(iarg)
include 'gcom1.f90' include 'gcom1.f90'
include 'gcom2.f90' include 'gcom2.f90'
equivalence (id,d8) equivalence (id,d8)
data nblock0/0/,first/.true./,kb/1/,ntx/0/,npkt/0/,nw/0/ data nblock0/0/,first/.true./,kb/1/,npkt/0/,nw/0/
data sqave/0.0/,u/0.001/,rxnoise/0.0/,kbuf/1/,lost_tot/0/ data sqave/0.0/,u/0.001/,rxnoise/0.0/,kbuf/1/,lost_tot/0/
data multicast0/-99/ data multicast0/-99/
save save
@ -35,21 +30,40 @@ subroutine recvpkt(iarg)
10 if(multicast.ne.multicast0) go to 1 10 if(multicast.ne.multicast0) go to 1
call recv_pkt(center_freq) call recv_pkt(center_freq)
if(nsec0.eq.-999) fcenter=center_freq fcenter=center_freq
! Wait for an even minute to start accepting Rx data.
if(nsec0.eq.-999) then
if(mod(msec/1000,60).ne.0) go to 10
nsec0=-998
endif
isec=sec_midn() isec=sec_midn()
imin=isec/60 imin=isec/60
if((monitoring.eq.0) .or. (lauto.eq.1 .and. mod(imin,2).eq.(1-TxFirst))) then if((monitoring.eq.0) .or. (lauto.eq.1 .and. mod(imin,2).eq.(1-TxFirst))) then
first=.true. first=.true.
! If we're transmitting and were previously receiving in this minute,
! switch buffers to prepare for the next Rx minute.
if(lauto.eq.1 .and. mod(imin,2).eq.(1-TxFirst) .and. reset.eq.1) then
nreset=0
kb=3-kb
k=0
if(kb.eq.2) k=NSMAX
lost_tot=0
ndone1=0
ndone2=0
endif
go to 10 go to 10
endif endif
! If we get here, we're in Rx mode
lost=nblock-nblock0-1 lost=nblock-nblock0-1
if(lost.ne.0 .and. .not.first) then if(lost.ne.0 .and. .not.first) then
nb=nblock nb=nblock
if(nb.lt.0) nb=nb+65536 if(nb.lt.0) nb=nb+65536
nb0=nblock0 nb0=nblock0
if(nb0.lt.0) nb0=nb0+65536 if(nb0.lt.0) nb0=nb0+65536
! if(ndebug.gt.0) print*,'Lost packets:',nb0,nb,lost
lost_tot=lost_tot + lost ! Insert zeros for the lost data. lost_tot=lost_tot + lost ! Insert zeros for the lost data.
do i=1,174*lost do i=1,174*lost
k=k+1 k=k+1
@ -60,8 +74,9 @@ subroutine recvpkt(iarg)
nsec=msec/1000 nsec=msec/1000
if(mod(nsec,60).eq.1) nreset=1 if(mod(nsec,60).eq.1) nreset=1
! If this is the start of a new minute, switch buffers
if(mod(nsec,60).eq.0 .and. nreset.eq.1) then if(mod(nsec,60).eq.0 .and. nreset.eq.1) then
! This is the start of a new minute, switch buffers
nreset=0 nreset=0
kb=3-kb kb=3-kb
k=0 k=0
@ -91,7 +106,12 @@ subroutine recvpkt(iarg)
rxnoise=10.0*log10(sqave) - 48.0 rxnoise=10.0*log10(sqave) - 48.0
kxp=k kxp=k
! This may be a bad idea, because of non-reentrant Fortran I/O? if(k.lt.1 .or. k.gt.NSZ) then
print*,'Error in recvpkt: ',k,NSZ,NSMAX
stop
endif
! The following may be a bad idea because it uses non-reentrant Fortran I/O ???
if(mode.eq.'Measur') then if(mode.eq.'Measur') then
npkt=npkt+1 npkt=npkt+1
if(npkt.ge.551) then if(npkt.ge.551) then
@ -109,37 +129,27 @@ subroutine recvpkt(iarg)
nw=0 nw=0
endif endif
if(k.lt.1 .or. k.gt.NSZ) then
print*,'Error in recvpkt: ',k,NSZ,NSMAX
stop
endif
20 if(nsec.ne.nsec0) then 20 if(nsec.ne.nsec0) then
mutch=nsec/3600 mutch=nsec/3600
mutcm=mod(nsec/60,60) mutcm=mod(nsec/60,60)
mutc=100*mutch + mutcm mutc=100*mutch + mutcm
ns=mod(nsec,60) ns=mod(nsec,60)
nsec0=nsec nsec0=nsec
ntx=ntx+transmitting
! See if it's time to start FFTs
if(ns.ge.nt1 .and. ndone1.eq.0) then if(ns.ge.nt1 .and. ndone1.eq.0) then
! Time in this minute has reached designated time to start FFTs
nutc=mutc nutc=mutc
fcenter=center_freq fcenter=center_freq
kbuf=kb kbuf=kb
kk=k kk=k
ndiskdat=0 ndiskdat=0
ndone1=1 ndone1=1
! if(ndebug.eq.2) write(29,3001) nutc,mod(int(sec_midn()),60), &
! kbuf,kk,kkdone
!3001 format('r1:',i5.4,i3.2,i5,2i10)
endif endif
! See if it's time to start second stage of processing
if(ns.ge.nt2 .and. ndone2.eq.0) then if(ns.ge.nt2 .and. ndone2.eq.0) then
kk=k kk=k
ndone2=1 ndone2=1
! if(ndebug.eq.2) write(29,3002) nutc,mod(int(sec_midn()),60), &
! kbuf,kk,kkdone
!3002 format('r2:',i5.4,i3.2,i5,2i10)
nlost=lost_tot ! Save stats for printout nlost=lost_tot ! Save stats for printout
endif endif
endif endif

View File

@ -42,6 +42,7 @@ g.cmap="Linrad"
g.cmap0="Linrad" g.cmap0="Linrad"
bw=96.0 bw=96.0
df=2.69165 df=2.69165
fcenter0=0.
fmid=1500 fmid=1500
fmid0=1500 fmid0=1500
frange=2000 frange=2000
@ -191,19 +192,21 @@ def draw_axis():
xmid=125.0 - 2.3 #Empirical xmid=125.0 - 2.3 #Empirical
x1=int(xmid-0.6*bw) #Make it too wide, to be x1=int(xmid-0.6*bw) #Make it too wide, to be
x2=int(xmid+0.6*bw) #sure to get all the numbers x2=int(xmid+0.6*bw) #sure to get all the numbers
ixadd=(int(1000.0*Audio.gcom2.fcenter) % 1000) - 125
ilab=10 ilab=10
if bw <= 60.0: ilab=5 if bw <= 60.0: ilab=5
if bw <= 30.0: ilab=2 if bw <= 30.0: ilab=2
for ix in range(x1,x2,1): for ix in range(x1,x2,1):
i=0.5*NX + (ix-xmid)/xdf i=0.5*NX + (ix-xmid)/xdf
j=20 j=20
if (ix%5)==0: j=16 k=int(ix+ixadd+10000.5)%1000
if (ix%ilab)==0 : if (k%5)==0: j=16
if (k%ilab)==0 :
j=16 j=16
x=i-1 x=i-1
if ix<100: x=x+1 if k<100: x=x+1
y=8 y=8
c.create_text(x,y,text=str(ix)) c.create_text(x,y,text=str(k))
c.create_line(i,25,i,j,fill='black') #Draw the upper scale c.create_line(i,25,i,j,fill='black') #Draw the upper scale
c2.delete(ALL) c2.delete(ALL)
@ -258,7 +261,7 @@ def update():
global a,a2,b0,c0,g0,im,im2,isec0,line0,line02,newMinute,\ global a,a2,b0,c0,g0,im,im2,isec0,line0,line02,newMinute,\
nscroll,pim,pim2,nfa0,nfb0,bw, \ nscroll,pim,pim2,nfa0,nfb0,bw, \
root_geom,t0,mousedf0,mousefqso0,nfreeze0,tol0,mode0,nmark0, \ root_geom,t0,mousedf0,mousefqso0,nfreeze0,tol0,mode0,nmark0, \
fmid,fmid0,frange,frange0,dftolerance0 fmid,fmid0,frange,frange0,dftolerance0,fcenter0
utc=time.gmtime(time.time()+0.1*Audio.gcom1.ndsec) utc=time.gmtime(time.time()+0.1*Audio.gcom1.ndsec)
isec=utc[5] isec=utc[5]
@ -371,6 +374,10 @@ def update():
# if newspec: Audio.gcom2.ndiskdat=0 # if newspec: Audio.gcom2.ndiskdat=0
Audio.gcom2.nlines=0 Audio.gcom2.nlines=0
Audio.gcom2.nflat=nflat.get() Audio.gcom2.nflat=nflat.get()
if Audio.gcom2.fcenter!=fcenter0:
draw_axis()
fcenter0=float(Audio.gcom2.fcenter)
frange=nfr.get()*2000 frange=nfr.get()*2000
if(fmid<>fmid0 or frange<>frange0): if(fmid<>fmid0 or frange<>frange0):
if fmid<1000*nfr.get(): fmid=1000*nfr.get() if fmid<1000*nfr.get(): fmid=1000*nfr.get()