Wire up the 'Decode only 77-bit messages' checkbox.

This commit is contained in:
Steve Franke 2018-07-05 07:51:10 -05:00
parent ed92d5a86c
commit 4b8ea3ef45
7 changed files with 43 additions and 34 deletions

View File

@ -44,6 +44,7 @@ extern struct dec_data {
bool lft8apon;
bool lapcqonly;
bool ljt65apon;
bool ldecode77;
int napwid;
int ntxmode;
int nmode;

View File

@ -96,7 +96,8 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
call my_ft8%decode(ft8_decoded,id2,params%nQSOProgress,params%nfqso, &
params%nftx,newdat,params%nutc,params%nfa,params%nfb, &
params%nexp_decode,params%ndepth,logical(params%nagain), &
logical(params%lft8apon),logical(params%lapcqonly),params%napwid, &
logical(params%lft8apon),logical(params%lapcqonly), &
logical(params%ldecode77),params%napwid, &
mycall,mygrid,hiscall,hisgrid)
call timer('decft8 ',1)
if(nfox.gt.0) then

View File

@ -1,9 +1,10 @@
subroutine sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase)
subroutine sync8(dd,nfa,nfb,syncmin,nfqso,ldecode77,s,candidate,ncand,sbase)
include 'ft8_params.f90'
! Search over +/- 2.5s relative to 0.5s TX start time.
parameter (JZ=62)
complex cx(0:NH1)
logical ldecode77
real s(NH1,NHSYM)
real savg(NH1)
real sbase(NH1)
@ -52,11 +53,14 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase)
candidate0=0.
k=0
do itype=1,2
if(itype.eq.1) icos7=icos7_1
if(itype.eq.2) icos7=icos7_2
do i=ia,ib
do j=-JZ,+JZ
is1=1
if(ldecode77) is1=2
do isync=is1,2
if(isync.eq.1) icos7=icos7_1
if(isync.eq.2) icos7=icos7_2
do i=ia,ib
do j=-JZ,+JZ
ta=0.
tb=0.
tc=0.
@ -86,34 +90,34 @@ do itype=1,2
t0=(t0-t)/6.0
sync_bc=t/t0
sync2d(i,j)=max(sync_abc,sync_bc)
enddo
enddo
enddo
enddo
red=0.
do i=ia,ib
ii=maxloc(sync2d(i,-JZ:JZ)) - 1 - JZ
j0=ii(1)
jpeak(i)=j0
red(i)=sync2d(i,j0)
red=0.
do i=ia,ib
ii=maxloc(sync2d(i,-JZ:JZ)) - 1 - JZ
j0=ii(1)
jpeak(i)=j0
red(i)=sync2d(i,j0)
! write(52,3052) i*df,red(i),db(red(i))
!3052 format(3f12.3)
enddo
iz=ib-ia+1
call indexx(red(ia:ib),iz,indx)
ibase=indx(nint(0.40*iz)) - 1 + ia
base=red(ibase)
red=red/base
enddo
iz=ib-ia+1
call indexx(red(ia:ib),iz,indx)
ibase=indx(nint(0.40*iz)) - 1 + ia
base=red(ibase)
red=red/base
do i=1,200
n=ia + indx(iz+1-i) - 1
if(red(n).lt.syncmin) exit
if(k.lt.200) k=k+1
candidate0(1,k)=n*df
candidate0(2,k)=(jpeak(n)-1)*tstep
candidate0(3,k)=red(n)
candidate0(4,k)=itype
enddo
enddo
do i=1,200
n=ia + indx(iz+1-i) - 1
if(red(n).lt.syncmin) exit
if(k.lt.200) k=k+1
candidate0(1,k)=n*df
candidate0(2,k)=(jpeak(n)-1)*tstep
candidate0(3,k)=red(n)
candidate0(4,k)=isync
enddo
enddo ! isync loop
ncand=k
! Put nfqso at top of list, and save only the best of near-dupe freqs.

View File

@ -33,7 +33,7 @@ module ft8_decode
contains
subroutine decode(this,callback,iwave,nQSOProgress,nfqso,nftx,newdat, &
nutc,nfa,nfb,nexp_decode,ndepth,nagain,lft8apon,lapcqonly,napwid, &
nutc,nfa,nfb,nexp_decode,ndepth,nagain,lft8apon,lapcqonly,ldecode77,napwid, &
mycall12,mygrid6,hiscall12,hisgrid6)
! use wavhdr
use timer_module, only: timer
@ -46,7 +46,7 @@ contains
real sbase(NH1)
real candidate(4,200)
real dd(15*12000)
logical, intent(in) :: lft8apon,lapcqonly,nagain
logical, intent(in) :: lft8apon,lapcqonly,ldecode77,nagain
logical newdat,lsubtract,ldupe,bcontest
character*12 mycall12, hiscall12
character*6 mygrid6,hisgrid6
@ -99,7 +99,7 @@ contains
lsubtract=.false.
endif
call timer('sync8 ',0)
call sync8(dd,ifa,ifb,syncmin,nfqso,s,candidate,ncand,sbase)
call sync8(dd,ifa,ifb,syncmin,nfqso,ldecode77,s,candidate,ncand,sbase)
call timer('sync8 ',1)
do icand=1,ncand
sync=candidate(3,icand)

View File

@ -263,6 +263,7 @@ program jt9
shared_data%params%ndepth=ndepth
shared_data%params%lft8apon=.true.
shared_data%params%ljt65apon=.true.
shared_data%params%ldecode77=.false.
shared_data%params%napwid=75
shared_data%params%dttol=3.

View File

@ -26,6 +26,7 @@
logical(c_bool) :: lft8apon
logical(c_bool) :: lapcqonly
logical(c_bool) :: ljt65apon
logical(c_bool) :: ldecode77
integer(c_int) :: napwid
integer(c_int) :: ntxmode
integer(c_int) :: nmode

View File

@ -2683,6 +2683,7 @@ void MainWindow::decode() //decode()
if(m_config.single_decode()) dec_data.params.nexp_decode += 32;
if(m_config.enable_VHF_features()) dec_data.params.nexp_decode += 64;
if(ui->cbVHFcontest->isChecked()) dec_data.params.nexp_decode += 128;
dec_data.params.ldecode77 = m_config.bDecode77();
strncpy(dec_data.params.datetime, m_dateTime.toLatin1(), 20);
strncpy(dec_data.params.mycall, (m_config.my_callsign()+" ").toLatin1(),12);