Added N3FJP logging integration natively. Added selected text in the RX window to be placed in the comments of the log window.
This commit is contained in:
parent
219d434006
commit
f304d3c6e1
@ -180,6 +180,7 @@ set (wsjt_qt_CXXSRCS
|
||||
NetworkMessage.cpp
|
||||
Message.cpp
|
||||
MessageClient.cpp
|
||||
TCPClient.cpp
|
||||
LettersSpinBox.cpp
|
||||
HintedSpinBox.cpp
|
||||
RestrictedSpinBox.cpp
|
||||
|
@ -674,13 +674,12 @@ private:
|
||||
|
||||
QString udp_server_name_;
|
||||
port_type udp_server_port_;
|
||||
// QString n1mm_server_name () const;
|
||||
QString n3fjp_server_name_;
|
||||
port_type n3fjp_server_port_;
|
||||
bool broadcast_to_n3fjp_;
|
||||
QString n1mm_server_name_;
|
||||
port_type n1mm_server_port_;
|
||||
bool broadcast_to_n1mm_;
|
||||
// port_type n1mm_server_port () const;
|
||||
// bool valid_n1mm_info () const;
|
||||
// bool broadcast_to_n1mm() const;
|
||||
bool accept_udp_requests_;
|
||||
bool udpWindowToFront_;
|
||||
bool udpWindowRestore_;
|
||||
@ -823,6 +822,9 @@ QString Configuration::aprs_passcode() const { return m_->aprs_passcode_; }
|
||||
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_;}
|
||||
QString Configuration::n3fjp_server_name () const {return m_->n3fjp_server_name_;}
|
||||
auto Configuration::n3fjp_server_port () const -> port_type {return m_->n3fjp_server_port_;}
|
||||
bool Configuration::broadcast_to_n3fjp () const {return m_->broadcast_to_n3fjp_;}
|
||||
QString Configuration::n1mm_server_name () const {return m_->n1mm_server_name_;}
|
||||
auto Configuration::n1mm_server_port () const -> port_type {return m_->n1mm_server_port_;}
|
||||
bool Configuration::broadcast_to_n1mm () const {return m_->broadcast_to_n1mm_;}
|
||||
@ -953,6 +955,15 @@ void Configuration::sync_transceiver (bool force_signal, bool enforce_mode_and_s
|
||||
}
|
||||
}
|
||||
|
||||
bool Configuration::valid_n3fjp_info () const
|
||||
{
|
||||
// do very rudimentary checking on the n3fjp server name and port number.
|
||||
//
|
||||
auto server_name = m_->n3fjp_server_name_;
|
||||
auto port_number = m_->n3fjp_server_port_;
|
||||
return(!(server_name.trimmed().isEmpty() || port_number == 0));
|
||||
}
|
||||
|
||||
bool Configuration::valid_n1mm_info () const
|
||||
{
|
||||
// do very rudimentary checking on the n1mm server name and port number.
|
||||
@ -1200,10 +1211,13 @@ Configuration::impl::impl (Configuration * self, QDir const& temp_directory,
|
||||
setUppercase(ui_->groups_line_edit);
|
||||
setUppercase(ui_->auto_whitelist_line_edit);
|
||||
|
||||
ui_->udp_server_port_spin_box->setMinimum (1);
|
||||
ui_->udp_server_port_spin_box->setMinimum (0);
|
||||
ui_->udp_server_port_spin_box->setMaximum (std::numeric_limits<port_type>::max ());
|
||||
|
||||
ui_->n1mm_server_port_spin_box->setMinimum (1);
|
||||
ui_->n3fjp_server_port_spin_box->setMinimum (0);
|
||||
ui_->n3fjp_server_port_spin_box->setMaximum (std::numeric_limits<port_type>::max ());
|
||||
|
||||
ui_->n1mm_server_port_spin_box->setMinimum (0);
|
||||
ui_->n1mm_server_port_spin_box->setMaximum (std::numeric_limits<port_type>::max ());
|
||||
|
||||
//
|
||||
@ -1487,6 +1501,9 @@ void Configuration::impl::initialize_models ()
|
||||
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_);
|
||||
ui_->n3fjp_server_name_line_edit->setText (n3fjp_server_name_);
|
||||
ui_->n3fjp_server_port_spin_box->setValue (n3fjp_server_port_);
|
||||
ui_->enable_n3fjp_broadcast_check_box->setChecked (broadcast_to_n3fjp_);
|
||||
ui_->n1mm_server_name_line_edit->setText (n1mm_server_name_);
|
||||
ui_->n1mm_server_port_spin_box->setValue (n1mm_server_port_);
|
||||
ui_->enable_n1mm_broadcast_check_box->setChecked (broadcast_to_n1mm_);
|
||||
@ -1783,6 +1800,9 @@ void Configuration::impl::read_settings ()
|
||||
aprs_passcode_ = settings_->value ("aprsPasscode", "").toString();
|
||||
udp_server_name_ = settings_->value ("UDPServer", "127.0.0.1").toString ();
|
||||
udp_server_port_ = settings_->value ("UDPServerPort", 2237).toUInt ();
|
||||
n3fjp_server_name_ = settings_->value ("N3FJPServer", "127.0.0.1").toString ();
|
||||
n3fjp_server_port_ = settings_->value ("N3FJPServerPort", 1100).toUInt ();
|
||||
broadcast_to_n3fjp_ = settings_->value ("BroadcastToN3FJP", false).toBool ();
|
||||
n1mm_server_name_ = settings_->value ("N1MMServer", "127.0.0.1").toString ();
|
||||
n1mm_server_port_ = settings_->value ("N1MMServerPort", 2333).toUInt ();
|
||||
broadcast_to_n1mm_ = settings_->value ("BroadcastToN1MM", false).toBool ();
|
||||
@ -1929,6 +1949,9 @@ void Configuration::impl::write_settings ()
|
||||
settings_->setValue ("aprsPasscode", aprs_passcode_);
|
||||
settings_->setValue ("UDPServer", udp_server_name_);
|
||||
settings_->setValue ("UDPServerPort", udp_server_port_);
|
||||
settings_->setValue ("N3FJPServer", n3fjp_server_name_);
|
||||
settings_->setValue ("N3FJPServerPort", n3fjp_server_port_);
|
||||
settings_->setValue ("BroadcastToN3FJP", broadcast_to_n3fjp_);
|
||||
settings_->setValue ("N1MMServer", n1mm_server_name_);
|
||||
settings_->setValue ("N1MMServerPort", n1mm_server_port_);
|
||||
settings_->setValue ("BroadcastToN1MM", broadcast_to_n1mm_);
|
||||
@ -2482,6 +2505,12 @@ void Configuration::impl::accept ()
|
||||
}
|
||||
|
||||
accept_udp_requests_ = ui_->accept_udp_requests_check_box->isChecked ();
|
||||
auto new_n3fjp_server = ui_->n3fjp_server_name_line_edit->text ();
|
||||
n3fjp_server_name_ = new_n3fjp_server;
|
||||
auto new_n3fjp_port = ui_->n3fjp_server_port_spin_box->value ();
|
||||
n3fjp_server_port_ = new_n3fjp_port;
|
||||
broadcast_to_n3fjp_ = ui_->enable_n3fjp_broadcast_check_box->isChecked ();
|
||||
|
||||
auto new_n1mm_server = ui_->n1mm_server_name_line_edit->text ();
|
||||
n1mm_server_name_ = new_n1mm_server;
|
||||
auto new_n1mm_port = ui_->n1mm_server_port_spin_box->value ();
|
||||
|
@ -176,6 +176,10 @@ public:
|
||||
port_type n1mm_server_port () const;
|
||||
bool valid_n1mm_info () const;
|
||||
bool broadcast_to_n1mm() const;
|
||||
QString n3fjp_server_name () const;
|
||||
port_type n3fjp_server_port () const;
|
||||
bool valid_n3fjp_info () const;
|
||||
bool broadcast_to_n3fjp() const;
|
||||
bool accept_udp_requests () const;
|
||||
bool udpWindowToFront () const;
|
||||
bool udpWindowRestore () const;
|
||||
|
164
Configuration.ui
164
Configuration.ui
@ -23,7 +23,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">
|
||||
@ -62,8 +62,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>738</width>
|
||||
<height>453</height>
|
||||
<width>587</width>
|
||||
<height>303</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
@ -2155,7 +2155,7 @@ both here.</string>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>746</width>
|
||||
<height>525</height>
|
||||
<height>663</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_30">
|
||||
@ -2179,7 +2179,42 @@ both here.</string>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_14">
|
||||
<item row="0" column="3">
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="report_in_comments_check_box">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Some logging programs will not accept the type of reports
|
||||
saved by this program.
|
||||
Check this option to save the sent and received reports in the
|
||||
comments field.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>d&B reports to comments</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="clear_callsign_check_box">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Check this option to force deselect callsign after logging.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Deselect callsign after logging</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>Operator Callsign (if different than Station Callsign):</string>
|
||||
@ -2202,23 +2237,7 @@ both here.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="clear_callsign_check_box">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Check this option to force deselect callsign after logging.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Deselect callsign after logging</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<item row="0" column="3">
|
||||
<widget class="QLineEdit" name="opCallEntry">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html></string>
|
||||
@ -2238,41 +2257,6 @@ both here.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="report_in_comments_check_box">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Some logging programs will not accept the type of reports
|
||||
saved by this program.
|
||||
Check this option to save the sent and received reports in the
|
||||
comments field.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>d&B reports to comments</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="visible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
@ -2409,8 +2393,8 @@ comments field.</string>
|
||||
<property name="title">
|
||||
<string>Network Services</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_14">
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="psk_reporter_check_box">
|
||||
<property name="toolTip">
|
||||
<string>The program can send your station details and all
|
||||
@ -2426,7 +2410,7 @@ for assessing propagation and system performance.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QFormLayout" name="formLayout_17">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
||||
@ -2504,10 +2488,58 @@ for assessing propagation and system performance.</string>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_11">
|
||||
<property name="title">
|
||||
<string>N3FJP Logger</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_12">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="enable_n3fjp_broadcast_check_box">
|
||||
<property name="text">
|
||||
<string>Enable sending logged contacts to N3FJP logging software</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QFormLayout" name="formLayout_20">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="n3fjp_server_name_label">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>N3FJP Server:</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="n3fjp_server_name_line_edit">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Optional host name of N3FJP software to receive logged contacts. This is usually 'localhost' or ip address 127.0.0.1</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 broadcasting of ADIF information via UDP.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="n3fjp_server_port_label">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>N3FJP Server Port:</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="n3fjp_server_port_spin_box">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Enter the port number that should be used for N3FJP log information. For N3FJP, this value should be 1100. If this is zero, no contacts will be sent.</p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="n1mm_group_box">
|
||||
<property name="title">
|
||||
<string>N1MM Logger+ Broadcasts</string>
|
||||
<string>N1MM Logger</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_15">
|
||||
<property name="fieldGrowthPolicy">
|
||||
@ -2519,7 +2551,7 @@ for assessing propagation and system performance.</string>
|
||||
<string><html><head/><body><p>When checked, the app will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable logged contact ADIF broadcast</string>
|
||||
<string>Enable sending logged contacts to N1MM logging software</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -4258,12 +4290,12 @@ soundcard changes</string>
|
||||
</connection>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="CAT_stop_bits_button_group"/>
|
||||
<buttongroup name="CAT_data_bits_button_group"/>
|
||||
<buttongroup name="PTT_method_button_group"/>
|
||||
<buttongroup name="TX_audio_source_button_group"/>
|
||||
<buttongroup name="TX_mode_button_group"/>
|
||||
<buttongroup name="CAT_handshake_button_group"/>
|
||||
<buttongroup name="CAT_data_bits_button_group"/>
|
||||
<buttongroup name="split_mode_button_group"/>
|
||||
<buttongroup name="CAT_handshake_button_group"/>
|
||||
<buttongroup name="CAT_stop_bits_button_group"/>
|
||||
<buttongroup name="TX_mode_button_group"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
81
TCPClient.cpp
Normal file
81
TCPClient.cpp
Normal file
@ -0,0 +1,81 @@
|
||||
#include "TCPClient.h"
|
||||
|
||||
#include <QTcpSocket>
|
||||
#include <QDebug>
|
||||
|
||||
#include "pimpl_impl.hpp"
|
||||
|
||||
#include "moc_TCPClient.cpp"
|
||||
|
||||
|
||||
class TCPClient::impl
|
||||
: public QTcpSocket
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
using port_type = quint16;
|
||||
|
||||
impl (TCPClient * self)
|
||||
: self_ {self}
|
||||
{
|
||||
}
|
||||
|
||||
~impl ()
|
||||
{
|
||||
}
|
||||
|
||||
bool isConnected(QString host, port_type port){
|
||||
if(host_ != host || port_ != port){
|
||||
disconnectFromHost();
|
||||
return false;
|
||||
}
|
||||
return state() == QTcpSocket::ConnectedState ;
|
||||
}
|
||||
|
||||
void connectToHost(QString host, port_type port){
|
||||
host_ = host;
|
||||
port_ = port;
|
||||
|
||||
QTcpSocket::connectToHost(host_, port_);
|
||||
}
|
||||
|
||||
qint64 send(QByteArray const &message, bool crlf){
|
||||
return write(message + (crlf ? "\r\f" : ""));
|
||||
}
|
||||
|
||||
TCPClient * self_;
|
||||
QString host_;
|
||||
port_type port_;
|
||||
};
|
||||
|
||||
#include "TCPClient.moc"
|
||||
|
||||
TCPClient::TCPClient(QObject *parent) : QObject(parent)
|
||||
, m_ {this}
|
||||
{
|
||||
}
|
||||
|
||||
bool TCPClient::ensureConnected(QString host, port_type port, int msecs){
|
||||
if(!m_->isConnected(host, port)){
|
||||
//qDebug() << "connecting to" << host << port;
|
||||
m_->connectToHost(host, port);
|
||||
}
|
||||
|
||||
return m_->waitForConnected(msecs);
|
||||
}
|
||||
|
||||
bool TCPClient::sendNetworkMessage(QString host, port_type port, QByteArray const &message, bool crlf){
|
||||
if(!ensureConnected(host, port)){
|
||||
return false;
|
||||
}
|
||||
|
||||
//qDebug() << "connecting to" << host << port;
|
||||
qint64 n = m_->send(message, crlf);
|
||||
if(n <= 0){
|
||||
return false;
|
||||
}
|
||||
|
||||
//qDebug() << "sent" << n << "bytes" << message;
|
||||
return m_->flush();
|
||||
}
|
28
TCPClient.h
Normal file
28
TCPClient.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef TCPCLIENT_H
|
||||
#define TCPCLIENT_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTcpSocket>
|
||||
|
||||
#include "pimpl_h.hpp"
|
||||
|
||||
class TCPClient : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
using port_type = quint16;
|
||||
|
||||
explicit TCPClient(QObject *parent = nullptr);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
Q_SLOT bool ensureConnected(QString host, port_type port, int msecs = 5000);
|
||||
Q_SLOT bool sendNetworkMessage(QString host, port_type port, QByteArray const &message, bool crlf=true);
|
||||
|
||||
private:
|
||||
class impl;
|
||||
pimpl<impl> m_;
|
||||
};
|
||||
|
||||
#endif // TCPCLIENT_H
|
@ -82,7 +82,8 @@ SOURCES += \
|
||||
Message.cpp \
|
||||
Inbox.cpp \
|
||||
messagewindow.cpp \
|
||||
SpotClient.cpp
|
||||
SpotClient.cpp \
|
||||
TCPClient.cpp
|
||||
|
||||
HEADERS += qt_helpers.hpp \
|
||||
pimpl_h.hpp pimpl_impl.hpp \
|
||||
@ -115,7 +116,8 @@ HEADERS += qt_helpers.hpp \
|
||||
Message.h \
|
||||
Inbox.h \
|
||||
messagewindow.h \
|
||||
SpotClient.h
|
||||
SpotClient.h \
|
||||
TCPClient.h
|
||||
|
||||
|
||||
INCLUDEPATH += qmake_only
|
||||
|
@ -55,7 +55,7 @@ void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString
|
||||
QString const& rptSent, QString const& rptRcvd,
|
||||
QDateTime const& dateTimeOn, QDateTime const& dateTimeOff,
|
||||
Radio::Frequency dialFreq, QString const& myCall, QString const& myGrid,
|
||||
bool toDATA, bool dBtoComments, bool bFox, QString const& opCall)
|
||||
bool toDATA, bool dBtoComments, bool bFox, QString const& opCall, QString const& comments)
|
||||
{
|
||||
if(!isHidden()) return;
|
||||
ui->call->setText(hisCall);
|
||||
@ -69,6 +69,9 @@ void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString
|
||||
if(rptRcvd!="") t+=" Rcvd: " + rptRcvd;
|
||||
ui->comments->setText(t);
|
||||
}
|
||||
if(!comments.isEmpty()){
|
||||
ui->comments->setText(comments);
|
||||
}
|
||||
if(toDATA) mode="DATA";
|
||||
ui->mode->setText(mode);
|
||||
ui->sent->setText(rptSent);
|
||||
|
2
logqso.h
2
logqso.h
@ -33,7 +33,7 @@ public:
|
||||
QString const& rptSent, QString const& rptRcvd, QDateTime const& dateTimeOn,
|
||||
QDateTime const& dateTimeOff,
|
||||
Radio::Frequency dialFreq, QString const& myCall, QString const& myGrid,
|
||||
bool toDATA, bool dBtoComments, bool bFox, QString const& opCall);
|
||||
bool toDATA, bool dBtoComments, bool bFox, QString const& opCall, const QString &comments);
|
||||
|
||||
public slots:
|
||||
void accept();
|
||||
|
@ -564,6 +564,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
||||
version (), revision (),
|
||||
m_config.udp_server_name (), m_config.udp_server_port (),
|
||||
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}},
|
||||
@ -6587,11 +6588,13 @@ void MainWindow::on_logQSOButton_clicked() //Log QSO button
|
||||
if(m_callActivity.contains(call)){
|
||||
grid = m_callActivity[call].grid;
|
||||
}
|
||||
|
||||
QString comments = ui->textEditRX->textCursor().selectedText();
|
||||
m_logDlg->initLogQSO (call.trimmed(), grid.trimmed(), m_modeTx == "FT8" ? "JS8" : m_modeTx, m_rptSent, m_rptRcvd,
|
||||
m_dateTimeQSOOn, dateTimeQSOOff, m_freqNominal + ui->TxFreqSpinBox->value(),
|
||||
m_config.my_callsign(), m_config.my_grid(),
|
||||
m_config.log_as_DATA(), m_config.report_in_comments(),
|
||||
m_config.bFox(), m_opCall);
|
||||
m_config.bFox(), m_opCall, comments);
|
||||
}
|
||||
|
||||
void MainWindow::acceptQSO (QDateTime const& QSO_date_off, QString const& call, QString const& grid
|
||||
@ -6604,23 +6607,64 @@ void MainWindow::acceptQSO (QDateTime const& QSO_date_off, QString const& call,
|
||||
QString date = QSO_date_on.toString("yyyyMMdd");
|
||||
m_logBook.addAsWorked (m_hisCall, m_config.bands ()->find (m_freqNominal), mode, submode, date, name, comments);
|
||||
|
||||
sendNetworkMessage("LOG.QSO", QString(ADIF), {
|
||||
{"UTC.ON", QVariant(QSO_date_on.toMSecsSinceEpoch())},
|
||||
{"UTC.OFF", QVariant(QSO_date_off.toMSecsSinceEpoch())},
|
||||
{"CALL", QVariant(call)},
|
||||
{"GRID", QVariant(grid)},
|
||||
{"FREQ", QVariant(dial_freq)},
|
||||
{"MODE", QVariant(mode)},
|
||||
{"SUBMODE", QVariant(submode)},
|
||||
{"RPT.SENT", QVariant(rpt_sent)},
|
||||
{"RPT.RECV", QVariant(rpt_received)},
|
||||
{"NAME", QVariant(name)},
|
||||
{"COMMENTS", QVariant(comments)},
|
||||
{"STATION.OP", QVariant(operator_call)},
|
||||
{"STATION.CALL", QVariant(my_call)},
|
||||
{"STATION.GRID", QVariant(my_grid)}
|
||||
});
|
||||
if(m_config.udpEnabled()){
|
||||
sendNetworkMessage("LOG.QSO", QString(ADIF), {
|
||||
{"UTC.ON", QVariant(QSO_date_on.toMSecsSinceEpoch())},
|
||||
{"UTC.OFF", QVariant(QSO_date_off.toMSecsSinceEpoch())},
|
||||
{"CALL", QVariant(call)},
|
||||
{"GRID", QVariant(grid)},
|
||||
{"FREQ", QVariant(dial_freq)},
|
||||
{"MODE", QVariant(mode)},
|
||||
{"SUBMODE", QVariant(submode)},
|
||||
{"RPT.SENT", QVariant(rpt_sent)},
|
||||
{"RPT.RECV", QVariant(rpt_received)},
|
||||
{"NAME", QVariant(name)},
|
||||
{"COMMENTS", QVariant(comments)},
|
||||
{"STATION.OP", QVariant(operator_call)},
|
||||
{"STATION.CALL", QVariant(my_call)},
|
||||
{"STATION.GRID", QVariant(my_grid)}
|
||||
});
|
||||
}
|
||||
|
||||
if(m_config.broadcast_to_n3fjp() && m_config.valid_n3fjp_info()){
|
||||
QString data = QString(
|
||||
"<CMD>"
|
||||
"<ADDDIRECT>"
|
||||
"<EXCLUDEDUPES>TRUE</EXCLUDEDUPES>"
|
||||
"<STAYOPEN>FALSE</STAYOPEN>"
|
||||
"<fldDateStr>%1</fldDateStr>"
|
||||
"<fldTimeOnStr>%2</fldTimeOnStr>"
|
||||
"<fldCall>%3</fldCall>"
|
||||
"<fldGrid>%4</fldGrid>"
|
||||
"<fldBand>%5</fldBand>"
|
||||
"<fldFrequency>%6</fldFrequency>"
|
||||
"<fldMode>JS8</fldMode>"
|
||||
"<fldOperator>%7</fldOperator>"
|
||||
"<fldNameR>%8</fldNameR>"
|
||||
"<fldComments>%9</fldComments>"
|
||||
"</CMD>");
|
||||
|
||||
data = data.arg(QSO_date_on.toString("yyyy/MM/dd"));
|
||||
data = data.arg(QSO_date_on.toString("H:mm"));
|
||||
data = data.arg(call);
|
||||
data = data.arg(grid);
|
||||
data = data.arg(m_config.bands ()->find(dial_freq).replace("m", ""));
|
||||
data = data.arg(Radio::frequency_MHz_string(dial_freq));
|
||||
data = data.arg(operator_call);
|
||||
data = data.arg(name);
|
||||
data = data.arg(comments);
|
||||
|
||||
auto host = m_config.n3fjp_server_name();
|
||||
auto port = m_config.n3fjp_server_port();
|
||||
|
||||
m_n3fjpClient->sendNetworkMessage(host, port, data.toLocal8Bit());
|
||||
|
||||
QTimer::singleShot(1000, this, [this, host, port](){
|
||||
m_n3fjpClient->sendNetworkMessage(host, port, "<CMD><CHECKLOG></CMD>");
|
||||
});
|
||||
}
|
||||
|
||||
// reload the logbook data
|
||||
m_logBook.init();
|
||||
|
||||
if (m_config.clear_callsign ()){
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include "qpriorityqueue.h"
|
||||
#include "varicode.h"
|
||||
#include "MessageClient.hpp"
|
||||
#include "TCPClient.h"
|
||||
#include "SpotClient.h"
|
||||
#include "APRSISClient.h"
|
||||
#include "keyeater.h"
|
||||
@ -903,6 +904,7 @@ private:
|
||||
int m_firstDecode;
|
||||
QProgressDialog m_optimizingProgress;
|
||||
MessageClient * m_messageClient;
|
||||
TCPClient * m_n3fjpClient;
|
||||
PSK_Reporter *psk_Reporter;
|
||||
SpotClient *m_spotClient;
|
||||
APRSISClient * m_aprsClient;
|
||||
|
Loading…
Reference in New Issue
Block a user