New format for end-of-line flags in JT4 and JT65; starting work on

establishing sync in JT4.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6685 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-05-19 16:13:51 +00:00
parent 21283cd475
commit 1531f3ad3b
3 changed files with 46 additions and 58 deletions

View File

@ -142,7 +142,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
contains
subroutine jt4_decoded(this,snr,dt,freq,have_sync,sync,is_deep, &
decoded,qual,ich,is_average,ave)
decoded0,qual,ich,is_average,ave)
implicit none
class(jt4_decoder), intent(inout) :: this
integer, intent(in) :: snr
@ -151,45 +151,35 @@ contains
logical, intent(in) :: have_sync
logical, intent(in) :: is_deep
character(len=1), intent(in) :: sync
character(len=22), intent(in) :: decoded
character(len=22), intent(in) :: decoded0
real, intent(in) :: qual
integer, intent(in) :: ich
logical, intent(in) :: is_average
integer, intent(in) :: ave
character*2 :: cqual
character*22 decoded
character*3 cflags
! write(*,3001) 'A',have_sync,is_deep,is_average,int(qual),ave,decoded
!3001 format(a1,3L2,2i4,1x,a22)
if (have_sync) then
write(cqual, '(i2)') int(qual)
if(int(qual).eq.99) cqual=' f'
if (int(qual).gt.0) then
if (ave.gt.0) then
write(*,1000) params%nutc,snr,dt,freq,sync,decoded,cqual, &
char(ichar('A')+ich-1),ave
else
write(*,1000) params%nutc,snr,dt,freq,sync,decoded,cqual, &
char(ichar('A')+ich-1)
end if
else
if (ave.gt.0) then
if(int(qual).eq.99) cqual=' f'
write(*,1000) params%nutc,snr,dt,freq,sync,decoded,cqual, &
char(ichar('A')+ich-1),ave
else
if(int(qual).le.0) then
write(*,1000) params%nutc,snr,dt,freq,sync
else
write(*,1000) params%nutc,snr,dt,freq,sync,decoded,cqual, &
char(ichar('A')+ich-1)
endif
endif
end if
decoded=decoded0
! write(*,3001) 'A',is_deep,is_average,int(qual),ave,decoded
!3001 format(a1,2L2,2i4,1x,a22)
cflags='f '
if(is_deep) then
cflags(1:2)='d1'
write(cflags(3:3),'(i1)') min(int(qual),9)
if(qual.ge.10.0) cflags(3:3)='*'
if(qual.lt.3.0) decoded(22:22)='?'
endif
if(is_average) then
write(cflags(2:2),'(i1)') min(ave,9)
if(ave.ge.10) cflags(2:2)='*'
endif
write(*,1000) params%nutc,snr,dt,freq,sync,decoded,cflags
1000 format(i4.4,i4,f5.1,i5,1x,'$',a1,1x,a22,1x,a3)
else
write(*,1000) params%nutc,snr,dt,freq
end if
1000 format(i4.4,i4,f5.1,i5,1x,'$',a1,1x,a22,a2,1x,a1,i3)
select type(this)
type is (counting_jt4_decoder)
@ -238,28 +228,28 @@ contains
integer, intent(in) :: minsync
integer i,n
character*5 ctail,decoded*22,csync*2
character*36 c
data c/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/
logical have_sync,is_deep,is_average
character decoded*22,csync*2,cflags*3
!$omp critical(decode_results)
decoded=decoded0
if(ft.eq.0 .and. minsync.ge.0 .and. int(sync).lt.minsync) then
write(*,1010) params%nutc,snr,dt,freq
else
ctail=' '
cflags=' '
is_deep=ft.eq.2
is_average=nsum.ge.2
if(params%naggressive.gt.0 .and. ft.gt.0) then
ctail(1:1)='d'
if(ft.eq.1) ctail(1:1)='f'
n=max(2,nsum+1)
n=min(n,36)
ctail(2:2)=c(n:n)
n=min(nsmo+1,36)
if(params%nsubmode.gt.0) ctail(3:3)=c(n:n)
if(ft.eq.2) then
ctail(5:5)='*'
if(qual.le.9) ctail(5:5)=char(48+qual)
if(qual.lt.3) decoded(21:21)='?'
cflags='f '
if(is_deep) then
cflags(1:2)='d1'
write(cflags(3:3),'(i1)') min(qual,9)
if(qual.ge.10) cflags(3:3)='*'
if(qual.lt.3) decoded(22:22)='?'
endif
if(is_average) then
write(cflags(2:2),'(i1)') min(nsum,9)
if(nsum.ge.10) cflags(2:2)='*'
endif
endif
csync='# '
@ -273,14 +263,13 @@ contains
do i=22,1,-1
if(decoded(i:i).ne.' ') exit
enddo
! write(*,*) 'C',i,decoded
if(i.gt.18) i=18
decoded(i+2:i+4)='OOO'
endif
endif
endif
write(*,1010) params%nutc,snr,dt,freq,csync,decoded,ctail
1010 format(i4.4,i4,f5.1,i5,1x,a2,1x,a22,a5)
write(*,1010) params%nutc,snr,dt,freq,csync,decoded,cflags
1010 format(i4.4,i4,f5.1,i5,1x,a2,1x,a22,1x,a3)
endif
write(13,1012) params%nutc,nint(sync),snr,dt,float(freq),drift, &

View File

@ -62,7 +62,7 @@ contains
character(len=6), intent(in) :: hisgrid
procedure(jt4_average_callback), optional :: average_callback
real*4 dat(30*12000)
real*4 dat(30*11025)
character*6 cfile6
this%decode_callback => decode_callback
@ -158,16 +158,19 @@ contains
z(1:458,1:65)=zz(274:731,1:65,ich)
call zplt(z,ich-4,syncz,dtxz,nfreqz,flipz,sync2z,0,emedelay,dttol, &
nfqso,ntol)
if(ich.eq.5) then
dtxzz=dtxz
nfreqzz=nfreqz
endif
enddo
call timer('zplt ',1)
! Use results from zplt
!### NB: JT4 is severely "sync limited" at present... (Maybe not still true???)
!### TESTS ONLY! ###
nfreqz=1000
dtxz=0.0
flipz=1.0
syncz=5.0
!###
flip=flipz
sync=syncz
snrx=db(sync) - 26.

View File

@ -2072,11 +2072,7 @@ void MainWindow::readFromStdout() //readFromStdout
QByteArray t=proc_jt9.readLine();
bool bAvgMsg=false;
int navg=0;
if(m_mode=="JT4") {
t=t.mid(0,39) + t.mid(42,t.length()-42);
bAvgMsg=(t.length()>49);
}
if(m_mode=="JT65") {
if(m_mode=="JT4" or m_mode=="JT65") {
int n=t.indexOf("f");
if(n<0) n=t.indexOf("d");
if(n>0) {