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
+20 -11
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;
}