diff --git a/ExportCabrillo.cpp b/ExportCabrillo.cpp index 0be826997..49e8a221b 100644 --- a/ExportCabrillo.cpp +++ b/ExportCabrillo.cpp @@ -1,5 +1,5 @@ #include "ExportCabrillo.h" -#include "ui_exportCabrillo.h" +#include "ui_ExportCabrillo.h" #include "SettingsGroup.hpp" #include "MessageBox.hpp" diff --git a/lib/ft8/foxgen.f90 b/lib/ft8/foxgen.f90 index 18cf3cc1d..853eabc1a 100644 --- a/lib/ft8/foxgen.f90 +++ b/lib/ft8/foxgen.f90 @@ -14,25 +14,20 @@ subroutine foxgen() ! common/foxcom/. The generated wave(NWAVE) is passed back in the same ! common block. - use crc - parameter (NN=79,ND=58,KK=87,NSPS=4*1920) + parameter (NN=79,ND=58,NSPS=4*1920) parameter (NWAVE=NN*NSPS,NFFT=614400,NH=NFFT/2) character*40 cmsg character*37 msg,msgsent - character*87 cbits - character*88 cb88 - integer itone(NN) - integer icos7(0:6) - integer*1 msgbits(KK),codeword(3*ND),msgbits2 + integer itone(79) + integer*1 msgbits(77),msgbits2 integer*1, target:: i1Msg8BitBytes(11) integer*1, target:: mycall real x(NFFT) real*8 dt,twopi,f0,fstep,dfreq,phi,dphi complex cx(0:NH) common/foxcom/wave(NWAVE),nslots,nfreq,i3bit(5),cmsg(5),mycall(12) - common/foxcom2/itone2(NN),msgbits2(KK) + common/foxcom2/itone2(NN),msgbits2(77) equivalence (x,cx),(y,cy) - data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern fstep=60.d0 dfreq=6.25d0 @@ -43,51 +38,11 @@ subroutine foxgen() wave=0. do n=1,nslots - i3b=i3bit(n) - if(i3b.eq.0) then - msg=cmsg(n)(1:22) !Standard FT8 message - else - i1=index(cmsg(n),' ') !Special Fox message - i2=index(cmsg(n),';') - i3=index(cmsg(n),'<') - i4=index(cmsg(n),'>') - msg=cmsg(n)(1:i1)//cmsg(n)(i2+1:i3-2)//' ' - read(cmsg(n)(i4+2:i4+4),*) irpt - endif - call genft8(msg,0,1,1,msgsent,msgbits,itone) -! print*,'Foxgen:',n,cmsg(n),msgsent + msg=cmsg(n)(1:37) + call genft8_174_91(msg,i3,n3,msgsent,msgbits,itone) +! print*,'Foxgen:',n,msg,msgsent,i3,n3 +! write(*,'(77i1)') msgbits - if(i3b.eq.1) then - icrc10=crc10(c_loc(mycall),12) - nrpt=irpt+30 - write(cbits,1001) msgbits(1:56),icrc10,nrpt,i3b,0 -1001 format(56b1.1,b10.10,b6.6,b3.3,b12.12) - read(cbits,1002) msgbits -1002 format(87i1) - - cb88=cbits//'0' - read(cb88,1003) i1Msg8BitBytes(1:11) -1003 format(11b8) - icrc12=crc12(c_loc(i1Msg8BitBytes),11) - - write(cbits,1001) msgbits(1:56),icrc10,nrpt,i3b,icrc12 - read(cbits,1002) msgbits - - call encode174(msgbits,codeword) !Encode the test message - -! Message structure: S7 D29 S7 D29 S7 - itone(1:7)=icos7 - itone(36+1:36+7)=icos7 - itone(NN-6:NN)=icos7 - k=7 - do j=1,ND - i=3*j -2 - k=k+1 - if(j.eq.30) k=k+7 - itone(k)=codeword(i)*4 + codeword(i+1)*2 + codeword(i+2) - enddo - endif - ! Make copies of itone() and msgbits() for ft8sim itone2=itone msgbits2=msgbits diff --git a/lib/ft8/foxgen_wrap.f90 b/lib/ft8/foxgen_wrap.f90 index dbcb2582f..bc8c430f7 100644 --- a/lib/ft8/foxgen_wrap.f90 +++ b/lib/ft8/foxgen_wrap.f90 @@ -1,6 +1,6 @@ subroutine foxgen_wrap(msg40,msgbits,itone) - parameter (NN=79,ND=58,KK=87,NSPS=4*1920) + parameter (NN=79,ND=58,KK=77,NSPS=4*1920) parameter (NWAVE=NN*NSPS) character*40 msg40,cmsg diff --git a/lib/ft8/ft8apset_174_91.f90 b/lib/ft8/ft8apset_174_91.f90 index 5066e626a..d979aeac1 100644 --- a/lib/ft8/ft8apset_174_91.f90 +++ b/lib/ft8/ft8apset_174_91.f90 @@ -1,20 +1,43 @@ -subroutine ft8apset_174_91(mycall12,hiscall12,hisgrid6,ncontest,apsym) - parameter(NAPM=4,KK=91) - character*37 msg,msgsent - character*12 mycall12,hiscall12 - character*6 hisgrid6 - character*4 hisgrid - integer apsym(77) +subroutine ft8apset_174_91(mycall12,hiscall12,apsym) + use packjt77 + character*77 c77 + character*37 msg + character*12 mycall12,hiscall12,hiscall + integer apsym(58) integer*1 msgbits(77) - integer itone(KK) - - if(index(hiscall12," ").eq.0) hiscall12="K9ABC" - msg=trim(mycall12)//' '//trim(hiscall12)//' RRR' - i3=1 - n3=0 -!write(*,*) 'apset msg ',msg - call genft8_174_91(msg,i3,n3,msgsent,msgbits,itone) - apsym=2*msgbits-1 -!write(*,'(29i1,1x,29i1,1x,19i1)') (apsym(1:77)+1)/2 + logical nohiscall + + if(len(trim(mycall12)).eq.0) then + apsym=0 + apsym(1)=99 + apsym(30)=99 + return + endif + + nohiscall=.false. + hiscall=hiscall12 + if(len(trim(hiscall)).eq.0) then + hiscall="K9ABC" + nohiscall=.true. + endif + +! Encode a dummy standard message: i3=1, 28 1 28 1 1 15 +! + msg=trim(mycall12)//' '//trim(hiscall)//' RRR' + call pack77(msg,i3,n3,c77) + if(i3.ne.1) then + apsym=0 + apsym(1)=99 + apsym(30)=99 + return + endif + + read(c77,'(58i1)',err=1) apsym(1:58) + if(nohiscall) apsym(30)=99 + return + +1 apsym=0 + apsym(1)=99 + apsym(30)=99 return end subroutine ft8apset_174_91 diff --git a/lib/ft8/ft8b_2.f90 b/lib/ft8/ft8b_2.f90 index 555b010a8..c40ec7e01 100644 --- a/lib/ft8/ft8b_2.f90 +++ b/lib/ft8/ft8b_2.f90 @@ -1,5 +1,5 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & - napwid,lsubtract,nagain,iaptype,mycall12,hiscall12, & + napwid,lsubtract,nagain,ncontest,iaptype,mycall12,hiscall12, & sync0,f1,xdt,xbase,apsym,nharderrors,dmin,nbadcrc,ipass,iera,msg37,xsnr) use crc @@ -16,19 +16,20 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & real a(5) real s8(0:7,NN) real s2(0:511),s2l(0:511) - real bmeta(3*ND),bmetb(3*ND),bmetc(3*ND) - real bmetal(3*ND),bmetbl(3*ND),bmetcl(3*ND) - real llra(3*ND),llrb(3*ND),llrc(3*ND),llrd(3*ND) !Soft symbols - real llral(3*ND),llrbl(3*ND),llrcl(3*ND) !Soft symbols + real bmeta(174),bmetb(174),bmetc(174) + real bmetal(174),bmetbl(174),bmetcl(174) + real llra(174),llrb(174),llrc(174),llrd(174) !Soft symbols + real llral(174),llrbl(174),llrcl(174) !Soft symbols real dd0(15*12000) - integer*1 message77(77),apmask(3*ND),cw(3*ND) - integer*1 msgbits(77) - integer apsym(77) - integer mcq(29),mrrr(19),m73(19),mrr73(19) + integer*1 message77(77),apmask(174),cw(174) + integer apsym(58) + integer mcq(29),mcqru(29),mcqfd(29),mcqtest(29),mcqhund(29) + integer mrrr(19),m73(19),mrr73(19) integer itone(NN) integer icos7(0:6),ip(1) integer nappasses(0:5) !Number of decoding passes to use for each QSO state integer naptypes(0:5,4) ! (nQSOProgress, decoding pass) maximum of 4 passes for now + integer ncontest,ncontest0 integer*1, target:: i1hiscall(12) logical one(0:511,0:8) integer graymap(0:7) @@ -38,16 +39,25 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & complex cs(0:7,NN) logical first,newdat,lsubtract,lapon,lapcqonly,nagain,unpk77_success data icos7/3,1,4,0,6,5,2/ ! Flipped w.r.t. original FT8 sync array - data mcq/0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0/ - data mrrr/0,1,1,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0,1/ - data m73/0,1,1,1,1,1,1,0,1,0,0,1,0,1,0,0,0,0,1/ - data mrr73/0,1,1,1,1,1,1,0,0,1,1,1,0,1,0,1,0,0,1/ + data mcq/0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0/ + data mcqru/0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,1,1,0,0/ + data mcqfd/0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,1,0/ + data mcqtest/0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,1,0,1,1,1,1,1,1,0,0,1,0/ + data mcqhund/0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,1,0,0,1,1,1,0,0/ + data mrrr/0,1,1,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0,1/ + data m73/0,1,1,1,1,1,1,0,1,0,0,1,0,1,0,0,0,0,1/ + data mrr73/0,1,1,1,1,1,1,0,0,1,1,1,0,1,0,1,0,0,1/ data first/.true./ data graymap/0,1,3,2,5,6,4,7/ - save nappasses,naptypes,one,hiscall12_0 + save nappasses,naptypes,ncontest0,one,hiscall12_0 - if(first) then + + if(first.or.(ncontest.ne.ncontest0)) then mcq=2*mcq-1 + mcqfd=2*mcqfd-1 + mcqru=2*mcqru-1 + mcqtest=2*mcqtest-1 + mcqhund=2*mcqhund-1 mrrr=2*mrrr-1 m73=2*m73-1 mrr73=2*mrr73-1 @@ -67,12 +77,12 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & ! 5 MyCall DxCall 73 (77 ap bits) ! 6 MyCall DxCall RR73 (77 ap bits) - naptypes(0,1:4)=(/1,2,0,0/) - naptypes(1,1:4)=(/2,3,0,0/) - naptypes(2,1:4)=(/2,3,0,0/) - naptypes(3,1:4)=(/3,4,5,6/) - naptypes(4,1:4)=(/3,4,5,6/) - naptypes(5,1:4)=(/3,1,2,0/) + naptypes(0,1:4)=(/1,2,0,0/) ! Tx6 selected (CQ) + naptypes(1,1:4)=(/2,3,0,0/) ! Tx1 + naptypes(2,1:4)=(/2,3,0,0/) ! Tx2 + naptypes(3,1:4)=(/3,4,5,6/) ! Tx3 + naptypes(4,1:4)=(/3,4,5,6/) ! Tx4 + naptypes(5,1:4)=(/3,1,2,0/) ! Tx5 one=.false. do i=0,511 @@ -81,6 +91,7 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & enddo enddo first=.false. + ncontest0=ncontest endif if(hiscall12.ne.hiscall12_0) then @@ -211,12 +222,12 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & enddo enddo enddo - call normalizebmet(bmeta,3*ND) -! call normalizebmet(bmetal,3*ND) - call normalizebmet(bmetb,3*ND) -! call normalizebmet(bmetbl,3*ND) - call normalizebmet(bmetc,3*ND) -! call normalizebmet(bmetcl,3*ND) + call normalizebmet(bmeta,174) +! call normalizebmet(bmetal,174) + call normalizebmet(bmetb,174) +! call normalizebmet(bmetbl,174) + call normalizebmet(bmetc,174) +! call normalizebmet(bmetcl,174) scalefac=2.83 llra=scalefac*bmeta @@ -226,7 +237,7 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & llrc=scalefac*bmetc ! llrcl=scalefac*bmetcl - apmag=maxval(abs(llrb))*1.01 + apmag=maxval(abs(llra))*1.01 ! pass # !------------------------------ @@ -238,7 +249,7 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & ! 6 ap pass 3 ! 7 ap pass 4 - if(lapon) then + if(lapon.or.ncontest.eq.6) then !Hounds always use AP if(.not.lapcqonly) then npasses=3+nappasses(nQSOProgress) else @@ -264,29 +275,117 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & else iaptype=1 endif - if(iaptype.ge.3 .and. (abs(f1-nfqso).gt.napwid .and. abs(f1-nftx).gt.napwid) ) cycle - if(iaptype.eq.1 .or. iaptype.eq.2 ) then ! AP,???,??? + +! ncontest=0 : NONE +! 1 : NA_VHF +! 2 : EU_VHF +! 3 : FIELD DAY +! 4 : RTTY +! 5 : FOX +! 6 : HOUND +! +! Conditions that cause us to bail out of AP decoding + if(ncontest.le.4 .and. iaptype.ge.3 .and. (abs(f1-nfqso).gt.napwid .and. abs(f1-nftx).gt.napwid) ) cycle + if(ncontest.eq.5) cycle ! No AP for Foxes + if(ncontest.eq.6.and.f1.gt.950.0) cycle ! Hounds use AP only for signals below 950 Hz + if(iaptype.ge.2 .and. apsym(1).gt.1) cycle ! No, or nonstandard, mycall + if(iaptype.ge.3 .and. apsym(30).gt.1) cycle ! No, or nonstandard, dxcall + apsym=2*apsym-1 ! Change from [0,1] to antipodal + + if(iaptype.eq.1) then ! CQ or CQ RU or CQ TEST or CQ FD apmask=0 apmask(1:29)=1 + if(ncontest.eq.0) llrd(1:29)=apmag*mcq(1:29) + if(ncontest.eq.1) llrd(1:29)=apmag*mcqtest(1:29) + if(ncontest.eq.2) llrd(1:29)=apmag*mcqtest(1:29) + if(ncontest.eq.3) llrd(1:29)=apmag*mcqfd(1:29) + if(ncontest.eq.4) llrd(1:29)=apmag*mcqru(1:29) + if(ncontest.eq.6) llrd(1:29)=apmag*mcqhund(1:29) apmask(75:77)=1 - llrd(75:77)=apmag*apsym(75:77) - if(iaptype.eq.1) llrd(1:29)=apmag*mcq(1:29) - if(iaptype.eq.2) llrd(1:29)=apmag*apsym(1:29) + llrd(75:76)=apmag*(-1) + llrd(77)=apmag*(+1) endif - if(iaptype.eq.3) then ! mycall, dxcall, ??? + + if(iaptype.eq.2) then ! MyCall,???,??? apmask=0 - apmask(1:56)=1 - apmask(75:77)=1 - llrd(1:56)=apmag*apsym(1:56) - llrd(75:77)=apmag*apsym(75:77) + if(ncontest.eq.0.or.ncontest.eq.1) then + apmask(1:29)=1 + llrd(1:29)=apmag*apsym(1:29) + apmask(75:77)=1 + llrd(75:76)=apmag*(-1) + llrd(77)=apmag*(+1) + else if(ncontest.eq.2) then + apmask(1:28)=1 + llrd(1:28)=apmag*apsym(1:28) + apmask(72:74)=1 + llrd(72)=apmag*(-1) + llrd(73)=apmag*(+1) + llrd(74)=apmag*(-1) + apmask(75:77)=1 + llrd(75:77)=apmag*(-1) + else if(ncontest.eq.3) then + apmask(1:28)=1 + llrd(1:28)=apmag*apsym(1:28) + apmask(75:77)=1 + llrd(75:77)=apmag*(-1) + else if(ncontest.eq.4) then + apmask(2:29)=1 + llrd(2:29)=apmag*apsym(1:28) + apmask(75:77)=1 + llrd(75)=apmag*(-1) + llrd(76:77)=apmag*(+1) + else if(ncontest.eq.6) then ! ??? RR73; MyCall ??? + apmask(29:56)=1 + llrd(29:56)=apmag*apsym(1:28) + apmask(72:77)=1 + llrd(72:73)=apmag*(-1) + llrd(74)=apmag*(+1) + llrd(75:77)=apmag*(-1) + endif endif + + if(iaptype.eq.3) then ! MyCall,DxCall,??? + apmask=0 + if(ncontest.eq.0.or.ncontest.eq.1.or.ncontest.eq.2.or.ncontest.eq.6) then + apmask(1:58)=1 + llrd(1:58)=apmag*apsym + apmask(75:77)=1 + llrd(75:76)=apmag*(-1) + llrd(77)=apmag*(+1) + else if(ncontest.eq.3) then ! Field Day + apmask(1:56)=1 + llrd(1:28)=apmag*apsym(1:28) + llrd(29:56)=apmag*apsym(30:57) + apmask(72:74)=1 + apmask(75:77)=1 + llrd(75:77)=apmag*(-1) + else if(ncontest.eq.4) then ! RTTY RU + apmask(2:57)=1 + llrd(2:29)=apmag*apsym(1:28) + llrd(30:57)=apmag*apsym(30:57) + apmask(75:77)=1 + llrd(75)=apmag*(-1) + llrd(76:77)=apmag*(+1) + endif + endif + + if(iaptype.eq.5.and.ncontest.eq.6) cycle !Hound if(iaptype.eq.4 .or. iaptype.eq.5 .or. iaptype.eq.6) then apmask=0 - apmask(1:77)=1 ! mycall, hiscall, RRR|73|RR73 - llrd(1:58)=apmag*apsym(1:58) - if(iaptype.eq.4) llrd(59:77)=apmag*mrrr - if(iaptype.eq.5) llrd(59:77)=apmag*m73 - if(iaptype.eq.6) llrd(59:77)=apmag*mrr73 + if(ncontest.le.4 .or. (ncontest.eq.6.and.iaptype.eq.6)) then + apmask(1:77)=1 ! mycall, hiscall, RRR|73|RR73 + llrd(1:58)=apmag*apsym + if(iaptype.eq.4) llrd(59:77)=apmag*mrrr + if(iaptype.eq.5) llrd(59:77)=apmag*m73 + if(iaptype.eq.6) llrd(59:77)=apmag*mrr73 + else if(ncontest.eq.6.and.iaptype.eq.4) then ! Hound listens for MyCall RR73;... + apmask(1:28)=1 + llrd(1:28)=apmag*apsym(1:28) + apmask(72:77)=1 + llrd(72:73)=apmag*(-1) + llrd(74)=apmag*(1) + llrd(75:77)=apmag*(-1) + endif endif endif @@ -301,7 +400,7 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & if(abs(nfqso-f1).le.napwid .or. abs(nftx-f1).le.napwid) then if((ipass.eq.3 .or. ipass.eq.4) .and. .not.nagain) then ndeep=3 - else + else ndeep=4 endif endif @@ -338,7 +437,7 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & xsnr2=0.001 arg=xsig/xnoi-1.0 if(arg.gt.0.1) xsnr=arg - arg=xsig/xbase/2.8e6-1.0 + arg=xsig/xbase/2.6e6-1.0 if(arg.gt.0.1) xsnr2=arg xsnr=10.0*log10(xsnr)-27.0 xsnr2=10.0*log10(xsnr2)-27.0 diff --git a/lib/ft8/genft8_174_91.f90 b/lib/ft8/genft8_174_91.f90 index 979915689..97297efab 100644 --- a/lib/ft8/genft8_174_91.f90 +++ b/lib/ft8/genft8_174_91.f90 @@ -18,7 +18,6 @@ subroutine genft8_174_91(msg,i3,n3,msgsent,msgbits,itone) n3=-1 call pack77(msg,i3,n3,c77) call unpack77(c77,msgsent,unpk77_success) - read(c77,'(77i1)',err=1) msgbits go to 2 1 write(81,*) msg,c77 ; flush(81) diff --git a/lib/ft8_decode.f90 b/lib/ft8_decode.f90 index 079e0ffc8..2e6f36464 100644 --- a/lib/ft8_decode.f90 +++ b/lib/ft8_decode.f90 @@ -52,7 +52,7 @@ contains character*12 mycall12,hiscall12,mycall12_0 character*6 hisgrid6 integer*2 iwave(15*12000) - integer apsym1(KK),apsym2(77) + integer apsym1(KK),apsym2(58) character datetime*13,msg37*37 ! character message*22 character*37 allmessages(100) @@ -70,7 +70,7 @@ contains 1001 format("000000_",i6.6) call ft8apset(mycall12,hiscall12,apsym1) - call ft8apset_174_91(mycall12,hiscall12,hisgrid6,ncontest,apsym2) + call ft8apset_174_91(mycall12,hiscall12,apsym2) dd=iwave ndecodes=0 allmessages=' ' @@ -121,7 +121,7 @@ contains nbadcrc,iappass,iera,msg37,xsnr) else call ft8b_2(dd,newdat,nQSOProgress,nfqso,nftx,ndepth,lft8apon, & - lapcqonly,napwid,lsubtract,nagain,iaptype,mycall12, & + lapcqonly,napwid,lsubtract,nagain,ncontest,iaptype,mycall12, & hiscall12,sync,f1,xdt,xbase,apsym2,nharderrors,dmin, & nbadcrc,iappass,iera,msg37,xsnr) endif @@ -131,9 +131,6 @@ contains hd=nharderrors+dmin call timer('ft8b ',1) if(nbadcrc.eq.0) then -! call jtmsg(message,iflag) -! This probably needs to be re-visited for the new message type -! if(iand(iflag,31).ne.0) message(22:22)='?' ldupe=.false. do id=1,ndecodes if(msg37.eq.allmessages(id).and.nsnr.le.allsnrs(id)) ldupe=.true. @@ -143,11 +140,11 @@ contains allmessages(ndecodes)=msg37 allsnrs(ndecodes)=nsnr endif -! write(81,1004) nutc,ncand,icand,ipass,iaptype,iappass, & -! nharderrors,dmin,hd,min(sync,999.0),nint(xsnr), & -! xdt,nint(f1),msg37,isync -!1004 format(i6.6,2i4,3i2,i3,3f6.1,i4,f6.2,i5,2x,a37,i4) -! flush(81) + write(81,1004) nutc,ncand,icand,ipass,iaptype,iappass, & + nharderrors,dmin,hd,min(sync,999.0),nint(xsnr), & + xdt,nint(f1),msg37,isync +1004 format(i6.6,2i4,3i2,i3,3f6.1,i4,f6.2,i5,2x,a37,i4) + flush(81) if(.not.ldupe .and. associated(this%callback)) then qual=1.0-(nharderrors+dmin)/60.0 ! scale qual to [0.0,1.0] call this%callback(sync,nsnr,xdt,f1,msg37,iaptype,qual) diff --git a/lib/genmsk40.f90 b/lib/genmsk40.f90 index 80411819f..4177cbc2e 100644 --- a/lib/genmsk40.f90 +++ b/lib/genmsk40.f90 @@ -29,7 +29,7 @@ subroutine genmsk40(msg,msgsent,ichk,itone,itype) 10 irpt=i !Report index, 0-15 if(ichk.lt.10000) then hashmsg=msg(2:i1-1) - call hash(hashmsg,22,ihash) + call hash(hashmsg,37,ihash) ihash=iand(ihash,4095) !12-bit hash ig=16*ihash + irpt !4-bit report else diff --git a/lib/genmsk_128_90.f90 b/lib/genmsk_128_90.f90 index 7ced79f29..bfd175db3 100644 --- a/lib/genmsk_128_90.f90 +++ b/lib/genmsk_128_90.f90 @@ -46,6 +46,7 @@ subroutine genmsk_128_90(msg0,ichk,msgsent,i4tone,itype) enddo endif + message(1:37)=' ' itype=1 if(msg0(1:1).eq.'@') then !Generate a fixed tone read(msg0(2:5),*,end=1,err=1) nfreq !at specified frequency @@ -54,23 +55,28 @@ subroutine genmsk_128_90(msg0,ichk,msgsent,i4tone,itype) 2 i4tone(1)=nfreq else message=msg0 + do i=1, 37 if(ichar(message(i:i)).eq.0) then - message(i:)=' ' + message(i:37)=' ' exit endif enddo - do i=1,37 !Strip leading blanks if(message(1:1).ne.' ') exit message=message(i+1:) enddo if(message(1:1).eq.'<') then - call genmsk40(message,msgsent,ichk,i4tone,itype) - if(itype.lt.0) go to 999 - i4tone(41)=-40 - go to 999 + i2=index(message,'>') + i1=0 + if(i2.gt.0) i1=index(message(1:i2),' ') + if(i1.gt.0) then + call genmsk40(message,msgsent,ichk,i4tone,itype) + if(itype.lt.0) go to 999 + i4tone(41)=-40 + go to 999 + endif endif i3=-1 diff --git a/lib/msk40decodeframe.f90 b/lib/msk40decodeframe.f90 index 51c9346a8..2023412ec 100644 --- a/lib/msk40decodeframe.f90 +++ b/lib/msk40decodeframe.f90 @@ -5,8 +5,8 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,bswl,nhasharray, & parameter (NSPM=240) character*4 rpt(0:15) - character*6 mycall,hiscall,mycall0,hiscall0 - character*22 hashmsg,msgreceived + character*12 mycall,hiscall,mycall0,hiscall0 + character*37 hashmsg,msgreceived complex cb(42) complex cfac,cca complex c(NSPM) @@ -59,7 +59,7 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,bswl,nhasharray, & hashmsg=trim(mycall)//' '//trim(hiscall) if( hashmsg .ne. ' ' .and. hiscall .ne. '' ) then ! protect against blank mycall/hiscall call fmtmsg(hashmsg,iz) - call hash(hashmsg,22,ihash) + call hash(hashmsg,37,ihash) ihash=iand(ihash,4095) else ihash=9999 ! so that it can never match a received hash diff --git a/lib/msk40spd.f90 b/lib/msk40spd.f90 index 337bc8cc8..63532ae94 100644 --- a/lib/msk40spd.f90 +++ b/lib/msk40spd.f90 @@ -6,8 +6,8 @@ subroutine msk40spd(cbig,n,ntol,mycall,hiscall,bswl,nhasharray, & use timer_module, only: timer parameter (NSPM=240, MAXSTEPS=150, NFFT=NSPM, MAXCAND=5, NPATTERNS=6) - character*6 mycall,hiscall - character*22 msgreceived + character*12 mycall,hiscall + character*37 msgreceived complex cbig(n) complex cdat(3*NSPM) !Analytic signal complex c(NSPM) diff --git a/lib/mskrtd.f90 b/lib/mskrtd.f90 index d3fdada63..025cfda21 100644 --- a/lib/mskrtd.f90 +++ b/lib/mskrtd.f90 @@ -15,10 +15,10 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,mycall,mygrid,hiscall, & character*4 decsym !"&" for mskspd or "^" for long averages character*37 msgreceived !Decoded message - character*22 msgrx22 !Sh messages are returned as 22chars - character*37 msglast,msglastswl !Used for dupechecking + character*37 msglast,msglastswl !Used for dupechecking character*80 line !Formatted line with UTC dB T Freq Msg character*12 mycall,hiscall + character*13 mycall13 character*6 mygrid character*37 recent_shmsgs(NSHMEM) character*512 datadir @@ -55,7 +55,7 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,mycall,mygrid,hiscall, & 1,1,1,1,1,1,1,0/ data xmc/2.0,4.5,2.5,3.5/ !Used to set time at center of averaging mask save first,tsec0,nutc00,pnoise,cdat,msglast,msglastswl, & - nsnrlast,nsnrlastswl,nhasharray,recent_shmsgs + nsnrlast,nsnrlastswl,nhasharray,recent_shmsgs,mycall13 if(first) then tsec0=tsec @@ -71,11 +71,16 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,mycall,mygrid,hiscall, & msglastswl=' ' nsnrlast=-99 nsnrlastswl=-99 + mycall13=mycall//" " + call save_hash_call(mycall13,n10,n12,n22) ! Make sure that my callsign is in hashtable first=.false. endif fc=nrxfreq +! Reset if mycall changes + if(mycall13(1:12).ne.mycall) first=.true. + ! Dupe checking setup if(nutc00.ne.nutc0 .or. tsec.lt.tsec0) then ! reset dupe checker msglast=' ' @@ -119,9 +124,8 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,mycall,mygrid,hiscall, & call msk144spd(cdat,np,ntol,ndecodesuccess,msgreceived,fc,fest,tdec,navg,ct, & softbits) if(ndecodesuccess.eq.0 .and. (bshmsg.or.bswl)) then - call msk40spd(cdat,np,ntol,mycall(1:6),hiscall(1:6),bswl,nhasharray, & - ndecodesuccess,msgrx22,fc,fest,tdec,navg) - if( ndecodesuccess .ge. 1 ) msgreceived=msgrx22//' ' + call msk40spd(cdat,np,ntol,mycall,hiscall,bswl,nhasharray, & + ndecodesuccess,msgreceived,fc,fest,tdec,navg) endif if( ndecodesuccess .ge. 1 ) then tdec=tsec+tdec @@ -184,7 +188,12 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,mycall,mygrid,hiscall, & nsnr=nint(snr0) bshdecode=.false. - if( msgreceived(1:1) .eq. '<' ) bshdecode=.true. + if( msgreceived(1:1) .eq. '<' ) then + i2=index(msgreceived,'>') + i1=0 + if(i2.gt.0) i1=index(msgreceived(1:i2),' ') + if(i1.gt.0) bshdecode=.true. + endif if(.not. bshdecode) then call msk144signalquality(ct,snr0,fest,tdec,softbits,msgreceived,hiscall, & diff --git a/lib/update_hasharray.f90 b/lib/update_hasharray.f90 index 4ccbba51c..baf50329f 100644 --- a/lib/update_hasharray.f90 +++ b/lib/update_hasharray.f90 @@ -1,7 +1,7 @@ subroutine update_hasharray(nhasharray) use packjt77 - character*22 hashmsg + character*37 hashmsg integer nhasharray(MAXRECENT,MAXRECENT) nhasharray=-1 @@ -10,12 +10,12 @@ subroutine update_hasharray(nhasharray) if( recent_calls(i)(1:1) .ne. ' ' .and. recent_calls(j)(1:1) .ne. ' ' ) then hashmsg=trim(recent_calls(i))//' '//trim(recent_calls(j)) call fmtmsg(hashmsg,iz) - call hash(hashmsg,22,ihash) + call hash(hashmsg,37,ihash) ihash=iand(ihash,4095) nhasharray(i,j)=ihash hashmsg=trim(recent_calls(j))//' '//trim(recent_calls(i)) call fmtmsg(hashmsg,iz) - call hash(hashmsg,22,ihash) + call hash(hashmsg,37,ihash) ihash=iand(ihash,4095) nhasharray(j,i)=ihash endif diff --git a/mainwindow.cpp b/mainwindow.cpp index a830846af..8a1446403 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1510,11 +1510,13 @@ void MainWindow::fastSink(qint64 frames) int RxFreq=ui->RxFreqSpinBox->value (); int nTRpDepth=m_TRperiod + 1000*(m_ndepth & 3); qint64 ms0 = QDateTime::currentMSecsSinceEpoch(); - strncpy(dec_data.params.mycall, (m_baseCall+" ").toLatin1(),12); +// strncpy(dec_data.params.mycall, (m_baseCall+" ").toLatin1(),12); + strncpy(dec_data.params.mycall,(m_config.my_callsign () + " ").toLatin1(),12); QString hisCall {ui->dxCallEntry->text ()}; bool bshmsg=ui->cbShMsgs->isChecked(); bool bswl=ui->cbSWL->isChecked(); - strncpy(dec_data.params.hiscall,(Radio::base_callsign (hisCall) + " ").toLatin1 ().constData (), 12); +// strncpy(dec_data.params.hiscall,(Radio::base_callsign (hisCall) + " ").toLatin1 ().constData (), 12); + strncpy(dec_data.params.hiscall,(hisCall + " ").toLatin1 ().constData (), 12); strncpy(dec_data.params.mygrid, (m_config.my_grid()+" ").toLatin1(),6); QString dataDir; dataDir = m_config.writeable_data_dir ().absolutePath (); @@ -4728,6 +4730,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) (!bMyCall or !bHisCall or m_config.bGenerate77()); QString t0=hisBase + " " + m_baseCall + " "; + QString t0s=hisCall + " " + my_callsign + " "; QString t0a,t0b; if(b77) { if(bHisCall and bMyCall) t0=hisCall + " " + my_callsign + " "; @@ -4783,8 +4786,8 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) } if(m_mode=="MSK144" and m_bShMsgs) { - int i=t0.length()-1; - t0="<" + t0.mid(0,i) + "> "; + int i=t0s.length()-1; + t0="<" + t0s.mid(0,i) + "> "; if(!m_config.bNA_VHF_Contest()) { if(n<=-2) n=-3; if(n>=-1 and n<=1) n=0; @@ -4810,7 +4813,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) } t=t0 + (m_send_RR73 ? "RR73" : "RRR"); - if(m_mode=="MSK144" or m_mode=="FT8") { + if((m_mode=="MSK144" and !m_bShMsgs) or m_mode=="FT8") { if(!bHisCall and bMyCall) t=hisCall + " <" + my_callsign + "> " + (m_send_RR73 ? "RR73" : "RRR"); if(bHisCall and !bMyCall) t="<" + hisCall + "> " + my_callsign + " " + (m_send_RR73 ? "RR73" : "RRR"); } @@ -4818,7 +4821,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) msgtype(t, ui->tx4); t=t0 + "73"; - if(m_mode=="MSK144" or m_mode=="FT8") { + if((m_mode=="MSK144" and !m_bShMsgs) or m_mode=="FT8") { if(!bHisCall and bMyCall) t=hisCall + " <" + my_callsign + "> 73"; if(bHisCall and !bMyCall) t="<" + hisCall + "> " + my_callsign + " 73"; } @@ -4834,7 +4837,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) } } - if(m_config.bGenerate77()) return; + if(m_config.bGenerate77() or "MSK144" == m_mode) return; if (is_compound) { if (is_type_one) { diff --git a/mainwindow.h b/mainwindow.h index 6a2d9704a..5a35cbfaa 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -36,7 +36,7 @@ #include "astro.h" #include "MessageBox.hpp" #include "NetworkAccessManager.hpp" -#include "exportCabrillo.h" +#include "ExportCabrillo.h" #define NUM_JT4_SYMBOLS 206 //(72+31)*2, embedded sync #define NUM_JT65_SYMBOLS 126 //63 data + 63 sync