-
Notifications
You must be signed in to change notification settings - Fork 1
/
APRS.hpp
78 lines (63 loc) · 2.41 KB
/
APRS.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef APRS_HPP
#define APRS_HPP
#include <QObject>
#include <QString>
#include <QQueue>
#include <QMap>
#include <QStringList>
#include <QUdpSocket>
#include <vector>
class APRS:public QObject
{
Q_OBJECT;
public:
APRS();
APRS(const QString &server,const quint16 port, const QString &callsign,
const QString &callpass);
QString createObject(const QString &oName,const std::vector<double> &coords,
const QString &symbol,const QString &comment);
QString createDFObject(const QString &oName, const std::vector<double> &coords,
double bearing, double sigma, const QString &comment);
QString createDFErrorObject(const QString &oName,
const std::vector<double> &coords,
double axisLon,double axisLat);
QString createMultilineObject(const QString &oName,
const std::vector<double> &lats,
const std::vector<double> &lons,
const std::vector<double> &coords,
char colorStyle, int lineType,
const QString &oSym);
QString deleteObject(const QString &oName);
QStringList deleteAllObjects();
void sendPacketToServer(const QString &payload);
void setServer(const QString &server);
void setCallsign(const QString &callsign);
void setCallpass(const QString &callpass);
void setPort(const quint16 port);
const QString &getServer() const;
const QString &getCallsign() const;
const QString &getCallpass() const;
const quint16 getPort() const;
QString makeMultiline(const std::vector<double> &lon,const std::vector<double>&lat,
char colorStyle, int lineType, const QString &sequence,
double *lonCentr, double *latCentr);
void generateEllipse(double lonCentr, double latCentr,
double axisLon, double axisLat,
int numPoints,
std::vector<double> &lons, std::vector<double> &lats);
private:
QMap<QString,QString> activeObjects;
QString server_;
quint16 port_;
QString callsign_;
QString callpass_;
// QList<QPair<QUdpSocket *,int> > udpSockets;
QQueue<QPair<QString,int> > pendingPackets;
bool timerActive;
QUdpSocket *theSocket;
private slots:
void checkPendingDatagrams();
signals:
void queueCleared();
};
#endif