Adapt brach to changes proposed by G4WJS

This commit is contained in:
phl0 2020-06-27 00:17:03 +02:00 committed by Bill Somerville
parent 6cbc91b653
commit 2a31d12d39
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
8 changed files with 118 additions and 279 deletions

View File

@ -25,8 +25,9 @@ namespace
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Operator"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "My Call"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "My Grid"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Exchange Sent"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Exchange Rcvd"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Exch Sent"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Exch Rcvd"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Prop"),
QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Comments"),
};
}
@ -212,7 +213,8 @@ void MessageAggregatorMainWindow::log_qso (QString const& /*id*/, QDateTime time
, QString const& tx_power, QString const& comments
, QString const& name, QDateTime time_on, QString const& operator_call
, QString const& my_call, QString const& my_grid
, QString const& exchange_sent, QString const& exchange_rcvd)
, QString const& exchange_sent, QString const& exchange_rcvd
, QString const& prop_mode)
{
QList<QStandardItem *> row;
row << new QStandardItem {time_on.toString ("dd-MMM-yyyy hh:mm:ss")}
@ -230,6 +232,7 @@ void MessageAggregatorMainWindow::log_qso (QString const& /*id*/, QDateTime time
<< new QStandardItem {my_grid}
<< new QStandardItem {exchange_sent}
<< new QStandardItem {exchange_rcvd}
<< new QStandardItem {prop_mode}
<< new QStandardItem {comments};
log_->appendRow (row);
log_table_view_->resizeColumnsToContents ();

View File

@ -33,7 +33,7 @@ public:
, QString const& report_received, QString const& tx_power, QString const& comments
, QString const& name, QDateTime time_on, QString const& operator_call
, QString const& my_call, QString const& my_grid
, QString const& exchange_sent, QString const& exchange_rcvd);
, QString const& exchange_sent, QString const& exchange_rcvd, QString const& prop_mode);
private:
void add_client (QString const& id, QString const& version, QString const& revision);

View File

@ -345,9 +345,10 @@ void MessageServer::impl::parse_message (QHostAddress const& sender, port_type s
QByteArray my_grid;
QByteArray exchange_sent;
QByteArray exchange_rcvd;
QByteArray prop_mode;
in >> time_off >> dx_call >> dx_grid >> dial_frequency >> mode >> report_sent >> report_received
>> tx_power >> comments >> name >> time_on >> operator_call >> my_call >> my_grid
>> exchange_sent >> exchange_rcvd;
>> exchange_sent >> exchange_rcvd >> prop_mode;
if (check_status (in) != Fail)
{
Q_EMIT self_->qso_logged (id, time_off, QString::fromUtf8 (dx_call), QString::fromUtf8 (dx_grid)
@ -356,7 +357,7 @@ void MessageServer::impl::parse_message (QHostAddress const& sender, port_type s
, QString::fromUtf8 (comments), QString::fromUtf8 (name), time_on
, QString::fromUtf8 (operator_call), QString::fromUtf8 (my_call)
, QString::fromUtf8 (my_grid), QString::fromUtf8 (exchange_sent)
, QString::fromUtf8 (exchange_rcvd));
, QString::fromUtf8 (exchange_rcvd), QString::fromUtf8 (prop_mode));
}
}
break;

View File

@ -106,7 +106,7 @@ public:
, QString const& report_received, QString const& tx_power, QString const& comments
, QString const& name, QDateTime time_on, QString const& operator_call
, QString const& my_call, QString const& my_grid
, QString const& exchange_sent, QString const& exchange_rcvd);
, QString const& exchange_sent, QString const& exchange_rcvd, QString const& prop_mode);
Q_SIGNAL void decodes_cleared (QString const& id);
Q_SIGNAL void logged_ADIF (QString const& id, QByteArray const& ADIF);

View File

