From 1fb8eaf13b06e6cb23bc81853fd8e9ce657aa8bc Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Mon, 12 Nov 2018 16:59:02 +0000 Subject: [PATCH] Send STX ADIF field when sending contest serial numbers This assumes that the last sent exchange field is a serial number if there is more than one word in the exchange sent and the last word is a positive non-zero number. --- logbook/logbook.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/logbook/logbook.cpp b/logbook/logbook.cpp index cf4e594f1..f7dfc83b3 100644 --- a/logbook/logbook.cpp +++ b/logbook/logbook.cpp @@ -77,7 +77,22 @@ QByteArray LogBook::QSOToADIF (QString const& hisCall, QString const& hisGrid, Q if(comments!="") t += " " + comments; if(name!="") t += " " + name; if(operator_call!="") t+=" " + operator_call; - if(xRcvd!="") { + if (xSent.size ()) + { + auto words = xSent.split (' ', QString::SkipEmptyParts); + if (words.size () > 1) + { + bool ok; + auto sn = words.back ().toUInt (&ok); + if (ok && sn) + { + // assume last word is a serial if there are at least + // two words and if it is positive numeric + t += " ' + words.back (); + } + } + } + if (xRcvd.size ()) { QString t1=""; if(xRcvd.split(" ").size()==2) t1=xRcvd.split(" ").at(1); if(t1.toInt()>0) {