mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-23 04:38:37 -05:00
Fix measure mode (and make its label yellow).
Enlarge the system packet buffersize. Include executable plrr.exe git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@475 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
9c9bdbd219
commit
309e59f234
5
map65.py
5
map65.py
@ -992,7 +992,10 @@ def update():
|
|||||||
i=g.rfnd(t,".")
|
i=g.rfnd(t,".")
|
||||||
t=t[:i]
|
t=t[:i]
|
||||||
if mode.get() != g.mode or first:
|
if mode.get() != g.mode or first:
|
||||||
msg1.configure(bg='#00FFFF')
|
if mode.get()[:4]=='JT65':
|
||||||
|
msg1.configure(bg='#00FFFF')
|
||||||
|
elif mode.get()=='Measure':
|
||||||
|
msg1.configure(bg='yellow')
|
||||||
g.mode=mode.get()
|
g.mode=mode.get()
|
||||||
first=0
|
first=0
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ subroutine map65a(newdat)
|
|||||||
|
|
||||||
pctlost=nlost/331.03
|
pctlost=nlost/331.03
|
||||||
if(ndebug.eq.2) write(*,3001) nutc,mod(int(sec_midn()),60),nlost,pctlost
|
if(ndebug.eq.2) write(*,3001) nutc,mod(int(sec_midn()),60),nlost,pctlost
|
||||||
3001 format('mod65a 1:',i5.4,i3.2,i8,f6.1,' %')
|
3001 format('mod65a 1:',i5.4,i3.2,i8,f7.2,' %')
|
||||||
|
|
||||||
rewind 11
|
rewind 11
|
||||||
rewind 12
|
rewind 12
|
||||||
@ -328,8 +328,9 @@ subroutine map65a(newdat)
|
|||||||
t3=sec_midn()
|
t3=sec_midn()
|
||||||
if(ndebug.eq.2) write(*,3003) mod(int(t3),60)
|
if(ndebug.eq.2) write(*,3003) mod(int(t3),60)
|
||||||
3003 format('mod65a 3:'i8.2)
|
3003 format('mod65a 3:'i8.2)
|
||||||
if(ndebug.eq.1) write(*,3004) nutc,mod(t2,60.0),mod(t3,60.0),pctlost
|
if(ndebug.eq.1) write(*,3004) nutc,mod(t2,60.0),mod(t3,60.0), &
|
||||||
3004 format('mod65a:',i5.4,1x,2f6.1,f8.2,' %')
|
nlost,pctlost
|
||||||
|
3004 format('mod65a:',i5.4,1x,2f6.1,i6,f8.2,' %')
|
||||||
endif
|
endif
|
||||||
nagain=0
|
nagain=0
|
||||||
|
|
||||||
|
40
plrr.f90
40
plrr.f90
@ -3,20 +3,54 @@ program plrr
|
|||||||
! Pseudo-Linrad "Receive" program
|
! Pseudo-Linrad "Receive" program
|
||||||
|
|
||||||
integer*1 userx_no,iusb
|
integer*1 userx_no,iusb
|
||||||
integer*2 nblock
|
integer*2 nblock,nblock0
|
||||||
real*8 center_freq,buf8
|
real*8 center_freq,buf8
|
||||||
|
logical first
|
||||||
common/plrscom/center_freq,msec,fselect,iptr,nblock,userx_no,iusb,buf8(174)
|
common/plrscom/center_freq,msec,fselect,iptr,nblock,userx_no,iusb,buf8(174)
|
||||||
|
data first/.true./
|
||||||
|
|
||||||
call setup_rsocket
|
call setup_rsocket
|
||||||
ns0=-99
|
ns0=-99
|
||||||
|
nlost=0
|
||||||
|
|
||||||
10 call recv_pkt(center_freq)
|
10 call recv_pkt(center_freq)
|
||||||
|
|
||||||
|
lost=nblock-nblock0-1
|
||||||
|
if(lost.ne.0 .and. .not.first) then
|
||||||
|
nb=nblock
|
||||||
|
if(nb.lt.0) nb=nb+65536
|
||||||
|
nb0=nblock0
|
||||||
|
if(nb0.lt.0) nb0=nb0+65536
|
||||||
|
print*,'Lost packets:',nb,nb0,lost
|
||||||
|
nlost=nlost + lost ! Insert zeros for the lost data.
|
||||||
|
! do i=1,174*lost
|
||||||
|
! k=k+1
|
||||||
|
! d8(k)=0
|
||||||
|
! enddo
|
||||||
|
first=.false.
|
||||||
|
nlost=nlost+lost
|
||||||
|
endif
|
||||||
|
nblock0=nblock
|
||||||
|
|
||||||
ns=mod(msec/1000,60)
|
ns=mod(msec/1000,60)
|
||||||
if(ns.ne.ns0) write(*,1010) ns,center_freq,0.001*msec,sec_midn()
|
if(ns.ne.ns0) write(*,1010) ns,center_freq,0.001*msec,sec_midn(),nlost
|
||||||
1010 format('ns:',i3,' f0:',f10.3,' t1:',f10.3,' t2:',f10.3)
|
1010 format('ns:',i3,' f0:',f10.3,' t1:',f10.3,' t2:',f10.3,i8)
|
||||||
ns0=ns
|
ns0=ns
|
||||||
go to 10
|
go to 10
|
||||||
|
|
||||||
end program plrr
|
end program plrr
|
||||||
|
|
||||||
! To compile: % gfortran -o plrr plrr.f90 plrr_subs.c
|
! To compile: % gfortran -o plrr plrr.f90 plrr_subs.c
|
||||||
|
|
||||||
|
|
||||||
|
real function sec_midn()
|
||||||
|
real*8 sec8,hrtime
|
||||||
|
sec_midn=secnds(0.0)
|
||||||
|
return
|
||||||
|
end function sec_midn
|
||||||
|
|
||||||
|
subroutine sleep_msec(n)
|
||||||
|
use dflib
|
||||||
|
call sleepqq(n)
|
||||||
|
return
|
||||||
|
end subroutine sleep_msec
|
||||||
|
@ -15,6 +15,7 @@ void setup_rsocket_(void)
|
|||||||
{
|
{
|
||||||
struct ip_mreq mreq;
|
struct ip_mreq mreq;
|
||||||
u_int yes=1;
|
u_int yes=1;
|
||||||
|
int sndsize;
|
||||||
|
|
||||||
// Make sure that we have compatible Winsock support
|
// Make sure that we have compatible Winsock support
|
||||||
WORD wVersionRequested;
|
WORD wVersionRequested;
|
||||||
@ -75,6 +76,15 @@ void setup_rsocket_(void)
|
|||||||
perror("setsockopt");
|
perror("setsockopt");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
err=getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&sndsize,
|
||||||
|
(int)sizeof(sndsize));
|
||||||
|
printf("sndsize: %d %d\n",sndsize,err);
|
||||||
|
sndsize=65536;
|
||||||
|
err=setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&sndsize,
|
||||||
|
(int)sizeof(sndsize));
|
||||||
|
err=getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&sndsize,
|
||||||
|
(int)sizeof(sndsize));
|
||||||
|
printf("sndsize: %d %d\n",sndsize,err);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void __stdcall RECV_PKT(char buf[])
|
//void __stdcall RECV_PKT(char buf[])
|
||||||
|
20
recvpkt.F90
20
recvpkt.F90
@ -21,7 +21,7 @@ subroutine recvpkt(iarg)
|
|||||||
include 'gcom2.f90'
|
include 'gcom2.f90'
|
||||||
equivalence (id,d8)
|
equivalence (id,d8)
|
||||||
data nblock0/0/,first/.true./,kb/1/,ntx/0/,npkt/0/,nw/0/
|
data nblock0/0/,first/.true./,kb/1/,ntx/0/,npkt/0/,nw/0/
|
||||||
data sqave/0.0/,u/0.001/,rxnoise/0.0/,kbuf/1/
|
data sqave/0.0/,u/0.001/,rxnoise/0.0/,kbuf/1/,lost_tot/0/
|
||||||
save
|
save
|
||||||
|
|
||||||
call setup_rsocket ! Open socket to receive multicast data
|
call setup_rsocket ! Open socket to receive multicast data
|
||||||
@ -39,17 +39,19 @@ subroutine recvpkt(iarg)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
lost=nblock-nblock0-1
|
lost=nblock-nblock0-1
|
||||||
nblock0=nblock
|
|
||||||
|
|
||||||
if(lost.ne.0 .and. .not.first) then
|
if(lost.ne.0 .and. .not.first) then
|
||||||
! print*,'Lost packets:',nblock,nblock0,lost
|
nb=nblock
|
||||||
nlost=nlost + lost ! Insert zeros for the lost data.
|
if(nb.lt.0) nb=nb+65536
|
||||||
|
nb0=nblock0
|
||||||
|
if(nb0.lt.0) nb0=nb0+65536
|
||||||
|
if(ndebug.eq.2) print*,'Lost packets:',nb0,nb,lost
|
||||||
|
lost_tot=lost_tot + lost ! Insert zeros for the lost data.
|
||||||
do i=1,174*lost
|
do i=1,174*lost
|
||||||
k=k+1
|
k=k+1
|
||||||
d8(k)=0
|
d8(k)=0
|
||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
first=.false.
|
nblock0=nblock
|
||||||
|
|
||||||
nsec=msec/1000
|
nsec=msec/1000
|
||||||
if(mod(nsec,60).eq.1) nreset=1
|
if(mod(nsec,60).eq.1) nreset=1
|
||||||
@ -59,7 +61,7 @@ subroutine recvpkt(iarg)
|
|||||||
kb=3-kb
|
kb=3-kb
|
||||||
k=0
|
k=0
|
||||||
if(kb.eq.2) k=NSMAX
|
if(kb.eq.2) k=NSMAX
|
||||||
nlost=0
|
lost_tot=0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if(kb.eq.1 .and. (k+174).gt.NSMAX) go to 20
|
if(kb.eq.1 .and. (k+174).gt.NSMAX) go to 20
|
||||||
@ -80,8 +82,10 @@ subroutine recvpkt(iarg)
|
|||||||
if(npkt.ge.551) then
|
if(npkt.ge.551) then
|
||||||
npkt=0
|
npkt=0
|
||||||
nw=nw+1
|
nw=nw+1
|
||||||
|
rewind 11
|
||||||
write(11,1000) nw,rxnoise
|
write(11,1000) nw,rxnoise
|
||||||
1000 format(i6,f8.2)
|
1000 format(i6,f8.2)
|
||||||
|
write(11,*) '$EOF'
|
||||||
call flushqqq(11)
|
call flushqqq(11)
|
||||||
ndecdone=1
|
ndecdone=1
|
||||||
write(24,1000) nw,rxnoise
|
write(24,1000) nw,rxnoise
|
||||||
@ -115,8 +119,10 @@ subroutine recvpkt(iarg)
|
|||||||
kk=k
|
kk=k
|
||||||
if(ndebug.eq.2) write(*,3002) nutc,mod(int(sec_midn()),60),ns
|
if(ndebug.eq.2) write(*,3002) nutc,mod(int(sec_midn()),60),ns
|
||||||
3002 format('recvpkt 2:',i5.4,2i3.2)
|
3002 format('recvpkt 2:',i5.4,2i3.2)
|
||||||
|
nlost=lost_tot ! Save stats for printout
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
first=.false.
|
||||||
go to 10
|
go to 10
|
||||||
|
|
||||||
end subroutine recvpkt
|
end subroutine recvpkt
|
||||||
|
Loading…
Reference in New Issue
Block a user