From 1ff54e35aa6e94e9fd8bf19822518f13393c66b3 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 13 Jul 2007 15:47:35 +0000 Subject: [PATCH] Fixed up the state-machine fine tuning. Some diagnostic stuff remains. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@504 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- decode1.F90 | 10 +++++++--- map65.py | 2 +- recvpkt.F90 | 8 ++++++-- symspec.f90 | 14 +++++++++++--- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/decode1.F90 b/decode1.F90 index 9cfcf0018..3c7981483 100644 --- a/decode1.F90 +++ b/decode1.F90 @@ -15,7 +15,7 @@ subroutine decode1(iarg) include 'gcom2.f90' include 'gcom3.f90' include 'gcom4.f90' - + data kbuf0/0/ data sending0/' '/ save @@ -33,8 +33,12 @@ subroutine decode1(iarg) newdat=1 endif - if((ndiskdat.eq.1 .or. ndecoding.eq.0) .and. ((kk-kkdone).gt.32768)) & - call symspec(id,kbuf,kk,kkdone,nutc,t00,newdat) + if(kbuf.ne.kbuf0) kkdone=0 + kbuf0=kbuf + kkk=kk + if(kbuf.eq.2) kkk=kk-5760000 + if((ndiskdat.eq.1 .or. ndecoding.eq.0) .and. ((kkk-kkdone).gt.32768)) & + call symspec(id,kbuf,kk,kkdone,nutc,newdat) if(ndecoding.gt.0 .and. mode(1:4).eq.'JT65') then ndecdone=0 diff --git a/map65.py b/map65.py index 60f823585..bf50f9cd0 100644 --- a/map65.py +++ b/map65.py @@ -1,4 +1,4 @@ -#--------------------------------------------------------------------- MAP65 +#-------------------------------------------------------------------- MAP65 # $Date$ $Revision$ # from Tkinter import * diff --git a/recvpkt.F90 b/recvpkt.F90 index 85c71a365..e87745043 100644 --- a/recvpkt.F90 +++ b/recvpkt.F90 @@ -64,6 +64,8 @@ subroutine recvpkt(iarg) k=0 if(kb.eq.2) k=NSMAX lost_tot=0 + ndone1=0 + ndone2=0 endif if(kb.eq.1 .and. (k+174).gt.NSMAX) go to 20 @@ -110,17 +112,19 @@ subroutine recvpkt(iarg) nsec0=nsec ntx=ntx+transmitting - if(ns.eq.nt1) then + if(ns.ge.nt1 .and. ndone1.eq.0) then nutc=mutc fcenter=center_freq kbuf=kb kk=k ndiskdat=0 + ndone1=1 if(ndebug.eq.2) write(*,3001) nutc,mod(int(sec_midn()),60),ns 3001 format('recvpkt 1:',i5.4,2i3.2) endif - if(ns.eq.nt2) then + if(ns.ge.nt2 .and. ndone2.eq.0) then kk=k + ndone2=1 if(ndebug.eq.2) write(*,3002) nutc,mod(int(sec_midn()),60),ns 3002 format('recvpkt 2:',i5.4,2i3.2) nlost=lost_tot ! Save stats for printout diff --git a/symspec.f90 b/symspec.f90 index a20f06a6f..82f676a06 100644 --- a/symspec.f90 +++ b/symspec.f90 @@ -1,4 +1,4 @@ -subroutine symspec(id,kbuf,kk,kkdone,nutc,t00,newdat) +subroutine symspec(id,kbuf,kk,kkdone,nutc,newdat) ! Compute spectra at four polarizations, using half-symbol steps. @@ -9,9 +9,15 @@ subroutine symspec(id,kbuf,kk,kkdone,nutc,t00,newdat) include 'spcom.f90' include 'gcom2.f90' complex cx(NFFT),cy(NFFT) ! pad to 32k with zeros - data kbuf0/-999/ + data kbuf0/-999/,n/0/ save + kkk=kk + if(kbuf.eq.2) kkk=kk-5760000 + if(ndebug.gt.0) write(*,4001) 'A',nutc,mod(int(sec_midn()),60), & + kbuf,kk,kkk,kkdone +4001 format(a1,i5.4,2i3,3i9,i5) + if(ndebug.eq.2) write(*,3001) nutc,mod(int(sec_midn()),60) 3001 format('symspec 1:',i5.4,i3.2) fac=0.0002 * 10.0**(0.05*(-rxnoise)) @@ -34,7 +40,7 @@ subroutine symspec(id,kbuf,kk,kkdone,nutc,t00,newdat) do nn=1,ntot i0=ts+hsym !Starting sample pointer - if((i0+npts-1).gt.kk) go to 998 !See if we have enough points + if((i0+npts-1).gt.kkk) go to 998 !See if we have enough points i1=ts+2*hsym !Next starting sample pointer ts=ts+hsym !OK, update the exact sample pointer do i=1,npts !Copy data to FFT arrays @@ -110,6 +116,8 @@ subroutine symspec(id,kbuf,kk,kkdone,nutc,t00,newdat) 998 kkdone=i1-1 999 continue + if(ndebug.gt.0) write(*,4001) 'B',nutc,mod(int(sec_midn()),60), & + kbuf,kk,kkk,kkdone,n if(ndebug.eq.2) write(*,3002) mod(int(sec_midn()),60),n 3002 format('symspec 2:',i8.2,i5) return