Created
January 22, 2019 11:07
-
-
Save aaronbrown1988/a8c90ed769ff661c2d836cd52e1573dc to your computer and use it in GitHub Desktop.
A patch for WSJTX for uploading to a custom WSPR spot repository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Configuration.cpp b/Configuration.cpp | |
index cb0566c..e81ac55 100644 | |
--- a/Configuration.cpp | |
+++ b/Configuration.cpp | |
@@ -630,6 +630,7 @@ private: | |
DataMode data_mode_; | |
bool pwrBandTxMemory_; | |
bool pwrBandTuneMemory_; | |
+ QString wsprnetUrl_; | |
QAudioDeviceInfo audio_input_device_; | |
bool default_audio_input_device_selected_; | |
@@ -735,6 +736,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_;} | |
+QString Configuration::wsprnetUrl () const {return m_->wsprnetUrl_;} | |
void Configuration::set_calibration (CalibrationParams params) | |
{ | |
@@ -1252,6 +1254,8 @@ void Configuration::impl::initialize_models () | |
ui_->CAT_handshake_button_group->button (rig_params_.handshake)->setChecked (true); | |
ui_->checkBoxPwrBandTxMemory->setChecked(pwrBandTxMemory_); | |
ui_->checkBoxPwrBandTuneMemory->setChecked(pwrBandTuneMemory_); | |
+ ui_->wsprnetUrl_edit->setText(wsprnetUrl_); | |
+ | |
if (rig_params_.force_dtr) | |
{ | |
ui_->force_DTR_combo_box->setCurrentIndex (rig_params_.dtr_high ? 1 : 2); | |
@@ -1506,6 +1510,7 @@ void Configuration::impl::read_settings () | |
calibration_.slope_ppm = settings_->value ("CalibrationSlopePPM", 0.).toDouble (); | |
pwrBandTxMemory_ = settings_->value("pwrBandTxMemory",false).toBool (); | |
pwrBandTuneMemory_ = settings_->value("pwrBandTuneMemory",false).toBool (); | |
+ wsprnetUrl_ = settings_->value("wsprnetUrl", "http://wsprnet.org/post?").toString (); | |
} | |
void Configuration::impl::write_settings () | |
@@ -1612,6 +1617,7 @@ void Configuration::impl::write_settings () | |
settings_->setValue ("pwrBandTuneMemory", pwrBandTuneMemory_); | |
settings_->setValue ("Region", QVariant::fromValue (region_)); | |
settings_->setValue ("AutoGrid", use_dynamic_grid_); | |
+ settings_->setValue("wsprnetUrl", wsprnetUrl_); | |
} | |
void Configuration::impl::set_rig_invariants () | |
@@ -2058,6 +2064,7 @@ void Configuration::impl::accept () | |
n1mm_server_name_ = ui_->n1mm_server_name_line_edit->text (); | |
n1mm_server_port_ = ui_->n1mm_server_port_spin_box->value (); | |
broadcast_to_n1mm_ = ui_->enable_n1mm_broadcast_check_box->isChecked (); | |
+ wsprnetUrl_ = ui_->wsprnetUrl_edit->text (); | |
udpWindowToFront_ = ui_->udpWindowToFront->isChecked (); | |
udpWindowRestore_ = ui_->udpWindowRestore->isChecked (); | |
diff --git a/Configuration.hpp b/Configuration.hpp | |
index 3f76c1b..0a66d01 100644 | |
--- a/Configuration.hpp | |
+++ b/Configuration.hpp | |
@@ -171,6 +171,7 @@ public: | |
LotWUsers const& lotw_users () const; | |
DecodeHighlightingModel const& decode_highlighting () const; | |
bool highlight_by_mode () const; | |
+ QString wsprnetUrl () const; | |
enum class SpecialOperatingActivity {NONE, NA_VHF, EU_VHF, FIELD_DAY, RTTY, FOX, HOUND}; | |
SpecialOperatingActivity special_op_id () const; | |
diff --git a/Configuration.ui b/Configuration.ui | |
index 6b04fd3..f4b95b6 100644 | |
--- a/Configuration.ui | |
+++ b/Configuration.ui | |
@@ -6,8 +6,8 @@ | |
<rect> | |
<x>0</x> | |
<y>0</y> | |
- <width>542</width> | |
- <height>542</height> | |
+ <width>614</width> | |
+ <height>635</height> | |
</rect> | |
</property> | |
<property name="windowTitle"> | |
@@ -17,7 +17,7 @@ | |
<item> | |
<widget class="QTabWidget" name="configuration_tabs"> | |
<property name="currentIndex"> | |
- <number>0</number> | |
+ <number>7</number> | |
</property> | |
<widget class="QWidget" name="general_tab"> | |
<attribute name="title"> | |
@@ -2803,7 +2803,7 @@ Right click for insert and delete options.</string> | |
</layout> | |
</widget> | |
</item> | |
- <item row="2" column="0" colspan="2"> | |
+ <item row="3" column="0" colspan="2"> | |
<spacer name="verticalSpacer_8"> | |
<property name="orientation"> | |
<enum>Qt::Vertical</enum> | |
@@ -2816,6 +2816,48 @@ Right click for insert and delete options.</string> | |
</property> | |
</spacer> | |
</item> | |
+ <item row="2" column="0" colspan="2"> | |
+ <widget class="QGroupBox" name="groupBox_7"> | |
+ <property name="minimumSize"> | |
+ <size> | |
+ <width>0</width> | |
+ <height>60</height> | |
+ </size> | |
+ </property> | |
+ <property name="baseSize"> | |
+ <size> | |
+ <width>0</width> | |
+ <height>35</height> | |
+ </size> | |
+ </property> | |
+ <property name="title"> | |
+ <string>WSPR Spot Uploads</string> | |
+ </property> | |
+ <widget class="QLineEdit" name="wsprnetUrl_edit"> | |
+ <property name="geometry"> | |
+ <rect> | |
+ <x>60</x> | |
+ <y>20</y> | |
+ <width>160</width> | |
+ <height>27</height> | |
+ </rect> | |
+ </property> | |
+ </widget> | |
+ <widget class="QLabel" name="label_16"> | |
+ <property name="geometry"> | |
+ <rect> | |
+ <x>30</x> | |
+ <y>20</y> | |
+ <width>54</width> | |
+ <height>17</height> | |
+ </rect> | |
+ </property> | |
+ <property name="text"> | |
+ <string>Url:</string> | |
+ </property> | |
+ </widget> | |
+ </widget> | |
+ </item> | |
</layout> | |
</widget> | |
</widget> | |
@@ -3018,12 +3060,12 @@ Right click for insert and delete options.</string> | |
</connection> | |
</connections> | |
<buttongroups> | |
- <buttongroup name="CAT_handshake_button_group"/> | |
<buttongroup name="split_mode_button_group"/> | |
- <buttongroup name="CAT_data_bits_button_group"/> | |
- <buttongroup name="PTT_method_button_group"/> | |
<buttongroup name="TX_mode_button_group"/> | |
+ <buttongroup name="PTT_method_button_group"/> | |
<buttongroup name="CAT_stop_bits_button_group"/> | |
+ <buttongroup name="CAT_handshake_button_group"/> | |
+ <buttongroup name="CAT_data_bits_button_group"/> | |
<buttongroup name="special_op_activity_button_group"/> | |
<buttongroup name="TX_audio_source_button_group"/> | |
</buttongroups> | |
diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp | |
index 42dac2f..632f9d4 100644 | |
--- a/widgets/mainwindow.cpp | |
+++ b/widgets/mainwindow.cpp | |
@@ -7411,7 +7411,7 @@ void MainWindow::uploadSpots() | |
QString rfreq = QString("%1").arg(0.000001*(m_dialFreqRxWSPR + 1500), 0, 'f', 6); | |
QString tfreq = QString("%1").arg(0.000001*(m_dialFreqRxWSPR + | |
ui->TxFreqSpinBox->value()), 0, 'f', 6); | |
- wsprNet->upload(m_config.my_callsign(), m_config.my_grid(), rfreq, tfreq, | |
+ wsprNet->upload(m_config.wsprnetUrl(),m_config.my_callsign(), m_config.my_grid(), rfreq, tfreq, | |
m_mode, QString::number(ui->autoButton->isChecked() ? m_pctx : 0), | |
QString::number(m_dBm), version(), | |
QDir::toNativeSeparators(m_config.writeable_data_dir ().absolutePath()) + "/wspr_spots.txt"); | |
diff --git a/wsprnet.cpp b/wsprnet.cpp | |
index 9e66608..85511de 100644 | |
--- a/wsprnet.cpp | |
+++ b/wsprnet.cpp | |
@@ -32,10 +32,11 @@ WSPRNet::WSPRNet(QNetworkAccessManager * manager, QObject *parent) | |
connect( uploadTimer, SIGNAL(timeout()), this, SLOT(work())); | |
} | |
-void WSPRNet::upload(QString const& call, QString const& grid, QString const& rfreq, QString const& tfreq, | |
+void WSPRNet::upload(QString const& url, QString const& call, QString const& grid, QString const& rfreq, QString const& tfreq, | |
QString const& mode, QString const& tpct, QString const& dbm, QString const& version, | |
QString const& fileName) | |
{ | |
+ m_url = url; | |
m_call = call; | |
m_grid = grid; | |
m_rfreq = rfreq; | |
@@ -63,7 +64,7 @@ void WSPRNet::upload(QString const& call, QString const& grid, QString const& rf | |
// Prevent reporting data ouside of the current frequency band | |
float f = fabs(m_rfreq.toFloat() - query["tqrg"].toFloat()); | |
if (f < 0.0002) { | |
- urlQueue.enqueue( wsprNetUrl + urlEncodeSpot(query)); | |
+ urlQueue.enqueue( m_url + urlEncodeSpot(query)); | |
m_uploadType = 2; | |
} | |
} | |
diff --git a/wsprnet.h b/wsprnet.h | |
index d712d52..1eac7f3 100644 | |
--- a/wsprnet.h | |
+++ b/wsprnet.h | |
@@ -17,7 +17,7 @@ class WSPRNet : public QObject | |
public: | |
explicit WSPRNet(QNetworkAccessManager *, QObject *parent = nullptr); | |
- void upload(QString const& call, QString const& grid, QString const& rfreq, QString const& tfreq, | |
+ void upload(QString const& url, QString const& call, QString const& grid, QString const& rfreq, QString const& tfreq, | |
QString const& mode, QString const& tpct, QString const& dbm, QString const& version, | |
QString const& fileName); | |
static bool decodeLine(QString const& line, QHash<QString,QString> &query); | |
@@ -33,7 +33,7 @@ public slots: | |
private: | |
QNetworkAccessManager *networkManager; | |
QList<QNetworkReply *> m_outstandingRequests; | |
- QString m_call, m_grid, m_rfreq, m_tfreq, m_mode, m_tpct, m_dbm, m_vers, m_file; | |
+ QString m_url,m_call, m_grid, m_rfreq, m_tfreq, m_mode, m_tpct, m_dbm, m_vers, m_file; | |
QQueue<QString> urlQueue; | |
QTimer *uploadTimer; | |
int m_urlQueueSize; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment