mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-21 11:31:51 -05:00
Add option to include or exclude WAE extra entities in DXCC entity lookups
Also refactored object relationships as a start to implementing contest multiplier highlighting.
This commit is contained in:
parent
a54140582a
commit
381faca99a
@ -564,6 +564,7 @@ private:
|
||||
DecodeHighlightingModel decode_highlighing_model_;
|
||||
DecodeHighlightingModel next_decode_highlighing_model_;
|
||||
bool highlight_by_mode_;
|
||||
bool include_WAE_entities_;
|
||||
int LotW_days_since_upload_;
|
||||
|
||||
TransceiverFactory::ParameterPack rig_params_;
|
||||
@ -745,6 +746,7 @@ bool Configuration::pwrBandTuneMemory () const {return m_->pwrBandTuneMemory_;}
|
||||
LotWUsers const& Configuration::lotw_users () const {return m_->lotw_users_;}
|
||||
DecodeHighlightingModel const& Configuration::decode_highlighting () const {return m_->decode_highlighing_model_;}
|
||||
bool Configuration::highlight_by_mode () const {return m_->highlight_by_mode_;}
|
||||
bool Configuration::include_WAE_entities () const {return m_->include_WAE_entities_;}
|
||||
|
||||
void Configuration::set_calibration (CalibrationParams params)
|
||||
{
|
||||
@ -950,6 +952,7 @@ Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network
|
||||
, station_insert_action_ {tr ("&Insert ..."), nullptr}
|
||||
, station_dialog_ {new StationDialog {&next_stations_, &bands_, this}}
|
||||
, highlight_by_mode_ {false}
|
||||
, include_WAE_entities_ {false}
|
||||
, LotW_days_since_upload_ {0}
|
||||
, last_port_type_ {TransceiverFactory::Capabilities::none}
|
||||
, rig_is_dummy_ {false}
|
||||
@ -1319,6 +1322,7 @@ void Configuration::impl::initialize_models ()
|
||||
|
||||
next_decode_highlighing_model_.items (decode_highlighing_model_.items ());
|
||||
ui_->highlight_by_mode_check_box->setChecked (highlight_by_mode_);
|
||||
ui_->include_WAE_check_box->setChecked (include_WAE_entities_);
|
||||
ui_->LotW_days_since_upload_spin_box->setValue (LotW_days_since_upload_);
|
||||
|
||||
set_rig_invariants ();
|
||||
@ -1467,6 +1471,7 @@ void Configuration::impl::read_settings ()
|
||||
if (!highlight_items.size ()) highlight_items = DecodeHighlightingModel::default_items ();
|
||||
decode_highlighing_model_.items (highlight_items);
|
||||
highlight_by_mode_ = settings_->value("HighlightByMode", false).toBool ();
|
||||
include_WAE_entities_ = settings_->value("IncludeWAEEntities", false).toBool ();
|
||||
LotW_days_since_upload_ = settings_->value ("LotWDaysSinceLastUpload", 365).toInt ();
|
||||
lotw_users_.set_age_constraint (LotW_days_since_upload_);
|
||||
|
||||
@ -1579,7 +1584,7 @@ void Configuration::impl::write_settings ()
|
||||
settings_->setValue ("FrequenciesForRegionModes", QVariant::fromValue (frequencies_.frequency_list ()));
|
||||
settings_->setValue ("stations", QVariant::fromValue (stations_.station_list ()));
|
||||
settings_->setValue ("DecodeHighlighting", QVariant::fromValue (decode_highlighing_model_.items ()));
|
||||
settings_->setValue ("HighlightByMode", highlight_by_mode_);
|
||||
settings_->setValue ("IncludeWAEEntities", include_WAE_entities_);
|
||||
settings_->setValue ("LotWDaysSinceLastUpload", LotW_days_since_upload_);
|
||||
settings_->setValue ("toRTTY", log_as_RTTY_);
|
||||
settings_->setValue ("dBtoComments", report_in_comments_);
|
||||
@ -2116,6 +2121,7 @@ void Configuration::impl::accept ()
|
||||
Q_EMIT self_->decode_highlighting_changed (decode_highlighing_model_);
|
||||
}
|
||||
highlight_by_mode_ = ui_->highlight_by_mode_check_box->isChecked ();
|
||||
include_WAE_entities_ = ui_->include_WAE_check_box->isChecked ();
|
||||
LotW_days_since_upload_ = ui_->LotW_days_since_upload_spin_box->value ();
|
||||
lotw_users_.set_age_constraint (LotW_days_since_upload_);
|
||||
|
||||
|
@ -177,6 +177,7 @@ public:
|
||||
LotWUsers const& lotw_users () const;
|
||||
DecodeHighlightingModel const& decode_highlighting () const;
|
||||
bool highlight_by_mode () const;
|
||||
bool include_WAE_entities () const;
|
||||
|
||||
enum class SpecialOperatingActivity {NONE, NA_VHF, EU_VHF, FIELD_DAY, RTTY, FOX, HOUND};
|
||||
SpecialOperatingActivity special_op_id () const;
|
||||
|
@ -2294,6 +2294,23 @@ Right click for insert and delete options.</string>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_20">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="include_WAE_check_box"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="includeExtraWAEEntitiesLabel">
|
||||
<property name="text">
|
||||
<string>Include extra WAE entities</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>include_WAE_check_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -2306,35 +2323,6 @@ Right click for insert and delete options.</string>
|
||||
<string>Logbook of the World User Validation</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_18">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Age of last upload less than:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>LotW_days_since_upload_spin_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="LotW_days_since_upload_spin_box">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html></string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> days</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>9999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>365</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
@ -2369,6 +2357,35 @@ Right click for insert and delete options.</string>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>Age of last upload less than:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>LotW_days_since_upload_spin_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="LotW_days_since_upload_spin_box">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html></string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> days</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>9999</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>365</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -3085,13 +3102,13 @@ Right click for insert and delete options.</string>
|
||||
</connection>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="split_mode_button_group"/>
|
||||
<buttongroup name="special_op_activity_button_group"/>
|
||||
<buttongroup name="CAT_data_bits_button_group"/>
|
||||
<buttongroup name="CAT_handshake_button_group"/>
|
||||
<buttongroup name="TX_audio_source_button_group"/>
|
||||
<buttongroup name="split_mode_button_group"/>
|
||||
<buttongroup name="TX_mode_button_group"/>
|
||||
<buttongroup name="PTT_method_button_group"/>
|
||||
<buttongroup name="special_op_activity_button_group"/>
|
||||
<buttongroup name="CAT_stop_bits_button_group"/>
|
||||
<buttongroup name="CAT_handshake_button_group"/>
|
||||
<buttongroup name="TX_audio_source_button_group"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <QTextStream>
|
||||
#include <QDebug>
|
||||
#include <QDebugStateSaver>
|
||||
#include "Configuration.hpp"
|
||||
#include "Radio.hpp"
|
||||
#include "pimpl_impl.hpp"
|
||||
|
||||
@ -155,14 +156,16 @@ typedef multi_index_container<
|
||||
class AD1CCty::impl final
|
||||
{
|
||||
public:
|
||||
explicit impl ()
|
||||
using entity_by_id = entities_type::index<id>::type;
|
||||
|
||||
explicit impl (Configuration const * configuration)
|
||||
: configuration_ {configuration}
|
||||
{
|
||||
}
|
||||
|
||||
Record fixup (QString call, prefix const& p) const
|
||||
entity_by_id::iterator lookup_entity (QString call, prefix const& p) const
|
||||
{
|
||||
call = call.toUpper ();
|
||||
using entity_by_id = entities_type::index<id>::type;
|
||||
entity_by_id::iterator e; // iterator into entity set
|
||||
|
||||
//
|
||||
@ -171,23 +174,26 @@ public:
|
||||
if (call.startsWith ("KG4") && call.size () != 5 && call.size () != 3)
|
||||
{
|
||||
// KG4 2x1 and 2x3 calls that map to Gitmo are mainland US not Gitmo
|
||||
e = entities_.project<id> (entities_.get<primary_prefix> ().find ("K"));
|
||||
return entities_.project<id> (entities_.get<primary_prefix> ().find ("K"));
|
||||
}
|
||||
else
|
||||
{
|
||||
e = entities_.get<id> ().find (p.entity_id_);
|
||||
return entities_.get<id> ().find (p.entity_id_);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Record fixup (prefix const& p, entity const& e) const
|
||||
{
|
||||
Record result;
|
||||
result.continent = e->continent_;
|
||||
result.CQ_zone = e->CQ_zone_;
|
||||
result.ITU_zone = e->ITU_zone_;
|
||||
result.entity_name = e->name_;
|
||||
result.WAE_only = e->WAE_only_;
|
||||
result.latitude = e->lat_;
|
||||
result.longtitude = e->long_;
|
||||
result.UTC_offset = e->UTC_offset_;
|
||||
result.primary_prefix = e->primary_prefix_;
|
||||
result.continent = e.continent_;
|
||||
result.CQ_zone = e.CQ_zone_;
|
||||
result.ITU_zone = e.ITU_zone_;
|
||||
result.entity_name = e.name_;
|
||||
result.WAE_only = e.WAE_only_;
|
||||
result.latitude = e.lat_;
|
||||
result.longtitude = e.long_;
|
||||
result.UTC_offset = e.UTC_offset_;
|
||||
result.primary_prefix = e.primary_prefix_;
|
||||
|
||||
// check for overrides
|
||||
bool ok1 {true}, ok2 {true}, ok3 {true}, ok4 {true}, ok5 {true};
|
||||
@ -220,6 +226,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
Configuration const * configuration_;
|
||||
QString path_;
|
||||
entities_type entities_;
|
||||
prefixes_type prefixes_;
|
||||
@ -307,8 +314,13 @@ char const * AD1CCty::continent (Continent c)
|
||||
}
|
||||
}
|
||||
|
||||
AD1CCty::AD1CCty ()
|
||||
AD1CCty::AD1CCty (Configuration const * configuration)
|
||||
: m_ {configuration}
|
||||
{
|
||||
Q_ASSERT (configuration);
|
||||
// TODO: G4WJS - consider doing the following asynchronously to
|
||||
// speed up startup. Not urgent as it takes less than 1s on a Core
|
||||
// i7 reading BIG CTY.DAT.
|
||||
QDir dataPath {QStandardPaths::writableLocation (QStandardPaths::DataLocation)};
|
||||
m_->path_ = dataPath.exists (file_name)
|
||||
? dataPath.absoluteFilePath (file_name) // user override
|
||||
@ -389,7 +401,7 @@ auto AD1CCty::lookup (QString const& call) const -> Record
|
||||
auto p = m_->prefixes_.find (exact_search);
|
||||
if (p != m_->prefixes_.end () && p->exact_)
|
||||
{
|
||||
return m_->fixup (call, *p);
|
||||
return m_->fixup (*p, *m_->lookup_entity (call, *p));
|
||||
}
|
||||
}
|
||||
while (search_prefix.size ())
|
||||
@ -397,9 +409,11 @@ auto AD1CCty::lookup (QString const& call) const -> Record
|
||||
auto p = m_->prefixes_.find (search_prefix);
|
||||
if (p != m_->prefixes_.end ())
|
||||
{
|
||||
if (!p->exact_ || call.size () == search_prefix.size ())
|
||||
impl::entity_by_id::iterator e = m_->lookup_entity (call, *p);
|
||||
if ((m_->configuration_->include_WAE_entities () || !e->WAE_only_)
|
||||
&& (!p->exact_ || call.size () == search_prefix.size ()))
|
||||
{
|
||||
return m_->fixup (call, *p);
|
||||
return m_->fixup (*p, *e);
|
||||
}
|
||||
}
|
||||
search_prefix = search_prefix.left (search_prefix.size () - 1);
|
||||
|
@ -1,17 +1,19 @@
|
||||
#ifndef AD1C_CTY_HPP_
|
||||
#define AD1C_CTY_HPP_
|
||||
|
||||
#include <boost/core/noncopyable.hpp>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include "pimpl_h.hpp"
|
||||
|
||||
class QString;
|
||||
class Configuration;
|
||||
|
||||
//
|
||||
// AD1CCty - Fast access database of Jim Reisert, AD1C's, cty.dat
|
||||
// entity and entity override information file.
|
||||
//
|
||||
class AD1CCty final
|
||||
: public QObject
|
||||
, private boost::noncopyable
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -39,7 +41,7 @@ public:
|
||||
QString primary_prefix;
|
||||
};
|
||||
|
||||
explicit AD1CCty ();
|
||||
explicit AD1CCty (Configuration const *);
|
||||
~AD1CCty ();
|
||||
Record lookup (QString const& call) const;
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <QFileInfo>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
|
||||
#include "Configuration.hpp"
|
||||
#include "qt_helpers.hpp"
|
||||
#include "pimpl_impl.hpp"
|
||||
|
||||
@ -361,8 +361,9 @@ namespace
|
||||
class WorkedBefore::impl final
|
||||
{
|
||||
public:
|
||||
impl ()
|
||||
impl (Configuration const * configuration)
|
||||
: path_ {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath (logFileName)}
|
||||
, prefixes_ {configuration}
|
||||
{
|
||||
}
|
||||
|
||||
@ -379,8 +380,10 @@ public:
|
||||
worked_before_database_type worked_;
|
||||
};
|
||||
|
||||
WorkedBefore::WorkedBefore ()
|
||||
WorkedBefore::WorkedBefore (Configuration const * configuration)
|
||||
: m_ {configuration}
|
||||
{
|
||||
Q_ASSERT (configuration);
|
||||
connect (&m_->loader_watcher_, &QFutureWatcher<worked_before_database_type>::finished, [this] () {
|
||||
QString error;
|
||||
size_t n {0};
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "AD1CCty.hpp"
|
||||
#include "pimpl_h.hpp"
|
||||
|
||||
class Configuration;
|
||||
class CountryDat;
|
||||
class QString;
|
||||
class QByteArray;
|
||||
@ -17,7 +18,7 @@ class WorkedBefore final
|
||||
public:
|
||||
using Continent = AD1CCty::Continent;
|
||||
|
||||
explicit WorkedBefore ();
|
||||
explicit WorkedBefore (Configuration const *);
|
||||
~WorkedBefore ();
|
||||
|
||||
Q_SLOT void reload ();
|
||||
|
@ -3,12 +3,16 @@
|
||||
#include <QDateTime>
|
||||
#include "Configuration.hpp"
|
||||
#include "AD1CCty.hpp"
|
||||
#include "models/CabrilloLog.hpp"
|
||||
#include "models/FoxLog.hpp"
|
||||
|
||||
#include "moc_logbook.cpp"
|
||||
|
||||
LogBook::LogBook (Configuration const * configuration)
|
||||
: config_ {configuration}
|
||||
, worked_before_ {configuration}
|
||||
{
|
||||
Q_ASSERT (configuration);
|
||||
connect (&worked_before_, &WorkedBefore::finished_loading, this, &LogBook::finished_loading);
|
||||
}
|
||||
|
||||
@ -136,3 +140,23 @@ QByteArray LogBook::QSOToADIF (QString const& hisCall, QString const& hisGrid, Q
|
||||
}
|
||||
return t.toLatin1();
|
||||
}
|
||||
|
||||
CabrilloLog * LogBook::contest_log ()
|
||||
{
|
||||
// lazy create of Cabrillo log object instance
|
||||
if (!m_contest_log)
|
||||
{
|
||||
m_contest_log.reset (new CabrilloLog {config_});
|
||||
}
|
||||
return m_contest_log.data ();
|
||||
}
|
||||
|
||||
FoxLog * LogBook::fox_log ()
|
||||
{
|
||||
// lazy create of Fox log object instance
|
||||
if (!m_fox_log)
|
||||
{
|
||||
m_fox_log.reset (new FoxLog {config_});
|
||||
}
|
||||
return m_fox_log.data ();
|
||||
}
|
||||
|
@ -8,12 +8,15 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QScopedPointer>
|
||||
|
||||
#include "WorkedBefore.hpp"
|
||||
|
||||
class Configuration;
|
||||
class QByteArray;
|
||||
class QDateTime;
|
||||
class CabrilloLog;
|
||||
class FoxLog;
|
||||
|
||||
class LogBook final
|
||||
: public QObject
|
||||
@ -43,9 +46,14 @@ public:
|
||||
|
||||
Q_SIGNAL void finished_loading (int worked_before_record_count, QString const& error) const;
|
||||
|
||||
CabrilloLog * contest_log ();
|
||||
FoxLog * fox_log ();
|
||||
|
||||
private:
|
||||
Configuration const * config_;
|
||||
WorkedBefore worked_before_;
|
||||
QScopedPointer<CabrilloLog> m_contest_log;
|
||||
QScopedPointer<FoxLog> m_fox_log;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include <QDataStream>
|
||||
#include "Configuration.hpp"
|
||||
#include "Bands.hpp"
|
||||
#include "logbook/AD1CCty.hpp"
|
||||
#include "qt_db_helpers.hpp"
|
||||
#include "pimpl_impl.hpp"
|
||||
|
||||
@ -232,3 +233,15 @@ void CabrilloLog::export_qsos (QTextStream& stream) const
|
||||
.arg (m_->export_query_.value (rcvd_index).toString (), -13);
|
||||
}
|
||||
}
|
||||
|
||||
QSet<QString> CabrilloLog::unique_DXCC_entities (AD1CCty const& countries) const
|
||||
{
|
||||
QSqlQuery q {"SELECT UNIQUE CALL FROM cabrillo_log"};
|
||||
auto call_index = q.record ().indexOf ("call");
|
||||
QSet<QString> entities;
|
||||
while (q.next ())
|
||||
{
|
||||
entities << countries.lookup (q.value(call_index).toString ()).primary_prefix;
|
||||
}
|
||||
return entities;
|
||||
}
|
||||
|
@ -2,14 +2,16 @@
|
||||
#define CABRILLO_LOG_HPP_
|
||||
|
||||
#include <boost/core/noncopyable.hpp>
|
||||
#include <QSet>
|
||||
#include <QString>
|
||||
#include "Radio.hpp"
|
||||
#include "pimpl_h.hpp"
|
||||
|
||||
class Configuration;
|
||||
class QDateTime;
|
||||
class QString;
|
||||
class QSqlTableModel;
|
||||
class QTextStream;
|
||||
class AD1CCty;
|
||||
|
||||
class CabrilloLog final
|
||||
: private boost::noncopyable
|
||||
@ -28,6 +30,7 @@ public:
|
||||
QSqlTableModel * model ();
|
||||
void reset ();
|
||||
void export_qsos (QTextStream&) const;
|
||||
QSet<QString> unique_DXCC_entities (AD1CCty const&) const;
|
||||
|
||||
private:
|
||||
class impl;
|
||||
|
@ -16,11 +16,12 @@
|
||||
#include "moc_logqso.cpp"
|
||||
|
||||
LogQSO::LogQSO(QString const& programTitle, QSettings * settings
|
||||
, Configuration const * config, QWidget *parent)
|
||||
, Configuration const * config, LogBook * log, QWidget *parent)
|
||||
: QDialog {parent, Qt::WindowStaysOnTopHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint}
|
||||
, ui(new Ui::LogQSO)
|
||||
, m_settings (settings)
|
||||
, m_config {config}
|
||||
, m_log {log}
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowTitle(programTitle + " - Log QSO");
|
||||
@ -57,8 +58,7 @@ void LogQSO::storeSettings () const
|
||||
void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString mode,
|
||||
QString const& rptSent, QString const& rptRcvd,
|
||||
QDateTime const& dateTimeOn, QDateTime const& dateTimeOff,
|
||||
Radio::Frequency dialFreq, bool noSuffix, QString xSent, QString xRcvd,
|
||||
CabrilloLog * cabrillo_log)
|
||||
Radio::Frequency dialFreq, bool noSuffix, QString xSent, QString xRcvd)
|
||||
{
|
||||
if(!isHidden()) return;
|
||||
ui->call->setText (hisCall);
|
||||
@ -100,7 +100,6 @@ void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString
|
||||
ui->loggedOperator->setText(m_config->opCall());
|
||||
ui->exchSent->setText (xSent);
|
||||
ui->exchRcvd->setText (xRcvd);
|
||||
m_cabrilloLog = cabrillo_log;
|
||||
|
||||
using SpOp = Configuration::SpecialOperatingActivity;
|
||||
auto special_op = m_config->special_op_id ();
|
||||
@ -158,7 +157,7 @@ void LogQSO::accept()
|
||||
return; // without accepting
|
||||
}
|
||||
|
||||
if (!m_cabrilloLog->add_QSO (m_dialFreq, dateTimeOff, hisCall, xsent, xrcvd))
|
||||
if (!m_log->contest_log ()->add_QSO (m_dialFreq, dateTimeOff, hisCall, xsent, xrcvd))
|
||||
{
|
||||
show ();
|
||||
MessageBox::warning_message (this, tr ("Invalid QSO Data"),
|
||||
|
@ -17,19 +17,19 @@ namespace Ui {
|
||||
class QSettings;
|
||||
class Configuration;
|
||||
class QByteArray;
|
||||
class CabrilloLog;
|
||||
class LogBook;
|
||||
|
||||
class LogQSO : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LogQSO(QString const& programTitle, QSettings *, Configuration const *, QWidget *parent = 0);
|
||||
explicit LogQSO(QString const& programTitle, QSettings *, Configuration const *, LogBook *, QWidget *parent = 0);
|
||||
~LogQSO();
|
||||
void initLogQSO(QString const& hisCall, QString const& hisGrid, QString mode,
|
||||
QString const& rptSent, QString const& rptRcvd, QDateTime const& dateTimeOn,
|
||||
QDateTime const& dateTimeOff, Radio::Frequency dialFreq,
|
||||
bool noSuffix, QString xSent, QString xRcvd, CabrilloLog *);
|
||||
bool noSuffix, QString xSent, QString xRcvd);
|
||||
|
||||
public slots:
|
||||
void accept();
|
||||
@ -54,12 +54,12 @@ private:
|
||||
QScopedPointer<Ui::LogQSO> ui;
|
||||
QSettings * m_settings;
|
||||
Configuration const * m_config;
|
||||
LogBook * m_log;
|
||||
QString m_txPower;
|
||||
QString m_comments;
|
||||
Radio::Frequency m_dialFreq;
|
||||
QString m_myCall;
|
||||
QString m_myGrid;
|
||||
CabrilloLog * m_cabrilloLog;
|
||||
};
|
||||
|
||||
#endif // LogQSO_H
|
||||
|
@ -244,7 +244,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
||||
m_echoGraph (new EchoGraph(m_settings)),
|
||||
m_fastGraph (new FastGraph(m_settings)),
|
||||
// no parent so that it has a taskbar icon
|
||||
m_logDlg (new LogQSO (program_title (), m_settings, &m_config, nullptr)),
|
||||
m_logDlg (new LogQSO (program_title (), m_settings, &m_config, &m_logBook, nullptr)),
|
||||
m_lastDialFreq {0},
|
||||
m_dialFreqRxWSPR {0},
|
||||
m_detector {new Detector {RX_SAMPLE_RATE, double(NTMAX), downSampleFactor}},
|
||||
@ -2544,16 +2544,14 @@ void MainWindow::on_actionAstronomical_data_toggled (bool checked)
|
||||
|
||||
void MainWindow::on_fox_log_action_triggered()
|
||||
{
|
||||
if (!m_foxLog) m_foxLog.reset (new FoxLog {&m_config});
|
||||
if (!m_foxLogWindow)
|
||||
{
|
||||
m_foxLogWindow.reset (new FoxLogWindow {m_settings, &m_config, m_foxLog.data ()});
|
||||
m_foxLogWindow.reset (new FoxLogWindow {m_settings, &m_config, m_logBook.fox_log ()});
|
||||
|
||||
// Connect signals from fox log window
|
||||
connect (this, &MainWindow::finished, m_foxLogWindow.data (), &FoxLogWindow::close);
|
||||
connect (m_foxLogWindow.data (), &FoxLogWindow::reset_log_model, [this] () {
|
||||
if (!m_foxLog) m_foxLog.reset (new FoxLog {&m_config});
|
||||
m_foxLog->reset ();
|
||||
m_logBook.fox_log ()->reset ();
|
||||
});
|
||||
}
|
||||
m_foxLogWindow->showNormal ();
|
||||
@ -2563,10 +2561,9 @@ void MainWindow::on_fox_log_action_triggered()
|
||||
|
||||
void MainWindow::on_contest_log_action_triggered()
|
||||
{
|
||||
if (!m_cabrilloLog) m_cabrilloLog.reset (new CabrilloLog {&m_config});
|
||||
if (!m_contestLogWindow)
|
||||
{
|
||||
m_contestLogWindow.reset (new CabrilloLogWindow {m_settings, &m_config, m_cabrilloLog->model ()});
|
||||
m_contestLogWindow.reset (new CabrilloLogWindow {m_settings, &m_config, m_logBook.contest_log ()->model ()});
|
||||
|
||||
// Connect signals from contest log window
|
||||
connect (this, &MainWindow::finished, m_contestLogWindow.data (), &CabrilloLogWindow::close);
|
||||
@ -5521,15 +5518,9 @@ void MainWindow::on_logQSOButton_clicked() //Log QSO button
|
||||
default: break;
|
||||
}
|
||||
|
||||
auto special_op = m_config.special_op_id ();
|
||||
if (SpecOp::NONE < special_op && special_op < SpecOp::FOX)
|
||||
{
|
||||
if (!m_cabrilloLog) m_cabrilloLog.reset (new CabrilloLog {&m_config});
|
||||
}
|
||||
m_logDlg->initLogQSO (m_hisCall, grid, m_modeTx, m_rptSent, m_rptRcvd,
|
||||
m_dateTimeQSOOn, dateTimeQSOOff, m_freqNominal +
|
||||
ui->TxFreqSpinBox->value(), m_noSuffix, m_xSent, m_xRcvd,
|
||||
m_cabrilloLog.data ());
|
||||
ui->TxFreqSpinBox->value(), m_noSuffix, m_xSent, m_xRcvd);
|
||||
m_inQSOwith="";
|
||||
}
|
||||
|
||||
@ -6369,15 +6360,13 @@ void MainWindow::on_reset_cabrillo_log_action_triggered ()
|
||||
"for export in your Cabrillo log.")))
|
||||
{
|
||||
if(m_config.RTTY_Exchange()!="SCC") ui->sbSerialNumber->setValue(1);
|
||||
if (!m_cabrilloLog) m_cabrilloLog.reset (new CabrilloLog {&m_config});
|
||||
m_cabrilloLog->reset ();
|
||||
m_logBook.contest_log ()->reset ();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionExport_Cabrillo_log_triggered()
|
||||
{
|
||||
if (!m_cabrilloLog) m_cabrilloLog.reset (new CabrilloLog {&m_config});
|
||||
if (QDialog::Accepted == ExportCabrillo {m_settings, &m_config, m_cabrilloLog.data ()}.exec())
|
||||
if (QDialog::Accepted == ExportCabrillo {m_settings, &m_config, m_logBook.contest_log ()}.exec())
|
||||
{
|
||||
MessageBox::information_message (this, tr ("Cabrillo Log saved"));
|
||||
}
|
||||
@ -8459,9 +8448,8 @@ list2Done:
|
||||
m_hisGrid=m_foxQSO[hc1].grid;
|
||||
m_rptSent=m_foxQSO[hc1].sent;
|
||||
m_rptRcvd=m_foxQSO[hc1].rcvd;
|
||||
if (!m_foxLog) m_foxLog.reset (new FoxLog {&m_config});
|
||||
if (!m_foxLogWindow) on_fox_log_action_triggered ();
|
||||
if (m_foxLog->add_QSO (QSO_time, m_hisCall, m_hisGrid, m_rptSent, m_rptRcvd, m_lastBand))
|
||||
if (m_logBook.fox_log ()->add_QSO (QSO_time, m_hisCall, m_hisGrid, m_rptSent, m_rptRcvd, m_lastBand))
|
||||
{
|
||||
writeFoxQSO (QString {" Log: %1 %2 %3 %4 %5"}.arg (m_hisCall).arg (m_hisGrid)
|
||||
.arg (m_rptSent).arg (m_rptRcvd).arg (m_lastBand));
|
||||
|
@ -72,9 +72,7 @@ class WideGraph;
|
||||
class LogQSO;
|
||||
class Transceiver;
|
||||
class MessageAveraging;
|
||||
class FoxLog;
|
||||
class FoxLogWindow;
|
||||
class CabrilloLog;
|
||||
class CabrilloLogWindow;
|
||||
class ColorHighlighting;
|
||||
class MessageClient;
|
||||
@ -376,9 +374,7 @@ private:
|
||||
QScopedPointer<HelpTextWindow> m_prefixes;
|
||||
QScopedPointer<HelpTextWindow> m_mouseCmnds;
|
||||
QScopedPointer<MessageAveraging> m_msgAvgWidget;
|
||||
QScopedPointer<FoxLog> m_foxLog;
|
||||
QScopedPointer<FoxLogWindow> m_foxLogWindow;
|
||||
QScopedPointer<CabrilloLog> m_cabrilloLog;
|
||||
QScopedPointer<CabrilloLogWindow> m_contestLogWindow;
|
||||
QScopedPointer<ColorHighlighting> m_colorHighlighting;
|
||||
Transceiver::TransceiverState m_rigState;
|
||||
|
Loading…
Reference in New Issue
Block a user