From 3812f2f9bcf40bfffa55735ced1908d258e09f4e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 7 May 2024 09:10:57 -0400 Subject: [PATCH] Add code to support use of SuperFox digital signatures. --- commons.h | 1 + lib/decoder.f90 | 4 ++-- lib/jt9com.f90 | 1 + widgets/mainwindow.cpp | 7 +++++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/commons.h b/commons.h index 43fab1bcb..b5d406b2f 100644 --- a/commons.h +++ b/commons.h @@ -66,6 +66,7 @@ typedef struct dec_data { char hisgrid[6]; bool b_even_seq; bool b_superfox; + int yymmdd; } params; } dec_data_t; diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 9f677da9a..9501c8bcc 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -67,7 +67,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample) ntr0=params%ntr rms=sqrt(dot_product(float(id2(1:180000)), & float(id2(1:180000)))/180000.0) - if(rms.lt.3.0) go to 800 + if(rms.lt.0.5) go to 800 !cast C character arrays to Fortran character strings datetime=transfer(params%datetime, datetime) @@ -143,7 +143,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample) if(params%nzhsym.lt.50) go to 800 ! Call the superFox decoder open(47,file='fort.47',status='unknown',access='stream') - write(47) params%nutc,id2(1:20),id2(1:180000) + write(47) params%yymmdd,params%nutc,id2(1:20),id2(1:180000) close(47) call execute_command_line('.\sfrx fort.47') else diff --git a/lib/jt9com.f90 b/lib/jt9com.f90 index a156e9862..3012a424d 100644 --- a/lib/jt9com.f90 +++ b/lib/jt9com.f90 @@ -49,6 +49,7 @@ character(kind=c_char) :: hisgrid(6) logical(c_bool) :: b_even_seq logical(c_bool) :: b_superfox + integer(c_int) :: yymmdd end type params_block type, bind(C) :: dec_data diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 3e2c3f8a3..927d3d2eb 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -3132,6 +3132,7 @@ void MainWindow::read_wav_file (QString const& fname) dec_data.params.newdat = 0; } + dec_data.params.yymmdd=basename.left(6).toInt(); if(basename.mid(0,10)=="000000_000" && m_mode == "FT8") { int isec=15*basename.mid(10,3).toInt(); int ih=isec/3600; @@ -3406,8 +3407,10 @@ void MainWindow::decode() //decode() m_dateTimeLastTX = now.addSecs(-900); dec_data.params.lapcqonly=true; } - if( m_diskData ) { + if(m_diskData) { dec_data.params.lapcqonly=false; + } else { + dec_data.params.yymmdd=-1; } if(!m_dataAvailable or m_TRperiod==0.0) return; ui->DecodeButton->setChecked (true); @@ -10940,7 +10943,7 @@ void MainWindow::sfox_tx() auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()}; QStringList args{fname}; args.append(m_config.FoxKey()); - qDebug() << "aa" << args; +// qDebug() << "aa" << args; p2.start(QDir::toNativeSeparators(m_appDir)+QDir::separator()+"sftx", args); p2.waitForFinished(); auto fname2 {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_2.dat")).toLocal8Bit()};