From 2cfd513bd7ee1d62c22e45e4f428bd694f68ab50 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 9 Jan 2006 15:42:44 +0000 Subject: [PATCH] Implemented Freeze/Tolerance/MouseDF features for JT6M. Removed superfluous "#ifdef Win32" in jtaudio.c. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@67 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Makefile.win | 21 +++++++++++++++++---- Makefile_0.Win | 31 ------------------------------- jtaudio.c | 4 ---- syncf0.f | 13 +++++++++---- syncf1.f | 19 ++++++++++++------- wsjt.py | 11 +++++++++++ wsjt1.f | 8 +++++--- wsjtrc.win | 6 +++--- 8 files changed, 57 insertions(+), 56 deletions(-) delete mode 100644 Makefile_0.Win diff --git a/Makefile.win b/Makefile.win index dc4bf78de..2a7a7cdd1 100644 --- a/Makefile.win +++ b/Makefile.win @@ -26,15 +26,28 @@ SRCS2F90 = a2d.f90 abc441.f90 astro0.f90 audio_init.f90 azdist0.f90 \ ftn_quit.f90 get_fname.f90 getfile.f90 horizspec.f90 hscroll.f90 \ i1tor4.f90 pix2d.f90 pix2d65.f90 rfile.f90 savedata.f90 spec.f90 \ wsjtgen.f90 runqqq.f90 fivehz.f90 -SRCS2F77 = wsjt1.f fsubs1.f fsubs.f astro.f astropak.f -SRCS2C = resample.c ptt.c igray.c wrapkarn.c +SRCS2F77 = wsjt1.f avesp2.f bzap.f spec441.f spec2d.f mtdecode.f \ + stdecode.f indexx.f s2shape.f flat2.f gen65.f chkmsg.f gen6m.f \ + gentone.f syncf0.f syncf1.f synct.f decode6m.f avemsg6m.f \ + set.f flatten.f db.f pctile.f sort.f ssort.f ps.f smooth.f ping.f \ + longx.f peakup.f sync.f detect.f avemsg65.f decode65.f demod64a.f \ + encode65.f extract.f flat1.f four2.f gencw.f getpfx1.f \ + getpfx2.f getsnr.f graycode.f grid2k.f interleave63.f k2grid.f \ + limit.f lpf1.f deep65.f morse.f nchar.f packcall.f packgrid.f \ + packmsg.f packtext.f setup65.f short65.f slope.f spec2d65.f \ + sync65.f unpackcall.f unpackgrid.f unpackmsg.f unpacktext.f \ + xcor.f xfft.f wsjt65.f astro.f azdist.f coord.f dcoord.f \ + deg2grid.f dot.f ftsky.f geocentric.f GeoDist.f grid2deg.f \ + moon2.f MoonDop.f sun.f toxyz.f + +SRCS2C = resample.c ptt.c igray.c wrapkarn.c WSJT6.EXE: Audio.pyd wsjt.spec python c:\python23\installer\Build.py wsjt.spec -del WSJT6.EXE REN wsjt.exe WSJT6.EXE -Audio.pyd: $(OBJS2C) +Audio.pyd: $(OBJS2C) $(SRCS2F90) $(SRCS2F77) $(SRCS2C) python f2py.py -c \ --quiet --"fcompiler=compaqv" \ --opt="/traceback /fast /fpp /define:Win32" \ @@ -78,6 +91,6 @@ igray.obj: igray.c .PHONY : clean clean: - -del *.o *.obj JT65code.exe Audio.pyd + -del *.o *.obj JT65code.exe wsjt6.exe Audio.pyd diff --git a/Makefile_0.Win b/Makefile_0.Win deleted file mode 100644 index cc5e1fd67..000000000 --- a/Makefile_0.Win +++ /dev/null @@ -1,31 +0,0 @@ -#Makefile for WSJT -!include - -OBJS1 = pa_lib.o pa_win_mme.o jtaudio.o ... - -# Much more to be done, if this is to work! - -all: xcomdat.dll specjt2.dll tstsp.exe a2d.exe - -xcomdat.dll xcomdat.lib: xcomdat.f xcom.f - $(FOR) $(fflags) xcomdat.f /dll /link /section:.data,RWS - -specjt2.dll: specjt2.f xcom.f - $(FOR) $(fflags) specjt2.f /dll xcomdat.lib - -tstsp.exe: tstsp.f xcomdat.lib - $(FOR) $(fflags) tstsp.f xcomdat.lib specjt2.lib - -a2d.exe: a2d.f jtaudio.obj xcomdat.lib - $(FOR) $(fflags) /traceback /check:all a2d.f $(OBJS3) \ - /link winmm.lib xcomdat.lib - -clean: - -del xcomdat.dll - -del xcomdat.lib - -del xcomdat.exp - -del specjt2.dll - -del specjt2.lib - -del specjt2.exp - -del tstsp.exe - -del a2d.exe diff --git a/jtaudio.c b/jtaudio.c index 741ac1b8d..b39b7ea5c 100644 --- a/jtaudio.c +++ b/jtaudio.c @@ -37,11 +37,7 @@ typedef struct _SYSTEMTIME short Millisecond; } SYSTEMTIME; -#ifdef Win32 extern void __stdcall GetSystemTime(SYSTEMTIME *st); -#else -extern void GetSystemTime(SYSTEMTIME *st); -#endif // Input callback routine: static int SoundIn( void *inputBuffer, void *outputBuffer, diff --git a/syncf0.f b/syncf0.f index a55a47239..71207d331 100644 --- a/syncf0.f +++ b/syncf0.f @@ -1,4 +1,4 @@ - subroutine syncf0(data,jz,NTol,jstart,f0,smax) + subroutine syncf0(data,jz,NFreeze,NTol,jstart,f0,smax) C Does 512-pt FFTs of data with 256-pt step size. C Finds sync tone and determines aproximate values for jstart and f0. @@ -14,12 +14,17 @@ C Finds sync tone and determines aproximate values for jstart and f0. call zero(s2,6*128) !Clear average df=11025./512. - ia=(1076-NTol)/df - ib=(1076+Ntol)/df - nblk=jz/256 - 6 + + ia=(f0-400)/df + ib=(f0+400)/df + 0.999 + if(NFreeze.eq.1) then + ia=(f0-NTol)/df + ib=(f0+Ntol)/df + 0.999 + endif C Most of the time in this routine is in this loop. + nblk=jz/256 - 6 do n=1,nblk !Accumulate avg spectrum for j=256*(n-1)+1 !512-pt blocks, stepping by 256 call move(data(j),x,512) diff --git a/syncf1.f b/syncf1.f index 911af70d2..819c871da 100644 --- a/syncf1.f +++ b/syncf1.f @@ -1,4 +1,4 @@ - subroutine syncf1(data,jz,jstart,f0,NFreeze,smax,red) + subroutine syncf1(data,jz,jstart,f0,NFreeze,DFTolerance,smax,red) C Does 16k FFTs of data with stepsize 15360, using only "sync on" intervals. C Returns a refined value of f0, the sync-tone frequency. @@ -8,6 +8,7 @@ C Returns a refined value of f0, the sync-tone frequency. parameter (NQ=NFFT/4) parameter (NB3=3*512) real data(jz) !Raw data + integer DFTolerance real x(NFFT) real red(512) real s(NQ) !Ref spectrum for flattening and birdie-zapping @@ -41,6 +42,7 @@ C Accumulate a high-resolution average spectrum do i=1,NQ !Normalize s(i)=fac*s(i) enddo + call smooth(s,NQ) C NB: could also compute a "blue" spectrum, using the sync-off intervals. n8=NQ/8 @@ -52,14 +54,17 @@ C NB: could also compute a "blue" spectrum, using the sync-off intervals. red(i)=10.0*red(i)/(8.0*nz) enddo + + dftol=min(DFTolerance,25) + if(nfreeze.eq.1) dftol=DFTolerance C Find improved value for f0 smax=0. - ia=(f0-25.)/df - ib=(f0+25.)/df - if(NFreeze.eq.1) then - ia=(f0-5.)/df - ib=(f0+5.)/df - endif + ia=(f0-dftol)/df + ib=(f0+dftol)/df + 0.999 +! if(NFreeze.eq.1) then +! ia=(f0-5.)/df +! ib=(f0+5.)/df +! endif do i=ia,ib if(s(i).gt.smax) then smax=s(i) diff --git a/wsjt.py b/wsjt.py index c6889a15c..2eec00775 100644 --- a/wsjt.py +++ b/wsjt.py @@ -574,6 +574,7 @@ def ModeJT6M(event=NONE): isync=isync6m lsync.configure(text=slabel+str(isync)) shmsg.configure(state=DISABLED) + cbfreeze.configure(state=NORMAL) itol=5 inctol() ntx.set(1) @@ -973,6 +974,14 @@ def mouse_up_g1(event): # print event.x pass +#------------------------------------------------------ right_arrow +def right_arrow(event=NONE): + Audio.gcom2.mousedf=Audio.gcom2.mousedf+10 + +#------------------------------------------------------ left_arrow +def left_arrow(event=NONE): + Audio.gcom2.mousedf=Audio.gcom2.mousedf-10 + #------------------------------------------------------ GenStdMsgs def GenStdMsgs(event=NONE): t=ToRadio.get().upper().strip() @@ -1658,6 +1667,8 @@ root.bind_all('',decode_exclude) root.bind_all('',decode_exclude) root.bind_all('',lookup_gen) root.bind_all('',lookup_gen) +root.bind_all('',left_arrow) +root.bind_all('',right_arrow) text.pack(side=LEFT, fill=X, padx=1) sb = Scrollbar(iframe4, orient=VERTICAL, command=text.yview) diff --git a/wsjt1.f b/wsjt1.f index 2eb9f8750..c0e87f70d 100644 --- a/wsjt1.f +++ b/wsjt1.f @@ -197,10 +197,12 @@ ! For waterfall plot call spec2d(dat,jz,nstep,s2,nchan,nz,psavg,sigma) if(jz/11025.0.lt.3.9) go to 900 - call syncf0(dat,jz,DFTolerance,jstart,f0,smax) - if(NFreeze.eq.1) f0=1076.66 + + f0=1076.66 + if(NFreeze.eq.1) f0=1076.66+mousedf + call syncf0(dat,jz,NFreeze,DFTolerance,jstart,f0,smax) call synct(dat,jz,jstart,f0,smax) - call syncf1(dat,jz,jstart,f0,NFreeze,smax,red) + call syncf1(dat,jz,jstart,f0,NFreeze,DFTolerance,smax,red) f0a=f0 do i=1,512 diff --git a/wsjtrc.win b/wsjtrc.win index 878089ec8..045f70637 100644 --- a/wsjtrc.win +++ b/wsjtrc.win @@ -1,6 +1,6 @@ -*font: Arial 9 -*Label*font: Arial 9 -*Text*font: "Courier New" 10 +*font: Arial 8 +*Label*font: Arial 8 +*Text*font: "Courier New" 9 *background: gray85 *Text*background: white *Entry*background: white