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 "bncephuser.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 | ~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 setPortEph(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 initCombination();
|
---|
65 | void stopCombination();
|
---|
66 | const QString& pgmName() {return _pgmName;}
|
---|
67 | const QString& userName() {return _userName;}
|
---|
68 | QWidget* mainWindow() const {return _mainWindow;};
|
---|
69 | void setMainWindow(QWidget* mainWindow){_mainWindow = mainWindow;}
|
---|
70 | bool GUIenabled() const {return _GUIenabled;}
|
---|
71 | void startPPP();
|
---|
72 | void stopPPP();
|
---|
73 |
|
---|
74 | QMap<int, bncTableItem*> _uploadTableItems;
|
---|
75 |
|
---|
76 | public slots:
|
---|
77 | void slotMessage(QByteArray msg, bool showOnScreen);
|
---|
78 | void slotNewGPSEph(t_ephGPS);
|
---|
79 | void slotNewGlonassEph(t_ephGlo);
|
---|
80 | void slotNewGalileoEph(t_ephGal);
|
---|
81 | void slotNewSBASEph(t_ephSBAS);
|
---|
82 | void slotNewOrbCorrections(QList<t_orbCorr>);
|
---|
83 | void slotNewClkCorrections(QList<t_clkCorr>);
|
---|
84 | void slotNewCodeBiases(QList<t_satCodeBias>);
|
---|
85 | void slotNewPhaseBiases(QList<t_satPhaseBias>);
|
---|
86 | void slotNewTec(t_vTec);
|
---|
87 | void slotQuit();
|
---|
88 |
|
---|
89 | signals:
|
---|
90 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
91 | void newGPSEph(t_ephGPS eph);
|
---|
92 | void newGlonassEph(t_ephGlo eph);
|
---|
93 | void newSBASEph(t_ephSBAS eph);
|
---|
94 | void newGalileoEph(t_ephGal eph);
|
---|
95 | void newOrbCorrections(QList<t_orbCorr>);
|
---|
96 | void newClkCorrections(QList<t_clkCorr>);
|
---|
97 | void newCodeBiases(QList<t_satCodeBias>);
|
---|
98 | void newPhaseBiases(QList<t_satPhaseBias>);
|
---|
99 | void newTec(t_vTec);
|
---|
100 | void providerIDChanged(QString);
|
---|
101 | void newPosition(QByteArray staID, bncTime time, QVector<double> xx);
|
---|
102 | void newNMEAstr(QByteArray staID, QByteArray str);
|
---|
103 | void progressRnxPPP(int);
|
---|
104 | void finishedRnxPPP();
|
---|
105 | void mapSpeedSliderChanged(int);
|
---|
106 | void stopRinexPPP();
|
---|
107 |
|
---|
108 | private slots:
|
---|
109 | void slotNewConnectionEph();
|
---|
110 | void slotNewConnectionCorr();
|
---|
111 |
|
---|
112 | private:
|
---|
113 | void printEphHeader();
|
---|
114 | void printEph(const t_eph& eph, bool printFile);
|
---|
115 | void printOutputEph(bool printFile, QTextStream* stream,
|
---|
116 | const QString& strV2, const QString& strV3);
|
---|
117 | void messagePrivate(const QByteArray& msg);
|
---|
118 |
|
---|
119 | QSettings::SettingsMap _settings;
|
---|
120 | QFile* _logFile;
|
---|
121 | QTextStream* _logStream;
|
---|
122 | int _logFileFlag;
|
---|
123 | QMutex _mutex;
|
---|
124 | QMutex _mutexMessage;
|
---|
125 | QString _ephPath;
|
---|
126 | QString _ephFileNameGPS;
|
---|
127 | int _rinexVers;
|
---|
128 | QFile* _ephFileGPS;
|
---|
129 | QTextStream* _ephStreamGPS;
|
---|
130 | QFile* _ephFileGlonass;
|
---|
131 | QTextStream* _ephStreamGlonass;
|
---|
132 | QFile* _ephFileGalileo;
|
---|
133 | QTextStream* _ephStreamGalileo;
|
---|
134 | QFile* _ephFileSBAS;
|
---|
135 | QTextStream* _ephStreamSBAS;
|
---|
136 | QString _userName;
|
---|
137 | QString _pgmName;
|
---|
138 | int _portEph;
|
---|
139 | QTcpServer* _serverEph;
|
---|
140 | QList<QTcpSocket*>* _socketsEph;
|
---|
141 | int _portCorr;
|
---|
142 | QTcpServer* _serverCorr;
|
---|
143 | QList<QTcpSocket*>* _socketsCorr;
|
---|
144 | int _portNMEA;
|
---|
145 | QTcpServer* _serverNMEA;
|
---|
146 | QList<QTcpSocket*>* _socketsNMEA;
|
---|
147 | bncCaster* _caster;
|
---|
148 | QString _confFileName;
|
---|
149 | QDate _fileDate;
|
---|
150 | bncRawFile* _rawFile;
|
---|
151 | bncComb* _bncComb;
|
---|
152 | e_mode _mode;
|
---|
153 | QWidget* _mainWindow;
|
---|
154 | bool _GUIenabled;
|
---|
155 | QDateTime* _dateAndTimeGPS;
|
---|
156 | mutable QMutex _mutexDateAndTimeGPS;
|
---|
157 | BNC_PPP::t_pppMain* _pppMain;
|
---|
158 | bncEphUser _ephUser;
|
---|
159 | };
|
---|
160 |
|
---|
161 | #define BNC_CORE (t_bncCore::instance())
|
---|
162 |
|
---|
163 | #endif
|
---|