Added user configurable APRS server option
This commit is contained in:
parent
9bbaba3f72
commit
24e9b15e42
@ -4,15 +4,13 @@
|
||||
|
||||
#include "varicode.h"
|
||||
|
||||
|
||||
|
||||
APRSISClient::APRSISClient(QString host, quint16 port, QObject *parent):
|
||||
QTcpSocket(parent),
|
||||
m_host(host),
|
||||
m_port(port)
|
||||
{
|
||||
connect(&m_timer, &QTimer::timeout, this, &APRSISClient::sendReports);
|
||||
m_timer.setInterval(30*1000); // every 30 seconds
|
||||
m_timer.setInterval(60*1000); // every 60 seconds
|
||||
m_timer.start();
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,19 @@ public:
|
||||
static QPair<float, float> grid2deg(QString grid);
|
||||
static QPair<QString, QString> grid2aprs(QString grid);
|
||||
|
||||
void setServer(QString host, quint16 port){
|
||||
if(state() == QTcpSocket::ConnectedState){
|
||||
disconnectFromHost();
|
||||
}
|
||||
|
||||
m_host = host;
|
||||
m_port = port;
|
||||
}
|
||||
|
||||
void setPaused(bool paused){
|
||||
m_paused = paused;
|
||||
}
|
||||
|
||||
void setLocalStation(QString mycall, QString mygrid){
|
||||
m_localCall = mycall;
|
||||
m_localGrid = mygrid;
|
||||
@ -29,7 +42,11 @@ public:
|
||||
void processQueue(bool disconnect=true);
|
||||
|
||||
public slots:
|
||||
void sendReports(){ processQueue(true); }
|
||||
void sendReports(){
|
||||
if(m_paused) return;
|
||||
|
||||
processQueue(true);
|
||||
}
|
||||
|
||||
private:
|
||||
QString m_localCall;
|
||||
@ -39,6 +56,7 @@ private:
|
||||
QString m_host;
|
||||
quint16 m_port;
|
||||
QTimer m_timer;
|
||||
bool m_paused;
|
||||
};
|
||||
|
||||
#endif // APRSISCLIENT_H
|
||||
|
@ -555,7 +555,6 @@ private:
|
||||
QString my_callsign_;
|
||||
QString my_grid_;
|
||||
QString my_station_;
|
||||
QString aprs_ssid_;
|
||||
QString my_qth_;
|
||||
QString reply_;
|
||||
int callsign_aging_;
|
||||
@ -606,6 +605,10 @@ private:
|
||||
bool x4ToneSpacing_;
|
||||
bool use_dynamic_info_;
|
||||
QString opCall_;
|
||||
|
||||
QString aprs_server_name_;
|
||||
port_type aprs_server_port_;
|
||||
|
||||
QString udp_server_name_;
|
||||
port_type udp_server_port_;
|
||||
// QString n1mm_server_name () const;
|
||||
@ -720,6 +723,8 @@ bool Configuration::x2ToneSpacing() const {return m_->x2ToneSpacing_;}
|
||||
bool Configuration::x4ToneSpacing() const {return m_->x4ToneSpacing_;}
|
||||
bool Configuration::split_mode () const {return m_->split_mode ();}
|
||||
QString Configuration::opCall() const {return m_->opCall_;}
|
||||
QString Configuration::aprs_server_name () const {return m_->aprs_server_name_;}
|
||||
auto Configuration::aprs_server_port () const -> port_type {return m_->aprs_server_port_;}
|
||||
QString Configuration::udp_server_name () const {return m_->udp_server_name_;}
|
||||
auto Configuration::udp_server_port () const -> port_type {return m_->udp_server_port_;}
|
||||
bool Configuration::accept_udp_requests () const {return m_->accept_udp_requests_;}
|
||||
@ -865,10 +870,6 @@ QString Configuration::my_station() const
|
||||
return station;
|
||||
}
|
||||
|
||||
QString Configuration::aprs_ssid() const {
|
||||
return m_->aprs_ssid_;
|
||||
}
|
||||
|
||||
QString Configuration::my_qth() const
|
||||
{
|
||||
return m_->my_qth_;
|
||||
@ -1304,6 +1305,8 @@ void Configuration::impl::initialize_models ()
|
||||
ui_->TX_audio_source_button_group->button (rig_params_.audio_source)->setChecked (true);
|
||||
ui_->CAT_poll_interval_spin_box->setValue (rig_params_.poll_interval);
|
||||
ui_->opCallEntry->setText (opCall_);
|
||||
ui_->aprs_server_line_edit->setText (aprs_server_name_);
|
||||
ui_->aprs_server_port_spin_box->setValue (aprs_server_port_);
|
||||
ui_->udp_server_line_edit->setText (udp_server_name_);
|
||||
ui_->udp_server_port_spin_box->setValue (udp_server_port_);
|
||||
ui_->accept_udp_requests_check_box->setChecked (accept_udp_requests_);
|
||||
@ -1356,7 +1359,6 @@ void Configuration::impl::read_settings ()
|
||||
my_callsign_ = settings_->value ("MyCall", QString {}).toString ();
|
||||
my_grid_ = settings_->value ("MyGrid", QString {}).toString ();
|
||||
my_station_ = settings_->value("MyStation", QString {}).toString();
|
||||
aprs_ssid_ = settings_->value("APRSSSID", "-0").toString();
|
||||
callsign_aging_ = settings_->value ("CallsignAging", 0).toInt ();
|
||||
activity_aging_ = settings_->value ("ActivityAging", 2).toInt ();
|
||||
my_qth_ = settings_->value("MyQTH", QString {}).toString();
|
||||
@ -1529,6 +1531,8 @@ void Configuration::impl::read_settings ()
|
||||
rig_params_.poll_interval = settings_->value ("Polling", 0).toInt ();
|
||||
rig_params_.split_mode = settings_->value ("SplitMode", QVariant::fromValue (TransceiverFactory::split_mode_none)).value<TransceiverFactory::SplitMode> ();
|
||||
opCall_ = settings_->value ("OpCall", "").toString ();
|
||||
aprs_server_name_ = settings_->value ("aprsServer", "rotate.aprs2.net").toString ();
|
||||
aprs_server_port_ = settings_->value ("aprsServerPort", 14580).toUInt ();
|
||||
udp_server_name_ = settings_->value ("UDPServer", "127.0.0.1").toString ();
|
||||
udp_server_port_ = settings_->value ("UDPServerPort", 2237).toUInt ();
|
||||
n1mm_server_name_ = settings_->value ("N1MMServer", "127.0.0.1").toString ();
|
||||
@ -1552,7 +1556,6 @@ void Configuration::impl::write_settings ()
|
||||
settings_->setValue ("MyCall", my_callsign_);
|
||||
settings_->setValue ("MyGrid", my_grid_);
|
||||
settings_->setValue ("MyStation", my_station_);
|
||||
settings_->setValue ("APRSSSID", aprs_ssid_);
|
||||
settings_->setValue ("MyQTH", my_qth_);
|
||||
settings_->setValue ("Reply", reply_);
|
||||
settings_->setValue ("CallsignAging", callsign_aging_);
|
||||
@ -1643,6 +1646,8 @@ void Configuration::impl::write_settings ()
|
||||
settings_->setValue ("x2ToneSpacing", x2ToneSpacing_);
|
||||
settings_->setValue ("x4ToneSpacing", x4ToneSpacing_);
|
||||
settings_->setValue ("OpCall", opCall_);
|
||||
settings_->setValue ("aprsServer", aprs_server_name_);
|
||||
settings_->setValue ("aprsServerPort", aprs_server_port_);
|
||||
settings_->setValue ("UDPServer", udp_server_name_);
|
||||
settings_->setValue ("UDPServerPort", udp_server_port_);
|
||||
settings_->setValue ("N1MMServer", n1mm_server_name_);
|
||||
@ -2016,7 +2021,6 @@ void Configuration::impl::accept ()
|
||||
my_grid_ = ui_->grid_line_edit->text ();
|
||||
my_station_ = ui_->station_message_line_edit->text().toUpper();
|
||||
reply_ = ui_->reply_message_line_edit->text().toUpper();
|
||||
aprs_ssid_ = ui_->aprs_ssid_line_edit->text().toUpper();
|
||||
my_qth_ = ui_->qth_message_line_edit->text().toUpper();
|
||||
callsign_aging_ = ui_->callsign_aging_spin_box->value();
|
||||
activity_aging_ = ui_->activity_aging_spin_box->value();
|
||||
@ -2064,6 +2068,9 @@ void Configuration::impl::accept ()
|
||||
pwrBandTuneMemory_ = ui_->checkBoxPwrBandTuneMemory->isChecked ();
|
||||
opCall_=ui_->opCallEntry->text();
|
||||
|
||||
aprs_server_name_ = ui_->aprs_server_line_edit->text();
|
||||
aprs_server_port_ = ui_->aprs_server_port_spin_box->value();
|
||||
|
||||
auto newUdpEnabled = ui_->udpEnable->isChecked();
|
||||
auto new_server = ui_->udp_server_line_edit->text ();
|
||||
if (new_server != udp_server_name_ || newUdpEnabled != udpEnabled_)
|
||||
|
@ -98,7 +98,6 @@ public:
|
||||
QString my_callsign () const;
|
||||
QString my_grid () const;
|
||||
QString my_station () const;
|
||||
QString aprs_ssid() const;
|
||||
int activity_aging() const;
|
||||
int callsign_aging() const;
|
||||
QString my_qth () const;
|
||||
@ -149,6 +148,8 @@ public:
|
||||
bool EMEonly() const;
|
||||
bool post_decodes () const;
|
||||
QString opCall() const;
|
||||
QString aprs_server_name () const;
|
||||
port_type aprs_server_port () const;
|
||||
QString udp_server_name () const;
|
||||
port_type udp_server_port () const;
|
||||
QString n1mm_server_name () const;
|
||||
|
125
Configuration.ui
125
Configuration.ui
@ -2027,73 +2027,80 @@ comments field.</string>
|
||||
<property name="title">
|
||||
<string>Network Services</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_17">
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="bottomMargin">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="psk_reporter_check_box">
|
||||
<property name="toolTip">
|
||||
<string>The program can send your station details and all
|
||||
<layout class="QVBoxLayout" name="verticalLayout_14">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="psk_reporter_check_box">
|
||||
<property name="toolTip">
|
||||
<string>The program can send your station details and all
|
||||
decoded signals as spots to the http://pskreporter.info web site.
|
||||
This is used for reverse beacon analysis which is very useful
|
||||
for assessing propagation and system performance.</string>
|
||||
</property>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable spotting to reporting networks (PSKReporter && APRS-IS)</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_17">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="udp_server_label_2">
|
||||
<property name="text">
|
||||
<string>Enable spotting to reporting networks (PSKReporter && APRS-IS)</string>
|
||||
<string>APRS Server:</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
<property name="buddy">
|
||||
<cstring>udp_server_line_edit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>The SSID to be used for local APRS spots</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>APRS SSID:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="aprs_ssid_line_edit">
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="aprs_server_line_edit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Optional hostname of APRS server to send spots to.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the spotting to APRS.</p></body></html></string>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::ImhDigitsOnly</set>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-0</string>
|
||||
<string>rotate.aprs2.net</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>APRS Server Port:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>udp_server_port_spin_box</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="aprs_server_port_spin_box">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Enter the service port number of the APRS server that should receive updates. If this is zero no updates will be broadcast.</p></body></html></string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>65534</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>14580</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -2142,7 +2149,7 @@ for assessing propagation and system performance.</string>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>UDP Server port number:</string>
|
||||
<string>UDP Server Port:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>udp_server_port_spin_box</cstring>
|
||||
@ -2152,7 +2159,7 @@ for assessing propagation and system performance.</string>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="udp_server_port_spin_box">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be broadcast.</p></body></html></string>
|
||||
<string><html><head/><body><p>Enter the service port number of the UDP server that should receive updates. If this is zero no updates will be broadcast.</p></body></html></string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
@ -2252,7 +2259,7 @@ for assessing propagation and system performance.</string>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="n1mm_server_name_label">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>N1MM Server name or IP address:</p></body></html></string>
|
||||
<string><html><head/><body><p>N1MM Server:</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -2266,14 +2273,14 @@ for assessing propagation and system performance.</string>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="n1mm_server_port_label">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>N1MM Server port number:</p></body></html></string>
|
||||
<string><html><head/><body><p>N1MM Server Port:</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="n1mm_server_port_spin_box">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html></string>
|
||||
<string><html><head/><body><p>Enter the port number that should be used for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -3232,12 +3239,12 @@ soundcard changes</string>
|
||||
</connection>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="TX_audio_source_button_group"/>
|
||||
<buttongroup name="CAT_stop_bits_button_group"/>
|
||||
<buttongroup name="PTT_method_button_group"/>
|
||||
<buttongroup name="CAT_handshake_button_group"/>
|
||||
<buttongroup name="CAT_data_bits_button_group"/>
|
||||
<buttongroup name="TX_mode_button_group"/>
|
||||
<buttongroup name="CAT_handshake_button_group"/>
|
||||
<buttongroup name="TX_audio_source_button_group"/>
|
||||
<buttongroup name="CAT_data_bits_button_group"/>
|
||||
<buttongroup name="split_mode_button_group"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
@ -2295,8 +2295,11 @@ void MainWindow::prepareSpotting(){
|
||||
if(m_config.spot_to_reporting_networks ()){
|
||||
pskSetLocal();
|
||||
aprsSetLocal();
|
||||
m_aprsClient->setServer(m_config.aprs_server_name(), m_config.aprs_server_port());
|
||||
m_aprsClient->setPaused(false);
|
||||
ui->spotButton->setChecked(true);
|
||||
} else {
|
||||
m_aprsClient->setPaused(true);
|
||||
ui->spotButton->setChecked(false);
|
||||
}
|
||||
}
|
||||
@ -7120,7 +7123,7 @@ void MainWindow::band_changed (Frequency f)
|
||||
m_bandEdited = false;
|
||||
|
||||
psk_Reporter->sendReport(); // Upload any queued spots before changing band
|
||||
m_aprsClient->processQueue(true);
|
||||
m_aprsClient->sendReports();
|
||||
if (!m_transmitting) monitor (true);
|
||||
if ("FreqCal" == m_mode)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user