@ -102,7 +102,7 @@ public:
, QString const& report_received, QString const& tx_power
, QString const& comments, QString const& name, QDateTime time_on
, QString const& operator_call, QString const& my_call, QString const& my_grid
, QString const& exchange_sent, QString const& exchange_rcvd)
, QString const& exchange_sent, QString const& exchange_rcvd, QString const& prop_mode)
{
if (client_id == id_)
{
@ -111,12 +111,13 @@ public:
<< "rpt_rcvd:" << report_received << "Tx_pwr:" << tx_power << "comments:" << comments
<< "name:" << name << "operator_call:" << operator_call << "my_call:" << my_call
<< "my_grid:" << my_grid << "exchange_sent:" << exchange_sent
<< "exchange_rcvd:" << exchange_rcvd;
<< "exchange_rcvd:" << exchange_rcvd << "prop_mode:" << prop_mode;
std::cout << QByteArray {80, '-'}.data () << '\n';
std::cout << tr ("%1: Logged %2 grid: %3 power: %4 sent: %5 recd: %6 freq: %7 time_off: %8 op: %9 my_call: %10 my_grid: %11")
std::cout << tr ("%1: Logged %2 grid: %3 power: %4 sent: %5 recd: %6 freq: %7 time_off: %8 op: %9 my_call: %10 my_grid: %11 exchange_sent: %12 exchange_rcvd: %13 comments: %14 prop_mode: %15")
.arg (id_).arg (dx_call).arg (dx_grid).arg (tx_power).arg (report_sent).arg (report_received)
.arg (dial_frequency).arg (time_off.toString("yyyy-MM-dd hh:mm:ss.z")).arg (operator_call)
.arg (my_call).arg (my_grid).toStdString ()
.arg (my_call).arg (my_grid).arg (exchange_sent).arg (exchange_rcvd)
.arg (comments).arg (prop_mode).toStdString ()
<< std::endl;
}
}

View File

