From 9ff9dc5c42dee71460a06a2a933acaa46fb2d31c Mon Sep 17 00:00:00 2001 From: K9AN Date: Fri, 1 Mar 2019 14:36:26 -0600 Subject: [PATCH 1/6] Make wsprd Makefile work on Linux with gcc/gfortran. --- lib/wsprd/Makefile | 12 ++---- lib/wsprd/indexx.f90 | 91 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 8 deletions(-) create mode 100644 lib/wsprd/indexx.f90 diff --git a/lib/wsprd/Makefile b/lib/wsprd/Makefile index 920407349..aef4840e0 100644 --- a/lib/wsprd/Makefile +++ b/lib/wsprd/Makefile @@ -5,7 +5,7 @@ FC = gfortran CFLAGS= -I/usr/include -Wall -Wno-missing-braces -O3 -ffast-math LDFLAGS = -L/usr/lib FFLAGS = -O2 -Wall -Wno-conversion -LIBS = -lfftw3f -lm +LIBS = -lfftw3f -lm -lgfortran # Default rules %.o: %.c $(DEPS) @@ -19,16 +19,12 @@ LIBS = -lfftw3f -lm %.o: %.F90 ${FC} ${FFLAGS} -c $< -all: wsprd wsprsim wsprd_exp +all: wsprd DEPS = wsprsim_utils.h wsprd_utils.h fano.h jelinek.h nhash.h -OBJS1 = wsprd.o wsprsim_utils.o wsprd_utils.o tab.o fano.o jelinek.o nhash.o +OBJS1 = wsprd.o wsprsim_utils.o wsprd_utils.o tab.o fano.o jelinek.o nhash.o indexx.o osdwspr.o wsprd: $(OBJS1) $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) -OBJS2 = wsprsim.o wsprsim_utils.o wsprd_utils.o tab.o fano.o nhash.o -wsprsim: $(OBJS2) - $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) - clean: - rm *.o wsprd wsprsim + rm *.o wsprd diff --git a/lib/wsprd/indexx.f90 b/lib/wsprd/indexx.f90 new file mode 100644 index 000000000..7a35f53b8 --- /dev/null +++ b/lib/wsprd/indexx.f90 @@ -0,0 +1,91 @@ +subroutine indexx(arr,n,indx) + + parameter (M=7,NSTACK=50) + integer n,indx(n) + real arr(n) + integer i,indxt,ir,itemp,j,jstack,k,l,istack(NSTACK) + real a + + do j=1,n + indx(j)=j + enddo + + jstack=0 + l=1 + ir=n +1 if(ir-l.lt.M) then + do j=l+1,ir + indxt=indx(j) + a=arr(indxt) + do i=j-1,1,-1 + if(arr(indx(i)).le.a) goto 2 + indx(i+1)=indx(i) + enddo + i=0 +2 indx(i+1)=indxt + enddo + if(jstack.eq.0) return + + ir=istack(jstack) + l=istack(jstack-1) + jstack=jstack-2 + + else + k=(l+ir)/2 + itemp=indx(k) + indx(k)=indx(l+1) + indx(l+1)=itemp + + if(arr(indx(l+1)).gt.arr(indx(ir))) then + itemp=indx(l+1) + indx(l+1)=indx(ir) + indx(ir)=itemp + endif + + if(arr(indx(l)).gt.arr(indx(ir))) then + itemp=indx(l) + indx(l)=indx(ir) + indx(ir)=itemp + endif + + if(arr(indx(l+1)).gt.arr(indx(l))) then + itemp=indx(l+1) + indx(l+1)=indx(l) + indx(l)=itemp + endif + + i=l+1 + j=ir + indxt=indx(l) + a=arr(indxt) +3 continue + i=i+1 + if(arr(indx(i)).lt.a) goto 3 + +4 continue + j=j-1 + if(arr(indx(j)).gt.a) goto 4 + if(j.lt.i) goto 5 + itemp=indx(i) + indx(i)=indx(j) + indx(j)=itemp + goto 3 + +5 indx(l)=indx(j) + indx(j)=indxt + jstack=jstack+2 + if(jstack.gt.NSTACK) stop 'NSTACK too small in indexx' + if(ir-i+1.ge.j-l)then + istack(jstack)=ir + istack(jstack-1)=i + ir=j-1 + else + istack(jstack)=j-1 + istack(jstack-1)=l + l=i + endif + endif + goto 1 + +end subroutine indexx + From 4d5fa21821f6e27b6075649746886072b4fb9d9c Mon Sep 17 00:00:00 2001 From: K9AN Date: Fri, 1 Mar 2019 17:07:11 -0600 Subject: [PATCH 2/6] More tweaks to wsprd Makefile. --- lib/wsprd/Makefile | 13 +++++-- lib/wsprd/indexx.f90 | 91 -------------------------------------------- 2 files changed, 9 insertions(+), 95 deletions(-) delete mode 100644 lib/wsprd/indexx.f90 diff --git a/lib/wsprd/Makefile b/lib/wsprd/Makefile index aef4840e0..872f4976c 100644 --- a/lib/wsprd/Makefile +++ b/lib/wsprd/Makefile @@ -2,9 +2,9 @@ CC = gcc #CC = clang-3.5 FC = gfortran -CFLAGS= -I/usr/include -Wall -Wno-missing-braces -O3 -ffast-math +CFLAGS= -I/usr/include -Wall -Wno-missing-braces -Wno-unused-result -O3 -ffast-math LDFLAGS = -L/usr/lib -FFLAGS = -O2 -Wall -Wno-conversion +FFLAGS = -O2 -Wall -Wno-conversion LIBS = -lfftw3f -lm -lgfortran # Default rules @@ -14,7 +14,7 @@ LIBS = -lfftw3f -lm -lgfortran ${FC} ${FFLAGS} -c $< %.o: %.F ${FC} ${FFLAGS} -c $< -%.o: %.f90 +%.o: %.f90 ${FC} ${FFLAGS} -c $< %.o: %.F90 ${FC} ${FFLAGS} -c $< @@ -22,9 +22,14 @@ LIBS = -lfftw3f -lm -lgfortran all: wsprd DEPS = wsprsim_utils.h wsprd_utils.h fano.h jelinek.h nhash.h + +indexx.o: ../indexx.f90 + ${FC} -o indexx.o ${FFLAGS} -c ../indexx.f90 + OBJS1 = wsprd.o wsprsim_utils.o wsprd_utils.o tab.o fano.o jelinek.o nhash.o indexx.o osdwspr.o + wsprd: $(OBJS1) $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) clean: - rm *.o wsprd + $(RM) *.o wsprd diff --git a/lib/wsprd/indexx.f90 b/lib/wsprd/indexx.f90 deleted file mode 100644 index 7a35f53b8..000000000 --- a/lib/wsprd/indexx.f90 +++ /dev/null @@ -1,91 +0,0 @@ -subroutine indexx(arr,n,indx) - - parameter (M=7,NSTACK=50) - integer n,indx(n) - real arr(n) - integer i,indxt,ir,itemp,j,jstack,k,l,istack(NSTACK) - real a - - do j=1,n - indx(j)=j - enddo - - jstack=0 - l=1 - ir=n -1 if(ir-l.lt.M) then - do j=l+1,ir - indxt=indx(j) - a=arr(indxt) - do i=j-1,1,-1 - if(arr(indx(i)).le.a) goto 2 - indx(i+1)=indx(i) - enddo - i=0 -2 indx(i+1)=indxt - enddo - if(jstack.eq.0) return - - ir=istack(jstack) - l=istack(jstack-1) - jstack=jstack-2 - - else - k=(l+ir)/2 - itemp=indx(k) - indx(k)=indx(l+1) - indx(l+1)=itemp - - if(arr(indx(l+1)).gt.arr(indx(ir))) then - itemp=indx(l+1) - indx(l+1)=indx(ir) - indx(ir)=itemp - endif - - if(arr(indx(l)).gt.arr(indx(ir))) then - itemp=indx(l) - indx(l)=indx(ir) - indx(ir)=itemp - endif - - if(arr(indx(l+1)).gt.arr(indx(l))) then - itemp=indx(l+1) - indx(l+1)=indx(l) - indx(l)=itemp - endif - - i=l+1 - j=ir - indxt=indx(l) - a=arr(indxt) -3 continue - i=i+1 - if(arr(indx(i)).lt.a) goto 3 - -4 continue - j=j-1 - if(arr(indx(j)).gt.a) goto 4 - if(j.lt.i) goto 5 - itemp=indx(i) - indx(i)=indx(j) - indx(j)=itemp - goto 3 - -5 indx(l)=indx(j) - indx(j)=indxt - jstack=jstack+2 - if(jstack.gt.NSTACK) stop 'NSTACK too small in indexx' - if(ir-i+1.ge.j-l)then - istack(jstack)=ir - istack(jstack-1)=i - ir=j-1 - else - istack(jstack)=j-1 - istack(jstack-1)=l - l=i - endif - endif - goto 1 - -end subroutine indexx - From 3176c1d3ef3a24e65a4cf001161830ad7526a002 Mon Sep 17 00:00:00 2001 From: K9AN Date: Fri, 1 Mar 2019 17:48:57 -0600 Subject: [PATCH 3/6] wsprd Makefile now builds wsprsim too. --- lib/wsprd/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/wsprd/Makefile b/lib/wsprd/Makefile index 872f4976c..c8e15723f 100644 --- a/lib/wsprd/Makefile +++ b/lib/wsprd/Makefile @@ -1,5 +1,4 @@ CC = gcc -#CC = clang-3.5 FC = gfortran CFLAGS= -I/usr/include -Wall -Wno-missing-braces -Wno-unused-result -O3 -ffast-math @@ -19,7 +18,7 @@ LIBS = -lfftw3f -lm -lgfortran %.o: %.F90 ${FC} ${FFLAGS} -c $< -all: wsprd +all: wsprd wsprsim DEPS = wsprsim_utils.h wsprd_utils.h fano.h jelinek.h nhash.h @@ -31,5 +30,10 @@ OBJS1 = wsprd.o wsprsim_utils.o wsprd_utils.o tab.o fano.o jelinek.o nhash.o ind wsprd: $(OBJS1) $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) +OBJS2 = wsprsim.o wsprsim_utils.o wsprd_utils.o tab.o fano.o nhash.o + +wsprsim: $(OBJS2) + $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) + clean: - $(RM) *.o wsprd + $(RM) *.o wsprd wsprsim From 4769bf45d2780010ee6b2c8488e8c843141bbd8f Mon Sep 17 00:00:00 2001 From: Steve Franke Date: Sun, 3 Mar 2019 13:02:22 -0600 Subject: [PATCH 4/6] Make FT4 AP decoding work in RTTY RU and Field Day activities. Move Nuttal window to standalone subroutine nuttal_window.f90 and use Nuttal window in ft4/getcandidates4.f90. --- CMakeLists.txt | 1 + lib/ft4/ft4_decode.f90 | 31 ++++++++++--------------------- lib/ft4/getcandidates4.f90 | 18 ++---------------- lib/nuttal_window.f90 | 15 +++++++++++++++ lib/symspec.f90 | 14 ++------------ 5 files changed, 30 insertions(+), 49 deletions(-) create mode 100644 lib/nuttal_window.f90 diff --git a/CMakeLists.txt b/CMakeLists.txt index 0db7a569e..ccb2f6d5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -512,6 +512,7 @@ set (wsjt_FSRCS lib/msk144signalquality.f90 lib/msk144sim.f90 lib/mskrtd.f90 + lib/nuttal_window.f90 lib/ft4/ft4sim.f90 lib/ft4/ft4sim_mult.f90 lib/ft4/ft4_decode.f90 diff --git a/lib/ft4/ft4_decode.f90 b/lib/ft4/ft4_decode.f90 index 8d40aa8cd..89e219545 100644 --- a/lib/ft4/ft4_decode.f90 +++ b/lib/ft4/ft4_decode.f90 @@ -16,7 +16,6 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & character*6 hhmmss complex cd2(0:NMAX/NDOWN-1) !Complex waveform -! complex cds(0:NMAX/NDOWN-1) !Complex waveform complex cb(0:NMAX/NDOWN-1) complex cd(0:NN*NSS-1) !Complex waveform complex ctwk(4*NSS),ctwk2(4*NSS) @@ -32,6 +31,7 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & real savg(NH1),sbase(NH1) integer apbits(2*ND) + integer apmy_ru(28),aphis_fd(28) integer nrxx(100) integer icos4a(0:3),icos4b(0:3),icos4c(0:3),icos4d(0:3) integer*2 iwave(NMAX) !Generated full-length waveform @@ -107,9 +107,6 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & ! 4 MyCall DxCall RRR (77 ap bits) ! 5 MyCall DxCall 73 (77 ap bits) ! 6 MyCall DxCall RR73 (77 ap bits) -!******** -! For this contest-oriented mode, OK to only look for RR73?? -! Currently, 2 AP passes in all Txn states except for Tx5. !******** naptypes(0,1:4)=(/1,2,0,0/) ! Tx6 selected (CQ) naptypes(1,1:4)=(/2,3,0,0/) ! Tx1 @@ -131,6 +128,8 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & apbits=0 apbits(1)=99 apbits(30)=99 + apmy_ru=0 + aphis_fd=0 if(len(trim(mycall)) .lt. 3) go to 10 @@ -147,6 +146,8 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & call unpack77(c77,1,msgsent,unpk77_success) if(i3.ne.1 .or. (message.ne.msgsent) .or. .not.unpk77_success) go to 10 read(c77,'(77i1)') message77 + apmy_ru=2*mod(message77(1:28)+rvec(2:29),2)-1 + aphis_fd=2*mod(message77(30:57)+rvec(29:56),2)-1 message77=mod(message77+rvec,2) call encode174_91(message77,cw) apbits=2*cw-1 @@ -390,43 +391,31 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & llrd(1:28)=apmag*apbits(1:28) else if(ncontest.eq.4) then apmask(2:29)=1 - llrd(2:29)=apmag*apbits(1:28) - else if(ncontest.eq.6) then ! ??? RR73; MyCall ??? - apmask(29:56)=1 - llrd(29:56)=apmag*apbits(1:28) + llrd(2:29)=apmag*apmy_ru(1:28) 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 + if(ncontest.eq.0.or.ncontest.eq.1.or.ncontest.eq.2) then apmask(1:58)=1 llrd(1:58)=apmag*apbits(1:58) else if(ncontest.eq.3) then ! Field Day apmask(1:56)=1 llrd(1:28)=apmag*apbits(1:28) - llrd(29:56)=apmag*apbits(30:57) + llrd(29:56)=apmag*aphis_fd(1:28) else if(ncontest.eq.4) then ! RTTY RU apmask(2:57)=1 - llrd(2:29)=apmag*apbits(1:28) + llrd(2:29)=apmag*apmy_ru(1:28) llrd(30:57)=apmag*apbits(30:57) 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 - if(ncontest.le.4 .or. (ncontest.eq.6.and.iaptype.eq.6)) then -! apmask(1:77)=1 ! mycall, hiscall, RRR|73|RR73 + if(ncontest.le.4) then apmask(1:91)=1 ! mycall, hiscall, RRR|73|RR73 - llrd(1:58)=apmag*apbits(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(iaptype.eq.6) llrd(1:91)=apmag*apbits(1:91) - else if(ncontest.eq.6.and.iaptype.eq.4) then ! Hound listens for MyCall RR73;... - apmask(1:28)=1 - llrd(1:28)=apmag*apbits(1:28) endif endif diff --git a/lib/ft4/getcandidates4.f90 b/lib/ft4/getcandidates4.f90 index 424a7d297..9b5200845 100644 --- a/lib/ft4/getcandidates4.f90 +++ b/lib/ft4/getcandidates4.f90 @@ -20,8 +20,8 @@ subroutine getcandidates4(id,fa,fb,syncmin,nfqso,maxcand,savg,candidate, & if(first) then first=.false. pi=4.0*atan(1.) - window=0.5*(1-cos(pi*(/(i,i=1,NFFT1)/)/(NFFT1/2.0))) - window=window**2 + window=0. + call nuttal_window(window,NFFT1) endif ! Compute symbol spectra, stepping by NSTEP steps. @@ -69,19 +69,5 @@ subroutine getcandidates4(id,fa,fb,syncmin,nfqso,maxcand,savg,candidate, & endif enddo -! do i=1,maxcand -! ipk=maxloc(savsm(nfa:nfb)) -! ip=nfa-1+ipk(1) -! xmax=savsm(ip) -! savsm(max(1,ip-8):min(NH1,ip+8))=0.0 -! if(xmax.ge.syncmin) then -! ncand=ncand+1 -! candidate(1,ncand)=ip*df+f_offset -! candidate(2,ncand)=-99.9 -! candidate(3,ncand)=xmax -! else -! exit -! endif -! enddo return end subroutine getcandidates4 diff --git a/lib/nuttal_window.f90 b/lib/nuttal_window.f90 new file mode 100644 index 000000000..aa813b15d --- /dev/null +++ b/lib/nuttal_window.f90 @@ -0,0 +1,15 @@ +subroutine nuttal_window(win,n) + real win(n) + + pi=4.0*atan(1.0) + a0=0.3635819 + a1=-0.4891775; + a2=0.1365995; + a3=-0.0106411; + do i=1,n + win(i)=a0+a1*cos(2*pi*(i-1)/(n))+ & + a2*cos(4*pi*(i-1)/(n))+ & + a3*cos(6*pi*(i-1)/(n)) + enddo + return +end subroutine nuttal_window diff --git a/lib/symspec.f90 b/lib/symspec.f90 index 78215e209..b9f5e2088 100644 --- a/lib/symspec.f90 +++ b/lib/symspec.f90 @@ -50,18 +50,8 @@ subroutine symspec(shared_data,k,ntrperiod,nsps,ingain,bLowSidelobes, & if(nfft3.ne.nfft3z) then ! Compute new window pi=4.0*atan(1.0) -! Coefficients taken from equation 37 of NUSC report: -! "Some windows with very good sidelobe behavior: application to -! discrete Hilbert Transform, by Albert Nuttall" - a0=0.3635819 - a1=-0.4891775; - a2=0.1365995; - a3=-0.0106411; - do i=1,nfft3 - w3(i)=a0+a1*cos(2*pi*(i-1)/(nfft3))+ & - a2*cos(4*pi*(i-1)/(nfft3))+ & - a3*cos(6*pi*(i-1)/(nfft3)) - enddo + w3=0 + call nuttal_window(w3,nfft3) nfft3z=nfft3 endif From d7012267c063b05602a42ceb94ab3b4f53bde9b1 Mon Sep 17 00:00:00 2001 From: Steve Franke Date: Mon, 4 Mar 2019 17:10:57 -0600 Subject: [PATCH 5/6] CQ message type strings are now passed from mainwindow.cpp to ft4_decode.f90, to enable AP decoding of special CQ messages. --- lib/ft4/ft4_decode.f90 | 40 +++++++++++++++++++++++----------------- widgets/mainwindow.cpp | 15 ++++++++++++--- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/lib/ft4/ft4_decode.f90 b/lib/ft4/ft4_decode.f90 index 89e219545..3a8c12f14 100644 --- a/lib/ft4/ft4_decode.f90 +++ b/lib/ft4/ft4_decode.f90 @@ -1,5 +1,5 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & - iwave,ndecodes,mycall,hiscall,nrx,line,data_dir) + iwave,ndecodes,mycall,hiscall,cqstr,nrx,line,data_dir) use packjt77 include 'ft4_params.f90' @@ -14,6 +14,7 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & character*12 mycall,hiscall character*12 mycall0,hiscall0 character*6 hhmmss + character*4 cqstr,cqstr0 complex cd2(0:NMAX/NDOWN-1) !Complex waveform complex cb(0:NMAX/NDOWN-1) @@ -41,7 +42,7 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & integer ip(1) integer nappasses(0:5) ! # of decoding passes for QSO States 0-5 integer naptypes(0:5,4) ! nQSOProgress, decoding pass - integer mcq(29),mcqru(29),mcqfd(29),mcqtest(29) + integer mcq(29) integer mrrr(19),m73(19),mrr73(19) logical nohiscall,unpk77_success @@ -56,9 +57,6 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & data msg0/' '/ data first/.true./ 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 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/ @@ -66,7 +64,7 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & 1,0,0,1,0,1,1,0,0,0,0,1,0,0,0,1,0,1,0,0,1,1,1,1,0,0,1,0,1, & 0,1,0,1,0,1,1,0,1,1,1,1,1,0,0,0,1,0,1/ save fs,dt,tt,txt,twopi,h,one,first,nrxx,linex,apbits,nappasses,naptypes, & - mycall0,hiscall0,msg0 + mycall0,hiscall0,msg0,cqstr0 call clockit('ft4_deco',0) hhmmss=cdatetime0(8:13) @@ -85,10 +83,6 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & enddo enddo - mcq=2*mod(mcq+rvec(1:29),2)-1 - mcqfd=2*mod(mcqfd+rvec(1:29),2)-1 - mcqru=2*mod(mcqru+rvec(1:29),2)-1 - mcqtest=2*mod(mcqtest+rvec(1:29),2)-1 mrrr=2*mod(mrrr+rvec(59:77),2)-1 m73=2*mod(m73+rvec(59:77),2)-1 mrr73=2*mod(mrr73+rvec(59:77),2)-1 @@ -117,9 +111,26 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & mycall0='' hiscall0='' + cqstr0='' first=.false. endif + if(cqstr.ne.cqstr0) then + i0=index(cqstr,' ') + if(i0.le.1) then + message='CQ A1AA AA01' + else + message='CQ '//cqstr(1:i0-1)//' A1AA AA01' + endif + i3=-1 + n3=-1 + call pack77(message,i3,n3,c77) + call unpack77(c77,1,msgsent,unpk77_success) + read(c77,'(29i1)') mcq + mcq=2*mod(mcq+rvec(1:29),2)-1 + cqstr0=cqstr + endif + l1=index(mycall,char(0)) if(l1.ne.0) mycall(l1:)=" " l1=index(hiscall,char(0)) @@ -367,15 +378,10 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, & if(iaptype.ge.2 .and. apbits(1).gt.1) cycle ! No, or nonstandard, mycall if(iaptype.ge.3 .and. apbits(30).gt.1) cycle ! No, or nonstandard, dxcall - if(iaptype.eq.1) then ! CQ or CQ TEST + if(iaptype.eq.1) then ! CQ or CQ TEST or CQ FD or CQ RU or CQ SCC 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*mcq(1:29) + llrd(1:29)=apmag*mcq(1:29) endif if(iaptype.eq.2) then ! MyCall,???,??? diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index a304af574..ef6df71c4 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -171,8 +171,8 @@ extern "C" { void ft4_decode_(char* cdatetime, float* tbuf, int* nfa, int* nfb, int* nQSOProgress, int* nContest, int* nfqso, short int id[], int* ndecodes, char* mycall, - char* hiscall, int* nrx, char* line, char* ddir, int len1, int len2, - int len3, int len4, int len5); + char* hiscall, char* cqstr, int* nrx, char* line, char* ddir, int len1, + int len2, int len3, int len4, int len5, int len6); void get_ft4msg_(int* idecode, int* nrx, char* line, int len); @@ -8714,8 +8714,17 @@ void MainWindow::ft4Data(int k) dataDir = m_config.writeable_data_dir ().absolutePath (); char ddir[512]; strncpy(ddir,dataDir.toLatin1(), sizeof (ddir) - 1); + char cqstr[4]; + strncpy(cqstr," ",4); + if(SpecOp::NA_VHF == m_config.special_op_id()) strncpy(cqstr,"TEST",4); + if(SpecOp::EU_VHF == m_config.special_op_id()) strncpy(cqstr,"TEST",4); + if(SpecOp::FIELD_DAY == m_config.special_op_id()) strncpy(cqstr,"FD",2); + if(SpecOp::RTTY == m_config.special_op_id()) { + if(m_config.RTTY_Exchange()!="SCC") strncpy(cqstr,"RU",2); + if(m_config.RTTY_Exchange()=="SCC") strncpy(cqstr,"SCC",3); + } ft4_decode_(cdatetime,&tbuf,&nfa,&nfb,&nQSOProgress,&nContest,&nfqso,id,&ndecodes,&mycall[0],&hiscall[0], - &nrx,&line[0],&ddir[0],17,12,12,61,512); + &cqstr[0],&nrx,&line[0],&ddir[0],17,12,12,4,61,512); line[60]=0; for (int idecode=1; idecode<=ndecodes; idecode++) { get_ft4msg_(&idecode,&nrx,&line[0],61); From 1b591e2c8c888c17f54e6b9d8df7969c7bd5c9ff Mon Sep 17 00:00:00 2001 From: Steve Franke Date: Mon, 4 Mar 2019 17:26:24 -0600 Subject: [PATCH 6/6] Make ft4d work with cqstr. --- lib/ft4/ft4d.f90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ft4/ft4d.f90 b/lib/ft4/ft4d.f90 index b92ff8711..7c17481b1 100644 --- a/lib/ft4/ft4d.f90 +++ b/lib/ft4/ft4d.f90 @@ -8,6 +8,7 @@ program ft4d character*12 hiscall character*80 infile character*61 line + character*4 cqstr real*8 fMHz integer ihdr(11) integer*2 iwave(180000) !15*12000 @@ -44,11 +45,12 @@ program ft4d endif nfa=0 nfb=4224 - ncontest=4 ndecodes=0 nfqso=1500 mycall="K9AN" hiscall="K1JT" + ncontest=4 + cqstr="RU " do ifile=iarg,nargs call getarg(ifile,infile) @@ -66,7 +68,7 @@ program ft4d i0=(n-1)*istep + 1 tbuf=(i0-1)/12000.0 call ft4_decode(cdatetime,tbuf,nfa,nfb,nQSOProgress,ncontest, & - nfqso,iwave(i0),ndecodes,mycall,hiscall,nrx,line,data_dir) + nfqso,iwave(i0),ndecodes,mycall,hiscall,cqstr,nrx,line,data_dir) do idecode=1,ndecodes call get_ft4msg(idecode,nrx,line) write(*,'(a61)') line