diff --git a/Makefile.win b/Makefile.win index d171f1b63..eddc7e255 100644 --- a/Makefile.win +++ b/Makefile.win @@ -1,88 +1,88 @@ -#Makefile for Windows -!include #Some definitions for Compaq Visual Fortran -gcc = cl -FC = df -#To do bounds checking (with useless reports) put "/check:all" in the -# --opt= line below (line 56, more or less ...) -#FFLAGS = /traceback /check:all -FFLAGS = /traceback /fast /nologo /check:all - -all: MAP65.EXE - -OBJS2C = init_rs.o encode_rs.o decode_rs.o jtaudio.o - -F2PYONLY = ftn_init ftn_quit audio_init getfile azdist0 astro0 \ - spec map65a0 - -SRCS2F90 = a2d.f90 astro0.f90 audio_init.f90 azdist0.f90 \ - decode1.f90 ftn_init.f90 ftn_quit.f90 wsjtgen.f90 \ - runqqq.f90 fivehz.f90 flushqqq.f90 map65a0.f90 \ - rfile.f90 rfile3a.f90 spec.f90 map65a.f90 display.F90 \ - getfile.f90 getfile2.f90 - -SRCS2F77 = indexx.f gen65.f chkmsg.f \ - gentone.f gencwid.f set.f db.f pctile.f sort.f ssort.f \ - avemsg65.f demod64a.f encode65.f extract.f four2a.f getpfx1.f \ - getpfx2.f graycode.f grid2k.f interleave63.f k2grid.f \ - deep65.f morse.f nchar.f packcall.f packgrid.f \ - packmsg.f packtext.f setup65.f unpackcall.f unpackgrid.f \ - unpackmsg.f unpacktext.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 pfxdump.f \ - symspec.f ccf65.f trimlist.f chkhist.f decode1a.f \ - filbig.f fil659.f fil658.f fil6521.f twkfreq.f decode65b.f \ - afc65b.f fchisq.f ccf2.f - -SRCS2C = resample.c ptt.c igray.c wrapkarn.c rfile3.c wfile3.c - -MAP65.EXE: Audio.pyd map65.spec - python c:\python23\installer\Build.py map65.spec - -Audio.pyd: $(OBJS2C) $(SRCS2F90) $(SRCS2F77) $(SRCS2C) - python f2py.py -c \ - --quiet --"fcompiler=compaqv" \ - --opt="/nologo /traceback /warn:errors /fast /fpp /define:Win32 \ - /define:USE_PORTAUDIO" \ - $(OBJS2C) \ - -lwinmm -lpa -lfftw3single -llibsamplerate \ - -m Audio \ - only: $(F2PYONLY) : \ - $(SRCS2F90) $(SRCS2F77) $(SRCS2C) - -map65.spec: map65.py astro.py g.py options.py palettes.py smeter.py specjt.py - python c:\python23\installer\makespec.py --icon wsjt.ico \ - --tk --onefile map65.py - -jtaudio.o: jtaudio.c - $(CC) /nologo /c /DWin32 /Fojtaudio.o jtaudio.c - -init_rs.obj: init_rs.c - $(CC) /nologo /c /DBIGSYM=1 init_rs.c - -init_rs.o: init_rs.c - $(CC) /nologo /c /DBIGSYM=1 /Foinit_rs.o init_rs.c - -encode_rs.obj: encode_rs.c - $(CC) /nologo /c /DBIGSYM=1 encode_rs.c - -encode_rs.o: encode_rs.c - $(CC) /nologo /c /DBIGSYM=1 /Foencode_rs.o encode_rs.c - -decode_rs.obj: decode_rs.c - $(CC) /nologo /c /DBIGSYM=1 decode_rs.c - -decode_rs.o: decode_rs.c - $(CC) /nologo /c /DBIGSYM=1 /Ox /Zd /Fodecode_rs.o decode_rs.c - -wrapkarn.obj: wrapkarn.c - $(CC) /nologo /c /DWin32=1 wrapkarn.c - -igray.obj: igray.c - $(CC) /nologo /c /DWin32=1 igray.c - -.PHONY : clean - -clean: - -del *.o *.obj MAP65.EXE Audio.pyd - - +#Makefile for Windows +!include #Some definitions for Compaq Visual Fortran +gcc = cl +FC = df +#To do bounds checking (with useless reports) put "/check:all" in the +# --opt= line below (line 56, more or less ...) +#FFLAGS = /traceback /check:all +FFLAGS = /traceback /fast /nologo /check:all + +all: MAP65.EXE + +OBJS2C = init_rs.o encode_rs.o decode_rs.o jtaudio.o + +F2PYONLY = ftn_init ftn_quit audio_init getfile azdist0 astro0 \ + spec map65a0 + +SRCS2F90 = a2d.f90 astro0.f90 audio_init.f90 azdist0.f90 \ + decode1.f90 ftn_init.f90 ftn_quit.f90 wsjtgen.f90 \ + runqqq.f90 fivehz.f90 flushqqq.f90 map65a0.f90 \ + rfile.f90 rfile3a.f90 spec.f90 map65a.f90 display.F90 \ + getfile.f90 getfile2.f90 + +SRCS2F77 = indexx.f gen65.f chkmsg.f \ + gentone.f gencwid.f set.f db.f pctile.f sort.f ssort.f \ + avemsg65.f demod64a.f encode65.f extract.f four2a.f getpfx1.f \ + getpfx2.f graycode.f grid2k.f interleave63.f k2grid.f \ + deep65.f morse.f nchar.f packcall.f packgrid.f \ + packmsg.f packtext.f setup65.f unpackcall.f unpackgrid.f \ + unpackmsg.f unpacktext.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 pfxdump.f \ + symspec.f ccf65.f trimlist.f chkhist.f decode1a.f \ + filbig.f fil659.f fil658.f fil6521.f twkfreq.f decode65b.f \ + afc65b.f fchisq.f ccf2.f + +SRCS2C = resample.c ptt.c igray.c wrapkarn.c rfile3.c wfile3.c + +MAP65.EXE: Audio.pyd map65.spec + python c:\python23\installer\Build.py map65.spec + +Audio.pyd: $(OBJS2C) $(SRCS2F90) $(SRCS2F77) $(SRCS2C) + python f2py.py -c \ + --quiet --"fcompiler=compaqv" \ + --opt="/nologo /traceback /warn:errors /fast /fpp /define:Win32 \ + /define:USE_PORTAUDIO" \ + $(OBJS2C) \ + -lwinmm -lpa -lfftw3single -llibsamplerate \ + -m Audio \ + only: $(F2PYONLY) : \ + $(SRCS2F90) $(SRCS2F77) $(SRCS2C) + +map65.spec: map65.py astro.py g.py options.py palettes.py smeter.py specjt.py + python c:\python23\installer\makespec.py --icon wsjt.ico \ + --tk --onefile map65.py + +jtaudio.o: jtaudio.c + $(CC) /nologo /c /DWin32 /Fojtaudio.o jtaudio.c + +init_rs.obj: init_rs.c + $(CC) /nologo /c /DBIGSYM=1 init_rs.c + +init_rs.o: init_rs.c + $(CC) /nologo /c /DBIGSYM=1 /Foinit_rs.o init_rs.c + +encode_rs.obj: encode_rs.c + $(CC) /nologo /c /DBIGSYM=1 encode_rs.c + +encode_rs.o: encode_rs.c + $(CC) /nologo /c /DBIGSYM=1 /Foencode_rs.o encode_rs.c + +decode_rs.obj: decode_rs.c + $(CC) /nologo /c /DBIGSYM=1 decode_rs.c + +decode_rs.o: decode_rs.c + $(CC) /nologo /c /DBIGSYM=1 /Ox /Zd /Fodecode_rs.o decode_rs.c + +wrapkarn.obj: wrapkarn.c + $(CC) /nologo /c /DWin32=1 wrapkarn.c + +igray.obj: igray.c + $(CC) /nologo /c /DWin32=1 igray.c + +.PHONY : clean + +clean: + -del *.o *.obj MAP65.EXE Audio.pyd + + diff --git a/audio_init.F90 b/audio_init.F90 index 71bb696ea..fc62feced 100644 --- a/audio_init.F90 +++ b/audio_init.F90 @@ -3,8 +3,8 @@ subroutine audio_init(ndin,ndout) #ifdef Win32 use dfmt - integer Thread1,Thread2 - external a2d,decode1 + integer Thread1,Thread2,Thread3 + external a2d,decode1,recvpkt #endif include 'gcom1.f90' @@ -44,8 +44,10 @@ subroutine audio_init(ndin,ndout) ! THREAD_PRIORITY_TIME_CRITICAL 15 m0=SetPriorityClass(GetCurrentProcess(),NORMAL_PRIORITY_CLASS) +! m0=SetPriorityClass(GetCurrentProcess(),HIGH_PRIORITY_CLASS) ! Start a thread for doing A/D and D/A with sound card. +! (actually, only D/A is used in MAP65) Thread1=CreateThread(0,0,a2d,0,CREATE_SUSPENDED,id1) m1=SetThreadPriority(Thread1,THREAD_PRIORITY_ABOVE_NORMAL) m2=ResumeThread(Thread1) @@ -54,6 +56,12 @@ subroutine audio_init(ndin,ndout) Thread2=CreateThread(0,0,decode1,0,CREATE_SUSPENDED,id2) m3=SetThreadPriority(Thread2,THREAD_PRIORITY_BELOW_NORMAL) m4=ResumeThread(Thread2) + +! Start a thread to receive packets from Linrad + Thread3=CreateThread(0,0,recvpkt,0,CREATE_SUSPENDED,id3) + m5=SetThreadPriority(Thread3,THREAD_PRIORITY_ABOVE_NORMAL) + m6=ResumeThread(Thread3) + #else ! print*,'Audio INIT called.' ierr=start_threads(ndevin,ndevout,y1,y2,nmax,iwrite,iwave,nwave, & diff --git a/decode1.F90 b/decode1.F90 index ec11c3a96..2714e7ac5 100644 --- a/decode1.F90 +++ b/decode1.F90 @@ -9,10 +9,8 @@ subroutine decode1(iarg) character sending0*28,mode0*6,cshort*11 integer sendingsh0 - character*80 fname80 - parameter (NSMAX=60*96000) !Samples per 60 s file - integer*2 id(4,NSMAX) !46 MB: raw data from Linrad timf2 - common/datcom/nutc,newdat2,id,fname80,nlen + + include 'datcom.f90' include 'gcom1.f90' include 'gcom2.f90' include 'gcom3.f90' diff --git a/getfile.F90 b/getfile.F90 index 5043fe91c..bf10e5eaf 100644 --- a/getfile.F90 +++ b/getfile.F90 @@ -1,10 +1,8 @@ !----------------------------------------------------- getfile subroutine getfile(fname,len) character*(*) fname - character*80 fname80 - parameter (NSMAX=60*96000) !Samples per 60 s file - integer*2 id(4,NSMAX) !46 MB: raw data from Linrad timf2 - common/datcom/nutc,newdat2,id,fname80,nlen + + include 'datcom.f90' include 'gcom2.f90' fname80=fname diff --git a/getfile2.F90 b/getfile2.F90 index ecc5b3609..933342846 100644 --- a/getfile2.F90 +++ b/getfile2.F90 @@ -7,9 +7,8 @@ subroutine getfile2(fname,len) parameter (NDMAX=661500) ! =60*11025 character*(*) fname character infile*15 - parameter (NSMAX=60*96000) !Samples per 60 s file - integer*2 id(4,NSMAX) !46 MB: raw data from Linrad timf2 - common/datcom/nutc,newdat2,id + + include 'datcom.f90' include 'gcom1.f90' include 'gcom2.f90' include 'gcom4.f90' diff --git a/map65a.f90 b/map65a.f90 index f41f088d7..9243c39f6 100644 --- a/map65a.f90 +++ b/map65a.f90 @@ -16,16 +16,16 @@ subroutine map65a integer indx(MAXMSG),nsiz(MAXMSG) logical done(MAXMSG) character decoded*22,blank*22 - parameter (NSMAX=60*96000) !Samples per 60 s file - integer*2 id(4,NSMAX) !46 MB: raw data from Linrad timf2 - common/datcom/nutc,newdat2,id + include 'datcom.f90' common/spcom/ip0,ss(4,322,NFFT),ss5(322,NFFT) data blank/' '/ data shmsg0/'ATT','RO ','RRR','73 '/ data nfile/0/,nutc0/-999/,nid/0/ + include 'gcom2.f90' save - include 'gcom2.f90' +! print*,'A',newdat2,nutc,nfile + if(newdat2.eq.0) newdat2=1 !### if(newdat2.gt.0) nid=1 if(nid.eq.0) go to 999 @@ -70,8 +70,15 @@ subroutine map65a nfilt=2 !nfilt=2 is faster for selected freq freq=fselect dt=2.314240 !Not needed? +! print*,'B',newdat2,nfilt,freq,nflip,ip0 + + write(*,3001) newdat2,nfilt,nflip,ip0,freq, & + (id(1,i),id(2,i),id(3,i),id(4,i),i=1,2) + 3001 format(4i5,f10.3,8i5) + call decode1a(id,newdat2,nfilt,freq,nflip,ip0,sync2, & a,dt,pol,nkv,nhist,qual,decoded) +! print*,'C',nkv,qual,decoded nsync1=0 nsync2=nint(10.0*log10(sync2)) - 40 !### empirical ### ndf=nint(a(1)) @@ -291,5 +298,6 @@ subroutine map65a call display ndecdone=2 -999 return +999 newdat2=0 + return end subroutine map65a