From f8079fbcbebcc1e2c9f9a951405e29582ea94483 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 21 Sep 2024 15:31:48 -0400 Subject: [PATCH] More (final?) corrections to logic for handling SF free text messages. --- lib/ft8/foxgen.f90 | 2 +- lib/superfox/sftx_sub.f90 | 6 ++---- widgets/mainwindow.cpp | 16 +++++----------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/lib/ft8/foxgen.f90 b/lib/ft8/foxgen.f90 index b9e39f624..7f6365f1f 100644 --- a/lib/ft8/foxgen.f90 +++ b/lib/ft8/foxgen.f90 @@ -38,7 +38,7 @@ subroutine foxgen(bSuperFox,fname) n=nslots if(bMoreCQs) cmsg(1)(40:40)='1' !Set flag to include a CQ if(bSendMsg) then - n=min(nslots+1,3) + n=min(nslots+1,5) cmsg(n)=textMsg cmsg(n)(39:39)='1' !Set flag for text message nslots=n diff --git a/lib/superfox/sftx_sub.f90 b/lib/superfox/sftx_sub.f90 index ed6c678c7..9227c6ccc 100644 --- a/lib/superfox/sftx_sub.f90 +++ b/lib/superfox/sftx_sub.f90 @@ -1,4 +1,4 @@ -subroutine sftx_sub(ckey0) +subroutine sftx_sub(ckey0,nslots,bSendMsg) ! This routine is required in order to create a SuperFox transmission. @@ -24,7 +24,7 @@ subroutine sftx_sub(ckey0) integer*1 y(0:127) !Encoded symbols as i*1 integers integer chansym0(127) !Transmitted symbols, data only integer isync(24) !Symbol numbers for sync tones - common/foxcom3/nslots,cmsg(5),itone(151) + common/foxcom3/nslots2,cmsg(5),itone(151) data isync/1,2,4,7,11,16,22,29,37,39,42,43,45,48,52,57,63,70,78,80, & 83,84,86,89/ @@ -34,10 +34,8 @@ subroutine sftx_sub(ckey0) call sfox_init(7,127,50,'no',fspread,delay,fsample,24) freeTextMsg=' ' bMoreCQs=cmsg(1)(40:40).eq.'1' - bSendMsg=cmsg(nslots)(39:39).eq.'1' if(bSendMsg) then freeTextMsg=cmsg(nslots)(1:26) - if(nslots.gt.4) nslots=4 endif call foxgen2(nslots,cmsg,line,foxcall) !Parse old-style Fox messages diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 0558c03c4..e2bd7131f 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -182,7 +182,7 @@ extern "C" { void sfox_wave_gfsk_(); - void sftx_sub_(char const * otp_key, FCL len1); + void sftx_sub_(char const * otp_key, int* nslots, bool* b, FCL len1); void plotsave_(float swide[], int* m_w , int* m_h1, int* irow); @@ -2673,11 +2673,7 @@ void MainWindow::statusChanged() ui->cbSendMsg->setVisible(true); if (m_config.superFox()) { ui->sbNslots->setVisible(false); - if(ui->cbSendMsg->isChecked()) { - ui->sbNslots->setValue(4); - } else { ui->sbNslots->setValue(5); - } } else { ui->sbNslots->setVisible(true); ui->sbNslots->setValue(m_Nslots0); @@ -9221,11 +9217,7 @@ void MainWindow::on_cbSendMsg_toggled(bool b) { if (!(m_config.superFox() && m_specOp==SpecOp::FOX)) return; // don't do anything with slot values unless SuperFox mode - if(b) { - ui->sbNslots->setValue(4); //### Is the correct value 4? Or 2? Is better logic needed? ### - } else { - ui->sbNslots->setValue(5); - } + if(b or !b) ui->sbNslots->setValue(5); //SF always uses Nslots=5 } void MainWindow::on_cbShMsgs_toggled(bool b) @@ -11466,6 +11458,8 @@ void MainWindow::sfox_tx() { } } #endif - sftx_sub_(ckey.toLatin1().constData(), (FCL)ckey.size()); + bool b=ui->cbSendMsg->isChecked(); + foxcom_.bSendMsg=b; + sftx_sub_(ckey.toLatin1().constData(), &m_Nslots, &b, (FCL)ckey.size()); sfox_wave_gfsk_(); }