Restore functionality of sending .WAV playback decodes to UDP

Extended  the Decode  and WSPRDecode  UDP messages  with an  "off air"
boolean  field indicating  the  decode  was derived  from  a .WAV  fle
playback rather than an on air reception.

Extended reference applications to use  the new off air decode message
field.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8092 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville
2017-09-16 22:20:59 +00:00
parent bca21c0560
commit 78c257b4f0
15 changed files with 107 additions and 64 deletions
+17 -6
View File
@@ -18,6 +18,7 @@ namespace
QT_TRANSLATE_NOOP ("DecodesModel", "Md"),
QT_TRANSLATE_NOOP ("DecodesModel", "Message"),
QT_TRANSLATE_NOOP ("DecodesModel", "Confidence"),
QT_TRANSLATE_NOOP ("DecodesModel", "Live"),
};
QString confidence_string (bool low_confidence)
@@ -25,11 +26,16 @@ namespace
return low_confidence ? QT_TRANSLATE_NOOP ("DecodesModel", "low") : QT_TRANSLATE_NOOP ("DecodesModel", "high");
}
QString live_string (bool off_air)
{
return off_air ? QT_TRANSLATE_NOOP ("DecodesModel", "no") : QT_TRANSLATE_NOOP ("DecodesModel", "yes");
}
QFont text_font {"Courier", 10};
QList<QStandardItem *> make_row (QString const& client_id, QTime time, qint32 snr, float delta_time
, quint32 delta_frequency, QString const& mode, QString const& message
, bool low_confidence, bool is_fast)
, bool low_confidence, bool off_air, bool is_fast)
{
auto time_item = new QStandardItem {time.toString (is_fast || "~" == mode ? "hh:mm:ss" : "hh:mm")};
time_item->setData (time);
@@ -53,8 +59,11 @@ namespace
auto confidence = new QStandardItem {confidence_string (low_confidence)};
confidence->setTextAlignment (Qt::AlignHCenter);
auto live = new QStandardItem {live_string (off_air)};
live->setTextAlignment (Qt::AlignHCenter);
QList<QStandardItem *> row {
new QStandardItem {client_id}, time_item, snr_item, dt, df, md, new QStandardItem {message}, confidence};
new QStandardItem {client_id}, time_item, snr_item, dt, df, md, new QStandardItem {message}, confidence, live};
Q_FOREACH (auto& item, row)
{
item->setEditable (false);
@@ -77,7 +86,7 @@ DecodesModel::DecodesModel (QObject * parent)
void DecodesModel::add_decode (bool is_new, QString const& client_id, QTime time, qint32 snr, float delta_time
, quint32 delta_frequency, QString const& mode, QString const& message
, bool low_confidence, bool is_fast)
, bool low_confidence, bool off_air, bool is_fast)
{
if (!is_new)
{
@@ -93,7 +102,8 @@ void DecodesModel::add_decode (bool is_new, QString const& client_id, QTime time
&& item (row, 4)->data ().toUInt () == delta_frequency
&& data (index (row, 5)).toString () == mode
&& data (index (row, 6)).toString () == message
&& data (index (row, 7)).toString () == confidence_string (low_confidence))
&& data (index (row, 7)).toString () == confidence_string (low_confidence)
&& data (index (row, 8)).toString () == live_string (off_air))
{
return;
}
@@ -106,12 +116,13 @@ void DecodesModel::add_decode (bool is_new, QString const& client_id, QTime time
if (target_row >= 0)
{
insertRow (target_row + 1, make_row (client_id, time, snr, delta_time, delta_frequency, mode
, message, low_confidence, is_fast));
, message, low_confidence, off_air, is_fast));
return;
}
}
appendRow (make_row (client_id, time, snr, delta_time, delta_frequency, mode, message, low_confidence, is_fast));
appendRow (make_row (client_id, time, snr, delta_time, delta_frequency, mode, message, low_confidence
, off_air, is_fast));
}
void DecodesModel::clear_decodes (QString const& client_id)