| 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 newOutBytes(int nBytes);
|
|---|
| 46 | void newMessage(const QByteArray msg);
|
|---|
| 47 | void error(const QByteArray msg);
|
|---|
| 48 | void moveSocket(QThread* tt);
|
|---|
| 49 |
|
|---|
| 50 | private slots:
|
|---|
| 51 | void slotNewEph(t_eph* ep, int nBytes);
|
|---|
| 52 | void slotNewConnection();
|
|---|
| 53 | void slotMessage(const QByteArray msg);
|
|---|
| 54 | void slotError(const QByteArray msg);
|
|---|
| 55 | void slotMoveSocket(QThread* tt);
|
|---|
| 56 |
|
|---|
| 57 | private:
|
|---|
| 58 | void deleteBnsEph();
|
|---|
| 59 | void openCaster();
|
|---|
| 60 | void readEpoch();
|
|---|
| 61 | void processSatellite(int oldEph, int iCaster, bool trafo, t_eph* ep,
|
|---|
| 62 | int GPSweek, double GPSweeks, const QString& prn,
|
|---|
| 63 | const ColumnVector& xx, struct ClockOrbit::SatData* sd,
|
|---|
| 64 | QString& outLine);
|
|---|
| 65 | void crdTrafo(int GPSWeek, ColumnVector& xyz);
|
|---|
| 66 |
|
|---|
| 67 | QTcpServer* _clkServer;
|
|---|
| 68 | QTcpSocket* _clkSocket;
|
|---|
| 69 | QList<t_bnscaster*> _caster;
|
|---|
| 70 | QFile* _logFile;
|
|---|
| 71 | QTextStream* _logStream;
|
|---|
| 72 | QFile* _echoFile;
|
|---|
| 73 | QTextStream* _echoStream;
|
|---|
| 74 | t_bnseph* _bnseph;
|
|---|
| 75 | QMutex _mutex;
|
|---|
| 76 | QMap<QString, t_ephPair*> _ephList;
|
|---|
| 77 | bnsRinex* _rnx;
|
|---|
| 78 | bnsSP3* _sp3;
|
|---|
| 79 | };
|
|---|
| 80 | #endif
|
|---|