1 | #ifndef BNS_H
|
---|
2 | #define BNS_H
|
---|
3 |
|
---|
4 | #include <newmat.h>
|
---|
5 |
|
---|
6 | #include <QtNetwork>
|
---|
7 | #include <QThread>
|
---|
8 |
|
---|
9 | #include "bnseph.h"
|
---|
10 | #include "bnscaster.h"
|
---|
11 | extern "C" {
|
---|
12 | #include "RTCM/clock_orbit_rtcm.h"
|
---|
13 | }
|
---|
14 |
|
---|
15 | class bnsRinex;
|
---|
16 | class bnsSP3;
|
---|
17 |
|
---|
18 | class t_ephPair {
|
---|
19 | public:
|
---|
20 | t_ephPair() {
|
---|
21 | eph = 0;
|
---|
22 | oldEph = 0;
|
---|
23 | }
|
---|
24 |
|
---|
25 | ~t_ephPair() {
|
---|
26 | delete eph;
|
---|
27 | delete oldEph;
|
---|
28 | }
|
---|
29 |
|
---|
30 | ColumnVector xx;
|
---|
31 | t_eph* eph;
|
---|
32 | t_eph* oldEph;
|
---|
33 | };
|
---|
34 |
|
---|
35 | class t_bns : public QThread {
|
---|
36 | Q_OBJECT
|
---|
37 | public:
|
---|
38 | t_bns(QObject* parent = 0);
|
---|
39 | virtual ~t_bns();
|
---|
40 | virtual void run();
|
---|
41 |
|
---|
42 | signals:
|
---|
43 | void newClkBytes(int nBytes);
|
---|
44 | void newEphBytes(int nBytes);
|
---|
45 | void newOutBytes1(int nBytes);
|
---|
46 | void newOutBytes2(int nBytes);
|
---|
47 | void newOutBytes3(int nBytes);
|
---|
48 | void newMessage(const QByteArray msg);
|
---|
49 | void error(const QByteArray msg);
|
---|
50 | void moveSocket(QThread* tt);
|
---|
51 |
|
---|
52 | private slots:
|
---|
53 | void slotNewEph(t_eph* ep, int nBytes);
|
---|
54 | void slotNewConnection();
|
---|
55 | void slotMessage(const QByteArray msg);
|
---|
56 | void slotError(const QByteArray msg);
|
---|
57 | void slotMoveSocket(QThread* tt);
|
---|
58 |
|
---|
59 | private:
|
---|
60 | void deleteBnsEph();
|
---|
61 | void openCaster();
|
---|
62 | void readEpoch();
|
---|
63 | void processSatellite(int oldEph, int iCaster, bool trafo, bool beClocks,
|
---|
64 | t_eph* ep, int GPSweek, double GPSweeks,
|
---|
65 | const QString& prn, const ColumnVector& xx,
|
---|
66 | struct ClockOrbit::SatData* sd, QString& outLine);
|
---|
67 | void crdTrafo(int GPSWeek, ColumnVector& xyz);
|
---|
68 |
|
---|
69 | QTcpServer* _clkServer;
|
---|
70 | QTcpSocket* _clkSocket;
|
---|
71 | QList<t_bnscaster*> _caster;
|
---|
72 | QFile* _logFile;
|
---|
73 | QTextStream* _logStream;
|
---|
74 | QFile* _echoFile;
|
---|
75 | QTextStream* _echoStream;
|
---|
76 | t_bnseph* _bnseph;
|
---|
77 | QMutex _mutex;
|
---|
78 | QMap<QString, t_ephPair*> _ephList;
|
---|
79 | bnsRinex* _rnx;
|
---|
80 | bnsSP3* _sp3;
|
---|
81 | QByteArray _clkLine;
|
---|
82 | };
|
---|
83 | #endif
|
---|