From ffea9660ba79a513401639a2f5d90e2fdc190fb8 Mon Sep 17 00:00:00 2001 From: tony mancill Date: Mon, 1 Jan 2024 11:39:50 -0800 Subject: New upstream version 2.7.0~rc3+repack --- widgets/mainwindow.cpp | 398 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 287 insertions(+), 111 deletions(-) (limited to 'widgets/mainwindow.cpp') diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index a476bba7..de061203 100755 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -213,6 +213,7 @@ QVector g_ColorTbl; using SpecOp = Configuration::SpecialOperatingActivity; +bool blocked = false; bool m_displayBand = false; bool no_a7_decodes = false; bool keep_frequency = false; @@ -1084,6 +1085,22 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, QString jpleph = m_config.data_dir().absoluteFilePath("JPLEPH"); jpl_setup_(const_cast(jpleph.toLocal8Bit().constData()),256); +#ifdef WIN32 + // backup libhamlib-4.dll file, so it is still available after the next program update + QDir dataPath = QCoreApplication::applicationDirPath(); + QFile f {dataPath.absolutePath() + "/" + "libhamlib-4_old.dll"}; + if (!f.exists()) { + QFile::copy(dataPath.absolutePath() + "/" + "libhamlib-4.dll", dataPath.absolutePath() + "/" + "libhamlib-4_old.dll"); + QTimer::singleShot (5000, [=] { //wait until hamlib has been started + extern char* hamlib_version2; + QString hamlib = QString(QLatin1String(hamlib_version2)); + m_settings->beginGroup("Configuration"); + m_settings->setValue ("HamlibBackedUp", hamlib); + m_settings->endGroup(); + }); + } +#endif + // this must be the last statement of constructor if (!m_valid) throw std::runtime_error {"Fatal initialization exception"}; } @@ -1091,11 +1108,11 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, void MainWindow::not_GA_warning_message () { MessageBox::critical_message (this, - "This is a pre-release version of WSJT-X 2.7.0-rc2 made\n" + "This is a pre-release version of WSJT-X " + version (false) + " made\n" "available for testing purposes. By design it will\n" - "be nonfunctional after Jan 15, 2024."); + "be nonfunctional after September 30, 2024."); auto now = QDateTime::currentDateTimeUtc (); - if (now >= QDateTime {{2024, 01, 15}, {23, 59, 59, 999}, Qt::UTC}) { + if (now >= QDateTime {{2024, 9, 30}, {23, 59, 59, 999}, Qt::UTC}) { Q_EMIT finished (); } } @@ -1206,6 +1223,16 @@ void MainWindow::writeSettings() m_settings->setValue ("SerialNumber",ui->sbSerialNumber->value ()); m_settings->endGroup(); + // do this in the General group because we save the parameters from various places + if(m_mode=="JT9") { + m_settings->setValue("SubMode",ui->sbSubmode->value()); + m_settings->setValue("TRPeriod", ui->sbTR->value()); + } + if(m_mode=="MSK144") m_settings->setValue("ShMsgs_MSK144",m_bShMsgs); + if(m_mode=="Q65") m_settings->setValue("ShMsgs_Q65",m_bShMsgs); + if(m_mode=="JT65") m_settings->setValue("ShMsgs_JT65",m_bShMsgs); + if(m_mode=="JT4") m_settings->setValue("ShMsgs_JT4",m_bShMsgs); + m_settings->beginGroup("Common"); m_settings->setValue("Mode",m_mode); m_settings->setValue("SaveNone",ui->actionNone->isChecked()); @@ -1219,13 +1246,12 @@ void MainWindow::writeSettings() m_settings->setValue("FST4W_FTol",ui->sbFST4W_FTol->value()); m_settings->setValue("FST4_FLow",ui->sbF_Low->value()); m_settings->setValue("FST4_FHigh",ui->sbF_High->value()); -// m_settings->setValue("SubMode",ui->sbSubmode->value()); m_settings->setValue("DTtol",m_DTtol); m_settings->setValue("Ftol", ui->sbFtol->value ()); m_settings->setValue("MinSync",m_minSync); m_settings->setValue ("AutoSeq", ui->cbAutoSeq->isChecked ()); m_settings->setValue ("RxAll", ui->cbRxAll->isChecked ()); - m_settings->setValue("ShMsgs",m_bShMsgs); +// m_settings->setValue("ShMsgs",m_bShMsgs); m_settings->setValue("SWL",ui->cbSWL->isChecked()); m_settings->setValue ("DialFreq", QVariant::fromValue(m_lastMonitoredFrequency)); m_settings->setValue("OutAttenuation", ui->outAttenuation->value ()); @@ -1241,7 +1267,6 @@ void MainWindow::writeSettings() m_settings->setValue("UploadSpots",m_uploadWSPRSpots); m_settings->setValue("NoOwnCall",ui->cbNoOwnCall->isChecked()); m_settings->setValue ("BandHopping", ui->band_hopping_group_box->isChecked ()); -// m_settings->setValue ("TRPeriod", ui->sbTR->value ()); m_settings->setValue ("MaxDrift", ui->sbMaxDrift->value()); m_settings->setValue ("TRPeriod_FST4W", ui->sbTR_FST4W->value ()); m_settings->setValue("FastMode",m_bFastMode); @@ -1309,16 +1334,58 @@ void MainWindow::readSettings() ui->sbSerialNumber->setValue (m_settings->value ("SerialNumber", 1).toInt ()); m_settings->endGroup(); + m_settings->beginGroup("Common"); + m_mode=m_settings->value("Mode","FT8").toString(); + m_settings->endGroup(); + + // do this outside of settings group because it uses groups internally ui->actionAstronomical_data->setChecked (displayAstro); + // do this in the General group because we save the parameters from various places + if(m_mode=="JT9") { + blocked=true; + m_nSubMode=m_settings->value("SubMode",0).toInt(); + ui->sbSubmode->setValue(m_nSubMode); + ui->sbFtol->setValue (m_settings->value("Ftol_JT9", 50).toInt()); + ui->sbTR->setValue (m_settings->value ("TRPeriod", 15).toInt()); + QTimer::singleShot (50, [=] {blocked = false;}); + } + if (m_mode=="Q65") { + m_nSubMode=m_settings->value("SubMode_Q65",0).toInt(); + ui->sbSubmode->setValue(m_nSubMode_Q65); + ui->sbFtol->setValue (m_settings->value("Ftol_Q65", 50).toInt()); + ui->sbTR->setValue (m_settings->value ("TRPeriod_Q65", 30).toInt()); + } + if (m_mode=="JT65") { + m_nSubMode=m_settings->value("SubMode_JT65",0).toInt(); + ui->sbSubmode->setValue(m_nSubMode_JT65); + ui->sbFtol->setValue (m_settings->value("Ftol_JT65", 50).toInt()); + } + if (m_mode=="JT4") { + m_nSubMode=m_settings->value("SubMode_JT4",0).toInt(); + ui->sbSubmode->setValue(m_nSubMode_JT4); + ui->sbFtol->setValue (m_settings->value("Ftol_JT4", 50).toInt()); + ui->sbTR->setValue (m_settings->value ("TRPeriod_FST4", 60).toInt()); + } + if (m_mode=="MSK144") { + ui->sbFtol->setValue (m_settings->value("Ftol_MSK144",50).toInt()); + if (!(m_currentBand=="6m" or m_currentBand=="4m" or m_currentBand=="2m")) ui->sbTR->setValue (m_settings->value ("TRPeriod_MSK144", 30).toInt()); + if (m_currentBand=="6m" or m_currentBand=="4m") ui->sbTR->setValue (m_settings->value ("TRPeriod_MSK144_6m", 15).toInt()); + if (m_currentBand=="2m") ui->sbTR->setValue (m_settings->value ("TRPeriod_MSK144_2m", 30).toInt()); + } + if (m_mode=="MSK144") m_bShMsgs=m_settings->value("ShMsgs_MSK144",false).toBool(); + if (m_mode=="Q65") m_bShMsgs=m_settings->value("ShMsgs_Q65",false).toBool(); + if (m_mode=="JT65") m_bShMsgs=m_settings->value("ShMsgs_JT65",false).toBool(); + if (m_mode=="JT4") m_bShMsgs=m_settings->value("ShMsgs_JT4",false).toBool(); + m_settings->beginGroup("Common"); ui->labDXped->setText(m_settings->value("labDXpedText",QString {}).toString ()); ui->actionDon_t_split_ALL_TXT->setChecked(m_settings->value("actionDontSplitALLTXT", true).toBool()); ui->actionSplit_ALL_TXT_yearly->setChecked(m_settings->value("splitAllTxtYearly", false).toBool()); ui->actionSplit_ALL_TXT_monthly->setChecked(m_settings->value("splitAllTxtMonthly", false).toBool()); ui->actionDisable_writing_of_ALL_TXT->setChecked(m_settings->value("disableWritingOfAllTxt", false).toBool()); - m_mode=m_settings->value("Mode","FT8").toString(); +// m_mode=m_settings->value("Mode","FT8").toString(); ui->actionNone->setChecked(m_settings->value("SaveNone",true).toBool()); ui->actionSave_decoded->setChecked(m_settings->value("SaveDecoded",false).toBool()); ui->actionSave_all->setChecked(m_settings->value("SaveAll",false).toBool()); @@ -1328,28 +1395,16 @@ void MainWindow::readSettings() ui->sbFST4W_RxFreq->setValue(m_settings->value("FST4W_RxFreq",1500).toInt()); ui->sbF_Low->setValue(m_settings->value("FST4_FLow",600).toInt()); ui->sbF_High->setValue(m_settings->value("FST4_FHigh",1400).toInt()); -// m_nSubMode=m_settings->value("SubMode",0).toInt(); - if (m_mode=="Q65") m_nSubMode=m_settings->value("SubMode_Q65",0).toInt(); - if (m_mode=="JT65") m_nSubMode=m_settings->value("SubMode_JT65",0).toInt(); - if (m_mode=="JT4") m_nSubMode=m_settings->value("SubMode_JT4",0).toInt(); -// ui->sbSubmode->setValue(m_nSubMode); - if (m_mode=="Q65") ui->sbSubmode->setValue(m_nSubMode_Q65); - if (m_mode=="JT65") ui->sbSubmode->setValue(m_nSubMode_JT65); - if (m_mode=="JT4") ui->sbSubmode->setValue(m_nSubMode_JT4); ui->sbFtol->setValue (m_settings->value("Ftol", 50).toInt()); ui->sbFST4W_FTol->setValue(m_settings->value("FST4W_FTol",100).toInt()); m_minSync=m_settings->value("MinSync",0).toInt(); ui->syncSpinBox->setValue(m_minSync); ui->cbAutoSeq->setChecked (m_settings->value ("AutoSeq", false).toBool()); ui->cbRxAll->setChecked (m_settings->value ("RxAll", false).toBool()); - m_bShMsgs=m_settings->value("ShMsgs",false).toBool(); +// m_bShMsgs=m_settings->value("ShMsgs",false).toBool(); m_bSWL=m_settings->value("SWL",false).toBool(); m_bFast9=m_settings->value("Fast9",false).toBool(); m_bFastMode=m_settings->value("FastMode",false).toBool(); -// ui->sbTR->setValue (m_settings->value ("TRPeriod", 15).toInt()); - if (m_mode=="Q65") ui->sbTR->setValue (m_settings->value ("TRPeriod_Q65", 30).toInt()); - if (m_mode=="MSK144") ui->sbTR->setValue (m_settings->value ("TRPeriod_MSK144", 15).toInt()); - if (m_mode=="FST4") ui->sbTR->setValue (m_settings->value ("TRPeriod_FST4", 60).toInt()); ui->sbMaxDrift->setValue (m_settings->value ("MaxDrift",0).toInt()); ui->sbTR_FST4W->setValue (m_settings->value ("TRPeriod_FST4W", 15).toInt()); m_lastMonitoredFrequency = m_settings->value ("DialFreq", @@ -1683,6 +1738,7 @@ void MainWindow::dataSink(qint64 frames) int idir=-1; save_echo_params_(&nDopTotal,&nDop,&nfrit,&f1,&width,dec_data.d2,&idir); } +// qDebug() << "aa" << k << frames << m_ihsym << m_hsymStop; avecho_(dec_data.d2,&nDop,&nfrit,&nauto,&navg,&nqual,&f1,&xlevel,&sigdb, &dBerr,&dfreq,&width,&m_diskData); //Don't restart Monitor after an Echo transmission @@ -2491,16 +2547,37 @@ void MainWindow::statusChanged() .arg (f.fileName ()).arg (f.errorString ())); } on_dxGridEntry_textChanged(m_hisGrid); - if(m_specOp!=SpecOp::HOUND) { - ui->txb2->setEnabled(true); - ui->txrb2->setEnabled(true); - ui->txb4->setEnabled(true); - ui->txrb4->setEnabled(true); - ui->txb5->setEnabled(true); - ui->txrb5->setEnabled(true); - ui->txb6->setEnabled(true); - ui->txrb6->setEnabled(true); - ui->houndButton->setChecked(false); + if (m_specOp!=SpecOp::HOUND) { + ui->txb2->setEnabled(true); + ui->txrb2->setEnabled(true); + ui->txb4->setEnabled(true); + ui->txrb4->setEnabled(true); + ui->txb5->setEnabled(true); + ui->txrb5->setEnabled(true); + ui->txb6->setEnabled(true); + ui->txrb6->setEnabled(true); + ui->houndButton->setChecked(false); + } + if (m_config.enable_VHF_features() && (m_mode=="JT4" or m_mode=="Q65" or m_mode=="JT65")) { + ui->actionInclude_averaging->setVisible(true); + ui->actionAuto_Clear_Avg->setVisible(true); + } else { + ui->actionInclude_averaging->setVisible(false); + ui->actionAuto_Clear_Avg->setVisible(false); + } + if (m_mode=="JT4" or m_mode=="Q65" or m_mode=="JT65") { + if (ui->actionInclude_averaging->isVisible() && ui->actionInclude_averaging->isChecked()) { + ui->lh_decodes_title_label->setText(tr ("Single-Period Decodes")); + ui->rh_decodes_title_label->setText(tr ("Average Decodes")); + } else { + if (m_config.enable_VHF_features()) { + ui->lh_decodes_title_label->setText(tr ("Band Activity")); + ui->rh_decodes_title_label->setText(tr ("Decodes containing My Call")); + } else { + ui->lh_decodes_title_label->setText(tr ("Band Activity")); + ui->rh_decodes_title_label->setText(tr ("Rx Frequency")); + } + } } } @@ -2803,7 +2880,7 @@ void MainWindow::on_actionCopyright_Notice_triggered() "\"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, MSK144 are Copyright (C) " - "2001-2023 by one or more of the following authors: Joseph Taylor, " + "2001-2024 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; " "Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; " @@ -3226,7 +3303,7 @@ void MainWindow::on_actionSpecial_mouse_commands_triggered() Click to set Rx frequency.
Shift-click to set Tx frequency.
Ctrl-click or Right-click to set Rx and Tx frequencies.
- Double-click to also decode at Rx frequency.
+ Double-click to also decode at Rx frequency. @@ -3237,7 +3314,7 @@ void MainWindow::on_actionSpecial_mouse_commands_triggered() messages.
If Hold Tx Freq is checked or first callsign in message
is your own call, Tx frequency is not changed unless
- Ctrl is held down.
+ Ctrl is held down. @@ -3246,6 +3323,18 @@ void MainWindow::on_actionSpecial_mouse_commands_triggered() Double-click to erase QSO and Band Activity windows. + + Q65 Button: + Click to switch to Q65 Mode.
+ Right-click to switch to Q65 Pileup Mode. + + + + JT65 Button: + Click to switch to JT65 Mode.
+ Right-click to switch to JT9 Mode. + + )"), font}); } m_mouseCmnds->showNormal (); @@ -4155,6 +4244,7 @@ void MainWindow::readFromStdout() //readFromStdout !m_config.enable_VHF_features()) bDisplayRight=true; } if(m_mode=="Q65" and !bAvgMsg) bDisplayRight=false; + if((m_mode=="JT4" or m_mode=="Q65" or m_mode=="JT65") and decodedtext.string().contains(m_baseCall) && ui->actionInclude_averaging->isVisible() && !ui->actionInclude_averaging->isChecked()) bDisplayRight=true; if (bDisplayRight) { // This msg is within 10 hertz of our tuned frequency, or a JT4 or JT65 avg, @@ -5517,7 +5607,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie QString firstcall = message.call(); if(firstcall.length()>=4 and firstcall.mid(0,3)=="CQ ") firstcall="CQ"; - if(!m_bFastMode and (!m_config.enable_VHF_features() or m_mode=="FT8")) { + if(!m_bFastMode and (!m_config.enable_VHF_features() or m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4")) { // Don't change Tx freq if in a fast mode, or VHF features enabled; also not if a // station is calling me, unless CTRL or SHIFT is held down. if ((Radio::is_callsign (firstcall) @@ -5973,7 +6063,7 @@ void MainWindow::genCQMsg () ( tlist.at(1)==my_callsign or tlist.at(2)==my_callsign ) and stdCall(my_callsign)) { - if(m_config.Individual_Contest_Name()) { + if(m_config.Individual_Contest_Name() && SpecOp::FOX != m_specOp) { m_cqStr = m_config.Contest_Name(); } else { if(SpecOp::NA_VHF == m_specOp) m_cqStr="TEST"; @@ -6102,6 +6192,9 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) t1 = t1.asprintf("%4.4d",ui->sbSerialNumber->value()); sent=rst + t1; } + if(t1.contains(QRegularExpression {"\\d\\d\\d\\d"})) { + t1 = m_config.RTTY_Exchange(); + } } if(SpecOp::EU_VHF==m_specOp) { QString a; @@ -6520,18 +6613,14 @@ void MainWindow::on_RoundRobin_currentTextChanged(QString text) void MainWindow::mousePressEvent(QMouseEvent *event) { - if(ui->q65Button->hasFocus() && (event->button() & Qt::RightButton)) { - m_specOp=m_config.special_op_id(); - if (m_specOp==SpecOp::Q65_PILEUP) { - m_config.setSpecial_None(); - ui->tx1->setEnabled(true); - ui->txb1->setEnabled(true); - } else { - m_config.setSpecial_Q65_Pileup(); - } + if(ui->q65Button->hasFocus() && (event->button() & Qt::RightButton)) { // switch to Q65_Pileup mode + m_config.setSpecial_Q65_Pileup(); m_specOp=m_config.special_op_id(); on_actionQ65_triggered(); } + if(ui->jt65Button->hasFocus() && (event->button() & Qt::RightButton)) { // switch to JT9 mode + on_actionJT9_triggered(); + } } void MainWindow::on_dxCallEntry_textChanged (QString const& call) @@ -6651,6 +6740,10 @@ void MainWindow::on_logQSOButton_clicked() //Log QSO button m_xSent=m_config.my_grid().left(4); m_xRcvd=m_hisGrid; break; + case SpecOp::Q65_PILEUP: + m_xSent=m_config.my_grid().left(4); + m_xRcvd=m_hisGrid; + break; default: break; } @@ -6840,6 +6933,10 @@ void MainWindow::on_actionFST4_triggered() on_sbSubmode_valueChanged(ui->sbSubmode->value()); }); m_mode="FST4"; + if(m_specOp==SpecOp::HOUND) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } ui->actionFST4->setChecked(true); m_bFast9=false; m_bFastMode=false; @@ -6882,6 +6979,10 @@ void MainWindow::on_actionFST4_triggered() void MainWindow::on_actionFST4W_triggered() { m_mode="FST4W"; + if(m_specOp==SpecOp::HOUND) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } ui->actionFST4W->setChecked(true); m_bFast9=false; m_bFastMode=false; @@ -6917,6 +7018,10 @@ void MainWindow::on_actionFT4_triggered() on_sbSubmode_valueChanged(ui->sbSubmode->value()); }); m_mode="FT4"; + if(m_specOp==SpecOp::HOUND) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } m_TRperiod=7.5; bool bVHF=m_config.enable_VHF_features(); m_bFast9=false; @@ -7083,6 +7188,10 @@ void MainWindow::on_actionJT4_triggered() ui->RxFreqSpinBox->setValue(m_settings->value("RxFreq_old",1500).toInt()); }); m_mode="JT4"; + if(m_specOp==SpecOp::HOUND) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } bool bVHF=m_config.enable_VHF_features(); WSPR_config(false); switch_mode (Modes::JT4); @@ -7103,15 +7212,16 @@ void MainWindow::on_actionJT4_triggered() m_bFast9=false; setup_status_bar (bVHF); ui->sbSubmode->setMaximum(6); - 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")); if(bVHF) { -// ui->sbSubmode->setValue(m_nSubMode); - QTimer::singleShot (50, [=] {m_nSubMode=m_settings->value("SubMode_JT4",0).toInt();}); - QTimer::singleShot (75, [=] {ui->sbSubmode->setValue(m_settings->value("SubMode_JT4",0).toInt());}); - QTimer::singleShot (100, [=] {on_sbSubmode_valueChanged(m_nSubMode);}); + // restore last used parameters + ui->sbFtol->setValue (m_settings->value ("Ftol_JT4", 50).toInt()); + m_nSubMode=m_settings->value("SubMode_JT4",0).toInt(); + ui->sbSubmode->setValue(m_settings->value("SubMode_JT4",0).toInt()); + QTimer::singleShot (50, [=] {on_sbSubmode_valueChanged(ui->sbSubmode->value());}); + m_bShMsgs=m_settings->value("ShMsgs_JT4",false).toBool(); + ui->cbShMsgs->setChecked(m_bShMsgs); } else { ui->sbSubmode->setValue(0); } @@ -7128,8 +7238,25 @@ void MainWindow::on_actionJT4_triggered() void MainWindow::on_actionJT9_triggered() { m_mode="JT9"; + if(m_specOp==SpecOp::HOUND) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } bool bVHF=m_config.enable_VHF_features(); - m_bFast9=ui->cbFast9->isChecked(); + // restore last used parameters + if(bVHF && m_mode!="JT65" && !blocked) { + ui->sbSubmode->setMaximum(7); + m_bFast9=m_settings->value("JT9_Fast",false).toBool(); + ui->cbFast9->setChecked(m_bFast9 or m_bFastMode); + ui->sbFtol->setValue (m_settings->value ("Ftol_JT9", 50).toInt()); + m_nSubMode=m_settings->value("SubMode",0).toInt(); + ui->sbSubmode->setValue(m_nSubMode); + QTimer::singleShot (50, [=] { + on_sbTR_valueChanged (ui->sbTR->value()); + on_sbSubmode_valueChanged(ui->sbSubmode->value()); + }); + } +// m_bFast9=ui->cbFast9->isChecked(); m_bFastMode=m_bFast9; WSPR_config(false); switch_mode (Modes::JT9); @@ -7152,6 +7279,7 @@ void MainWindow::on_actionJT9_triggered() ui->sbSubmode->setMaximum(7); if(m_bFast9) { ui->sbTR->values ({5, 10, 15, 30}); + if(bVHF && m_mode!="JT65" && !blocked) ui->sbTR->setValue (m_settings->value ("TRPeriod", 15).toInt()); // restore last used TRperiod on_sbTR_valueChanged (ui->sbTR->value()); m_wideGraph->hide(); m_fastGraph->showNormal(); @@ -7191,6 +7319,10 @@ void MainWindow::on_actionJT65_triggered() ui->RxFreqSpinBox->setValue(m_settings->value("RxFreq_old",1500).toInt()); }); on_actionJT9_triggered(); + if(m_specOp==SpecOp::HOUND) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } m_mode="JT65"; bool bVHF=m_config.enable_VHF_features(); WSPR_config(false); @@ -7216,12 +7348,13 @@ void MainWindow::on_actionJT65_triggered() m_bFast9=false; ui->sbSubmode->setMaximum(2); if(bVHF) { -// ui->sbSubmode->setValue(m_nSubMode); - QTimer::singleShot (50, [=] {m_nSubMode=m_settings->value("SubMode_JT65",0).toInt();}); - QTimer::singleShot (75, [=] {ui->sbSubmode->setValue(m_settings->value("SubMode_JT65",0).toInt());}); - QTimer::singleShot (100, [=] {on_sbSubmode_valueChanged(m_nSubMode);}); - ui->lh_decodes_title_label->setText(tr ("Single-Period Decodes")); - ui->rh_decodes_title_label->setText(tr ("Average Decodes")); + // restore last used parameters + ui->sbFtol->setValue (m_settings->value ("Ftol_JT65", 50).toInt()); + m_nSubMode=m_settings->value("SubMode_JT65",0).toInt(); + ui->sbSubmode->setValue(m_settings->value("SubMode_JT65",0).toInt()); + QTimer::singleShot (50, [=] {on_sbSubmode_valueChanged(ui->sbSubmode->value());}); + m_bShMsgs=m_settings->value("ShMsgs_JT65",false).toBool(); + ui->cbShMsgs->setChecked(m_bShMsgs); } else { ui->sbSubmode->setValue(0); ui->lh_decodes_title_label->setText(tr ("Band Activity")); @@ -7248,6 +7381,10 @@ void MainWindow::on_actionQ65_triggered() ui->RxFreqSpinBox->setValue(m_settings->value("RxFreq_old",1500).toInt()); }); m_mode="Q65"; + if(m_specOp==SpecOp::HOUND) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } ui->actionQ65->setChecked(true); switch_mode(Modes::Q65); ui->cbAutoSeq->setChecked(true); @@ -7261,12 +7398,17 @@ void MainWindow::on_actionQ65_triggered() Q_EMIT FFTSize(m_FFTSize); m_hsymStop=49; ui->sbTR->values ({15, 30, 60, 120, 300}); - ui->sbTR->setValue (m_settings->value ("TRPeriod_Q65", 30).toInt()); // remember sbTR settings by mode - QTimer::singleShot (50, [=] {on_sbTR_valueChanged (ui->sbTR->value());}); -// ui->sbSubmode->setValue(m_nSubMode); - QTimer::singleShot (50, [=] {m_nSubMode=m_settings->value("SubMode_Q65",0).toInt();}); - QTimer::singleShot (75, [=] {ui->sbSubmode->setValue(m_settings->value("SubMode_Q65",0).toInt());}); - QTimer::singleShot (100, [=] {on_sbSubmode_valueChanged(m_nSubMode);}); + // restore last used parameters + ui->sbTR->setValue (m_settings->value ("TRPeriod_Q65", 30).toInt()); + ui->sbFtol->setValue (m_settings->value ("Ftol_Q65", 50).toInt()); + m_nSubMode=m_settings->value("SubMode_Q65",0).toInt(); + ui->sbSubmode->setValue(m_settings->value("SubMode_Q65",0).toInt()); + QTimer::singleShot (50, [=] { + on_sbTR_valueChanged (ui->sbTR->value()); + on_sbSubmode_valueChanged(ui->sbSubmode->value()); + }); + m_bShMsgs=m_settings->value("ShMsgs_Q65",false).toBool(); + ui->cbShMsgs->setChecked(m_bShMsgs); QString fname {QDir::toNativeSeparators(m_config.temp_dir().absoluteFilePath ("red.dat"))}; m_wideGraph->setRedFile(fname); m_wideGraph->setMode(m_mode); @@ -7277,8 +7419,6 @@ void MainWindow::on_actionQ65_triggered() switch_mode (Modes::Q65); // 01234567890123456789012345678901234567 displayWidgets(nWidgets("11111101011011010011100000010000000011")); - 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")); @@ -7330,6 +7470,10 @@ void MainWindow::on_actionMSK144_triggered() return; } m_mode="MSK144"; + if(m_specOp==SpecOp::HOUND) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } ui->actionMSK144->setChecked(true); switch_mode (Modes::MSK144); m_nsps=6; @@ -7343,11 +7487,10 @@ void MainWindow::on_actionMSK144_triggered() m_bFastMode=true; m_bFast9=false; ui->sbTR->values ({5, 10, 15, 30}); - ui->sbTR->setValue (m_settings->value ("TRPeriod_MSK144", 15).toInt()); // remember sbTR settings by mode - QTimer::singleShot (50, [=] { - on_sbTR_valueChanged (ui->sbTR->value()); - on_sbSubmode_valueChanged(ui->sbSubmode->value()); - }); + ui->sbTR->setValue (m_settings->value ("TRPeriod_MSK144", 15).toInt()); // restore last used TRperiod + QTimer::singleShot (50, [=] {on_sbTR_valueChanged (ui->sbTR->value());}); + m_bShMsgs=m_settings->value("ShMsgs_MSK144",false).toBool(); + ui->cbShMsgs->setChecked(m_bShMsgs); m_wideGraph->hide(); m_fastGraph->showNormal(); ui->TxFreqSpinBox->setValue(1500); @@ -7388,6 +7531,10 @@ void MainWindow::on_actionMSK144_triggered() void MainWindow::on_actionWSPR_triggered() { m_mode="WSPR"; + if(m_specOp==SpecOp::HOUND) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } WSPR_config(true); switch_mode (Modes::WSPR); m_TRperiod=120.0; @@ -7424,6 +7571,10 @@ void MainWindow::on_actionEcho_triggered() if(nd==3) ui->actionDeepestDecode->setChecked (true); m_mode="Echo"; + if(m_specOp==SpecOp::HOUND) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } ui->actionEcho->setChecked(true); m_TRperiod=3.0; m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe @@ -7458,6 +7609,10 @@ void MainWindow::on_actionFreqCal_triggered() { on_actionJT9_triggered(); m_mode="FreqCal"; + if(m_specOp==SpecOp::HOUND) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } ui->actionFreqCal->setChecked(true); switch_mode(Modes::FreqCal); m_wideGraph->setMode(m_mode); @@ -7652,6 +7807,7 @@ void MainWindow::on_actionDeepestDecode_toggled (bool checked) void MainWindow::on_actionInclude_averaging_toggled (bool checked) { m_ndepth ^= (-checked ^ m_ndepth) & 0x00000010; + statusChanged(); } void MainWindow::on_actionInclude_correlation_toggled (bool checked) @@ -8008,6 +8164,7 @@ void MainWindow::setXIT(int n, Frequency base) void MainWindow::setFreq4(int rxFreq, int txFreq) { + if (m_mode=="ECHO") return; // we do not adjust rx/tx for echo mode -- always 1500Hz if (ui->RxFreqSpinBox->isEnabled ()) ui->RxFreqSpinBox->setValue(rxFreq); if(m_mode=="WSPR" or m_mode=="FST4W") { ui->WSPRfreqSpinBox->setValue(txFreq); @@ -8449,6 +8606,14 @@ void MainWindow::on_sbFtol_valueChanged(int value) { m_wideGraph->setTol (value); statusUpdate (); + // save last used parameters + QTimer::singleShot (200, [=] { + if (m_mode=="Q65") m_settings->setValue ("Ftol_Q65", ui->sbFtol->value()); + if (m_mode=="MSK144") m_settings->setValue ("Ftol_MSK144", ui->sbFtol->value()); + if (m_mode=="JT65") m_settings->setValue ("Ftol_JT65", ui->sbFtol->value ()); + if (m_mode=="JT4") m_settings->setValue ("Ftol_JT4", ui->sbFtol->value()); + if (m_mode=="JT9") m_settings->setValue ("Ftol_JT9", ui->sbFtol->value ()); + }); } void::MainWindow::VHF_features_enabled(bool b) @@ -8510,19 +8675,25 @@ void MainWindow::on_sbTR_valueChanged(int value) m_wideGraph->setPeriod (value, m_nsps); progressBar.setMaximum (value); } - if (m_mode=="Q65") { - QTimer::singleShot (200, [=] {m_settings->setValue ("TRPeriod_Q65", ui->sbTR->value ());}); - } - if (m_mode=="MSK144") { - QTimer::singleShot (200, [=] {m_settings->setValue ("TRPeriod_MSK144", ui->sbTR->value ());}); - } - if (m_mode=="FST4") { - chk_FST4_freq_range(); - QTimer::singleShot (200, [=] {m_settings->setValue ("TRPeriod_FST4", ui->sbTR->value ());}); - } // if(m_transmitting) on_stopTxButton_clicked(); //### Is this needed or desirable? ### + if (m_mode=="FST4") chk_FST4_freq_range(); on_sbSubmode_valueChanged(ui->sbSubmode->value()); statusUpdate (); + // save last used parameters + QTimer::singleShot (200, [=] { + if (m_mode=="Q65") m_settings->setValue ("TRPeriod_Q65", ui->sbTR->value ()); + if (m_mode=="MSK144" && (!(m_currentBand=="6m" or m_currentBand=="4m" or m_currentBand=="2m"))) { + m_settings->setValue ("TRPeriod_MSK144", ui->sbTR->value ()); + } + if (m_mode=="MSK144" && (m_currentBand=="6m" or m_currentBand=="4m")) { + m_settings->setValue ("TRPeriod_MSK144_6m", ui->sbTR->value ()); + } + if (m_mode=="MSK144" && m_currentBand=="2m") { + m_settings->setValue ("TRPeriod_MSK144_2m", ui->sbTR->value ()); + } + if (m_mode=="FST4") m_settings->setValue ("TRPeriod_FST4", ui->sbTR->value ()); + if (m_mode=="JT9") m_settings->setValue ("TRPeriod", ui->sbTR->value ()); + }); } void MainWindow::on_sbTR_FST4W_valueChanged(int value) @@ -8569,17 +8740,21 @@ void MainWindow::on_sbSubmode_valueChanged(int n) ui->sbTR->setVisible(false); m_TRperiod=60.0; } else { - ui->cbFast9->setEnabled(true); + if(!blocked) ui->cbFast9->setEnabled(true); } ui->sbTR->setVisible(m_bFast9); if(m_bFast9) ui->TxFreqSpinBox->setValue(700); } if(m_transmitting and m_bFast9 and m_nSubMode>=4) transmit (99.0); if (m_mode !="Q65") ui->TxFreqSpinBox->setStyleSheet(""); - if (m_mode=="Q65") {QTimer::singleShot (200, [=] {m_settings->setValue("SubMode_Q65",ui->sbSubmode->value());});} - if (m_mode=="JT65") {QTimer::singleShot (200, [=] {m_settings->setValue("SubMode_JT65",ui->sbSubmode->value());});} - if (m_mode=="JT4") {QTimer::singleShot (200, [=] {m_settings->setValue("SubMode_JT4",ui->sbSubmode->value());});} statusUpdate (); + // save last used parameters + QTimer::singleShot (200, [=] { + if (m_mode=="Q65") m_settings->setValue("SubMode_Q65",ui->sbSubmode->value()); + if (m_mode=="JT65") m_settings->setValue("SubMode_JT65",ui->sbSubmode->value()); + if (m_mode=="JT4") m_settings->setValue("SubMode_JT4",ui->sbSubmode->value()); + if (m_mode=="JT9") m_settings->setValue("SubMode",ui->sbSubmode->value()); + }); } void MainWindow::on_cbFast9_clicked(bool b) @@ -8587,7 +8762,12 @@ void MainWindow::on_cbFast9_clicked(bool b) if(m_mode=="JT9") { m_bFast9=b; // ui->cbAutoSeq->setVisible(b); + blocked=true; // needed to prevent a loop on_actionJT9_triggered(); + QTimer::singleShot (50, [=] {blocked = false;}); // needed to prevent a loop + QTimer::singleShot (200, [=] { + if(m_mode=="JT9") m_settings->setValue("JT9_Fast",m_bFast9); + }); } if(b) { @@ -8619,6 +8799,12 @@ void MainWindow::on_cbShMsgs_toggled(bool b) if(ntx==4) ui->txrb4->setChecked(true); if(ntx==5) ui->txrb5->setChecked(true); if(ntx==6) ui->txrb6->setChecked(true); + QTimer::singleShot (200, [=] { + if(m_mode=="MSK144") m_settings->setValue("ShMsgs_MSK144",m_bShMsgs); + if(m_mode=="Q65") m_settings->setValue("ShMsgs_Q65",m_bShMsgs); + if(m_mode=="JT65") m_settings->setValue("ShMsgs_JT65",m_bShMsgs); + if(m_mode=="JT4") m_settings->setValue("ShMsgs_JT4",m_bShMsgs); + }); } void MainWindow::on_cbSWL_toggled(bool b) @@ -8823,6 +9009,7 @@ void MainWindow::p1ReadFromStdout() //p1readFromStdout } killFileTimer.start (45*1000); //Kill in 45s (for slow modes) } + ndecodes_label.setText(QString::number(m_nWSPRdecodes)); m_nWSPRdecodes=0; ui->DecodeButton->setChecked (false); if(m_uploadWSPRSpots && m_config.is_transceiver_online()) { // need working rig control @@ -9461,7 +9648,8 @@ void MainWindow::readWidebandDecodes() m_EMECall[dxcall].t=60*nhr + nmin; if(w3.contains(grid_regexp)) m_EMECall[dxcall].grid4=w3; bool bCQ=line.contains(" CQ "); - m_EMECall[dxcall].ready2call=(bCQ or line.contains(" 73") or line.contains(" RR73")); +// m_EMECall[dxcall].ready2call=(bCQ or line.contains(" 73") or line.contains(" RR73")); + m_EMECall[dxcall].ready2call=(bCQ); Frequency frequency = (m_freqNominal/1000000) * 1000000 + int(fsked*1000.0); bool bFromDisk=qmapcom.nQDecoderDone==2; if(!bFromDisk and (m_EMECall[dxcall].grid4.contains(grid_regexp) or bCQ)) { @@ -10475,7 +10663,7 @@ void MainWindow::remote_configure (QString const& mode, quint32 frequency_tolera { if (mode.size ()) { - set_mode (mode); + if (mode != m_mode) set_mode (mode); } auto is_FST4W = "FST4W" == m_mode; if (frequency_tolerance != quint32_max && (ui->sbFtol->isVisible () || is_FST4W)) @@ -10596,45 +10784,33 @@ void MainWindow::on_houndButton_clicked (bool checked) void MainWindow::on_ft8Button_clicked() { - if(m_specOp==SpecOp::HOUND) { - m_config.setSpecial_None(); - m_specOp=m_config.special_op_id(); - } - on_actionFT8_triggered(); + if (m_specOp==SpecOp::HOUND) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } + on_actionFT8_triggered(); } void MainWindow::on_ft4Button_clicked() { - if(m_specOp==SpecOp::HOUND) { - m_config.setSpecial_None(); - m_specOp=m_config.special_op_id(); - } - on_actionFT4_triggered(); + on_actionFT4_triggered(); } void MainWindow::on_msk144Button_clicked() { - if(m_specOp==SpecOp::HOUND) { - m_config.setSpecial_None(); - m_specOp=m_config.special_op_id(); - } - on_actionMSK144_triggered(); + on_actionMSK144_triggered(); } void MainWindow::on_q65Button_clicked() { - if(m_specOp==SpecOp::HOUND) { - m_config.setSpecial_None(); - m_specOp=m_config.special_op_id(); - } - on_actionQ65_triggered(); + if (m_specOp==SpecOp::Q65_PILEUP) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } + on_actionQ65_triggered(); } void MainWindow::on_jt65Button_clicked() { - if(m_specOp==SpecOp::HOUND) { - m_config.setSpecial_None(); - m_specOp=m_config.special_op_id(); - } - on_actionJT65_triggered(); + on_actionJT65_triggered(); } -- cgit v1.2.3