From 941d45887769621879b83292f167142951977d69 Mon Sep 17 00:00:00 2001 From: tony mancill Date: Tue, 21 Dec 2021 21:48:16 -0800 Subject: New upstream version 2.5.3+repack --- widgets/mainwindow.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'widgets/mainwindow.cpp') diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index a56318f4..b6cb6542 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -184,6 +184,8 @@ extern "C" { void get_ft4msg_(int* idecode, char* line, int len); void chk_samples_(int* m_ihsym,int* k, int* m_hsymStop); + + void save_dxbase_(char* dxbase, int len); } int volatile itone[MAX_NUM_SYMBOLS]; //Audio tones for all Tx symbols @@ -210,7 +212,7 @@ using SpecOp = Configuration::SpecialOperatingActivity; namespace { Radio::Frequency constexpr default_frequency {14076000}; - QRegExp message_alphabet {"[- @A-Za-z0-9+./?#<>;]*"}; + QRegExp message_alphabet {"[- @A-Za-z0-9+./?#<>;$]*"}; // grid exact match excluding RR73 QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"}; auto quint32_max = std::numeric_limits::max (); @@ -3641,8 +3643,9 @@ 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(); + auto const& msg_no_hash = message.clean_string ().mid(22).remove("<").remove(">"); bool is_OK=false; - if(m_mode=="MSK144" and message.clean_string ().indexOf(ui->dxCallEntry->text()+" R ")>0) is_OK=true; + if(m_mode=="MSK144" && msg_no_hash.indexOf(ui->dxCallEntry->text()+" R ")>0) is_OK=true; if (message_words.size () > 3 && (message.isStandardMessage() || (is_73 or is_OK))) { auto df = message.frequencyOffset (); auto within_tolerance = (qAbs (ui->RxFreqSpinBox->value () - df) <= int (start_tolerance) @@ -3657,7 +3660,7 @@ void MainWindow::auto_sequence (DecodedText const& message, unsigned start_toler || message_words.contains ("DE"))) || !message.isStandardMessage ()); // free text 73/RR73 - QStringList w=message.clean_string ().mid(22).remove("<").remove(">").split(" ",SkipEmptyParts); + auto const& w = msg_no_hash.split(" ",SkipEmptyParts); QString w2; int nrpt=0; if (w.size () > 2) @@ -5370,6 +5373,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) auto is_type_one = !is77BitMode () && is_compound && shortList (my_callsign); auto const& my_grid = m_config.my_grid ().left (4); auto const& hisBase = Radio::base_callsign (hisCall); + save_dxbase_(const_cast ((hisBase + " ").left (6).toLatin1().constData()),6); auto eme_short_codes = m_config.enable_VHF_features () && ui->cbShMsgs->isChecked () && m_mode == "JT65"; @@ -5851,6 +5855,13 @@ void MainWindow::on_dxCallEntry_textChanged (QString const& call) statusUpdate (); } +void MainWindow::on_dxCallEntry_editingFinished() +{ + auto const& dxBase = Radio::base_callsign (m_hisCall); + save_dxbase_(const_cast ((dxBase + " ").left (6).toLatin1().constData()),6); +} + + void MainWindow::on_dxCallEntry_returnPressed () { on_lookupButton_clicked(); @@ -7757,10 +7768,11 @@ void MainWindow::replyToCQ (QTime time, qint32 snr, float delta_time, quint32 de , bool /*low_confidence*/, quint8 modifiers) { QString format_string {"%1 %2 %3 %4 %5 %6"}; - auto const& time_string = time.toString ("~" == mode || "&" == mode - || "+" == mode ? "hhmmss" : "hhmm"); + auto const& time_string = time.toString ("~" == mode || "&" == mode || "+" == mode + || (m_TRperiod < 60. && ("`" == mode || ":" == mode)) + ? "hhmmss" : "hhmm"); auto text = message_text; - auto ap_pos = text.lastIndexOf (QRegularExpression {R"((?:\?\s)?a[0-9]$)"}); + auto ap_pos = text.lastIndexOf (QRegularExpression {R"((?:\?\s)?(?:a[0-9]|q[0-9][0-9]?)$)"}); if (ap_pos >= 0) { // beware of decodes ending on shorter version of wanted call so @@ -7881,7 +7893,7 @@ void MainWindow::postDecode (bool is_new, QString const& message) , parts[1].toInt () , parts[2].toFloat (), parts[3].toUInt (), parts[4] , decode.mid (has_seconds ? 24 : 22) - , QChar {'?'} == decode.mid (has_seconds ? 24 + 21 : 22 + 21, 1) + , QChar {'?'} == decode.mid (has_seconds ? 24 + 36 : 22 + 36, 1) , m_diskData); } } -- cgit v1.2.3