From 87f7fce73ff4c1fef80e0435a7cd81709edef659 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 3 Mar 2009 21:10:59 +0000 Subject: [PATCH] Fixed problem with blanks in SaveDir and AzElDir. (Poorly motivated?) attempt to find bug in saveing files. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@1092 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- map65.py | 14 +++++++++----- savetf2.F90 | 31 ++++++++++++------------------- 2 files changed, 21 insertions(+), 24 deletions(-) diff --git a/map65.py b/map65.py index db3ec9edb..f6aa45627 100644 --- a/map65.py +++ b/map65.py @@ -1166,7 +1166,9 @@ def update(): g.ndecphase=1 if Audio.gcom2.nhispol != -999: - txpol=(int(Audio.gcom2.nhispol) - 2*g.poloffset + 360) % 180 + npol=int(Audio.gcom2.nhispol) + npol=180-npol #Reverse sign of x + txpol=(npol - 2*g.poloffset + 360) % 180 t="Tx pol: %d " % txpol if txpol < 45 or txpol > 135: t=t + 'H' @@ -1854,8 +1856,8 @@ try: elif key == 'CSmin': options.ncsmin.set(value) elif key == 'Nt1': options.nt1.set(value) elif key == 'dphi': options.dphi.set(value) - elif key == 'SaveDir': options.savedir.set(value) - elif key == 'AzElDir': options.azeldir.set(value) + elif key == 'SaveDir': options.savedir.set(value.replace("#"," ")) + elif key == 'AzElDir': options.azeldir.set(value.replace("#"," ")) elif key == 'TxFirst': TxFirst.set(value) elif key == 'KB8RQ': kb8rq.set(value) elif key == 'K2TXB': k2txb.set(value) @@ -1949,8 +1951,10 @@ f.write("fb " + str(options.fb.get()) + "\n") f.write("fcal " + str(options.fcal.get()) + "\n") f.write("CSmin " + str(options.ncsmin.get()) + "\n") f.write("Nt1 " + str(options.nt1.get()) + "\n") -f.write("SaveDir " + str(options.savedir.get()) + "\n") -f.write("AzElDir " + str(options.azeldir.get()) + "\n") +savedir2=options.savedir.get().replace(" ","#") +azeldir2=options.azeldir.get().replace(" ","#") +f.write("SaveDir " + str(savedir2) + "\n") +f.write("AzElDir " + str(azeldir2) + "\n") f.write("TxFirst " + str(TxFirst.get()) + "\n") f.write("KB8RQ " + str(kb8rq.get()) + "\n") f.write("K2TXB " + str(k2txb.get()) + "\n") diff --git a/savetf2.F90 b/savetf2.F90 index 3e4463653..b43398eca 100644 --- a/savetf2.F90 +++ b/savetf2.F90 @@ -7,6 +7,8 @@ subroutine savetf2(id,fnamedate,savedir) character*80 savedir,fname character cdate*8,ctime2*10,czone*5,fnamedate*6 integer itt(8) + data nloc/-1/ + save nloc call date_and_time(cdate,ctime2,czone,itt) nh=itt(5)-itt(4)/60 @@ -32,31 +34,22 @@ subroutine savetf2(id,fnamedate,savedir) open(17,file=fname,status='unknown',access='stream',err=998) #endif -! write(17,err=997) id - do i=1,1024 - i0=(i-1)*5625 + 1 - call w17(id(1,i0),ierr) - if(ierr.ne.0) print*,'Error writing tf2 file' - enddo - + if(nloc.eq.-1) nloc=loc(id) + n=abs(loc(id)-nloc) + if(n.eq.0 .or. n.eq.46080000) then + write(17,err=997) id + else + print*,'Address of id() clobbered???',nloc,loc(id) + endif close(17) go to 999 -!997 print*,'Error writing tf2 file' -! print*,fname -! go to 999 +997 print*,'Error writing tf2 file' + print*,fname + go to 999 998 print*,'Cannot open file:' print*,fname 999 return end subroutine savetf2 - -subroutine w17(id,ierr) - integer*2 id(4,5625) - write(17,err=998) id - ierr=0 - go to 999 -998 ierr=1 -999 return -end subroutine w17