[280] | 1 | // Part of BNC, a utility for retrieving decoding and
|
---|
[464] | 2 | // converting GNSS data streams from NTRIP broadcasters.
|
---|
[280] | 3 | //
|
---|
[464] | 4 | // Copyright (C) 2007
|
---|
[280] | 5 | // German Federal Agency for Cartography and Geodesy (BKG)
|
---|
| 6 | // http://www.bkg.bund.de
|
---|
[464] | 7 | // Czech Technical University Prague, Department of Geodesy
|
---|
[280] | 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.
|
---|
[82] | 24 |
|
---|
| 25 | #ifndef BNCAPP_H
|
---|
| 26 | #define BNCAPP_H
|
---|
| 27 |
|
---|
[4070] | 28 | #include <QtGui>
|
---|
[82] | 29 |
|
---|
[5884] | 30 | #include "bnctime.h"
|
---|
[243] | 31 | #include "bnccaster.h"
|
---|
[2519] | 32 | #include "bncrawfile.h"
|
---|
[6432] | 33 | #include "bncephuser.h"
|
---|
[243] | 34 |
|
---|
[2865] | 35 | class bncComb;
|
---|
[3232] | 36 | class bncTableItem;
|
---|
[5899] | 37 | namespace BNC_PPP {
|
---|
| 38 | class t_pppMain;
|
---|
| 39 | }
|
---|
[2865] | 40 |
|
---|
[5072] | 41 | class t_bncCore : public QObject {
|
---|
[5861] | 42 | Q_OBJECT
|
---|
| 43 | friend class bncSettings;
|
---|
[4070] | 44 |
|
---|
[5861] | 45 | public:
|
---|
| 46 | enum e_mode {interactive, nonInteractive, batchPostProcessing};
|
---|
| 47 | t_bncCore();
|
---|
[7298] | 48 | ~t_bncCore();
|
---|
[5861] | 49 | static t_bncCore* instance();
|
---|
[6151] | 50 | e_mode mode() const {return _mode;}
|
---|
| 51 | void setGUIenabled(bool GUIenabled) {_GUIenabled = GUIenabled;}
|
---|
| 52 | void setMode(e_mode mode) {_mode = mode;}
|
---|
[6451] | 53 | void setPortEph(int port);
|
---|
[6151] | 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;}
|
---|
[7298] | 62 | void writeRawData(const QByteArray& data, const QByteArray& staID,
|
---|
[6151] | 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();
|
---|
[7977] | 73 | int sigintReceived;
|
---|
[4070] | 74 |
|
---|
[5861] | 75 | QMap<int, bncTableItem*> _uploadTableItems;
|
---|
[1538] | 76 |
|
---|
[5861] | 77 | public slots:
|
---|
| 78 | void slotMessage(QByteArray msg, bool showOnScreen);
|
---|
[6432] | 79 | void slotNewGPSEph(t_ephGPS);
|
---|
| 80 | void slotNewGlonassEph(t_ephGlo);
|
---|
| 81 | void slotNewGalileoEph(t_ephGal);
|
---|
| 82 | void slotNewSBASEph(t_ephSBAS);
|
---|
[6598] | 83 | void slotNewBDSEph(t_ephBDS);
|
---|
[6484] | 84 | void slotNewOrbCorrections(QList<t_orbCorr>);
|
---|
| 85 | void slotNewClkCorrections(QList<t_clkCorr>);
|
---|
| 86 | void slotNewCodeBiases(QList<t_satCodeBias>);
|
---|
| 87 | void slotNewPhaseBiases(QList<t_satPhaseBias>);
|
---|
| 88 | void slotNewTec(t_vTec);
|
---|
[5861] | 89 | void slotQuit();
|
---|
[994] | 90 |
|
---|
[5861] | 91 | signals:
|
---|
| 92 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
[6432] | 93 | void newGPSEph(t_ephGPS eph);
|
---|
| 94 | void newGlonassEph(t_ephGlo eph);
|
---|
| 95 | void newSBASEph(t_ephSBAS eph);
|
---|
| 96 | void newGalileoEph(t_ephGal eph);
|
---|
[6598] | 97 | void newBDSEph(t_ephBDS eph);
|
---|
[6484] | 98 | void newOrbCorrections(QList<t_orbCorr>);
|
---|
| 99 | void newClkCorrections(QList<t_clkCorr>);
|
---|
| 100 | void newCodeBiases(QList<t_satCodeBias>);
|
---|
| 101 | void newPhaseBiases(QList<t_satPhaseBias>);
|
---|
| 102 | void newTec(t_vTec);
|
---|
[5861] | 103 | void providerIDChanged(QString);
|
---|
[5954] | 104 | void newPosition(QByteArray staID, bncTime time, QVector<double> xx);
|
---|
[5991] | 105 | void newNMEAstr(QByteArray staID, QByteArray str);
|
---|
[5941] | 106 | void progressRnxPPP(int);
|
---|
| 107 | void finishedRnxPPP();
|
---|
[5950] | 108 | void mapSpeedSliderChanged(int);
|
---|
[5972] | 109 | void stopRinexPPP();
|
---|
[7298] | 110 |
|
---|
[589] | 111 | private slots:
|
---|
[6451] | 112 | void slotNewConnectionEph();
|
---|
[5861] | 113 | void slotNewConnectionCorr();
|
---|
[516] | 114 |
|
---|
[5861] | 115 | private:
|
---|
[6520] | 116 | t_irc checkPrintEph(t_eph* eph);
|
---|
| 117 | void printEphHeader();
|
---|
| 118 | void printEph(const t_eph& eph, bool printFile);
|
---|
[7298] | 119 | void printOutputEph(bool printFile, QTextStream* stream,
|
---|
[6520] | 120 | const QString& strV2, const QString& strV3);
|
---|
| 121 | void messagePrivate(const QByteArray& msg);
|
---|
[5861] | 122 |
|
---|
[6151] | 123 | QSettings::SettingsMap _settings;
|
---|
| 124 | QFile* _logFile;
|
---|
| 125 | QTextStream* _logStream;
|
---|
| 126 | int _logFileFlag;
|
---|
| 127 | QMutex _mutex;
|
---|
| 128 | QMutex _mutexMessage;
|
---|
| 129 | QString _ephPath;
|
---|
| 130 | QString _ephFileNameGPS;
|
---|
| 131 | int _rinexVers;
|
---|
| 132 | QFile* _ephFileGPS;
|
---|
| 133 | QTextStream* _ephStreamGPS;
|
---|
| 134 | QFile* _ephFileGlonass;
|
---|
| 135 | QTextStream* _ephStreamGlonass;
|
---|
| 136 | QFile* _ephFileGalileo;
|
---|
| 137 | QTextStream* _ephStreamGalileo;
|
---|
[6384] | 138 | QFile* _ephFileSBAS;
|
---|
| 139 | QTextStream* _ephStreamSBAS;
|
---|
[6151] | 140 | QString _userName;
|
---|
| 141 | QString _pgmName;
|
---|
[6451] | 142 | int _portEph;
|
---|
| 143 | QTcpServer* _serverEph;
|
---|
| 144 | QList<QTcpSocket*>* _socketsEph;
|
---|
[6151] | 145 | int _portCorr;
|
---|
| 146 | QTcpServer* _serverCorr;
|
---|
| 147 | QList<QTcpSocket*>* _socketsCorr;
|
---|
| 148 | bncCaster* _caster;
|
---|
| 149 | QString _confFileName;
|
---|
| 150 | QDate _fileDate;
|
---|
| 151 | bncRawFile* _rawFile;
|
---|
| 152 | bncComb* _bncComb;
|
---|
| 153 | e_mode _mode;
|
---|
| 154 | QWidget* _mainWindow;
|
---|
| 155 | bool _GUIenabled;
|
---|
| 156 | QDateTime* _dateAndTimeGPS;
|
---|
| 157 | mutable QMutex _mutexDateAndTimeGPS;
|
---|
| 158 | BNC_PPP::t_pppMain* _pppMain;
|
---|
[6432] | 159 | bncEphUser _ephUser;
|
---|
[82] | 160 | };
|
---|
[5066] | 161 |
|
---|
[5861] | 162 | #define BNC_CORE (t_bncCore::instance())
|
---|
[5066] | 163 |
|
---|
[82] | 164 | #endif
|
---|