@ -15,6 +15,37 @@
#include "ui_logqso.h"
#include "moc_logqso.cpp"
namespace
{
struct PropMode
{
char const * id_;
char const * name_;
};
constexpr PropMode prop_modes[] =
{
{"", ""}
, {"AS", QT_TRANSLATE_NOOP ("LogQSO", "Aircraft scatter")}
, {"AUE", QT_TRANSLATE_NOOP ("LogQSO", "Aurora-E")}
, {"AUR", QT_TRANSLATE_NOOP ("LogQSO", "Aurora")}
, {"BS", QT_TRANSLATE_NOOP ("LogQSO", "Back scatter")}
, {"ECH", QT_TRANSLATE_NOOP ("LogQSO", "Echolink")}
, {"EME", QT_TRANSLATE_NOOP ("LogQSO", "Earth-moon-earth")}
, {"ES", QT_TRANSLATE_NOOP ("LogQSO", "Sporadic E")}
, {"F2", QT_TRANSLATE_NOOP ("LogQSO", "F2 Reflection")}
, {"FAI", QT_TRANSLATE_NOOP ("LogQSO", "Field aligned irregularities")}
, {"INTERNET", QT_TRANSLATE_NOOP ("LogQSO", "Internet-assisted")}
, {"ION", QT_TRANSLATE_NOOP ("LogQSO", "Ionoscatter")}
, {"IRL", QT_TRANSLATE_NOOP ("LogQSO", "IRLP")}
, {"MS", QT_TRANSLATE_NOOP ("LogQSO", "Meteor scatter")}
, {"RPT", QT_TRANSLATE_NOOP ("LogQSO", "Non-satellite repeater or transponder")}
, {"RS", QT_TRANSLATE_NOOP ("LogQSO", "Rain scatter")}
, {"SAT", QT_TRANSLATE_NOOP ("LogQSO", "Satellite")}
, {"TEP", QT_TRANSLATE_NOOP ("LogQSO", "Trans-equatorial")}
, {"TR", QT_TRANSLATE_NOOP ("LogQSO", "Troposheric ducting")}
};
}
LogQSO::LogQSO(QString const& programTitle, QSettings * settings
, Configuration const * config, LogBook * log, QWidget *parent)
: QDialog {parent, Qt::WindowStaysOnTopHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint}
@ -25,6 +56,10 @@ LogQSO::LogQSO(QString const& programTitle, QSettings * settings
{
ui->setupUi(this);
setWindowTitle(programTitle + " - Log QSO");
for (auto const& prop_mode : prop_modes)
{
ui->comboBoxPropMode->addItem (prop_mode.name_, prop_mode.id_);
}
loadSettings ();
ui->grid->setValidator (new MaidenheadLocatorValidator {this});
}
@ -42,7 +77,12 @@ void LogQSO::loadSettings ()
ui->cbPropMode->setChecked (m_settings->value ("SavePropMode", false).toBool ());
m_txPower = m_settings->value ("TxPower", "").toString ();
m_comments = m_settings->value ("LogComments", "").toString();
m_propmode = m_settings->value ("PropMode", "").toString();
int prop_index {0};
if (ui->cbPropMode->isChecked ())
{
prop_index = ui->comboBoxPropMode->findData (m_settings->value ("PropMode", "").toString());
}
ui->comboBoxPropMode->setCurrentIndex (prop_index);
m_settings->endGroup ();
}
@ -55,65 +95,7 @@ void LogQSO::storeSettings () const
m_settings->setValue ("SavePropMode", ui->cbPropMode->isChecked ());
m_settings->setValue ("TxPower", m_txPower);
m_settings->setValue ("LogComments", m_comments);
switch (ui->comboBoxPropMode->currentIndex()) {
case 0:
m_settings->setValue ("PropMode", "");
break;
case 1:
m_settings->setValue ("PropMode", "AS");
break;
case 2:
m_settings->setValue ("PropMode", "AUE");
break;
case 3:
m_settings->setValue ("PropMode", "AUR");
break;
case 4:
m_settings->setValue ("PropMode", "BS");
break;
case 5:
m_settings->setValue ("PropMode", "ECH");
break;
case 6:
m_settings->setValue ("PropMode", "EME");
break;
case 7:
m_settings->setValue ("PropMode", "ES");
break;
case 8:
m_settings->setValue ("PropMode", "F2");
break;
case 9:
m_settings->setValue ("PropMode", "FAI");
break;
case 10:
m_settings->setValue ("PropMode", "INTERNET");
break;
case 11:
m_settings->setValue ("PropMode", "ION");
break;
case 12:
m_settings->setValue ("PropMode", "IRL");
break;
case 13:
m_settings->setValue ("PropMode", "MS");
break;
case 14:
m_settings->setValue ("PropMode", "RPT");
break;
case 15:
m_settings->setValue ("PropMode", "RS");
break;
case 16:
m_settings->setValue ("PropMode", "SAT");
break;
case 17:
m_settings->setValue ("PropMode", "TEP");
break;
case 18:
m_settings->setValue ("PropMode", "TR");
break;
}
m_settings->setValue ("PropMode", ui->comboBoxPropMode->currentData ());
m_settings->endGroup ();
}
@ -142,51 +124,6 @@ void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString
{
ui->comments->clear ();
}
if (ui->cbPropMode->isChecked ())
{
if (m_propmode == "")
ui->comboBoxPropMode->setCurrentIndex(0);
if (m_propmode == "AS")
ui->comboBoxPropMode->setCurrentIndex(1);
if (m_propmode == "AUE")
ui->comboBoxPropMode->setCurrentIndex(2);
if (m_propmode == "AUR")
ui->comboBoxPropMode->setCurrentIndex(3);
if (m_propmode == "BS")
ui->comboBoxPropMode->setCurrentIndex(4);
if (m_propmode == "ECH")
ui->comboBoxPropMode->setCurrentIndex(5);
if (m_propmode == "EME")
ui->comboBoxPropMode->setCurrentIndex(6);
if (m_propmode == "ES")
ui->comboBoxPropMode->setCurrentIndex(7);
if (m_propmode == "F2")
ui->comboBoxPropMode->setCurrentIndex(8);
if (m_propmode == "FAI")
ui->comboBoxPropMode->setCurrentIndex(9);
if (m_propmode == "INTERNET")
ui->comboBoxPropMode->setCurrentIndex(10);
if (m_propmode == "ION")
ui->comboBoxPropMode->setCurrentIndex(11);
if (m_propmode == "IRL")
ui->comboBoxPropMode->setCurrentIndex(12);
if (m_propmode == "MS")
ui->comboBoxPropMode->setCurrentIndex(13);
if (m_propmode == "RPT")
ui->comboBoxPropMode->setCurrentIndex(14);
if (m_propmode == "RS")
ui->comboBoxPropMode->setCurrentIndex(15);
if (m_propmode == "SAT")
ui->comboBoxPropMode->setCurrentIndex(16);
if (m_propmode == "TEP")
ui->comboBoxPropMode->setCurrentIndex(17);
if (m_propmode == "TR")
ui->comboBoxPropMode->setCurrentIndex(18);
}
else
{
ui->comboBoxPropMode->setCurrentIndex(0);
}
if (m_config->report_in_comments()) {
auto t=mode;
if(rptSent!="") t+=" Sent: " + rptSent;
@ -207,6 +144,10 @@ void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString
ui->loggedOperator->setText(m_config->opCall());
ui->exchSent->setText (xSent);
ui->exchRcvd->setText (xRcvd);
if (!ui->cbPropMode->isChecked ())
{
ui->comboBoxPropMode->setCurrentIndex (-1);
}
using SpOp = Configuration::SpecialOperatingActivity;
auto special_op = m_config->special_op_id ();
@ -240,65 +181,6 @@ void LogQSO::accept()
auto operator_call = ui->loggedOperator->text ();
auto xsent = ui->exchSent->text ();
auto xrcvd = ui->exchRcvd->text ();
switch (ui->comboBoxPropMode->currentIndex()) {
case 0:
m_propmode = "";
break;
case 1:
m_propmode = "AS";
break;
case 2:
m_propmode = "AUE";
break;
case 3:
m_propmode = "AUR";
break;
case 4:
m_propmode = "BS";
break;
case 5:
m_propmode = "ECH";
break;
case 6:
m_propmode = "EME";
break;
case 7:
m_propmode = "ES";
break;
case 8:
m_propmode = "F2";
break;
case 9:
m_propmode = "FAI";
break;
case 10:
m_propmode = "INTERNET";
break;
case 11:
m_propmode = "ION";
break;
case 12:
m_propmode = "IRL";
break;
case 13:
m_propmode = "MS";
break;
case 14:
m_propmode = "RPT";
break;
case 15:
m_propmode = "RS";
break;
case 16:
m_propmode = "SAT";
break;
case 17:
m_propmode = "TEP";
break;
case 18:
m_propmode = "TR";
break;
}
using SpOp = Configuration::SpecialOperatingActivity;
auto special_op = m_config->special_op_id ();
@ -344,6 +226,7 @@ void LogQSO::accept()
}
}
auto const& prop_mode = ui->comboBoxPropMode->currentData ().toString ();
//Log this QSO to file "wsjtx.log"
static QFile f {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("wsjtx.log")};
if(!f.open(QIODevice::Text | QIODevice::Append)) {
@ -357,7 +240,7 @@ void LogQSO::accept()
dateTimeOff.time().toString("hh:mm:ss,") + hisCall + "," +
hisGrid + "," + strDialFreq + "," + mode +
"," + rptSent + "," + rptRcvd + "," + m_txPower +
"," + m_comments + "," + name + "," + m_propmode;
"," + m_comments + "," + name + "," + prop_mode;
QTextStream out(&f);
out << logEntry <<
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
@ -386,7 +269,7 @@ void LogQSO::accept()
, m_myGrid
, xsent
, xrcvd
, m_propmode
, prop_mode
, m_log->QSOToADIF (hisCall
, hisGrid
, mode
@ -404,7 +287,7 @@ void LogQSO::accept()
, operator_call
, xsent
, xrcvd
, m_propmode));
, prop_mode));
QDialog::accept();
}

