More (final?) corrections to logic for handling SF free text messages.

This commit is contained in:
Joe Taylor 2024-09-21 15:31:48 -04:00
parent 9b65b6c4e5
commit f8079fbcbe
3 changed files with 8 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -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_();
}