From 640ce756c0c456c11fd07467988821055748783c Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Wed, 1 Apr 2020 20:42:29 -0400 Subject: [PATCH] Added ability to spot ssids with compound callsigns ala, KN4CRD/7 --- APRSISClient.cpp | 5 +---- mainwindow.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/APRSISClient.cpp b/APRSISClient.cpp index 4934e2e..a22d827 100644 --- a/APRSISClient.cpp +++ b/APRSISClient.cpp @@ -190,14 +190,11 @@ QString APRSISClient::stripSSID(QString call){ QString APRSISClient::replaceCallsignSuffixWithSSID(QString call, QString base){ if(call != base){ - QRegularExpression re("[/](?(P|\\d+))"); + QRegularExpression re("[/](?(\\d+))"); auto matcher = re.globalMatch(call); if(matcher.hasNext()){ auto match = matcher.next(); auto ssid = match.captured("ssid"); - if(ssid == "P"){ - ssid = "16"; - } call = base + "-" + ssid; } else { call = base; diff --git a/mainwindow.cpp b/mainwindow.cpp index 2a638e1..be00918 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -5254,8 +5254,9 @@ void MainWindow::spotAprsCmd(CommandDetail cmd){ qDebug() << "APRSISClient Enqueueing Third Party Text" << cmd.from << cmd.text; - auto by_call = Radio::base_callsign(m_config.my_callsign()); - auto from_call = Radio::base_callsign(cmd.from); + auto callsign = cmd.from; + auto by_call = APRSISClient::replaceCallsignSuffixWithSSID(m_config.my_callsign(), Radio::base_callsign(m_config.my_callsign())); + auto from_call = APRSISClient::replaceCallsignSuffixWithSSID(callsign, Radio::base_callsign(callsign)); // we use a queued signal here so we can process these spots in a network thread // to prevent blocking the gui/decoder while waiting on TCP @@ -5274,8 +5275,8 @@ void MainWindow::spotAprsGrid(int offset, int snr, QString callsign, QString gri comment = QString("%1 %2").arg(callsign).arg(comment); } - auto by_call = Radio::base_callsign(m_config.my_callsign()); - auto from_call = Radio::base_callsign(callsign); + auto by_call = APRSISClient::replaceCallsignSuffixWithSSID(m_config.my_callsign(), Radio::base_callsign(m_config.my_callsign())); + auto from_call = APRSISClient::replaceCallsignSuffixWithSSID(callsign, Radio::base_callsign(callsign)); // we use a queued signal here so we can process these spots in a network thread // to prevent blocking the gui/decoder while waiting on TCP