diff --git a/MessageClient.cpp b/MessageClient.cpp index 80a14fe75..799179ab7 100644 --- a/MessageClient.cpp +++ b/MessageClient.cpp @@ -441,7 +441,7 @@ void MessageClient::qso_logged (QDateTime time_off, QString const& dx_call, QStr NetworkMessage::Builder out {&message, NetworkMessage::QSOLogged, m_->id_, m_->schema_}; out << time_off << dx_call.toUtf8 () << dx_grid.toUtf8 () << dial_frequency << mode.toUtf8 () << report_sent.toUtf8 () << report_received.toUtf8 () << tx_power.toUtf8 () << comments.toUtf8 () - << name.toUtf8 () << time_on << operator_call; + << name.toUtf8 () << time_on << operator_call.toUtf8 (); m_->send_message (out, message); } } diff --git a/MessageServer.cpp b/MessageServer.cpp index 39b4b1d5b..e6e100762 100644 --- a/MessageServer.cpp +++ b/MessageServer.cpp @@ -291,14 +291,15 @@ void MessageServer::impl::parse_message (QHostAddress const& sender, port_type s QByteArray comments; QByteArray name; QDateTime time_on; // Note: LOTW uses TIME_ON for their +/- 30-minute time window + QByteArray operator_call; in >> time_off >> dx_call >> dx_grid >> dial_frequency >> mode >> report_sent >> report_received - >> tx_power >> comments >> name >> time_on; + >> tx_power >> comments >> name >> time_on >> operator_call; if (check_status (in) != Fail) { Q_EMIT self_->qso_logged (id, time_off, QString::fromUtf8 (dx_call), QString::fromUtf8 (dx_grid) , dial_frequency, QString::fromUtf8 (mode), QString::fromUtf8 (report_sent) , QString::fromUtf8 (report_received), QString::fromUtf8 (tx_power) - , QString::fromUtf8 (comments), QString::fromUtf8 (name), time_on); + , QString::fromUtf8 (comments), QString::fromUtf8 (name), time_on, QString::fromUtf8 (operator_call)); } } break; diff --git a/MessageServer.hpp b/MessageServer.hpp index f78d07d16..83fb4ff83 100644 --- a/MessageServer.hpp +++ b/MessageServer.hpp @@ -77,7 +77,7 @@ public: Q_SIGNAL void qso_logged (QString const& id, QDateTime time_off, QString const& dx_call, QString const& dx_grid , Frequency dial_frequency, QString const& mode, QString const& report_sent , QString const& report_received, QString const& tx_power, QString const& comments - , QString const& name, QDateTime time_on); + , QString const& name, QDateTime time_on, QString const& operator_call); Q_SIGNAL void clear_decodes (QString const& id); // this signal is emitted when a network error occurs diff --git a/UDPExamples/UDPDaemon.cpp b/UDPExamples/UDPDaemon.cpp index 2d3b1b2d9..731f31661 100644 --- a/UDPExamples/UDPDaemon.cpp +++ b/UDPExamples/UDPDaemon.cpp @@ -95,6 +95,24 @@ public: } } + Q_SLOT void qso_logged (QString const&client_id, QDateTime time_off, QString const& dx_call, QString const& dx_grid + , Frequency dial_frequency, QString const& mode, QString const& report_sent + , QString const& report_received, QString const& tx_power + , QString const& comments, QString const& name, QDateTime time_on, QString const& operator_call) + { + if (client_id == id_) + { + qDebug () << "time_on:" << time_on << "time_off:" << time_off << "dx_call:" << dx_call << "grid:" << dx_grid + << "freq:" << dial_frequency << "mode:" << mode << "rpt_sent:" << report_sent + << "rpt_rcvd:" << report_received << "Tx_pwr:" << tx_power << "comments:" << comments + << "name:" << name << "operator_call:" << operator_call; + std::cout << tr ("%1: Logged %2 grid: %3 power: %4 sent: %5 recd: %6 freq: %7 op: %8").arg (id_) + .arg (dx_call).arg (dx_grid).arg (tx_power).arg (report_sent).arg (report_received).arg (dial_frequency).arg (operator_call).toStdString () + << tr (" @ %1").arg (time_off.toString("yyyy-MM-dd hh:mm:ss.z")).toStdString() + << std::endl; + } + } + private: QString id_; Frequency dial_frequency_; @@ -127,6 +145,7 @@ private: connect (server_, &MessageServer::status_update, client, &Client::update_status); connect (server_, &MessageServer::decode, client, &Client::decode_added); connect (server_, &MessageServer::WSPR_decode, client, &Client::beacon_spot_added); + connect (server_, &MessageServer::qso_logged, client, &Client::qso_logged); clients_[id] = client; server_->replay (id); std::cout << "Discovered WSJT-X instance: " << id.toStdString (); diff --git a/logbook/adif.cpp b/logbook/adif.cpp index 3184ed3a4..31cd39a9d 100644 --- a/logbook/adif.cpp +++ b/logbook/adif.cpp @@ -175,7 +175,7 @@ int ADIF::getCount() const } QString ADIF::QSOToADIF(QString const& hisCall, QString const& hisGrid, QString const& mode, QString const& rptSent, QString const& rptRcvd, QDateTime const& dateTimeOn, QDateTime const& dateTimeOff, QString const& band, - QString const& comments, QString const& name, QString const& strDialFreq, QString const& m_myCall, QString const& m_myGrid, QString const& m_txPower) + QString const& comments, QString const& name, QString const& strDialFreq, QString const& m_myCall, QString const& m_myGrid, QString const& m_txPower, QString const& operator_call) { QString t; t = "" + hisCall; @@ -202,6 +202,9 @@ QString ADIF::QSOToADIF(QString const& hisCall, QString const& hisGrid, QString if (name != "") t += " " + name; + if (operator_call!="") + t+=" " + operator_call; t += " "; return t; } @@ -222,7 +225,7 @@ bool ADIF::addQSOToFile(QString const& hisCall, QString const& hisGrid, QString QString t; t = QSOToADIF(hisCall,hisGrid,mode,rptSent,rptRcvd,dateTimeOn,dateTimeOff, - band,comments,name,strDialFreq,m_myCall,m_myGrid,m_txPower); + band,comments,name,strDialFreq,m_myCall,m_myGrid,m_txPower,operator_call); out << t << endl; f2.close(); } diff --git a/logbook/adif.h b/logbook/adif.h index f19712355..2c82c2144 100644 --- a/logbook/adif.h +++ b/logbook/adif.h @@ -30,10 +30,10 @@ class ADIF // open ADIF file and append the QSO details. Return true on success bool addQSOToFile(QString const& hisCall, QString const& hisGrid, QString const& mode, QString const& rptSent, QString const& rptRcvd, QDateTime const& dateTimeOn, QDateTime const& dateTimeOff, QString const& band, - QString const& comments, QString const& name, QString const& strDialFreq, QString const& m_myCall, QString const& m_myGrid, QString const& m_txPower,QString const& operator_call); + QString const& comments, QString const& name, QString const& strDialFreq, QString const& m_myCall, QString const& m_myGrid, QString const& m_txPower, QString const& operator_call); QString QSOToADIF(QString const& hisCall, QString const& hisGrid, QString const& mode, QString const& rptSent, QString const& rptRcvd, QDateTime const& dateTimeOn, QDateTime const& dateTimeOff, QString const& band, - QString const& comments, QString const& name, QString const& strDialFreq, QString const& m_myCall, QString const& m_myGrid, QString const& m_txPower); + QString const& comments, QString const& name, QString const& strDialFreq, QString const& m_myCall, QString const& m_myGrid, QString const& m_txPower, QString const& operator_call); private: diff --git a/logqso.cpp b/logqso.cpp index ea926bd95..c0c7572d6 100644 --- a/logqso.cpp +++ b/logqso.cpp @@ -116,7 +116,7 @@ void LogQSO::accept() ADIF adifile; auto adifilePath = QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("wsjtx_log.adi"); adifile.init(adifilePath); - // TODO add the operator to this + if (!adifile.addQSOToFile(hisCall,hisGrid,mode,rptSent,rptRcvd,m_dateTimeOn,m_dateTimeOff,band,comments,name,strDialFreq,m_myCall,m_myGrid,m_txPower, operator_call)) { MessageBox::warning_message (this, tr ("Log file error"), @@ -125,7 +125,7 @@ void LogQSO::accept() // Log to N1MM Logger if (m_config->broadcast_to_n1mm() && m_config->valid_n1mm_info()) { - QString adif = adifile.QSOToADIF(hisCall,hisGrid,mode,rptSent,rptRcvd,m_dateTimeOn,m_dateTimeOff,band,comments,name,strDialFreq,m_myCall,m_myGrid,m_txPower); + QString adif = adifile.QSOToADIF(hisCall,hisGrid,mode,rptSent,rptRcvd,m_dateTimeOn,m_dateTimeOff,band,comments,name,strDialFreq,m_myCall,m_myGrid,m_txPower, operator_call); const QHostAddress n1mmhost = QHostAddress(m_config->n1mm_server_name()); QByteArray qba_adif = adif.toLatin1(); QUdpSocket _sock; diff --git a/mainwindow.cpp b/mainwindow.cpp index 152306539..613a2b01a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -909,8 +909,8 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, } else { QString errorMsg; MessageBox::critical_message (this, - "Code in the WSJT-X development is not currently\n" - "available for on-the-air use.\n\n" + "Code in the WSJT-X development branch is not\n" + "currently available for on-the-air use.\n\n" "Please use WSJT-X v1.8.0\n", errorMsg); Q_EMIT finished (); }