Working toward free-text message capability for SuperFox.

This commit is contained in:
Joe Taylor 2024-03-25 15:46:20 -04:00
parent e7bfdbc656
commit 76db12cff0
6 changed files with 41 additions and 18 deletions

View File

@ -427,7 +427,7 @@ set (wsjt_FSRCS
lib/fspread_lorentz.f90
lib/ft8/foxfilt.f90
lib/ft8/foxgen.f90
lib/ft8/foxgen_wrap.f90
# lib/ft8/foxgen_wrap.f90
lib/freqcal.f90
lib/ft8/ft8apset.f90
lib/ft8/ft8b.f90

View File

@ -93,7 +93,9 @@ extern struct {
int i3bit[5];
char cmsg[5][40];
char mycall[12];
char textMsg[26];
bool bMoreCQs;
bool bSendMsg;
} foxcom_;
#ifdef __cplusplus

View File

@ -17,9 +17,10 @@ subroutine foxgen(bSuperFox,fname)
parameter (NN=79,ND=58,NSPS=4*1920)
parameter (NWAVE=(160+2)*134400*4) !the biggest waveform we generate (FST4-1800 at 48kHz)
parameter (NFFT=614400,NH=NFFT/2)
logical*1 bSuperFox,bMoreCQs
logical*1 bSuperFox,bMoreCQs,bSendMsg
character*(*) fname
character*40 cmsg
character*26 textMsg
character*37 msg,msgsent
integer itone(79)
integer*1 msgbits(77),msgbits2
@ -27,14 +28,23 @@ subroutine foxgen(bSuperFox,fname)
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),bMoreCQs
common/foxcom/wave(NWAVE),nslots,nfreq,i3bit(5),cmsg(5),mycall(12), &
textMsg,bMoreCQs,bSendMsg
common/foxcom2/itone2(NN),msgbits2(77)
equivalence (x,cx),(y,cy)
if(bSuperFox) then
if(bMoreCQs) cmsg(1)(40:40)='1'
if(bMoreCQs) cmsg(1)(40:40)='1' !Set flag to include a CQ
! print*,'A',bMoreCQs,bSendMsg,nslots,textMsg
if(bSendMsg) then
cmsg(1)(39:39)='1' !Set flag for text message
n=min(nslots+1,3)
cmsg(n)=textMsg
! do i=1,n
! print*,'CC',i,cmsg(i)
! enddo
endif
open(25,file=fname,status='unknown')
rewind(25)
write(25,'(a40)') cmsg(1:nslots)
close(25)
return

View File

