From c74ed5135bc2477cd310101b0104cb182db34fe4 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Sat, 14 Jul 2018 17:09:06 -0400 Subject: [PATCH] Parse callsigns from standard messages --- mainwindow.cpp | 53 ++++++++++++++++++++------------------------------ 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 4a32b21..ad8cd19 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -3198,48 +3198,37 @@ void MainWindow::readFromStdout() //readFromStdout // DE KN4CRD // KN4CRD - bool shouldParseCallsigns = false; + bool shouldParseCallsigns = true; if(shouldParseCallsigns){ QStringList callsigns = Varicode::parseCallsigns(decodedtext.message()); if(!callsigns.isEmpty()){ - // one callsign - // de [from] - // cq [from] + // one callsign + // de [from] + // cq [from] - // two callsigns - // [from]: [to] ... - // [to] [from] [grid|signal] + // two callsigns + // [from]: [to] ... + // [to] [from] [grid|signal] - QStringList grids = Varicode::parseGrids(decodedtext.message()); + QStringList grids = Varicode::parseGrids(decodedtext.message()); - // one callsigns are handled above... so we only need to handle two callsigns if it's a standard message - if(decodedtext.isStandardMessage()){ - if(callsigns.length() == 2){ - auto de_callsign = callsigns.last(); + // one callsigns are handled above... so we only need to handle two callsigns if it's a standard message + if(decodedtext.isStandardMessage()){ + if(callsigns.length() == 2){ + auto de_callsign = callsigns.last(); - // TODO: jsherer - put this in a function to record a callsign... - CallDetail d; - d.call = de_callsign; - d.grid = !grids.empty() ? grids.first() : ""; - d.snr = decodedtext.snr(); - d.freq = decodedtext.frequencyOffset(); - d.utcTimestamp = QDateTime::currentDateTimeUtc(); - m_callActivity[de_callsign] = d; - - /* - //auto to_callsign = callsigns.first(); - CallDetail d2; - d2.call = to_callsign; - d2.grid = ""; - d2.snr = -100; - d2.freq = decodedtext.frequencyOffset(); - d2.utcTimestamp = QDateTime::currentDateTimeUtc(); - m_callActivity[to_callsign] = d2; - */ + // TODO: jsherer - put this in a function to record a callsign... + CallDetail d; + d.call = de_callsign; + d.grid = !grids.empty() ? grids.first() : ""; + d.snr = decodedtext.snr(); + d.freq = decodedtext.frequencyOffset(); + d.utcTimestamp = QDateTime::currentDateTimeUtc(); + m_callActivity[de_callsign] = d; + } } } } - } // TOD0: jsherer - parse for commands? // KN4CRD K1JT ?