Parse callsigns from standard messages
This commit is contained in:
parent
b08ecd21e6
commit
c74ed5135b
@ -3198,48 +3198,37 @@ void MainWindow::readFromStdout() //readFromStdout
|
|||||||
// DE KN4CRD
|
// DE KN4CRD
|
||||||
// KN4CRD
|
// KN4CRD
|
||||||
|
|
||||||
bool shouldParseCallsigns = false;
|
bool shouldParseCallsigns = true;
|
||||||
if(shouldParseCallsigns){
|
if(shouldParseCallsigns){
|
||||||
QStringList callsigns = Varicode::parseCallsigns(decodedtext.message());
|
QStringList callsigns = Varicode::parseCallsigns(decodedtext.message());
|
||||||
if(!callsigns.isEmpty()){
|
if(!callsigns.isEmpty()){
|
||||||
// one callsign
|
// one callsign
|
||||||
// de [from]
|
// de [from]
|
||||||
// cq [from]
|
// cq [from]
|
||||||
|
|
||||||
// two callsigns
|
// two callsigns
|
||||||
// [from]: [to] ...
|
// [from]: [to] ...
|
||||||
// [to] [from] [grid|signal]
|
// [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
|
// one callsigns are handled above... so we only need to handle two callsigns if it's a standard message
|
||||||
if(decodedtext.isStandardMessage()){
|
if(decodedtext.isStandardMessage()){
|
||||||
if(callsigns.length() == 2){
|
if(callsigns.length() == 2){
|
||||||
auto de_callsign = callsigns.last();
|
auto de_callsign = callsigns.last();
|
||||||
|
|
||||||
// TODO: jsherer - put this in a function to record a callsign...
|
// TODO: jsherer - put this in a function to record a callsign...
|
||||||
CallDetail d;
|
CallDetail d;
|
||||||
d.call = de_callsign;
|
d.call = de_callsign;
|
||||||
d.grid = !grids.empty() ? grids.first() : "";
|
d.grid = !grids.empty() ? grids.first() : "";
|
||||||
d.snr = decodedtext.snr();
|
d.snr = decodedtext.snr();
|
||||||
d.freq = decodedtext.frequencyOffset();
|
d.freq = decodedtext.frequencyOffset();
|
||||||
d.utcTimestamp = QDateTime::currentDateTimeUtc();
|
d.utcTimestamp = QDateTime::currentDateTimeUtc();
|
||||||
m_callActivity[de_callsign] = d;
|
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;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// TOD0: jsherer - parse for commands?
|
// TOD0: jsherer - parse for commands?
|
||||||
// KN4CRD K1JT ?
|
// KN4CRD K1JT ?
|
||||||
|
Loading…
Reference in New Issue
Block a user