1 | // Part of BNC, a utility for retrieving decoding and
|
---|
2 | // converting GNSS data streams from NTRIP broadcasters.
|
---|
3 | //
|
---|
4 | // Copyright (C) 2007
|
---|
5 | // German Federal Agency for Cartography and Geodesy (BKG)
|
---|
6 | // http://www.bkg.bund.de
|
---|
7 | // Czech Technical University Prague, Department of Geodesy
|
---|
8 | // http://www.fsv.cvut.cz
|
---|
9 | //
|
---|
10 | // Email: euref-ip@bkg.bund.de
|
---|
11 | //
|
---|
12 | // This program is free software; you can redistribute it and/or
|
---|
13 | // modify it under the terms of the GNU General Public License
|
---|
14 | // as published by the Free Software Foundation, version 2.
|
---|
15 | //
|
---|
16 | // This program is distributed in the hope that it will be useful,
|
---|
17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | // GNU General Public License for more details.
|
---|
20 | //
|
---|
21 | // You should have received a copy of the GNU General Public License
|
---|
22 | // along with this program; if not, write to the Free Software
|
---|
23 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
---|
24 |
|
---|
25 | #ifndef BNCAPP_H
|
---|
26 | #define BNCAPP_H
|
---|
27 |
|
---|
28 | #include <QtGui>
|
---|
29 |
|
---|
30 | #include "bnctime.h"
|
---|
31 | #include "bnccaster.h"
|
---|
32 | #include "bncrawfile.h"
|
---|
33 | #include "RTCM3/RTCM3Decoder.h"
|
---|
34 |
|
---|
35 | class bncComb;
|
---|
36 | class bncTableItem;
|
---|
37 | namespace BNC_PPP {
|
---|
38 | class t_pppMain;
|
---|
39 | }
|
---|
40 |
|
---|
41 | class t_bncCore : public QObject {
|
---|
42 | Q_OBJECT
|
---|
43 | friend class bncSettings;
|
---|
44 |
|
---|
45 | public:
|
---|
46 | enum e_mode {interactive, nonInteractive, batchPostProcessing};
|
---|
47 | t_bncCore();
|
---|
48 | virtual ~t_bncCore();
|
---|
49 | static t_bncCore* instance();
|
---|
50 | e_mode mode() const {return _mode;}
|
---|
51 | void setGUIenabled(bool GUIenabled) {_GUIenabled = GUIenabled;}
|
---|
52 | void setMode(e_mode mode) {_mode = mode;}
|
---|
53 | void setPort(int port);
|
---|
54 | void setPortCorr(int port);
|
---|
55 | void setCaster(bncCaster* caster) {_caster = caster;}
|
---|
56 | const bncCaster* caster() const {return _caster;}
|
---|
57 | bool dateAndTimeGPSSet() const;
|
---|
58 | QDateTime dateAndTimeGPS() const;
|
---|
59 | void setDateAndTimeGPS(QDateTime dateTime);
|
---|
60 | void setConfFileName(const QString& confFileName);
|
---|
61 | QString confFileName() const {return _confFileName;}
|
---|
62 | void writeRawData(const QByteArray& data, const QByteArray& staID,
|
---|
63 | const QByteArray& format);
|
---|
64 | void storeGlonassSlotNums(const int GLOFreq[]);
|
---|
65 | void getGlonassSlotNums(int GLOFreq[]);
|
---|
66 | void initCombination();
|
---|
67 | void stopCombination();
|
---|
68 | const QString& pgmName() {return _pgmName;}
|
---|
69 | const QString& userName() {return _userName;}
|
---|
70 | QWidget* mainWindow() const {return _mainWindow;};
|
---|
71 | void setMainWindow(QWidget* mainWindow){_mainWindow = mainWindow;}
|
---|
72 | bool GUIenabled() const {return _GUIenabled;}
|
---|
73 | void startPPP();
|
---|
74 | void stopPPP();
|
---|
75 |
|
---|
76 | QMap<int, bncTableItem*> _uploadTableItems;
|
---|
77 |
|
---|
78 | public slots:
|
---|
79 | void slotMessage(QByteArray msg, bool showOnScreen);
|
---|
80 | void slotNewGPSEph(gpsephemeris* gpseph);
|
---|
81 | void slotNewGlonassEph(glonassephemeris* glonasseph, const QString& staID);
|
---|
82 | void slotNewGalileoEph(galileoephemeris* galileoeph);
|
---|
83 | void slotNewCorrLine(QString line, QString staID, bncTime coTime);
|
---|
84 | void slotQuit();
|
---|
85 |
|
---|
86 | signals:
|
---|
87 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
88 | void newEphGPS(gpsephemeris gpseph);
|
---|
89 | void newEphGlonass(glonassephemeris glonasseph);
|
---|
90 | void newEphGalileo(galileoephemeris galileoeph);
|
---|
91 | void newCorrections(QStringList);
|
---|
92 | void providerIDChanged(QString);
|
---|
93 | void newPosition(QByteArray staID, bncTime time, QVector<double> xx);
|
---|
94 | void progressRnxPPP(int);
|
---|
95 | void finishedRnxPPP();
|
---|
96 | void mapSpeedSliderChanged(int);
|
---|
97 | void stopRinexPPP();
|
---|
98 |
|
---|
99 | private slots:
|
---|
100 | void slotNewConnection();
|
---|
101 | void slotNewConnectionCorr();
|
---|
102 |
|
---|
103 | private:
|
---|
104 | void printEphHeader();
|
---|
105 | void printGPSEph(gpsephemeris* ep, bool printFile);
|
---|
106 | void printGlonassEph(glonassephemeris* ep, bool printFile, const QString& staID);
|
---|
107 | void printGalileoEph(galileoephemeris* ep, bool printFile);
|
---|
108 | void printOutput(bool printFile, QTextStream* stream,
|
---|
109 | const QString& strV2, const QString& strV3);
|
---|
110 | void dumpCorrs(bncTime minTime, bncTime maxTime);
|
---|
111 | void dumpCorrs();
|
---|
112 | void dumpCorrs(const QStringList& allCorrs);
|
---|
113 | void messagePrivate(const QByteArray& msg);
|
---|
114 | void checkEphemeris(gpsephemeris* oldEph, gpsephemeris* newEph);
|
---|
115 |
|
---|
116 | QSettings::SettingsMap _settings;
|
---|
117 | QFile* _logFile;
|
---|
118 | QTextStream* _logStream;
|
---|
119 | int _logFileFlag;
|
---|
120 | QMutex _mutex;
|
---|
121 | QMutex _mutexMessage;
|
---|
122 | QString _ephPath;
|
---|
123 | QString _ephFileNameGPS;
|
---|
124 | int _rinexVers;
|
---|
125 | QFile* _ephFileGPS;
|
---|
126 | QTextStream* _ephStreamGPS;
|
---|
127 | QFile* _ephFileGlonass;
|
---|
128 | QTextStream* _ephStreamGlonass;
|
---|
129 | QFile* _ephFileGalileo;
|
---|
130 | QTextStream* _ephStreamGalileo;
|
---|
131 | gpsephemeris* _gpsEph[PRN_GPS_END - PRN_GPS_START + 1];
|
---|
132 | glonassephemeris* _glonassEph[PRN_GLONASS_END - PRN_GLONASS_START + 1];
|
---|
133 | galileoephemeris* _galileoEph[PRN_GALILEO_END - PRN_GALILEO_START + 1];
|
---|
134 | QString _userName;
|
---|
135 | QString _pgmName;
|
---|
136 | int _port;
|
---|
137 | QTcpServer* _server;
|
---|
138 | QList<QTcpSocket*>* _sockets;
|
---|
139 | int _portCorr;
|
---|
140 | QTcpServer* _serverCorr;
|
---|
141 | QList<QTcpSocket*>* _socketsCorr;
|
---|
142 | int _portNMEA;
|
---|
143 | QTcpServer* _serverNMEA;
|
---|
144 | QList<QTcpSocket*>* _socketsNMEA;
|
---|
145 | bncCaster* _caster;
|
---|
146 | QMap<QString, bncTime> _lastCorrDumpTime;
|
---|
147 | double _waitCoTime;
|
---|
148 | QMultiMap<bncTime, QString>* _corrs;
|
---|
149 | QString _confFileName;
|
---|
150 | QDate _fileDate;
|
---|
151 | bncRawFile* _rawFile;
|
---|
152 | int _GLOFreq[PRN_GLONASS_NUM];
|
---|
153 | bncComb* _bncComb;
|
---|
154 | e_mode _mode;
|
---|
155 | QWidget* _mainWindow;
|
---|
156 | bool _GUIenabled;
|
---|
157 | QDateTime* _dateAndTimeGPS;
|
---|
158 | mutable QMutex _mutexDateAndTimeGPS;
|
---|
159 | BNC_PPP::t_pppMain* _pppMain;
|
---|
160 | };
|
---|
161 |
|
---|
162 | #define BNC_CORE (t_bncCore::instance())
|
---|
163 |
|
---|
164 | #endif
|
---|