@ -1225,6 +1225,7 @@ void MainWindow::writeSettings()
m_settings->setValue("FoxNslots",ui->sbNslots->value());
m_settings->setValue("FoxMaxDB_v2",ui->sbMax_dB->value()); // original key abandoned
m_settings->setValue ("SerialNumber",ui->sbSerialNumber->value ());
m_settings->setValue("FoxTextMsg", m_freeTextMsg0);
m_settings->endGroup();
// do this in the General group because we save the parameters from various places
@ -1336,6 +1337,8 @@ void MainWindow::readSettings()
ui->sbNslots->setValue(m_Nslots);
ui->sbMax_dB->setValue(m_settings->value("FoxMaxDB_v2",70).toInt());
ui->sbSerialNumber->setValue (m_settings->value ("SerialNumber", 1).toInt ());
m_freeTextMsg0=m_settings->value("FoxTextMsg","").toString();
m_freeTextMsg=m_freeTextMsg0;
m_settings->endGroup();
m_settings->beginGroup("Common");
@ -2226,13 +2229,11 @@ void MainWindow::keyPressEvent (QKeyEvent * e)
case Qt::Key_Backspace:
qDebug() << "Key Backspace";
return;
//#ifdef DEBUG_FOX
case Qt::Key_X:
if(e->modifiers() & Qt::AltModifier) {
foxTest();
return;
}
//#endif
}
QMainWindow::keyPressEvent (e);
}
@ -2453,8 +2454,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e)
break;
case Qt::Key_X:
if(e->modifiers() & Qt::AltModifier) {
// qDebug() << "Alt-X" << m_mode << m_TRperiod << m_nsps << m_bFast9
// << tx_duration(m_mode,m_TRperiod,m_nsps,m_bFast9);
foxTest();
return;
}
}
@ -3459,8 +3459,6 @@ void MainWindow::decode() //decode()
dec_data.params.b_even_seq=(dec_data.params.nutc%10)==0;
dec_data.params.b_superfox=(m_config.superFox() and (SpecOp::FOX == m_specOp or SpecOp::HOUND == m_specOp));
if(dec_data.params.b_superfox and dec_data.params.b_even_seq and m_ihsym<50) return;
// qDebug() << "aa" << dec_data.params.nutc << dec_data.params.b_even_seq
// << dec_data.params.b_superfox << m_ihsym;
dec_data.params.ntol=ui->sbFtol->value ();
if(!m_config.enable_VHF_features()) {
@ -4834,6 +4832,8 @@ void MainWindow::guiUpdate()
bool bSuperFox=m_config.superFox();
auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()};
foxcom_.bMoreCQs=ui->cbMoreCQs->isChecked();
foxcom_.bSendMsg=ui->cbSendMsg->isChecked();
memcpy(foxcom_.textMsg, m_freeTextMsg.leftJustified(26,' ').toLatin1(),26);
foxgen_(&bSuperFox, fname.constData(), (FCL)fname.size());
if(bSuperFox) sfox_tx();
}
@ -5119,10 +5119,8 @@ void MainWindow::guiUpdate()
readWidebandDecodes();
}
if(ipc_qmap[5]>0) {
// qDebug() << "aa" << m_freqNominal << ipc_qmap[5];
setRig((m_freqNominal/1000000)*1000000 + 1000*ipc_qmap[5]);
ipc_qmap[5]=0;
// qDebug() << "bb" << m_freqNominal << ipc_qmap[5];
}
mem_qmap.unlock();
}
@ -8852,6 +8850,15 @@ void MainWindow::on_cbFast9_clicked(bool b)
statusChanged ();
}
void MainWindow::on_cbSendMsg_toggled(bool b)
{
if(m_Nslots0>0 and !b) {
ui->sbNslots->setValue(m_Nslots0);
} else {
m_Nslots0=m_Nslots;
if(m_Nslots>2) ui->sbNslots->setValue(2);
}
}
void MainWindow::on_cbShMsgs_toggled(bool b)
{
@ -10326,6 +10333,11 @@ Transmit:
QString foxCall=m_config.my_callsign() + " ";
::memcpy(foxcom_.mycall, foxCall.toLatin1(),sizeof foxcom_.mycall); //Copy Fox callsign into foxcom_
bool bSuperFox=m_config.superFox();
foxcom_.bMoreCQs=ui->cbMoreCQs->isChecked();
foxcom_.bSendMsg=ui->cbSendMsg->isChecked();
// qDebug() << "bb" << foxcom_.bMoreCQs << foxcom_.bSendMsg << foxcom_.nslots
// << m_Nslots << m_freeTextMsg0;
::memcpy(foxcom_.textMsg, m_freeTextMsg0.leftJustified(26,' ').toLatin1(),26);
auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()};
foxgen_(&bSuperFox, fname.constData(), (FCL)fname.size());
if(bSuperFox) sfox_tx();
@ -10514,7 +10526,6 @@ void MainWindow::foxTest()
return;
}
QTextStream s(&f);
QTextStream sdiag(&fdiag);
@ -10906,11 +10917,9 @@ void MainWindow::on_jt65Button_clicked()
void MainWindow::sfox_tx()
{
// qint64 ms0 = QDateTime::currentMSecsSinceEpoch();
auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()};
p2.start(QDir::toNativeSeparators(m_appDir)+QDir::separator()+"sftx", QStringList {fname});
p2.waitForFinished();
auto fname2 {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_2.dat")).toLocal8Bit()};
sfox_wave_(fname2.constData(), (FCL)fname2.size());
// qDebug() << "cc" << QDateTime::currentMSecsSinceEpoch() - ms0;
}

View File

@ -283,6 +283,7 @@ private slots:
void on_actionAuto_Clear_Avg_toggled (bool);
void VHF_features_enabled(bool b);
void on_sbSubmode_valueChanged(int n);
void on_cbSendMsg_toggled(bool b);
void on_cbShMsgs_toggled(bool b);
void on_cbSWL_toggled(bool b);
void on_cbTx6_toggled(bool b);
@ -496,6 +497,7 @@ private:
qint32 m_nHoundsCalling=0;
qint32 m_Nlist=12;
qint32 m_Nslots=5;
qint32 m_Nslots0=0;
qint32 m_nFoxMsgTimes[5]={0,0,0,0,0};
qint32 m_tAutoOn;
qint32 m_tFoxTx=0;

View File

@ -2385,9 +2385,9 @@ Double-click to reset to the standard 73 message</string>
</widget>
</item>
<item row="9" column="2">
<widget class="QCheckBox" name="cbSend_it">
<widget class="QCheckBox" name="cbSendMsg">
<property name="text">
<string>Send it</string>
<string>Send msg</string>
</property>
</widget>
</item>