View File

@ -57,7 +57,6 @@ private:
LogBook * m_log;
QString m_txPower;
QString m_comments;
QString m_propmode;
Radio::Frequency m_dialFreq;
QString m_myCall;
QString m_myGrid;

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>437</width>
<height>351</height>
<width>440</width>
<height>322</height>
</rect>
</property>
<property name="sizePolicy">
@ -46,6 +46,9 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="buddy">
<cstring>call</cstring>
</property>
</widget>
</item>
<item>
@ -68,6 +71,9 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="buddy">
<cstring>start_date_time</cstring>
</property>
</widget>
</item>
<item>
@ -103,6 +109,9 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="buddy">
<cstring>end_date_time</cstring>
</property>
</widget>
</item>
<item>
@ -142,6 +151,9 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="buddy">
<cstring>mode</cstring>
</property>
</widget>
</item>
<item>
@ -171,6 +183,9 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="buddy">
<cstring>band</cstring>
</property>
</widget>
</item>
<item>
@ -200,6 +215,9 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="buddy">
<cstring>sent</cstring>
</property>
</widget>
</item>
<item>
@ -229,6 +247,9 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="buddy">
<cstring>rcvd</cstring>
</property>
</widget>
</item>
<item>
@ -258,6 +279,9 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="buddy">
<cstring>grid</cstring>
</property>
</widget>
</item>
<item>
@ -290,6 +314,9 @@
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="buddy">
<cstring>name</cstring>
</property>
</widget>
</item>
<item>
@ -310,6 +337,9 @@
<property name="text">
<string>Tx power</string>
</property>
<property name="buddy">
<cstring>txPower</cstring>
</property>
</widget>
</item>
<item>
@ -339,6 +369,9 @@
<property name="text">
<string>Comments</string>
</property>
<property name="buddy">
<cstring>comments</cstring>
</property>
</widget>
</item>
<item>
@ -369,6 +402,9 @@
<property name="text">
<string>Operator</string>
</property>
<property name="buddy">
<cstring>loggedOperator</cstring>
</property>
</widget>
</item>
<item>
@ -403,6 +439,9 @@
<property name="text">
<string>Exch sent</string>
</property>
<property name="buddy">
<cstring>exchSent</cstring>
</property>
</widget>
</item>
<item>
@ -433,6 +472,9 @@
<property name="text">
<string>Rcvd</string>
</property>
<property name="buddy">
<cstring>exchRcvd</cstring>
</property>
</widget>
</item>
<item>
@ -454,106 +496,13 @@
<property name="text">
<string>Prop Mode</string>
</property>
<property name="buddy">
<cstring>comboBoxPropMode</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBoxPropMode">
<item>
<property name="text">
<string/>
</property>
</item>
<item>
<property name="text">
<string>AS | Aircraft scatter</string>
</property>
</item>
<item>
<property name="text">
<string>AUE | Aurora-E</string>
</property>
</item>
<item>
<property name="text">
<string>AUR | Aurora</string>
</property>
</item>
<item>
<property name="text">
<string>BS | Back scatter</string>
</property>
</item>
<item>
<property name="text">
<string>ECH | Echolink</string>
</property>
</item>
<item>
<property name="text">
<string>EME | Earth-moon-earth</string>
</property>
</item>
<item>
<property name="text">
<string>ES | Sporadic E</string>
</property>
</item>
<item>
<property name="text">
<string>F2 | F2 Reflection</string>
</property>
</item>
<item>
<property name="text">
<string>FAI | Field aligned irregularities</string>
</property>
</item>
<item>
<property name="text">
<string>INTERNET | Internet-assisted</string>
</property>
</item>
<item>
<property name="text">
<string>ION | Ionoscatter</string>
</property>
</item>
<item>
<property name="text">
<string>IRL | IRLP</string>
</property>
</item>
<item>
<property name="text">
<string>MS | Meteor scatter</string>
</property>
</item>
<item>
<property name="text">
<string>RPT | Terrestrial or atmospheric repeater or transponder</string>
</property>
</item>
<item>
<property name="text">
<string>RS | Rain scatter</string>
</property>
</item>
<item>
<property name="text">
<string>SAT | Satellite</string>
</property>
</item>
<item>
<property name="text">
<string>TEP | Trans-equatorial</string>
</property>
</item>
<item>
<property name="text">
<string>TR | Troposheric ducting</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="comboBoxPropMode"/>
</item>
<item>
<widget class="QCheckBox" name="cbPropMode">
@ -603,8 +552,11 @@
<tabstop>cbTxPower</tabstop>
<tabstop>comments</tabstop>
<tabstop>cbComments</tabstop>
<tabstop>cbPropMode</tabstop>
<tabstop>loggedOperator</tabstop>
<tabstop>exchSent</tabstop>
<tabstop>exchRcvd</tabstop>
<tabstop>comboBoxPropMode</tabstop>
<tabstop>cbPropMode</tabstop>
</tabstops>
<resources/>
<connections>