Enable passing decodes back to caller

This commit is contained in:
Bill Somerville 2020-06-18 23:33:36 +01:00
parent 72005888ac
commit 402ce1b3fb
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
3 changed files with 42 additions and 40 deletions

View File

@ -677,43 +677,43 @@ contains
return
end subroutine ft4_decoded
! subroutine fst280_decoded (this,sync,nsnr,dt,freq,decoded,nap,qual)
subroutine fst280_decoded (this,sync,nsnr,dt,freq,decoded,nap,qual)
! use fst280_decode
! implicit none
use fst280_decode
implicit none
! class(fst280_decoder), intent(inout) :: this
! real, intent(in) :: sync
! integer, intent(in) :: nsnr
! real, intent(in) :: dt
! real, intent(in) :: freq
! character(len=37), intent(in) :: decoded
! integer, intent(in) :: nap
! real, intent(in) :: qual
! character*2 annot
! character*37 decoded0
class(fst280_decoder), intent(inout) :: this
real, intent(in) :: sync
integer, intent(in) :: nsnr
real, intent(in) :: dt
real, intent(in) :: freq
character(len=37), intent(in) :: decoded
integer, intent(in) :: nap
real, intent(in) :: qual
character*2 annot
character*37 decoded0
! decoded0=decoded
! annot=' '
! if(nap.ne.0) then
! write(annot,'(a1,i1)') 'a',nap
! if(qual.lt.0.17) decoded0(37:37)='?'
! endif
decoded0=decoded
annot=' '
if(nap.ne.0) then
write(annot,'(a1,i1)') 'a',nap
if(qual.lt.0.17) decoded0(37:37)='?'
endif
! write(*,1001) params%nutc,nsnr,dt,nint(freq),decoded0,annot
!1001 format(i6.6,i4,f5.1,i5,' + ',1x,a37,1x,a2)
! write(13,1002) params%nutc,nint(sync),nsnr,dt,freq,0,decoded0
!1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a37,' FST280')
write(*,1001) params%nutc,nsnr,dt,nint(freq),decoded0,annot
1001 format(i6.6,i4,f5.1,i5,' + ',1x,a37,1x,a2)
write(13,1002) params%nutc,nint(sync),nsnr,dt,freq,0,decoded0
1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a37,' FST280')
! call flush(6)
! call flush(13)
call flush(6)
call flush(13)
! select type(this)
! type is (counting_fst280_decoder)
! this%decoded = this%decoded + 1
! end select
select type(this)
type is (counting_fst280_decoder)
this%decoded = this%decoded + 1
end select
! return
! end subroutine fst280_decoded
return
end subroutine fst280_decoded
end subroutine multimode_decoder

View File

@ -22,7 +22,7 @@ program fst280sim
if(nargs.ne.9) then
print*,'Need 9 arguments, got ',nargs
print*,'Usage: fst280sim "message" type f0 DT h fdop del nfiles snr'
print*,'Examples: fst280sim "K1JT K9AN EN50" C 1500 0.0 1.0 0.1 1.0 10 -15'
print*,'Examples: fst280sim "K1JT K9AN EN50" C 1500 0.0 1 0.1 1.0 10 -15'
print*,'A: 15 sec'
print*,'B: 30 sec'
print*,'C: 1 min'

View File

@ -31,6 +31,7 @@ contains
include 'fst280/fst280_params.f90'
parameter (MAXCAND=100)
class(fst280_decoder), intent(inout) :: this
procedure(fst280_decode_callback) :: callback
character*37 msg
character*120 data_dir
character*77 c77
@ -49,7 +50,8 @@ contains
integer*1 message101(101),message74(74)
logical badsync,unpk77_success
integer*2 iwave(300*12000)
this%callback => callback
hmod=1 !### pass as arg ###
Keff=91
ndeep=3
@ -264,14 +266,14 @@ contains
endif
if(nharderrors .ge.0 .and. unpk77_success) then
ngood=ngood+1
write(*,1100) 0,nint(xsnr),dt_synced,nint(fc_synced), &
msg(1:22)
1100 format(i6.6,i5,f5.1,i5,' `',1x,a22)
! write(*,1100) 0,nint(xsnr),dt_synced,nint(fc_synced), &
! msg(1:22)
! 1100 format(i6.6,i5,f5.1,i5,' `',1x,a22)
! nsnr=nint(xsnr)
! iaptype=0
! qual=0.
! call this%callback(smax1,nsnr,xdt,fc_synced,msg,iaptype,qual)
nsnr=nint(xsnr)
iaptype=0
qual=0.
call this%callback(smax1,nsnr,xdt,fc_synced,msg,iaptype,qual)
goto 2002
else
cycle