summaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/AbstractLogWindow.cpp5
-rw-r--r--widgets/SplashScreen.cpp2
-rw-r--r--widgets/about.cpp2
-rw-r--r--widgets/mainwindow.cpp651
-rw-r--r--widgets/mainwindow.h6
-rw-r--r--widgets/mainwindow.ui11
-rw-r--r--widgets/plotter.cpp86
-rw-r--r--widgets/plotter.h2
-rw-r--r--widgets/widegraph.cpp7
-rw-r--r--widgets/widegraph.h1
10 files changed, 407 insertions, 366 deletions
diff --git a/widgets/AbstractLogWindow.cpp b/widgets/AbstractLogWindow.cpp
index cbe2b873..b8e2d7e7 100644
--- a/widgets/AbstractLogWindow.cpp
+++ b/widgets/AbstractLogWindow.cpp
@@ -64,7 +64,10 @@ void AbstractLogWindow::impl::delete_QSOs ()
, tr ("Confirm Delete")
, tr ("Are you sure you want to delete the %n "
"selected QSO(s) from the log?", ""
- , row_indexes.size ())))
+ , row_indexes.size ())
+ , QString {}
+ , MessageBox::Yes | MessageBox::No
+ , MessageBox::No))
{
// We must work with source model indexes because we don't want row
// removes to invalidate model indexes we haven't yet processed. We
diff --git a/widgets/SplashScreen.cpp b/widgets/SplashScreen.cpp
index 42f82877..561733cc 100644
--- a/widgets/SplashScreen.cpp
+++ b/widgets/SplashScreen.cpp
@@ -33,7 +33,7 @@ SplashScreen::SplashScreen ()
revision ()}.simplified () + "</h2>"
"V2.0 has many new features.<br /><br />"
"The release notes have more details.<br /><br />"
- "Send issue reports to wsjtgroup@yahoogroups.com, and be sure to save .wav<br />"
+ "Send issue reports to https://wsjtx.groups.io, and be sure to save .wav<br />"
"files where appropriate.<br /><br />"
"<b>Open the Help menu and select Release Notes for more details.</b><br />"
"<img src=\":/icon_128x128.png\" />"
diff --git a/widgets/about.cpp b/widgets/about.cpp
index 7989f5c9..5ba2003a 100644
--- a/widgets/about.cpp
+++ b/widgets/about.cpp
@@ -21,7 +21,7 @@ CAboutDlg::CAboutDlg(QWidget *parent) :
"&copy; 2001-2021 by Joe Taylor, K1JT, Bill Somerville, G4WJS, <br />"
"and Steve Franke, K9AN. <br /><br />"
"We gratefully acknowledge contributions from AC6SL, AE4JY,<br />"
- "DF2ET, DJ0OT, G3WDG, G4KLA, IV3NWV, IW3RAB, KA1GT, K3WYC,<br />"
+ "DF2ET, DJ0OT, G3WDG, G4KLA, IW3RAB, K3WYC, KA1GT,<br />"
"KA6MAL, KA9Q, KB1ZMX, KD6EKQ, KI7MT, KK1D, ND0B, PY2SDR,<br />"
"VE1SKY, VK3ACF, VK4BDJ, VK7MO, W3DJS, W4TI, W4TV, and W9MDB.<br /><br />"
"WSJT-X is licensed under the terms of Version 3 <br />"
diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp
index 8e442d05..26dba0e6 100644
--- a/widgets/mainwindow.cpp
+++ b/widgets/mainwindow.cpp
@@ -139,8 +139,6 @@ extern "C" {
void genwspr_(char* msg, char* msgsent, int itone[], fortran_charlen_t, fortran_charlen_t);
- void geniscat_(char* msg, char* msgsent, int itone[], fortran_charlen_t, fortran_charlen_t);
-
void azdist_(char* MyGrid, char* HisGrid, double* utch, int* nAz, int* nEl,
int* nDmiles, int* nDkm, int* nHotAz, int* nHotABetter,
fortran_charlen_t, fortran_charlen_t);
@@ -186,8 +184,8 @@ extern "C" {
void chk_samples_(int* m_ihsym,int* k, int* m_hsymStop);
}
-int volatile itone[NUM_ISCAT_SYMBOLS]; //Audio tones for all Tx symbols
-int volatile itone0[NUM_ISCAT_SYMBOLS]; //Dummy array, data not actually used
+int volatile itone[MAX_NUM_SYMBOLS]; //Audio tones for all Tx symbols
+int volatile itone0[MAX_NUM_SYMBOLS]; //Dummy array, data not actually used
int volatile icw[NUM_CW_SYMBOLS]; //Dits for CW ID
dec_data_t dec_data; // for sharing with Fortran
@@ -595,7 +593,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
ui->actionJT4->setActionGroup(modeGroup);
ui->actionWSPR->setActionGroup(modeGroup);
ui->actionEcho->setActionGroup(modeGroup);
- ui->actionISCAT->setActionGroup(modeGroup);
ui->actionMSK144->setActionGroup(modeGroup);
ui->actionQ65->setActionGroup(modeGroup);
ui->actionFreqCal->setActionGroup(modeGroup);
@@ -971,7 +968,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
set_mode (m_mode);
if(m_mode=="Echo") monitor(false); //Don't auto-start Monitor in Echo mode.
ui->sbSubmode->setValue (vhf ? m_nSubMode : 0); //Submodes require VHF features
- if(m_mode=="ISCAT" and !vhf) mode_label.setText("ISCAT A");
if(m_mode=="MSK144") {
Q_EMIT transmitFrequency (1000.0);
} else {
@@ -1038,9 +1034,9 @@ void MainWindow::not_GA_warning_message ()
MessageBox::critical_message (this,
"This is a pre-release version of WSJT-X 2.4.0 made\n"
"available for testing purposes. By design it will\n"
- "be nonfunctional after Apr 27, 2021.");
+ "be nonfunctional after May 30, 2021.");
auto now = QDateTime::currentDateTimeUtc ();
- if (now >= QDateTime {{2021, 4, 27}, {23, 59, 59, 999}, Qt::UTC}) {
+ if (now >= QDateTime {{2021, 5, 30}, {23, 59, 59, 999}, Qt::UTC}) {
Q_EMIT finished ();
}
}
@@ -1447,6 +1443,7 @@ void MainWindow::dataSink(qint64 frames)
dec_data.params.ndiskdat=1;
} else {
dec_data.params.ndiskdat=0;
+ m_wideGraph->setDiskUTC(-1);
}
m_bUseRef=m_wideGraph->useRef();
@@ -1456,7 +1453,7 @@ void MainWindow::dataSink(qint64 frames)
}
m_bClearRefSpec=false;
- if(m_mode=="ISCAT" or m_mode=="MSK144" or m_bFast9) {
+ if(m_mode=="MSK144" or m_bFast9) {
fastSink(frames);
if(m_bFastMode) return;
}
@@ -1755,7 +1752,7 @@ void MainWindow::fastSink(qint64 frames)
m_logBook,m_currentBand,m_config.ppfx());
m_bDecoded=true;
auto_sequence (decodedtext, ui->sbFtol->value (), std::numeric_limits<unsigned>::max ());
- if (m_mode != "ISCAT") postDecode (true, decodedtext.string ());
+ postDecode (true, decodedtext.string ());
// writeAllTxt(message);
write_all("Rx",message);
bool stdMsg = decodedtext.report(m_baseCall,
@@ -1878,7 +1875,7 @@ void MainWindow::on_actionSettings_triggered() //Setup Dialog
if (!vhf) ui->sbSubmode->setValue (0);
setup_status_bar (vhf);
- bool b = vhf && (m_mode=="JT4" or m_mode=="JT65" or m_mode=="ISCAT" or
+ bool b = vhf && (m_mode=="JT4" or m_mode=="JT65" or
m_mode=="JT9" or m_mode=="MSK144" or m_mode=="Q65");
if(b) VHF_features_enabled(b);
set_mode (m_mode);
@@ -2383,10 +2380,8 @@ void MainWindow::setup_status_bar (bool vhf)
mode_label.setText (t);
} else {
mode_label.setText (m_mode);
- }
- if ("ISCAT" == m_mode) {
- mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #ff9933}");
- } else if ("JT9" == m_mode) {
+ }
+ if ("JT9" == m_mode) {
mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #ff6ec7}");
} else if ("JT4" == m_mode) {
mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #cc99ff}");
@@ -2410,7 +2405,7 @@ void MainWindow::setup_status_bar (bool vhf)
mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #ff9933}");
}
last_tx_label.setText (QString {});
- if (m_mode.contains (QRegularExpression {R"(^(Echo|ISCAT))"})) {
+ if (m_mode.contains (QRegularExpression {R"(^(Echo))"})) {
if (band_hopping_label.isVisible ()) statusBar ()->removeWidget (&band_hopping_label);
} else if (m_mode=="WSPR") {
mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #ff66ff}");
@@ -2601,7 +2596,7 @@ void MainWindow::on_actionCopyright_Notice_triggered()
"notice prominently in your derivative work:\n\n"
"\"The algorithms, source code, look-and-feel of WSJT-X and related "
"programs, and protocol specifications for the modes FSK441, FST4, FT8, "
- "JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, ISCAT, MSK144 are Copyright (C) "
+ "JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) "
"2001-2021 by one or more of the following authors: Joseph Taylor, "
"K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, "
"IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; "
@@ -2870,6 +2865,7 @@ void MainWindow::on_actionDecode_remaining_files_in_directory_triggered()
void MainWindow::diskDat() //diskDat()
{
+ m_wideGraph->setDiskUTC(dec_data.params.nutc);
if(dec_data.params.kin>0) {
int k;
int kstep=m_FFTSize;
@@ -3199,7 +3195,7 @@ void MainWindow::decode() //decode()
from += noffset;
size -= noffset;
}
- if(m_mode=="ISCAT" or m_mode=="MSK144" or m_bFast9) {
+ if(m_mode=="MSK144" or m_bFast9) {
float t0=m_t0;
float t1=m_t1;
qApp->processEvents(); //Update the waterfall
@@ -3221,7 +3217,6 @@ void MainWindow::decode() //decode()
narg[7]=1000.0*t1;
narg[8]=2; //Max decode lines per decode attempt
if(dec_data.params.minSync<0) narg[8]=50;
- if(m_mode=="ISCAT") narg[9]=101; //ISCAT
if(m_mode=="JT9") narg[9]=102; //Fast JT9
if(m_mode=="MSK144") narg[9]=104; //MSK144
narg[10]=ui->RxFreqSpinBox->value();
@@ -3300,7 +3295,6 @@ void MainWindow::to_jt9(qint32 n, qint32 istart, qint32 idone)
void MainWindow::decodeDone ()
{
- if(m_mode!="FT8" or dec_data.params.nzhsym==50) m_nDecodes=0;
if(m_mode=="Q65") m_wideGraph->drawRed(0,0);
if ("FST4W" == m_mode)
{
@@ -3317,11 +3311,20 @@ void MainWindow::decodeDone ()
double tdone = fmod(double(tnow.time().second()),m_TRperiod);
int mswait;
if( tdone < 0.5*m_TRperiod ) {
- mswait = 1000.0 * ( 0.75 * m_TRperiod - tdone );
+ mswait = 1000.0 * ( 0.6 * m_TRperiod - tdone );
} else {
- mswait = 1000.0 * ( 1.75 * m_TRperiod - tdone );
+ mswait = 1000.0 * ( 1.6 * m_TRperiod - tdone );
}
- if(!m_diskData) killFileTimer.start(mswait); //Kill at 3/4 period
+ m_bDecoded=m_nDecodes>0;
+// qDebug() << "aa 3316" << m_saveDecoded << m_saveAll << m_bDecoded << m_nDecodes
+// << m_TRperiod << tdone << mswait;
+ if(!m_diskData and !m_saveAll) {
+ if(m_saveDecoded and (m_nDecodes==0)) {
+// qDebug() << "bb 3319" << mswait;
+ killFileTimer.start(mswait); //Kill at 3/4 period
+ }
+ }
+ if(m_mode!="FT8" or dec_data.params.nzhsym==50) m_nDecodes=0;
dec_data.params.nagain=0;
dec_data.params.ndiskdat=0;
@@ -3494,8 +3497,8 @@ void MainWindow::readFromStdout() //readFromStdout
//Right (Rx Frequency) window
bool bDisplayRight=bAvgMsg;
int audioFreq=decodedtext.frequencyOffset();
-// if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4" or m_mode=="Q65") {
- if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4") {
+ if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4" or m_mode=="Q65") {
+// if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4") {
int ftol=10;
if(m_mode=="Q65") ftol=ui->sbFtol->value();
auto const& parts = decodedtext.string().remove("<").remove(">")
@@ -3640,7 +3643,7 @@ void MainWindow::auto_sequence (DecodedText const& message, unsigned start_toler
auto const& message_words = message.messageWords ();
auto is_73 = message_words.filter (QRegularExpression {"^(73|RR73)$"}).size();
bool is_OK=false;
- if(m_mode=="MSK144" and message.string().indexOf(ui->dxCallEntry->text()+" R ")>0) is_OK=true;
+ if(m_mode=="MSK144" and message.clean_string ().indexOf(ui->dxCallEntry->text()+" R ")>0) is_OK=true;
if (message_words.size () > 2 && (message.isStandardMessage() || (is_73 or is_OK))) {
auto df = message.frequencyOffset ();
auto within_tolerance = (qAbs (ui->RxFreqSpinBox->value () - df) <= int (start_tolerance)
@@ -3655,7 +3658,7 @@ void MainWindow::auto_sequence (DecodedText const& message, unsigned start_toler
|| message_words.contains ("DE")))
|| !message.isStandardMessage ()); // free text 73/RR73
- QStringList w=message.string().mid(22).remove("<").remove(">").split(" ",SkipEmptyParts);
+ QStringList w=message.clean_string ().mid(22).remove("<").remove(">").split(" ",SkipEmptyParts);
QString w2;
int nrpt=0;
if (w.size () > 2)
@@ -3667,8 +3670,8 @@ void MainWindow::auto_sequence (DecodedText const& message, unsigned start_toler
}
}
bool bEU_VHF=(nrpt>=520001 and nrpt<=594000);
- if(bEU_VHF and message.string().contains("<"+m_config.my_callsign() + "> ")) {
- m_xRcvd=message.string().trimmed().right(13);
+ if(bEU_VHF and message.clean_string ().contains("<"+m_config.my_callsign() + "> ")) {
+ m_xRcvd=message.clean_string ().trimmed().right(13);
}
if (m_auto
&& (m_QSOProgress==REPLYING or (!ui->tx1->isEnabled () and m_QSOProgress==REPORT))
@@ -3679,7 +3682,7 @@ void MainWindow::auto_sequence (DecodedText const& message, unsigned start_toler
// auto stop to avoid accidental QRM
ui->stopTxButton->click (); // halt any transmission
} else if (m_auto // transmit allowed
- && ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isChecked() // auto-sequencing allowed
+ && ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isEnabled () && ui->cbAutoSeq->isChecked () // auto-sequencing allowed
&& ((!m_bCallingCQ // not calling CQ/QRZ
&& !m_sentFirst73 // not finished QSO
&& ((message_words.at (1).contains (m_baseCall)
@@ -3724,6 +3727,7 @@ void MainWindow::pskPost (DecodedText const& decodedtext)
void MainWindow::killFile ()
{
+// qDebug() << "cc 3725" << m_saveDecoded << m_saveAll << m_bDecoded << m_nDecodes << m_fnameWE;
if (m_fnameWE.size () && !(m_saveAll || (m_saveDecoded && m_bDecoded))) {
QFile f1 {m_fnameWE + ".wav"};
if(f1.exists()) f1.remove();
@@ -3738,7 +3742,7 @@ void MainWindow::on_EraseButton_clicked ()
{
qint64 ms=QDateTime::currentMSecsSinceEpoch();
ui->decodedTextBrowser2->erase ();
- if(m_mode=="WSPR" or m_mode=="Echo" or m_mode=="ISCAT" or m_mode=="FST4W") {
+ if(m_mode=="WSPR" or m_mode=="Echo" or m_mode=="FST4W") {
ui->decodedTextBrowser->erase ();
} else {
if((ms-m_msErase)<500) {
@@ -3807,8 +3811,8 @@ void MainWindow::guiUpdate()
if(m_TRperiod==900) txDuration=1.0 + 160*66560/12000.0;
if(m_TRperiod==1800) txDuration=1.0 + 160*134400/12000.0;
}
- if(m_modeTx=="ISCAT" or m_mode=="MSK144" or m_bFast9) {
- txDuration=m_TRperiod-0.25; // ISCAT, JT9-fast, MSK144
+ if(m_mode=="MSK144" or m_bFast9) {
+ txDuration=m_TRperiod-0.25; // JT9-fast, MSK144
}
double tx1=0.0;
@@ -4036,161 +4040,158 @@ void MainWindow::guiUpdate()
if(m_tune or m_mode=="Echo") {
itone[0]=0;
} else {
- if(m_mode=="ISCAT") {
- geniscat_(message, msgsent, const_cast<int *> (itone), 28, 28);
- msgsent[28]=0;
- } else {
- if(m_modeTx=="JT4") gen4_(message, &ichk , msgsent, const_cast<int *> (itone),
+ if(m_QSOProgress==REPORT || m_QSOProgress==ROGER_REPORT) m_bSentReport=true;
+ if(m_bSentReport and (m_QSOProgress<REPORT or m_QSOProgress>ROGER_REPORT)) m_bSentReport=false;
+ if(m_modeTx=="JT4") gen4_(message, &ichk , msgsent, const_cast<int *> (itone),
+ &m_currentMessageType, 22, 22);
+ if(m_modeTx=="JT9") gen9_(message, &ichk, msgsent, const_cast<int *> (itone),
+ &m_currentMessageType, 22, 22);
+ if(m_modeTx=="JT65") gen65_(message, &ichk, msgsent, const_cast<int *> (itone),
&m_currentMessageType, 22, 22);
- if(m_modeTx=="JT9") gen9_(message, &ichk, msgsent, const_cast<int *> (itone),
- &m_currentMessageType, 22, 22);
- if(m_modeTx=="JT65") gen65_(message, &ichk, msgsent, const_cast<int *> (itone),
- &m_currentMessageType, 22, 22);
- if(m_modeTx=="Q65") {
- int i3=-1;
- int n3=-1;
- genq65_(message,&ichk,msgsent,const_cast<int *>(itone),&i3,&n3,37,37);
- int nsps=1800;
- if(m_TRperiod==30) nsps=3600;
- if(m_TRperiod==60) nsps=7200;
- if(m_TRperiod==120) nsps=16000;
- if(m_TRperiod==300) nsps=41472;
- int nsps4=4*nsps; //48000 Hz sampling
- int nsym=85;
- float fsample=48000.0;
- int nwave=(nsym+2)*nsps4;
- int icmplx=0;
- int hmod=1;
- float f0=ui->TxFreqSpinBox->value()-m_XIT;
- genwave_(const_cast<int *>(itone),&nsym,&nsps4,&nwave,
- &fsample,&hmod,&f0,&icmplx,foxcom_.wave,foxcom_.wave);
- }
- if(m_modeTx=="WSPR") genwspr_(message, msgsent, const_cast<int *> (itone),
+ if(m_modeTx=="Q65") {
+ int i3=-1;
+ int n3=-1;
+ genq65_(message,&ichk,msgsent,const_cast<int *>(itone),&i3,&n3,37,37);
+ int nsps=1800;
+ if(m_TRperiod==30) nsps=3600;
+ if(m_TRperiod==60) nsps=7200;
+ if(m_TRperiod==120) nsps=16000;
+ if(m_TRperiod==300) nsps=41472;
+ int nsps4=4*nsps; //48000 Hz sampling
+ int nsym=85;
+ float fsample=48000.0;
+ int nwave=(nsym+2)*nsps4;
+ int icmplx=0;
+ int hmod=1;
+ float f0=ui->TxFreqSpinBox->value()-m_XIT;
+ genwave_(const_cast<int *>(itone),&nsym,&nsps4,&nwave,
+ &fsample,&hmod,&f0,&icmplx,foxcom_.wave,foxcom_.wave);
+ }
+ if(m_modeTx=="WSPR") genwspr_(message, msgsent, const_cast<int *> (itone),
22, 22);
- if(m_modeTx=="MSK144" or m_modeTx=="FT8" or m_modeTx=="FT4"
- or m_modeTx=="FST4" or m_modeTx=="FST4W") {
- char MyCall[6];
- char MyGrid[6];
- ::memcpy(MyCall, (m_config.my_callsign()+" ").toLatin1(), sizeof MyCall);
- ::memcpy(MyGrid, (m_config.my_grid()+" ").toLatin1(), sizeof MyGrid);
- if(m_modeTx=="MSK144") {
- genmsk_128_90_(message, &ichk, msgsent, const_cast<int *> (itone),
- &m_currentMessageType, 37, 37);
- if(m_restart) {
- int nsym=144;
- if(itone[40]==-40) nsym=40;
- m_modulator->set_nsym(nsym);
- }
+ if(m_modeTx=="MSK144" or m_modeTx=="FT8" or m_modeTx=="FT4"
+ or m_modeTx=="FST4" or m_modeTx=="FST4W") {
+ char MyCall[6];
+ char MyGrid[6];
+ ::memcpy(MyCall, (m_config.my_callsign()+" ").toLatin1(), sizeof MyCall);
+ ::memcpy(MyGrid, (m_config.my_grid()+" ").toLatin1(), sizeof MyGrid);
+ if(m_modeTx=="MSK144") {
+ genmsk_128_90_(message, &ichk, msgsent, const_cast<int *> (itone),
+ &m_currentMessageType, 37, 37);
+ if(m_restart) {
+ int nsym=144;
+ if(itone[40]==-40) nsym=40;
+ m_modulator->set_nsym(nsym);
}
+ }
- if(m_modeTx=="FT8") {
- if(SpecOp::FOX==m_config.special_op_id() and ui->tabWidget->currentIndex()==1) {
- foxTxSequencer();
- } else {
- int i3=0;
- int n3=0;
- char ft8msgbits[77];
- genft8_(message, &i3, &n3, msgsent, const_cast<char *> (ft8msgbits),
- const_cast<int *> (itone), 37, 37);
- int nsym=79;
- int nsps=4*1920;
- float fsample=48000.0;
- float bt=2.0;
- float f0=ui->TxFreqSpinBox->value() - m_XIT;
- int icmplx=0;
- int nwave=nsym*nsps;
- gen_ft8wave_(const_cast<int *>(itone),&nsym,&nsps,&bt,&fsample,&f0,foxcom_.wave,
- foxcom_.wave,&icmplx,&nwave);
- if(SpecOp::FOX == m_config.special_op_id()) {
- //Fox must generate the full Tx waveform, not just an itone[] array.
- QString fm = QString::fromStdString(message).trimmed();
- foxGenWaveform(0,fm);
- foxcom_.nslots=1;
- foxcom_.nfreq=ui->TxFreqSpinBox->value();
- if(m_config.split_mode()) foxcom_.nfreq = foxcom_.nfreq - m_XIT; //Fox Tx freq
- QString foxCall=m_config.my_callsign() + " ";
- ::memcpy(foxcom_.mycall, foxCall.toLatin1(), sizeof foxcom_.mycall); //Copy Fox callsign into foxcom_
- foxgen_();
- }
- }
- }
- if(m_modeTx=="FT4") {
- int ichk=0;
- char ft4msgbits[77];
- genft4_(message, &ichk, msgsent, const_cast<char *> (ft4msgbits),
- const_cast<int *>(itone), 37, 37);
- int nsym=103;
- int nsps=4*576;
+ if(m_modeTx=="FT8") {
+ if(SpecOp::FOX==m_config.special_op_id() and ui->tabWidget->currentIndex()==1) {
+ foxTxSequencer();
+ } else {
+ int i3=0;
+ int n3=0;
+ char ft8msgbits[77];
+ genft8_(message, &i3, &n3, msgsent, const_cast<char *> (ft8msgbits),
+ const_cast<int *> (itone), 37, 37);
+ int nsym=79;
+ int nsps=4*1920;
float fsample=48000.0;
+ float bt=2.0;
float f0=ui->TxFreqSpinBox->value() - m_XIT;
- int nwave=(nsym+2)*nsps;
int icmplx=0;
- gen_ft4wave_(const_cast<int *>(itone),&nsym,&nsps,&fsample,&f0,foxcom_.wave,
- foxcom_.wave,&icmplx,&nwave);
- }
- if(m_modeTx=="FST4" or m_modeTx=="FST4W") {
- int ichk=0;
- int iwspr=0;
- char fst4msgbits[101];
- QString wmsg;
- if(m_mode=="FST4W") {
- iwspr = 1;
- wmsg=WSPR_message();
- ba=wmsg.toLatin1();
- ba2msg(ba,message);
+ int nwave=nsym*nsps;
+ gen_ft8wave_(const_cast<int *>(itone),&nsym,&nsps,&bt,&fsample,&f0,foxcom_.wave,
+ foxcom_.wave,&icmplx,&nwave);
+ if(SpecOp::FOX == m_config.special_op_id()) {
+ //Fox must generate the full Tx waveform, not just an itone[] array.
+ QString fm = QString::fromStdString(message).trimmed();
+ foxGenWaveform(0,fm);
+ foxcom_.nslots=1;
+ foxcom_.nfreq=ui->TxFreqSpinBox->value();
+ if(m_config.split_mode()) foxcom_.nfreq = foxcom_.nfreq - m_XIT; //Fox Tx freq
+ QString foxCall=m_config.my_callsign() + " ";
+ ::memcpy(foxcom_.mycall, foxCall.toLatin1(), sizeof foxcom_.mycall); //Copy Fox callsign into foxcom_
+ foxgen_();
}
- genfst4_(message,&ichk,msgsent,const_cast<char *> (fst4msgbits),
- const_cast<int *>(itone), &iwspr, 37, 37);
- int hmod=1;
- if(m_config.x2ToneSpacing()) hmod=2;
- if(m_config.x4ToneSpacing()) hmod=4;
- int nsps=720;
- if(m_TRperiod==30) nsps=1680;
- if(m_TRperiod==60) nsps=3888;
- if(m_TRperiod==120) nsps=8200;
- if(m_TRperiod==300) nsps=21504;
- if(m_TRperiod==900) nsps=66560;
- if(m_TRperiod==1800) nsps=134400;
- nsps=4*nsps; //48000 Hz sampling
- int nsym=160;
- float fsample=48000.0;
- float dfreq=hmod*fsample/nsps;
- float f0=ui->TxFreqSpinBox->value() - m_XIT + 1.5*dfreq;
- if(m_mode=="FST4W") f0=ui->WSPRfreqSpinBox->value() - m_XIT + 1.5*dfreq;
- int nwave=(nsym+2)*nsps;
- int icmplx=0;
- gen_fst4wave_(const_cast<int *>(itone),&nsym,&nsps,&nwave,
- &fsample,&hmod,&f0,&icmplx,foxcom_.wave,foxcom_.wave);
-
- QString t = QString::fromStdString(message).trimmed();
}
-
- if(SpecOp::EU_VHF==m_config.special_op_id()) {
- if(m_ntx==2) m_xSent=ui->tx2->text().right(13);
- if(m_ntx==3) m_xSent=ui->tx3->text().right(13);
+ }
+ if(m_modeTx=="FT4") {
+ int ichk=0;
+ char ft4msgbits[77];
+ genft4_(message, &ichk, msgsent, const_cast<char *> (ft4msgbits),
+ const_cast<int *>(itone), 37, 37);
+ int nsym=103;
+ int nsps=4*576;
+ float fsample=48000.0;
+ float f0=ui->TxFreqSpinBox->value() - m_XIT;
+ int nwave=(nsym+2)*nsps;
+ int icmplx=0;
+ gen_ft4wave_(const_cast<int *>(itone),&nsym,&nsps,&fsample,&f0,foxcom_.wave,
+ foxcom_.wave,&icmplx,&nwave);
+ }
+ if(m_modeTx=="FST4" or m_modeTx=="FST4W") {
+ int ichk=0;
+ int iwspr=0;
+ char fst4msgbits[101];
+ QString wmsg;
+ if(m_mode=="FST4W") {
+ iwspr = 1;
+ wmsg=WSPR_message();
+ ba=wmsg.toLatin1();
+ ba2msg(ba,message);
}
+ genfst4_(message,&ichk,msgsent,const_cast<char *> (fst4msgbits),
+ const_cast<int *>(itone), &iwspr, 37, 37);
+ int hmod=1;
+ if(m_config.x2ToneSpacing()) hmod=2;
+ if(m_config.x4ToneSpacing()) hmod=4;
+ int nsps=720;
+ if(m_TRperiod==30) nsps=1680;
+ if(m_TRperiod==60) nsps=3888;
+ if(m_TRperiod==120) nsps=8200;
+ if(m_TRperiod==300) nsps=21504;
+ if(m_TRperiod==900) nsps=66560;
+ if(m_TRperiod==1800) nsps=134400;
+ nsps=4*nsps; //48000 Hz sampling
+ int nsym=160;
+ float fsample=48000.0;
+ float dfreq=hmod*fsample/nsps;
+ float f0=ui->TxFreqSpinBox->value() - m_XIT + 1.5*dfreq;
+ if(m_mode=="FST4W") f0=ui->WSPRfreqSpinBox->value() - m_XIT + 1.5*dfreq;
+ int nwave=(nsym+2)*nsps;
+ int icmplx=0;
+ gen_fst4wave_(const_cast<int *>(itone),&nsym,&nsps,&nwave,
+ &fsample,&hmod,&f0,&icmplx,foxcom_.wave,foxcom_.wave);
- if(SpecOp::FIELD_DAY==m_config.special_op_id() or SpecOp::RTTY==m_config.special_op_id()) {
- if(m_ntx==2 or m_ntx==3) {
- QStringList t=ui->tx2->text().split(' ', SkipEmptyParts);
- int n=t.size();
- m_xSent=t.at(n-2) + " " + t.at(n-1);
- }
+ QString t = QString::fromStdString(message).trimmed();
+ }
+
+ if(SpecOp::EU_VHF==m_config.special_op_id()) {
+ if(m_ntx==2) m_xSent=ui->tx2->text().right(13);
+ if(m_ntx==3) m_xSent=ui->tx3->text().right(13);
+ }
+
+ if(SpecOp::FIELD_DAY==m_config.special_op_id() or SpecOp::RTTY==m_config.special_op_id()) {
+ if(m_ntx==2 or m_ntx==3) {
+ QStringList t=ui->tx2->text().split(' ', SkipEmptyParts);
+ int n=t.size();
+ m_xSent=t.at(n-2) + " " + t.at(n-1);
}
}
- msgsent[37]=0;
}
+ msgsent[37]=0;
}
{
auto temp = m_currentMessage;
m_currentMessage = QString::fromLatin1(msgsent);
if (m_currentMessage != temp) // check if tx message changed
- {
+ {
statusUpdate ();
}
}
- m_bCallingCQ = CALLING == m_QSOProgress
+ m_bCallingCQ = 6 == m_ntx
|| m_currentMessage.contains (QRegularExpression {"^(CQ|QRZ) "});
if(m_mode=="FT8" or m_mode=="FT4") {
if(m_bCallingCQ && ui->cbFirst->isVisible () && ui->cbFirst->isChecked ()) {
@@ -4222,19 +4223,21 @@ void MainWindow::guiUpdate()
msg_parts[1].remove (QChar {'<'});
msg_parts[1].remove (QChar {'>'});
}
- auto is_73 = m_QSOProgress >= ROGER_REPORT
- && message_is_73 (m_currentMessageType, msg_parts);
+ auto is_73 = message_is_73 (m_currentMessageType, msg_parts);
m_sentFirst73 = is_73
&& !message_is_73 (m_lastMessageType, m_lastMessageSent.split (' ', SkipEmptyParts));
- if (m_sentFirst73) {
+ if (m_sentFirst73 || (is_73 && CALLING == m_QSOProgress)) {
m_qsoStop=t2;
if(m_config.id_after_73 ()) {
icw[0] = m_ncw;
}
- if((m_config.prompt_to_log() or m_config.autoLog()) && !m_tune) logQSOTimer.start(0);
+ if((m_config.prompt_to_log() or m_config.autoLog()) && !m_tune && CALLING != m_QSOProgress)
+ {
+ logQSOTimer.start(0);
+ }
}
- bool b=(m_mode=="FT8" or m_mode=="FT4") and ui->cbAutoSeq->isChecked();
+ bool b=(m_mode=="FT8" or m_mode=="FT4") and ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isEnabled () && ui->cbAutoSeq->isChecked ();
if(is_73 and (m_config.disable_TX_on_73() or b)) {
m_nextCall=""; //### Temporary: disable use of "TU;" messages;
if(m_nextCall!="") {
@@ -4519,7 +4522,7 @@ void MainWindow::stopTx2()
{
m_config.transceiver_ptt (false); //Lower PTT
if (m_mode == "JT9" && m_bFast9
- && ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isChecked()
+ && ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isEnabled () && ui->cbAutoSeq->isChecked ()
&& m_ntx == 5 && m_nTx73 >= 5) {
on_stopTxButton_clicked ();
m_nTx73 = 0;
@@ -4751,9 +4754,9 @@ void MainWindow::doubleClickOnCall2(Qt::KeyboardModifiers modifiers)
void MainWindow::doubleClickOnCall(Qt::KeyboardModifiers modifiers)
{
QTextCursor cursor;
- if(m_mode=="ISCAT" or m_mode=="FST4W") {
+ if(m_mode=="FST4W") {
MessageBox::information_message (this,
- "Double-click not available for ISCAT or FST4W mode");
+ "Double-click not available for FST4W mode");
return;
}
if(m_decodedText2) {
@@ -4787,8 +4790,9 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
auto shift = modifiers.testFlag (Qt::ShiftModifier);
auto ctrl = modifiers.testFlag (Qt::ControlModifier);
// auto alt = modifiers.testFlag (Qt::AltModifier);
+ auto auto_seq = ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isEnabled () && ui->cbAutoSeq->isChecked ();
// basic mode sanity checks
- auto const& parts = message.string ().split (' ', SkipEmptyParts);
+ auto const& parts = message.clean_string ().split (' ', SkipEmptyParts);
if (parts.size () < 5) return;
auto const& mode = parts.at (4).left (1);
if (("JT65" == m_mode && mode != "#")
@@ -4837,16 +4841,16 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
QString hisgrid;
message.deCallAndGrid(/*out*/hiscall,hisgrid);
- if(message.string().contains(hiscall+"/R")) {
+ if(message.clean_string ().contains(hiscall+"/R")) {
hiscall+="/R";
ui->dxCallEntry->setText(hiscall);
}
- if(message.string().contains(hiscall+"/P")) {
+ if(message.clean_string ().contains(hiscall+"/P")) {
hiscall+="/P";
ui->dxCallEntry->setText(hiscall);
}
- QStringList w=message.string().mid(22).remove("<").remove(">").split(" ",SkipEmptyParts);
+ QStringList w=message.clean_string ().mid(22).remove("<").remove(">").split(" ",SkipEmptyParts);
int nw=w.size();
if(nw>=4) {
if(message_words.size()<3) return;
@@ -4858,9 +4862,9 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
}
bool is_73 = message_words.filter (QRegularExpression {"^(73|RR73)$"}).size ();
- if (!is_73 and !message.isStandardMessage() and !message.string().contains("<")) {
+ if (!is_73 and !message.isStandardMessage() and !message.clean_string ().contains("<")) {
qDebug () << "Not processing message - hiscall:" << hiscall << "hisgrid:" << hisgrid
- << message.string() << message.isStandardMessage();
+ << message.clean_string () << message.isStandardMessage();
return;
}
@@ -4902,7 +4906,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
auto base_call = Radio::base_callsign (hiscall);
// Determine appropriate response to received message
- auto dtext = " " + message.string () + " ";
+ auto dtext = " " + message.clean_string () + " ";
dtext=dtext.remove("<").remove(">");
if(dtext.contains (" " + m_baseCall + " ")
|| dtext.contains ("<" + m_baseCall + "> ")
@@ -4930,7 +4934,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
MessageBox::information_message (this, msg);
}
- QStringList t=message.string().split(' ', SkipEmptyParts);
+ QStringList t=message.clean_string ().split(' ', SkipEmptyParts);
int n=t.size();
QString t0=t.at(n-2);
QString t1=t0.right(1);
@@ -5006,11 +5010,11 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
}
} else { // no grid on end of msg
auto const& word_3 = message_words.at (3);
- bool word_3_is_int;
- auto word_3_as_number = word_3.toInt (&word_3_is_int);
- if(m_QSOProgress >= ROGER_REPORT && ("RRR" == word_3
- || (word_3_is_int && word_3_as_number == 73)
- || "RR73" == word_3)) {
+ auto word_3_as_number = word_3.toInt ();
+ if (("RRR" == word_3
+ || (word_3_as_number == 73 && ROGERS == m_QSOProgress)
+ || "RR73" == word_3
+ || ("R" == word_3 && m_QSOProgress != REPORT))) {
if(m_mode=="FT4" and "RR73" == word_3) m_dateTimeRcvdRR73=QDateTime::currentDateTimeUtc();
m_bTUmsg=false;
m_nextCall=""; //### Temporary: disable use of "TU;" message
@@ -5023,16 +5027,50 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
ui->tx3->setText(t);
m_bTUmsg=true;
} else {
- if(SpecOp::RTTY == m_config.special_op_id()) {
- logQSOTimer.start(0);
- m_ntx=6;
- ui->txrb6->setChecked(true);
- } else {
- m_ntx=5;
- ui->txrb5->setChecked(true);
- }
+ if (m_QSOProgress > CALLING && m_QSOProgress < SIGNOFF
+ && SpecOp::NONE < m_config.special_op_id () && SpecOp::FOX > m_config.special_op_id ()
+ && ("RR73" == word_3 || 73 == word_3_as_number))
+ {
+ logQSOTimer.start(0);
+ m_ntx=6;
+ ui->txrb6->setChecked(true);
+ }
+ else if (word_3.contains (QRegularExpression {"^R(?!R73|RR)"})
+ && m_QSOProgress != ROGER_REPORT)
+ {
+ m_ntx=4;
+ ui->txrb4->setChecked(true);
+ }
+ else if ((m_QSOProgress > CALLING && m_QSOProgress < ROGERS)
+ || word_3.contains (QRegularExpression {"^RR(?:R|73)$"}))
+ {
+ m_ntx=5;
+ ui->txrb5->setChecked(true);
+ }
+ else if (ROGERS == m_QSOProgress)
+ {
+ logQSOTimer.start(0);
+ m_ntx=6;
+ ui->txrb6->setChecked(true);
+ }
+ else
+ {
+ // just work them (again)
+ if (ui->tx1->isEnabled ()) {
+ m_ntx = 1;
+ m_QSOProgress = REPLYING;
+ ui->txrb1->setChecked (true);
+ } else {
+ m_ntx=2;
+ m_QSOProgress = REPORT;
+ ui->txrb2->setChecked (true);
+ }
+ }
}
- m_QSOProgress = SIGNOFF;
+ if (m_QSOProgress >= ROGER_REPORT)
+ {
+ m_QSOProgress = SIGNOFF;
+ }
} else if((m_QSOProgress >= REPORT
|| (m_QSOProgress >= REPLYING &&
(m_mode=="MSK144" or m_mode=="FT8" or m_mode=="FT4")))
@@ -5047,30 +5085,35 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
ui->txrb4->setChecked(true);
} else if (m_QSOProgress >= CALLING)
{
- if (word_3_is_int
- && ((word_3_as_number >= -50 && word_3_as_number <= 49)
- || (word_3_as_number >= 529 && word_3_as_number <= 599))) {
- if(SpecOp::EU_VHF==m_config.special_op_id() or
- SpecOp::FIELD_DAY==m_config.special_op_id() or
- SpecOp::RTTY==m_config.special_op_id()) {
- setTxMsg(2);
- m_QSOProgress=REPORT;
- }
- else {
- setTxMsg (3);
- m_QSOProgress = ROGER_REPORT;
+ if ((word_3_as_number >= -50 && word_3_as_number <= 49)
+ || (word_3_as_number >= 529 && word_3_as_number <= 599))
+ {
+ if(SpecOp::EU_VHF==m_config.special_op_id() or
+ SpecOp::FIELD_DAY==m_config.special_op_id() or
+ SpecOp::RTTY==m_config.special_op_id())
+ {
+ setTxMsg(2);
+ m_QSOProgress=REPORT;
+ }
+ else
+ {
+ if (word_3.startsWith ("R-") || word_3.startsWith ("R+"))
+ {
+ setTxMsg(4);
+ m_QSOProgress=ROGERS;
+ }
+ else
+ {
+ setTxMsg (3);
+ m_QSOProgress = ROGER_REPORT;
+ }
+ }
}
- } else {
- if (word_3.startsWith ("R-") || word_3.startsWith ("R+")) {
- setTxMsg(4);
- m_QSOProgress=ROGERS;
- }
}
- }
- else
- { // nothing for us
- return;
- }
+ else
+ { // nothing for us
+ return;
+ }
}
}
else if (m_QSOProgress >= ROGERS
@@ -5148,7 +5191,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
}
QString s1 = m_QSOText.trimmed ();
- QString s2 = message.string ().trimmed();
+ QString s2 = message.clean_string ().trimmed();
if (s1!=s2 and !message.isTX()) {
if (!s2.contains(m_baseCall) or m_mode=="MSK144") { // Taken care of elsewhere if for_us and slow mode
ui->decodedTextBrowser2->displayDecodedText(message, m_baseCall,m_mode,m_config.DXCC(),
@@ -5174,29 +5217,27 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie
lookup();
m_hisGrid = ui->dxGridEntry->text();
- QString rpt = message.report();
- int n=rpt.toInt();
- if(m_mode=="MSK144" and m_bShMsgs) {
- int n=rpt.toInt();
- if(n<=-2) n=-3;
- if(n>=-1 and n<=1) n=0;
- if(n>=2 and n<=4) n=3;
- if(n>=5 and n<=7) n=6;
- if(n>=8 and n<=11) n=10;
- if(n>=12 and n<=14) n=13;
- if(n>=15) n=16;
- rpt=QString::number(n);
- }
-
- ui->rptSpinBox->setValue(n);
+ if (!m_bSentReport || base_call != qso_partner_base_call) // Don't change report within a QSO
+ {
+ auto n = message.report ().toInt ();
+ if(m_mode=="MSK144" and m_bShMsgs) {
+ if(n<=-2) n=-3;
+ if(n>=-1 and n<=1) n=0;
+ if(n>=2 and n<=4) n=3;
+ if(n>=5 and n<=7) n=6;
+ if(n>=8 and n<=11) n=10;
+ if(n>=12 and n<=14) n=13;
+ if(n>=15) n=16;
+ }
+ ui->rptSpinBox->setValue (n);
+ }
// Don't genStdMsgs if we're already sending 73, or a "TU; " msg is queued.
m_bTUmsg=false; //### Temporary: disable use of "TU;" messages
if (!m_nTx73 and !m_bTUmsg) {
- genStdMsgs(rpt);
+ genStdMsgs (QString::number (ui->rptSpinBox->value ()));
}
if(m_transmitting) m_restart=true;
- if (ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isChecked ()
- && !m_bDoubleClicked && m_mode!="FT4") {
+ if (auto_seq && !m_bDoubleClicked && m_mode!="FT4") {
return;
}
if(m_config.quick_call() && m_bDoubleClicked) auto_tx_mode(true);
@@ -5721,7 +5762,7 @@ void MainWindow::msgtype(QString t, QLineEdit* tx) //msgtype()
p.setColor(QPalette::Base,"#66ffff"); //light blue
} else {
p.setColor(QPalette::Base,Qt::transparent);
- if(m_mode=="MSK144" and t.mid(0,1)=="<") {
+ if ("MSK144" == m_mode && t.count ('<') == 1) {
p.setColor(QPalette::Base,"#00ffff"); //another light blue
}
}
@@ -5839,7 +5880,7 @@ void MainWindow::on_logQSOButton_clicked() //Log QSO button
if (SpecOp::FOX != m_config.special_op_id ()
&& ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isEnabled () && ui->cbAutoSeq->isChecked ())
{
- // ensure that auto Tx is disabled even if clear DX call & grid
+ // ensure that auto Tx is disabled even if disable Tx
// on 73 is not checked, unless in Fox mode where it is allowed
// to be a robot.
auto_tx_mode (false);
@@ -6398,7 +6439,6 @@ void MainWindow::on_actionJT65_triggered()
void MainWindow::on_actionQ65_triggered()
{
-// on_actionFST4_triggered();
m_mode="Q65";
m_modeTx="Q65";
ui->actionQ65->setChecked(true);
@@ -6412,8 +6452,6 @@ void MainWindow::on_actionQ65_triggered()
m_hsymStop=49;
ui->sbTR->values ({15, 30, 60, 120, 300});
on_sbTR_valueChanged (ui->sbTR->value());
-//### ui->sbSubmode->setMaximum(4);
- ui->sbSubmode->setMaximum(7);
ui->sbSubmode->setValue(m_nSubMode);
QString fname {QDir::toNativeSeparators(m_config.temp_dir().absoluteFilePath ("red.dat"))};
m_wideGraph->setRedFile(fname);
@@ -6426,47 +6464,19 @@ void MainWindow::on_actionQ65_triggered()
switch_mode (Modes::Q65);
// 0123456789012345678901234567890123456
displayWidgets(nWidgets("1111110101101101001110000001000000001"));
+ ui->labDXped->setText("");
ui->lh_decodes_title_label->setText(tr ("Single-Period Decodes"));
ui->rh_decodes_title_label->setText(tr ("Average Decodes"));
ui->lh_decodes_headings_label->setText("UTC dB DT Freq " + tr ("Message"));
ui->rh_decodes_headings_label->setText("UTC dB DT Freq " + tr ("Message"));
statusChanged();
-}
-
-void MainWindow::on_actionISCAT_triggered()
-{
- m_mode="ISCAT";
- m_modeTx="ISCAT";
- ui->actionISCAT->setChecked(true);
- ui->sbTR->values ({5, 10, 15, 30});
- on_sbTR_valueChanged (ui->sbTR->value ());
- m_modulator->setTRPeriod(m_TRperiod);
- m_detector->setTRPeriod(m_TRperiod);
- m_wideGraph->setPeriod(m_TRperiod,m_nsps);
- m_nsps=6912; //For symspec only
- m_FFTSize = m_nsps / 2;
- Q_EMIT FFTSize (m_FFTSize);
- m_hsymStop=103;
- m_toneSpacing=11025.0/256.0;
- WSPR_config(false);
- ui->rh_decodes_widget->setVisible (false);
- switch_mode(Modes::ISCAT);
- m_wideGraph->setMode(m_mode);
- m_wideGraph->setModeTx(m_modeTx);
- statusChanged();
- if(!m_fastGraph->isVisible()) m_fastGraph->showNormal();
- if(m_wideGraph->isVisible()) m_wideGraph->hide();
- setup_status_bar (true);
- ui->cbShMsgs->setChecked(false);
- ui->lh_decodes_headings_label->setText(
- " UTC Sync dB DT DF F1 M N C T ");
- ui->tabWidget->setCurrentIndex(0);
- ui->sbSubmode->setMaximum(1);
- if(m_nSubMode==0) ui->TxFreqSpinBox->setValue(1012);
- if(m_nSubMode==1) ui->TxFreqSpinBox->setValue(560);
- displayWidgets(nWidgets("1001110000000001100000000000000000000"));
- fast_config(true);
- statusChanged ();
+ if(SpecOp::NONE < m_config.special_op_id()) {
+ ui->labDXped->setVisible(true);
+ ui->labDXped->setText("Contest ?");
+ } else {
+ ui->labDXped->setVisible(false);
+ ui->labDXped->setText("");
+ }
}
void MainWindow::on_actionMSK144_triggered()
@@ -6477,7 +6487,6 @@ void MainWindow::on_actionMSK144_triggered()
if("JT4"==m_mode) ui->actionJT4->setChecked(true);
if("JT9"==m_mode) ui->actionJT9->setChecked(true);
if("JT65"==m_mode) ui->actionJT65->setChecked(true);
- if("ISCAT"==m_mode) ui->actionISCAT->setChecked(true);
if("Q65"==m_mode) ui->actionQ65->setChecked(true);
if("WSPR"==m_mode) ui->actionWSPR->setChecked(true);
if("Echo"==m_mode) ui->actionEcho->setChecked(true);
@@ -6537,6 +6546,7 @@ void MainWindow::on_actionMSK144_triggered()
} else {
ui->labDXped->setVisible(true);
ui->labDXped->setText(t0);
+ on_contest_log_action_triggered();
}
}
@@ -6698,7 +6708,7 @@ void MainWindow::fast_config(bool b)
m_bFastMode=b;
ui->TxFreqSpinBox->setEnabled(!b);
ui->sbTR->setVisible(b);
- if(b and (m_bFast9 or m_mode=="MSK144" or m_mode=="ISCAT")) {
+ if(b and (m_bFast9 or m_mode=="MSK144")) {
m_wideGraph->hide();
m_fastGraph->showNormal();
} else {
@@ -6714,6 +6724,16 @@ void MainWindow::on_TxFreqSpinBox_valueChanged(int n)
if(m_mode!="MSK144") {
Q_EMIT transmitFrequency (n - m_XIT);
}
+
+ if(m_mode=="Q65") {
+ if(((m_nSubMode==4 && m_TRperiod==60.0) || (m_nSubMode==3 && m_TRperiod==30.0) ||
+ (m_nSubMode==2 && m_TRperiod==15.0)) && ui->TxFreqSpinBox->value()!=700) {
+ ui->TxFreqSpinBox->setStyleSheet("QSpinBox{background-color:red}");
+ } else {
+ ui->TxFreqSpinBox->setStyleSheet("");
+ }
+ }
+
statusUpdate ();
}
@@ -7082,8 +7102,8 @@ void MainWindow::setXIT(int n, Frequency base)
m_XIT = 0;
if (!m_bSimplex) {
// m_bSimplex is false, so we can use split mode if requested
- if (m_config.split_mode () && (!m_config.enable_VHF_features () || m_mode == "FT8" ||
- m_mode=="FST4")) {
+ if (m_config.split_mode () && (!m_config.enable_VHF_features () ||
+ m_mode=="FT4" || m_mode == "FT8" || m_mode=="FST4")) {
// Don't use XIT for VHF & up
m_XIT=(n/500)*500 - 1500;
}
@@ -7393,25 +7413,9 @@ void MainWindow::transmit (double snr)
false, false, snr, m_TRperiod);
}
- if(m_mode=="ISCAT") {
- double sps,f0;
- if(m_nSubMode==0) {
- sps=512.0*12000.0/11025.0;
- toneSpacing=11025.0/512.0;
- f0=47*toneSpacing;
- } else {
- sps=256.0*12000.0/11025.0;
- toneSpacing=11025.0/256.0;
- f0=13*toneSpacing;
- }
- Q_EMIT sendMessage (m_mode, NUM_ISCAT_SYMBOLS, sps, f0, toneSpacing, m_soundOutput,
- m_config.audio_output_channel(),
- true, true, snr, m_TRperiod);
- }
-
// In auto-sequencing mode, stop after 5 transmissions of "73" message.
if (m_bFastMode || m_bFast9) {
- if (ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isChecked ()) {
+ if (ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isEnabled () && ui->cbAutoSeq->isChecked ()) {
if(m_ntx==5) {
m_nTx73 += 1;
} else {
@@ -7590,7 +7594,17 @@ void MainWindow::on_sbTR_valueChanged(int value)
ui->rh_decodes_headings_label->setText("UTC dB DT Freq " + tr ("Message"));
}
}
- }
+
+ if ("Q65" == m_mode)
+ {
+ switch (value)
+ {
+ case 15: ui->sbSubmode->setMaximum (2); break;
+ case 30: ui->sbSubmode->setMaximum (3); break;
+ default: ui->sbSubmode->setMaximum (4); break;
+ }
+ }
+ }
m_fastGraph->setTRPeriod (value);
m_modulator->setTRPeriod (value); // TODO - not thread safe
m_detector->setTRPeriod (value); // TODO - not thread safe
@@ -7598,9 +7612,7 @@ void MainWindow::on_sbTR_valueChanged(int value)
progressBar.setMaximum (value);
}
if(m_mode=="FST4") chk_FST4_freq_range();
- if(m_transmitting) {
- on_stopTxButton_clicked();
- }
+// if(m_transmitting) on_stopTxButton_clicked(); //### Is this needed or desirable? ###
on_sbSubmode_valueChanged(ui->sbSubmode->value());
statusUpdate ();
}
@@ -7613,8 +7625,8 @@ void MainWindow::on_sbTR_FST4W_valueChanged(int value)
QChar MainWindow::current_submode () const
{
QChar submode {0};
- if (m_mode.contains (QRegularExpression {R"(^(JT65|JT9|JT4|ISCAT|Q65)$)"})
- && (m_config.enable_VHF_features () || "JT4" == m_mode || "ISCAT" == m_mode))
+ if (m_mode.contains (QRegularExpression {R"(^(JT65|JT9|JT4|Q65)$)"})
+ && (m_config.enable_VHF_features () || "JT4" == m_mode))
{
submode = m_nSubMode + 65;
}
@@ -7633,9 +7645,13 @@ void MainWindow::on_sbSubmode_valueChanged(int n)
} else {
mode_label.setText (m_mode);
}
- if(m_mode=="ISCAT") {
- if(m_nSubMode==0) ui->TxFreqSpinBox->setValue(1012);
- if(m_nSubMode==1) ui->TxFreqSpinBox->setValue(560);
+ if(m_mode=="Q65") {
+ if(((m_nSubMode==4 && m_TRperiod==60.0) || (m_nSubMode==3 && m_TRperiod==30.0) ||
+ (m_nSubMode==2 && m_TRperiod==15.0)) && ui->TxFreqSpinBox->value()!=700) {
+ ui->TxFreqSpinBox->setStyleSheet("QSpinBox{background-color:red}");
+ } else {
+ ui->TxFreqSpinBox->setStyleSheet("");
+ }
}
if(m_mode=="JT9") {
if(m_nSubMode<4) {
@@ -7811,17 +7827,13 @@ void MainWindow::replayDecodes ()
if (message.size() >= 4 && message.left (4) != "----")
{
auto const& parts = message.split (' ', SkipEmptyParts);
- if (parts.size () >= 5 && parts[3].contains ('.')) //
- {
- postWSPRDecode (false, parts);
- }
- else
- {
- // TODO - how to skip ISCAT decodes
- postDecode (false, message);
- }
- }
- }
+ if (parts.size () >= 5 && parts[3].contains ('.')) {
+ postWSPRDecode (false, parts);
+ } else {
+ postDecode (false, message);
+ }
+ }
+ }
statusChanged ();
}
@@ -8281,7 +8293,7 @@ void MainWindow::fastPick(int x0, int x1, int y)
{
float pixPerSecond=12000.0/512.0;
if(m_TRperiod<30.0) pixPerSecond=12000.0/256.0;
- if(m_mode!="ISCAT" and m_mode!="MSK144") return;
+ if(m_mode!="MSK144") return;
if(!m_decoderBusy) {
dec_data.params.newdat=0;
dec_data.params.nagain=1;
@@ -9270,7 +9282,6 @@ void MainWindow::set_mode (QString const& mode)
else if ("JT65" == mode) on_actionJT65_triggered ();
else if ("Q65" == mode) on_actionQ65_triggered ();
else if ("FreqCal" == mode) on_actionFreqCal_triggered ();
- else if ("ISCAT" == mode) on_actionISCAT_triggered ();
else if ("MSK144" == mode) on_actionMSK144_triggered ();
else if ("WSPR" == mode) on_actionWSPR_triggered ();
else if ("Echo" == mode) on_actionEcho_triggered ();
diff --git a/widgets/mainwindow.h b/widgets/mainwindow.h
index d71a400f..61bb98ce 100644
--- a/widgets/mainwindow.h
+++ b/widgets/mainwindow.h
@@ -47,17 +47,17 @@
#define NUM_JT65_SYMBOLS 126 //63 data + 63 sync
#define NUM_JT9_SYMBOLS 85 //69 data + 16 sync
#define NUM_WSPR_SYMBOLS 162 //(50+31)*2, embedded sync
-#define NUM_ISCAT_SYMBOLS 1291 //30*11025/256
#define NUM_MSK144_SYMBOLS 144 //s8 + d48 + s8 + d80
#define NUM_Q65_SYMBOLS 85 //63 data + 22 sync
#define NUM_FT8_SYMBOLS 79
#define NUM_FT4_SYMBOLS 105
#define NUM_FST4_SYMBOLS 160 //240/2 data + 5*8 sync
#define NUM_CW_SYMBOLS 250
+#define MAX_NUM_SYMBOLS 250
#define TX_SAMPLE_RATE 48000
#define NRING 3456000
-extern int volatile itone[NUM_ISCAT_SYMBOLS]; //Audio tones for all Tx symbols
+extern int volatile itone[MAX_NUM_SYMBOLS]; //Audio tones for all Tx symbols
extern int volatile icw[NUM_CW_SYMBOLS]; //Dits for CW ID
//--------------------------------------------------------------- MainWindow
@@ -291,7 +291,6 @@ private slots:
void on_pbTxNext_clicked(bool b);
void on_actionEcho_Graph_triggered();
void on_actionEcho_triggered();
- void on_actionISCAT_triggered();
void on_actionFast_Graph_triggered();
void fast_decode_done();
void on_actionMeasure_reference_spectrum_triggered();
@@ -538,6 +537,7 @@ private:
bool m_bTUmsg;
bool m_bBestSPArmed=false;
bool m_bOK_to_chk=false;
+ bool m_bSentReport=false;
enum
{
diff --git a/widgets/mainwindow.ui b/widgets/mainwindow.ui
index 2501b823..35f64d91 100644
--- a/widgets/mainwindow.ui
+++ b/widgets/mainwindow.ui
@@ -2,6 +2,14 @@
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>1124</width>
+ <height>582</height>
+ </rect>
+ </property>
<property name="windowTitle">
<string>WSJT-X by K1JT</string>
</property>
@@ -2796,7 +2804,7 @@ Double-click to reset to the standard 73 message</string>
<rect>
<x>0</x>
<y>0</y>
- <width>1110</width>
+ <width>1124</width>
<height>21</height>
</rect>
</property>
@@ -2890,7 +2898,6 @@ Double-click to reset to the standard 73 message</string>
<addaction name="actionJT65"/>
<addaction name="actionQ65"/>
<addaction name="separator"/>
- <addaction name="actionISCAT"/>
<addaction name="actionMSK144"/>
<addaction name="separator"/>
<addaction name="actionFST4W"/>
diff --git a/widgets/plotter.cpp b/widgets/plotter.cpp
index 14c13a50..8c2e9613 100644
--- a/widgets/plotter.cpp
+++ b/widgets/plotter.cpp
@@ -7,12 +7,13 @@
#include <QPen>
#include <QMouseEvent>
#include <QDebug>
+#include "qt_helpers.hpp"
#include "commons.h"
#include "moc_plotter.cpp"
#include <fstream>
#include <iostream>
-#define MAX_SCREENSIZE 2048
+#define MAX_SCREENSIZE 8192
extern "C" {
void flat4_(float swide[], int* iz, int* nflatten);
@@ -239,20 +240,22 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed)
if(y2>y2max) y2max=y2;
j++;
}
- if(m_bReplot) return;
+ if(m_bReplot and m_mode!="Q65") return;
if(swide[0]>1.0e29) m_line=0;
if(m_mode=="FT4" and m_line==34) m_line=0;
if(m_line == painter1.fontMetrics ().height ()) {
painter1.setPen(Qt::white);
QString t;
- qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
- int n = fmod(0.001*ms,m_TRperiod);
- QDateTime t1=QDateTime::currentDateTimeUtc().addSecs(-n);
- if(m_TRperiod<60.0) {
- t=t1.toString("hh:mm:ss") + " " + m_rxBand;
+ if(m_nUTC<0) {
+ auto start = qt_truncate_date_time_to (QDateTime::currentDateTimeUtc(), m_TRperiod * 1e3)
+ .toString (m_TRperiod < 60. ? "hh:mm:ss" : "hh:mm");
+ t = QString {"%1 %2"}.arg (start, m_rxBand);
} else {
- t=t1.toString("hh:mm") + " " + m_rxBand;
+ auto hr = m_nUTC / 10000;
+ auto start = QTime {hr, (m_nUTC - 10000 * hr) / 100, m_nUTC % 100}
+ .toString (m_TRperiod < 60. ? "hh:mm:ss" : "hh:mm");
+ t = QString {"%1 %2"}.arg (start).arg (m_rxBand);
}
painter1.drawText (5, painter1.fontMetrics ().ascent (), t);
}
@@ -274,45 +277,47 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed)
painter2D.drawText(x1-4,y,"73");
}
- if(bRed and m_bQ65_Sync) { //Plot the Q65 red or orange sync curve
+ if(bRed and m_bQ65_Sync) { //Plot the Q65 red/orange sync curves
int k=0;
int k2=0;
std::ifstream f;
f.open(m_redFile.toLatin1());
if(f) {
int x,y;
- float freq,xdt,sync,sync2;
- f >> xdt;
- for(int i=0; i<99999; i++) {
- f >> freq >> sync >> sync2;
- if(f.eof()) break;
- x=XfromFreq(freq);
- if(sync > -99.0 and sync != 0.0) {
- y=m_h2*(0.9 - 0.09*gain2d*sync) - m_plot2dZero - 10;
- LineBuf2[k2].setX(x); //Red sync curve
- LineBuf2[k2].setY(y);
- k2++;
+ float freq,xdt,smin,smax,sync,sync2;
+ f >> xdt >> smin >> smax;
+ if(f) {
+ for(int i=0; i<99999; i++) {
+ f >> freq >> sync >> sync2;
+ if(!f or f.eof() or k>=MAX_SCREENSIZE or k2>=MAX_SCREENSIZE) break;
+ x=XfromFreq(freq);
+ if(sync > -99.0 and (smin!=0.0 or smax != 0.0)) {
+ y=m_h2*(0.9 - 0.09*gain2d*sync) - m_plot2dZero - 10;
+ LineBuf2[k2].setX(x); //Red sync curve
+ LineBuf2[k2].setY(y);
+ k2++;
+ }
+ y=m_h2*(0.9 - 0.09*gain2d*sync2) - m_plot2dZero;
+ LineBuf3[k].setX(x); //Orange sync curve
+ LineBuf3[k].setY(y);
+ k++;
}
- y=m_h2*(0.9 - 0.09*gain2d*sync2) - m_plot2dZero;
- LineBuf3[k].setX(x); //Orange sync curve
- LineBuf3[k].setY(y);
- k++;
}
f.close();
- QPen pen0(Qt::red,2);
+ QPen pen0(Qt::red,2);
painter2D.setPen(pen0);
- painter2D.drawPolyline(LineBuf2,k2);
+ if(smin!=0.0 or smax != 0.0) {
+ painter2D.drawPolyline(LineBuf2,k2);
+ }
pen0.setColor("orange");
painter2D.setPen(pen0);
painter2D.drawPolyline(LineBuf3,k);
- if(m_bQ65_Sync) {
- QString t;
- t = t.asprintf("DT = %6.2f",xdt);
- painter2D.setPen(Qt::white);
- Font.setWeight(QFont::Bold);
- painter2D.setFont(Font);
- painter2D.drawText(m_w-100,m_h2/2,t);
- }
+ QString t;
+ t = t.asprintf("DT = %6.2f",xdt);
+ painter2D.setPen(Qt::white);
+ Font.setWeight(QFont::Bold);
+ painter2D.setFont(Font);
+ painter2D.drawText(m_w-100,m_h2/2,t);
}
}
update(); //trigger a new paintEvent
@@ -335,6 +340,9 @@ void CPlotter::replot()
plotsave_(swide,&m_w,&m_h1,&irow);
draw(swide,false,false);
}
+ if(m_mode=="Q65" and m_bQ65_Sync) {
+ draw(swide,false,true);
+ }
update(); //trigger a new paintEvent
m_bReplot=false;
}
@@ -623,7 +631,6 @@ void CPlotter::MakeFrequencyStrs() //MakeFrequencyStrs
int CPlotter::XfromFreq(float f) //XfromFreq()
{
-// float w = m_WaterfallPixmap.width();
int x = int(m_w * (f - m_startFreq)/m_fSpan + 0.5);
if(x<0 ) return 0;
if(x>m_w) return m_w;
@@ -765,6 +772,7 @@ void CPlotter::mouseReleaseEvent (QMouseEvent * event)
else {
event->ignore (); // let parent handle
}
+// replot(); // ### Not needed? ###
}
void CPlotter::mouseDoubleClickEvent (QMouseEvent * event)
@@ -774,8 +782,7 @@ void CPlotter::mouseDoubleClickEvent (QMouseEvent * event)
int n=2;
if(ctrl) n+=100;
emit freezeDecode1(n);
- }
- else {
+ } else {
event->ignore (); // let parent handle
}
}
@@ -878,3 +885,8 @@ void CPlotter::setRedFile(QString fRed)
{
m_redFile=fRed;
}
+
+void CPlotter::setDiskUTC(int nutc)
+{
+ m_nUTC=nutc;
+}
diff --git a/widgets/plotter.h b/widgets/plotter.h
index 582d3645..52936f2b 100644
--- a/widgets/plotter.h
+++ b/widgets/plotter.h
@@ -87,6 +87,7 @@ public:
void setRedFile(QString fRed);
void setFST4_FreqRange(int fLow,int fHigh);
void setSingleDecode(bool b);
+ void setDiskUTC(int nutc);
bool scaleOK () const {return m_bScaleOK;}
signals:
@@ -136,6 +137,7 @@ private:
qint32 m_ib;
qint32 m_nfa;
qint32 m_nfb;
+ qint32 m_nUTC;
QPixmap m_WaterfallPixmap;
QPixmap m_2DPixmap;
diff --git a/widgets/widegraph.cpp b/widgets/widegraph.cpp
index bb53279c..78325d27 100644
--- a/widgets/widegraph.cpp
+++ b/widgets/widegraph.cpp
@@ -236,7 +236,7 @@ void WideGraph::keyPressEvent(QKeyEvent *e) //F1
void WideGraph::setRxFreq(int n) //setRxFreq
{
ui->widePlot->setRxFreq(n);
- ui->widePlot->draw(m_swide,false,false);
+ if(m_mode!="Q65") ui->widePlot->draw(m_swide,false,false);
}
int WideGraph::rxFreq() //rxFreq
@@ -542,3 +542,8 @@ void WideGraph::setRedFile(QString fRed)
{
ui->widePlot->setRedFile(fRed);
}
+
+void WideGraph::setDiskUTC(int nutc)
+{
+ ui->widePlot->setDiskUTC(nutc);
+}
diff --git a/widgets/widegraph.h b/widgets/widegraph.h
index 421fc821..e8d241da 100644
--- a/widgets/widegraph.h
+++ b/widgets/widegraph.h
@@ -51,6 +51,7 @@ public:
void setRedFile(QString fRed);
void setFST4_FreqRange(int fLow,int fHigh);
void setSingleDecode(bool b);
+ void setDiskUTC(int nutc);
signals:
void freezeDecode2(int n);