Make it compile on Linux.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@405 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2007-06-22 14:38:03 +00:00
parent ce3af81327
commit dfd8b44002
3 changed files with 39 additions and 16 deletions

View File

@ -38,7 +38,7 @@ F2PY = @F2PY@
### ###
all: Audio.so all: Audio.so
OBJS2C = init_rs.o encode_rs.o decode_rs.o OBJS2C = init_rs.o encode_rs.o decode_rs.o plrr_subs.o
F2PYONLY = ftn_init ftn_quit audio_init getfile azdist0 astro0 \ F2PYONLY = ftn_init ftn_quit audio_init getfile azdist0 astro0 \
spec map65a0 spec map65a0
@ -47,7 +47,7 @@ SRCS2F90 = astro0.F90 audio_init.F90 azdist0.f90 \
decode1.F90 ftn_init.F90 ftn_quit.f90 wsjtgen.F90 \ decode1.F90 ftn_init.F90 ftn_quit.f90 wsjtgen.F90 \
runqqq.F90 fivehz.F90 flushqqq.F90 map65a0.f90 \ runqqq.F90 fivehz.F90 flushqqq.F90 map65a0.f90 \
rfile.f90 rfile3a.f90 spec.f90 map65a.f90 display.F90 \ rfile.f90 rfile3a.f90 spec.f90 map65a.f90 display.F90 \
getfile.F90 getfile2.F90 getfile.F90 getfile2.F90 recvpkt.F90
SRCS2F77 = indexx.f gen65.f chkmsg.f \ SRCS2F77 = indexx.f gen65.f chkmsg.f \
gentone.f gencwid.f set.f db.f pctile.f sort.f ssort.f \ gentone.f gencwid.f set.f db.f pctile.f sort.f ssort.f \

View File

@ -5,18 +5,29 @@ program plrs
integer RMODE integer RMODE
parameter(RMODE=0) parameter(RMODE=0)
parameter (NBPP=1392,NPPR=184) parameter (NBPP=1392)
parameter (NBYTES=NBPP*NPPR,NZ=NBYTES/8) parameter (NZ=60*96000)
parameter (NRECS=1979) parameter (NBYTES=8*NZ)
parameter (NPPR=NBYTES/NBPP)
integer*1 userx_no,iusb integer*1 userx_no,iusb
integer*2 nblock integer*2 nblock
real*8 d(NZ),buf8 real*8 d(NZ),buf8
integer fd integer fd
integer open,read,close integer open,read,close
integer nm(11)
character*8 fname character*8 fname
real*8 center_freq,dmsec,dtmspacket real*8 center_freq,dmsec,dtmspacket,tmsec
common/plrscom/center_freq,msec,fselect,iptr,nblock,userx_no,iusb,buf8(174) common/plrscom/center_freq,msec2,fsample,iptr,nblock,userx_no,iusb,buf8(174)
! 8 4 4 4 2 1 1 1392 ! 8 4 4 4 2 1 1 1392
data nm/45,46,48,50,52,54,55,56,57,58,59/
data nblock/0/
nargs=iargc()
if(nargs.ne.1) then
print*,'Usage: plrs <iters>'
go to 999
endif
fname="all.tf2"//char(0) fname="all.tf2"//char(0)
iters=1 iters=1
@ -24,7 +35,7 @@ program plrs
iusb=1 iusb=1
center_freq=144.125d0 center_freq=144.125d0
dtmspacket=1000.d0*NBPP/(8.d0*96000.d0) dtmspacket=1000.d0*NBPP/(8.d0*96000.d0)
fselect=128.0 + 1.6 + 0.220 fsample=96000.0
npkt=0 npkt=0
call setup_ssocket !Open a socket for multicasting call setup_ssocket !Open a socket for multicasting
@ -34,7 +45,10 @@ program plrs
dmsec=-dtmspacket dmsec=-dtmspacket
nsec0=time() nsec0=time()
do irec=1,NRECS do ifile=1,11
print*,'Reading file',ifile
ns0=0
tmsec=1000*(3600*7 + 60*nm(ifile))-dtmspacket
nr=read(fd,d,NBYTES) nr=read(fd,d,NBYTES)
if(nr.ne.NBYTES) then if(nr.ne.NBYTES) then
print*,'Error reading file all.tf2' print*,'Error reading file all.tf2'
@ -44,21 +58,27 @@ program plrs
k=0 k=0
do ipacket=1,NPPR do ipacket=1,NPPR
dmsec=dmsec+dtmspacket dmsec=dmsec+dtmspacket
tmsec=tmsec+dtmspacket
msec2=nint(tmsec)
msec=nint(dmsec) msec=nint(dmsec)
do i=1,NBPP/8 do i=1,NBPP/8
k=k+1 k=k+1
buf8(i)=d(k) buf8(i)=d(k)
enddo enddo
nblock=nblock+1
call send_pkt(center_freq) call send_pkt(center_freq)
npkt=npkt+1 npkt=npkt+1
if(mod(npkt,100).eq.0) then if(mod(npkt,100).eq.0) then
nsec=time()-nsec0 nsec=time()-nsec0
nwait=msec-1000*nsec nwait=msec-1000*nsec
if(mod(npkt,1000).eq.0) write(*,1010) npkt,nsec,0.001*msec,nwait
1010 format('npkt:',i10,' nsec:',i6,' t:',f10.3,' nwait:',i8)
! Pace the data at close to its real-time rate ! Pace the data at close to its real-time rate
if(nwait.gt.0) call usleep(nwait*1000) if(nwait.gt.0) call usleep(nwait*1000)
endif endif
ns=mod(msec2/1000,60)
if(ns.ne.ns0) write(*,1010) npkt,ns,0.001*msec2,nwait
1010 format('npkt:',i10,' ns:',i6,' t:',f10.3,' nwait:',i8)
ns0=ns
enddo enddo
enddo enddo
i=close(fd) i=close(fd)

View File

@ -5,8 +5,9 @@
#include <time.h> #include <time.h>
#include <sys/time.h> #include <sys/time.h>
extern void decode1_(int *iarg);
extern void a2d_(int *iarg); extern void a2d_(int *iarg);
extern void decode1_(int *iarg);
extern void recvpkt_(int *iarg);
int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[],
int *nbuflen, int *iwrite, short iwave[], int *nbuflen, int *iwrite, short iwave[],
@ -15,13 +16,15 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[],
int *Transmitting, double *Tsec, int *ngo, int *nmode, int *Transmitting, double *Tsec, int *ngo, int *nmode,
double tbuf[], int *ibuf, int *ndsec) double tbuf[], int *ibuf, int *ndsec)
{ {
pthread_t thread1,thread2; pthread_t thread1,thread2,thread3;
int iret1,iret2; int iret1,iret2,iret3;
int iarg1 = 1,iarg2 = 2; int iarg1=1, iarg2=2, iarg3=3;
/* snd_pcm_start */ /* snd_pcm_start */
// printf("start_threads: creating thread for a2d\n"); // printf("start_threads: creating thread for a2d\n");
iret1 = pthread_create(&thread1,NULL,a2d_,&iarg1); iret1 = pthread_create(&thread1,NULL,a2d_,&iarg1);
// printf("start_threads: creating thread for decode1_\n"); // printf("start_threads: creating thread for decode1_\n");
iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2);
// printf("start_threads: creating thread for recvpkt_\n");
iret3 = pthread_create(&thread3,NULL,recvpkt_,&iarg3);
} }