Restructuring @APRSIS into @JS8NET

This commit is contained in:
Jordan Sherer 2019-11-15 21:54:17 -05:00
parent d9ecd5a94e
commit fcf40e6f3b
4 changed files with 123 additions and 174 deletions

View File

@ -14,6 +14,9 @@
<string>Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="topMargin">
<number>1</number>
</property>
<item>
<widget class="QTabWidget" name="configuration_tabs">
<property name="enabled">
@ -23,7 +26,7 @@
<string>Select tab to change configuration parameters.</string>
</property>
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="general_tab">
<attribute name="title">
@ -63,7 +66,7 @@
<x>0</x>
<y>0</y>
<width>738</width>
<height>453</height>
<height>461</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
@ -1922,7 +1925,7 @@ this setting allows you to select which audio input will be used
<x>0</x>
<y>0</y>
<width>760</width>
<height>502</height>
<height>510</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_29">
@ -2181,9 +2184,9 @@ both here.</string>
</item>
<item>
<widget class="QGroupBox" name="azel_path_group_box">
<property name="visible">
<bool>false</bool>
</property>
<property name="visible">
<bool>false</bool>
</property>
<property name="toolTip">
<string>AzEl Directory</string>
</property>
@ -2309,7 +2312,7 @@ both here.</string>
<x>0</x>
<y>0</y>
<width>746</width>
<height>663</height>
<height>573</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_30">
@ -2557,88 +2560,13 @@ This is used for reverse ping analysis which is very useful
for assessing propagation and system performance.</string>
</property>
<property name="text">
<string>Enable spotting to reporting networks (JS8NET, PSKReporter, APRS-IS, etc)</string>
<string>Enable spotting to reporting networks (JS8NET, PSKReporter, etc)</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<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>APRS Server:</string>
</property>
<property name="buddy">
<cstring>udp_server_line_edit</cstring>
</property>
</widget>
</item>
<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="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Optional hostname of APRS server to send spots to.&lt;/p&gt;&lt;p&gt;Formats:&lt;/p&gt;&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;hostname&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;IPv4 address&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;IPv6 address&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;IPv4 multicast group address&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;IPv6 multicast group address&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Clearing this field will disable the spotting to APRS.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="inputMethodHints">
<set>Qt::ImhDigitsOnly</set>
</property>
<property name="text">
<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>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enter the service port number of the APRS server that should receive updates. If this is zero no updates will be broadcast.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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>
<item row="2" column="0">
<widget class="QLabel" name="label_16">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;APRS Server Passcode for Sending APRS Packets&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>APRS Passcode:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="aprs_passcode_line_edit"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
@ -2744,6 +2672,111 @@ for assessing propagation and system performance.</string>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QWidget" name="aprsForm" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="visible">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_36">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<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>APRS Server:</string>
</property>
<property name="buddy">
<cstring>udp_server_line_edit</cstring>
</property>
</widget>
</item>
<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="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Optional hostname of APRS server to send spots to.&lt;/p&gt;&lt;p&gt;Formats:&lt;/p&gt;&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;hostname&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;IPv4 address&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;IPv6 address&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;IPv4 multicast group address&lt;/li&gt;&lt;li style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;IPv6 multicast group address&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Clearing this field will disable the spotting to APRS.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="inputMethodHints">
<set>Qt::ImhDigitsOnly</set>
</property>
<property name="text">
<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>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enter the service port number of the APRS server that should receive updates. If this is zero no updates will be broadcast.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</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>
<item row="2" column="0">
<widget class="QLabel" name="label_16">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;APRS Server Passcode for Sending APRS Packets&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>APRS Passcode:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="aprs_passcode_line_edit"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_7">
<property name="orientation">
@ -2804,7 +2837,7 @@ for assessing propagation and system performance.</string>
<x>0</x>
<y>0</y>
<width>760</width>
<height>502</height>
<height>510</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_31">
@ -3141,7 +3174,7 @@ QListView::item:hover {
<x>0</x>
<y>0</y>
<width>760</width>
<height>502</height>
<height>510</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_35">
@ -4544,11 +4577,11 @@ soundcard changes</string>
</connections>
<buttongroups>
<buttongroup name="TX_mode_button_group"/>
<buttongroup name="PTT_method_button_group"/>
<buttongroup name="split_mode_button_group"/>
<buttongroup name="TX_audio_source_button_group"/>
<buttongroup name="CAT_handshake_button_group"/>
<buttongroup name="TX_audio_source_button_group"/>
<buttongroup name="PTT_method_button_group"/>
<buttongroup name="CAT_data_bits_button_group"/>
<buttongroup name="CAT_stop_bits_button_group"/>
<buttongroup name="split_mode_button_group"/>
</buttongroups>
</ui>

View File

@ -71,7 +71,6 @@ SOURCES += \
NetworkMessage.cpp \
MessageClient.cpp \
SelfDestructMessageBox.cpp \
APRSISClient.cpp \
messagereplydialog.cpp \
keyeater.cpp \
DriftingDateTime.cpp \
@ -113,7 +112,6 @@ HEADERS += qt_helpers.hpp \
NetworkMessage.hpp \
MessageClient.hpp \
SelfDestructMessageBox.h \
APRSISClient.h \
messagereplydialog.h \
keyeater.h \
DriftingDateTime.h \

View File

@ -32,7 +32,6 @@
#include <QUdpSocket>
#include <QVariant>
#include "APRSISClient.h"
#include "revision_utils.hpp"
#include "qt_helpers.hpp"
#include "NetworkAccessManager.hpp"
@ -438,7 +437,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
this}},
m_n3fjpClient { new TCPClient{this}},
m_spotClient { new SpotClient{m_messageClient, this}},
m_aprsClient {new APRSISClient{"rotate.aprs2.net", 14580, this}},
psk_Reporter {new PSK_Reporter {m_messageClient, this}},
m_i3bit {0},
m_manual {&m_network_manager},
@ -3117,12 +3115,8 @@ void MainWindow::prepareSpotting(){
if(m_config.spot_to_reporting_networks ()){
spotSetLocal();
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);
}
}
@ -5170,18 +5164,6 @@ void MainWindow::spotCmd(CommandDetail cmd){
m_spotClient->enqueueCmd(cmdStr, cmd.from, cmd.to, cmd.relayPath, cmd.text, cmd.grid, cmd.extra, m_freqNominal + cmd.freq, cmd.snr);
}
void MainWindow::spotAPRSMsg(CommandDetail d){
if(!m_config.spot_to_reporting_networks()) return;
if(!m_aprsClient->isPasscodeValid()) return;
// ONLY MSG IS APPROPRIATE HERE, e.g.,
// KN4CRD: @APRSIS MSG :EMAIL-2 :email@domain.com booya{
if(d.cmd != " MSG") return;
qDebug() << "enqueueing third party text" << d.from << d.text;
m_aprsClient->enqueueThirdParty(Radio::base_callsign(d.from), d.text);
}
void MainWindow::pskLogReport(QString mode, int offset, int snr, QString callsign, QString grid){
if(!m_config.spot_to_reporting_networks()) return;
@ -5196,33 +5178,6 @@ void MainWindow::pskLogReport(QString mode, int offset, int snr, QString callsig
QString::number(DriftingDateTime::currentDateTime().toTime_t()));
}
void MainWindow::aprsLogReport(int offset, int snr, QString callsign, QString grid){
if(!m_config.spot_to_reporting_networks()) return;
Frequency frequency = m_freqNominal + offset;
if(grid.length() < 6){
qDebug() << "APRSISClient Spot Skipped:" << callsign << grid;
return;
}
auto comment = QString("%1MHz %2dB").arg(Radio::frequency_MHz_string(frequency)).arg(Varicode::formatSNR(snr));
if(callsign.contains("/")){
comment = QString("%1 %2").arg(callsign).arg(comment);
}
auto base = Radio::base_callsign(callsign);
callsign = APRSISClient::replaceCallsignSuffixWithSSID(callsign, base);
if(m_aprsCallCache.contains(callsign)){
qDebug() << "APRSISClient Spot Skipped For Cache:" << callsign << grid;
return;
}
m_aprsClient->enqueueSpot(callsign, grid, comment);
m_aprsCallCache.insert(callsign, DriftingDateTime::currentDateTimeUtc());
}
void MainWindow::killFile ()
{
if (m_fnameWE.size () &&
@ -6664,11 +6619,6 @@ bool MainWindow::ensureCreateMessageReady(const QString &text){
return false;
}
if(text.contains("@APRSIS") && !m_aprsClient->isPasscodeValid()){
MessageBox::warning_message(this, tr ("Please ensure a valid APRS passcode is set in the settings when sending to the @APRSIS group."));
return false;
}
return true;
}
@ -7772,7 +7722,6 @@ void MainWindow::band_changed (Frequency f)
m_bandEdited = false;
psk_Reporter->sendReport(); // Upload any queued spots before changing band
m_aprsClient->sendReports();
if (!m_transmitting) monitor (true);
if ("FreqCal" == m_mode)
{
@ -9501,7 +9450,6 @@ void MainWindow::handle_transceiver_update (Transceiver::TransceiverState const&
if (m_config.spot_to_reporting_networks ()) {
spotSetLocal();
pskSetLocal();
aprsSetLocal();
}
statusChanged();
m_wideGraph->setDialFreq(m_freqNominal / 1.e6);
@ -9661,19 +9609,6 @@ void MainWindow::pskSetLocal ()
psk_Reporter->setLocalStation(m_config.my_callsign (), m_config.my_grid (), info, QString {"JS8Call v" + version() }.simplified ());
}
void MainWindow::aprsSetLocal ()
{
auto call = m_config.my_callsign();
auto base = Radio::base_callsign(call);
auto grid = m_config.my_grid();
auto passcode = m_config.aprs_passcode();
call = APRSISClient::replaceCallsignSuffixWithSSID(call, base);
qDebug() << "APRSISClient Set Local Station:" << call << grid << passcode;
m_aprsClient->setLocalStation(call, grid, passcode);
}
void MainWindow::transmitDisplay (bool transmitting)
{
ui->monitorTxButton->setChecked(transmitting);
@ -10833,25 +10768,15 @@ void MainWindow::processCommandActivity() {
cd.tdrift = d.tdrift;
cd.submode = d.submode;
if(d.to == "@APRSIS"){
m_aprsCallCache.remove(cd.call);
m_aprsCallCache.remove(APRSISClient::replaceCallsignSuffixWithSSID(cd.call, Radio::base_callsign(cd.call)));
}
logCallActivity(cd, true);
}
}
// PROCESS @JS8NET SPOTS FOR EVERYONE
if (d.to == "@JS8NET"){
// PROCESS @JS8NET AND @APRSIS SPOTS FOR EVERYONE
if (d.to == "@JS8NET" || d.to == "@APRSIS"){
spotCmd(d);
}
// PROCESS @APRSIS MSG SPOTS FOR EVERYONE
if (d.to == "@APRSIS"){
spotAPRSMsg(d);
}
// PREPARE CMD TEXT STRING
QStringList textList = {
QString("%1: %2%3").arg(d.from).arg(d.to).arg(d.cmd)
@ -11669,7 +11594,6 @@ void MainWindow::processSpots() {
spotReport(d.freq, d.snr, d.call, d.grid);
pskLogReport("JS8", d.freq, d.snr, d.call, d.grid);
aprsLogReport(d.freq, d.snr, d.call, d.grid);
sendNetworkMessage("RX.SPOT", "", {
{"DIAL", QVariant(dial)},

View File

@ -46,7 +46,6 @@
#include "MessageClient.hpp"
#include "TCPClient.h"
#include "SpotClient.h"
#include "APRSISClient.h"
#include "keyeater.h"
#include "NotificationAudio.h"
@ -840,7 +839,6 @@ private:
QMap<int, MessageBuffer> m_messageBuffer; // freq -> (cmd, [frames, ...])
int m_lastClosedMessageBufferOffset;
QMap<QString, CallDetail> m_callActivity; // call -> (last freq, last timestamp)
QMap<QString, QDateTime> m_aprsCallCache;
QMap<QString, QSet<QString>> m_heardGraphOutgoing; // callsign -> [stations who've this callsign has heard]
QMap<QString, QSet<QString>> m_heardGraphIncoming; // callsign -> [stations who've heard this callsign]
@ -917,7 +915,6 @@ private:
TCPClient * m_n3fjpClient;
PSK_Reporter *psk_Reporter;
SpotClient *m_spotClient;
APRSISClient * m_aprsClient;
DisplayManual m_manual;
QHash<QString, QVariant> m_pwrBandTxMemory; // Remembers power level by band
QHash<QString, QVariant> m_pwrBandTuneMemory; // Remembers power level by band for tuning
@ -950,12 +947,9 @@ private:
void rigFailure (QString const& reason);
void spotSetLocal();
void pskSetLocal ();
void aprsSetLocal ();
void spotReport(int offset, int snr, QString callsign, QString grid);
void spotCmd(CommandDetail cmd);
void spotAPRSMsg(CommandDetail d);
void pskLogReport(QString mode, int offset, int snr, QString callsign, QString grid);
void aprsLogReport(int offset, int snr, QString callsign, QString grid);
Radio::Frequency dialFrequency();
void setSubmode(int submode);
int submodeNameToSubmode(QString speed);