From d657da59806c084523cb1ec55ab3269e5d044358 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 23 Apr 2020 16:15:19 -0400 Subject: [PATCH 1/6] Don't switch automatically to EU VHF Contest mode. --- Decoder/decodedtext.cpp | 9 --------- widgets/mainwindow.cpp | 11 ++--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/Decoder/decodedtext.cpp b/Decoder/decodedtext.cpp index 282bb6a31..95f6f9372 100644 --- a/Decoder/decodedtext.cpp +++ b/Decoder/decodedtext.cpp @@ -177,15 +177,6 @@ unsigned DecodedText::timeInSeconds() const + (padding_ ? string_.mid (column_time + 2 + padding_, 2).toUInt () : 0U); } -/* -2343 -11 0.8 1259 # YV6BFE F6GUU R-08 -2343 -19 0.3 718 # VE6WQ SQ2NIJ -14 -2343 -7 0.3 815 # KK4DSD W7VP -16 -2343 -13 0.1 3627 @ CT1FBK IK5YZT R+02 - -0605 Tx 1259 # CQ VK3ACF QF22 -*/ - QString DecodedText::report() const // returns a string of the SNR field with a leading + or - followed by two digits { int sr = snr(); diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index e964904f7..47b4778d8 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -4589,15 +4589,9 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie } bool bEU_VHF_w2=(nrpt>=520001 and nrpt<=594000); if(bEU_VHF_w2 and SpecOp::EU_VHF!=m_config.special_op_id()) { - // Switch automatically to EU VHF Contest mode - m_config.setEU_VHF_Contest(); -// m_nContest=EU_VHF; - if(m_transmitting) m_restart=true; - ui->decodedTextBrowser2->displayQSY (QString{"Enabled EU VHF Contest messages."}); - QString t0="EU VHF"; - ui->labDXped->setVisible(true); - ui->labDXped->setText(t0); + MessageBox::information_message (this, tr ("Should you switch to EU VHF Contest mode?")); } + QStringList t=message.string().split(' ', QString::SkipEmptyParts); int n=t.size(); QString t0=t.at(n-2); @@ -4609,7 +4603,6 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie m_xRcvd=t.at(n-2) + " " + t.at(n-1); t0=t.at(n-3); } - if(bFieldDay_msg and SpecOp::FIELD_DAY!=m_config.special_op_id()) { // ### Should be in ARRL Field Day mode ??? ### MessageBox::information_message (this, tr ("Should you switch to ARRL Field Day mode?")); From ee04d864cfaa43c8ffa3110a18975f64fd84d83a Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 24 Apr 2020 10:33:23 -0400 Subject: [PATCH 2/6] Correct for "deCallAndGrid" not working for EU VHF contest messages. --- widgets/mainwindow.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 47b4778d8..ca04c4057 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -4517,6 +4517,18 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie ui->dxCallEntry->setText(hiscall); } + QStringList w=message.string().mid(22).remove("<").remove(">").split(" ",QString::SkipEmptyParts); + int nw=w.size(); + if(nw>=4) { + // Temporary? Correct for the fact that message.deCallAndGrid() does not work for EU VHF contest messages + QString t=message_words.at(nw-2); + int n=w.at(nw-2).toInt(); + if(n>=520001 and n<=592047) { + hiscall=w.at(1); + hisgrid=w.at(nw-1); + } + } + bool is_73 = message_words.filter (QRegularExpression {"^(73|RR73)$"}).size (); if (!is_73 and !message.isStandardMessage() and !message.string().contains("<")) { qDebug () << "Not processing message - hiscall:" << hiscall << "hisgrid:" << hisgrid @@ -4577,7 +4589,6 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie || dtext.contains (" " + m_baseCall + "/") || (firstcall == "DE")) { - QStringList w=message.string().mid(22).remove("<").remove(">").split(" ",QString::SkipEmptyParts); QString w2; if(w.size()>=3) w2=w.at(2); QString w34; From f4811845cb131add4780638828432012a9d011d0 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 25 Apr 2020 11:53:20 -0400 Subject: [PATCH 3/6] Add a feature for testing: simulate responses from another station. --- lib/decoder.f90 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/decoder.f90 b/lib/decoder.f90 index e0d4b4682..98b45ef52 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -40,6 +40,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample) character(len=20) :: datetime character(len=12) :: mycall, hiscall character(len=6) :: mygrid, hisgrid + character*60 line data ndec8/0/ save type(counting_jt4_decoder) :: my_jt4 @@ -61,6 +62,19 @@ subroutine multimode_decoder(ss,id2,params,nfsample) my_jt9%decoded = 0 my_ft8%decoded = 0 my_ft4%decoded = 0 + +! For testing only: return Rx messages stored in a file as decodes + inquire(file='rx_messages.txt',exist=ex) + if(ex .and. params%nzhsym.eq.41) then + open(39,file='rx_messages.txt',status='old') + do i=1,9999 + read(39,'(a60)',end=5) line + if(line(1:1).eq.' ' .or. line(1:1).eq.'-') go to 800 + write(*,'(a)') trim(line) + enddo +5 close(39) + go to 800 + endif ncontest=iand(params%nexp_decode,7) single_decode=iand(params%nexp_decode,32).ne.0 @@ -86,7 +100,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample) if(params%nmode.eq.8) then ! We're in FT8 mode - + if(ncontest.eq.6) then ! Fox mode: initialize and open houndcallers.txt inquire(file=trim(temp_dir)//'/houndcallers.txt',exist=ex) From 4379ef9627c768e50d6c68c77ec7fadaa1de3fea Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 25 Apr 2020 12:10:32 -0400 Subject: [PATCH 4/6] Fix a flaw in the new test logic. --- lib/decoder.f90 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 98b45ef52..a5f542e1e 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -65,14 +65,16 @@ subroutine multimode_decoder(ss,id2,params,nfsample) ! For testing only: return Rx messages stored in a file as decodes inquire(file='rx_messages.txt',exist=ex) - if(ex .and. params%nzhsym.eq.41) then - open(39,file='rx_messages.txt',status='old') - do i=1,9999 - read(39,'(a60)',end=5) line - if(line(1:1).eq.' ' .or. line(1:1).eq.'-') go to 800 - write(*,'(a)') trim(line) - enddo -5 close(39) + if(ex) then + if(params%nzhsym.eq.41) then + open(39,file='rx_messages.txt',status='old') + do i=1,9999 + read(39,'(a60)',end=5) line + if(line(1:1).eq.' ' .or. line(1:1).eq.'-') go to 800 + write(*,'(a)') trim(line) + enddo +5 close(39) + endif go to 800 endif From 47a3f9c73601405b98ea758787e763fabfd2779d Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 25 Apr 2020 12:11:20 -0400 Subject: [PATCH 5/6] Don't allow hijacking of EU VHF Contest QSOs. (Why is this change necessary?) --- widgets/mainwindow.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index ca04c4057..afaa6ca49 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -4626,9 +4626,15 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie // ### Should be in RTTY contest mode ??? ### MessageBox::information_message (this, tr ("Should you switch to RTTY contest mode?")); } + + if(SpecOp::EU_VHF==m_config.special_op_id() and message_words.at(1).contains(m_baseCall) and + (!message_words.at(2).contains(qso_partner_base_call)) and (!m_bDoubleClicked)) { +// qDebug() << "aa" << "Ignoring:" << message.string().mid(24); + return; + } + if(message_words.size () > 3 // enough fields for a normal message && (message_words.at(1).contains(m_baseCall) || "DE" == message_words.at(1)) -// && (message_words.at(2).contains(qso_partner_base_call) or bEU_VHF_w2)) { && (message_words.at(2).contains(qso_partner_base_call) or m_bDoubleClicked or bEU_VHF_w2 or (m_QSOProgress==CALLING))) { From f4c0e7803b5f367888b114c44e73d5db544fd01e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 25 Apr 2020 16:28:05 -0400 Subject: [PATCH 6/6] Don't crash after double-click on a EU_VHF message with <...>. --- widgets/mainwindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index afaa6ca49..5ce930f96 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -4520,6 +4520,7 @@ void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifie QStringList w=message.string().mid(22).remove("<").remove(">").split(" ",QString::SkipEmptyParts); int nw=w.size(); if(nw>=4) { + if(message_words.size()<3) return; // Temporary? Correct for the fact that message.deCallAndGrid() does not work for EU VHF contest messages QString t=message_words.at(nw-2); int n=w.at(nw-2).toInt();