mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-16 09:01:59 -05:00
3c384f7cbb
When "Auto Grid" is checked in "Settings->General" UDP messages of type "Location" will update a temporary DE grid square. The intent is to allow an external application joining the WSJT-X UDP message protocol to dynamically update the DE grid during mobile operation. This change also tidies up some outstanding issues around logging the operator call. This change adds a new UDP message "Logged ADIF" that is emitted in parallel with "QSO Logged" messages. The new message is valid ADIF file format and contains the logged QSO fields. The intent is that basic UDP server applications might already have ADIF log record capture capabilities and could use this message to feed existing ADIF parsing routines to log QSOs. All that should be needed is to identify this message type and the single field is ADIF compatible ASCII. Thanks to Brian, N9ADG, for the patches that lead to these enhancements. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8454 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
/*
|
|
* Reads an ADIF log file into memory
|
|
* Searches log for call, band and mode
|
|
* VK3ACF July 2013
|
|
*/
|
|
|
|
|
|
#ifndef __ADIF_H
|
|
#define __ADIF_H
|
|
|
|
#if defined (QT5)
|
|
#include <QList>
|
|
#include <QString>
|
|
#include <QMultiHash>
|
|
#else
|
|
#include <QtGui>
|
|
#endif
|
|
|
|
class QDateTime;
|
|
|
|
class ADIF
|
|
{
|
|
public:
|
|
void init(QString const& filename);
|
|
void load();
|
|
void add(QString const& call, QString const& band, QString const& mode, QString const& date);
|
|
bool match(QString const& call, QString const& band, QString const& mode) const;
|
|
QList<QString> getCallList() const;
|
|
int getCount() const;
|
|
|
|
// open ADIF file and append the QSO details. Return true on success
|
|
bool addQSOToFile(QByteArray const& ADIF_record);
|
|
|
|
QByteArray 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& operator_call);
|
|
|
|
|
|
private:
|
|
struct QSO
|
|
{
|
|
QString call,band,mode,date;
|
|
};
|
|
|
|
QMultiHash<QString, QSO> _data;
|
|
QString _filename;
|
|
|
|
QString extractField(QString const& line, QString const& fieldName) const;
|
|
};
|
|
|
|
|
|
#endif
|
|
|