[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"
|
---|
[511] | 33 | #include "RTCM3/RTCM3Decoder.h"
|
---|
[243] | 34 |
|
---|
[2865] | 35 | class bncComb;
|
---|
[3232] | 36 | class bncTableItem;
|
---|
[2865] | 37 |
|
---|
[5072] | 38 | class t_bncCore : public QObject {
|
---|
[5861] | 39 | Q_OBJECT
|
---|
| 40 | friend class bncSettings;
|
---|
[4070] | 41 |
|
---|
[5861] | 42 | public:
|
---|
| 43 | enum e_mode {interactive, nonInteractive, batchPostProcessing};
|
---|
| 44 | t_bncCore();
|
---|
| 45 | virtual ~t_bncCore();
|
---|
| 46 | static t_bncCore* instance();
|
---|
| 47 | e_mode mode() const {return _mode;}
|
---|
| 48 | void setGUIenabled(bool GUIenabled) {_GUIenabled = GUIenabled;}
|
---|
| 49 | void setMode(e_mode mode) {_mode = mode;}
|
---|
| 50 | void setPort(int port);
|
---|
| 51 | void setPortCorr(int port);
|
---|
| 52 | void setCaster(bncCaster* caster) {_caster = caster;}
|
---|
| 53 | const bncCaster* caster() const {return _caster;}
|
---|
| 54 | bool dateAndTimeGPSSet() const;
|
---|
| 55 | QDateTime dateAndTimeGPS() const;
|
---|
| 56 | void setDateAndTimeGPS(QDateTime dateTime);
|
---|
| 57 | void setConfFileName(const QString& confFileName);
|
---|
| 58 | QString confFileName() const {return _confFileName;}
|
---|
| 59 | void writeRawData(const QByteArray& data, const QByteArray& staID,
|
---|
| 60 | const QByteArray& format);
|
---|
| 61 | void storeGlonassSlotNums(const int GLOFreq[]);
|
---|
| 62 | void getGlonassSlotNums(int GLOFreq[]);
|
---|
| 63 | void initCombination();
|
---|
| 64 | void stopCombination();
|
---|
| 65 | const QString& pgmName() {return _pgmName;}
|
---|
| 66 | const QString& userName() {return _userName;}
|
---|
| 67 | QWidget* mainWindow() const {return _mainWindow;};
|
---|
| 68 | void setMainWindow(QWidget* mainWindow){_mainWindow = mainWindow;}
|
---|
| 69 | bool GUIenabled() const {return _GUIenabled;}
|
---|
[4070] | 70 |
|
---|
[5861] | 71 | QMap<int, bncTableItem*> _uploadTableItems;
|
---|
[1538] | 72 |
|
---|
[5861] | 73 | public slots:
|
---|
| 74 | void slotMessage(QByteArray msg, bool showOnScreen);
|
---|
| 75 | void slotNewGPSEph(gpsephemeris* gpseph);
|
---|
| 76 | void slotNewGlonassEph(glonassephemeris* glonasseph, const QString& staID);
|
---|
| 77 | void slotNewGalileoEph(galileoephemeris* galileoeph);
|
---|
| 78 | void slotNewCorrLine(QString line, QString staID, bncTime coTime);
|
---|
| 79 | void slotQuit();
|
---|
[994] | 80 |
|
---|
[5861] | 81 | signals:
|
---|
| 82 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
| 83 | void newEphGPS(gpsephemeris gpseph);
|
---|
| 84 | void newEphGlonass(glonassephemeris glonasseph);
|
---|
| 85 | void newEphGalileo(galileoephemeris galileoeph);
|
---|
| 86 | void newCorrections(QStringList);
|
---|
| 87 | void providerIDChanged(QString);
|
---|
[5879] | 88 | void newPosition(bncTime time, QVector<double> xx);
|
---|
[621] | 89 |
|
---|
[589] | 90 | private slots:
|
---|
[5861] | 91 | void slotNewConnection();
|
---|
| 92 | void slotNewConnectionCorr();
|
---|
[516] | 93 |
|
---|
[5861] | 94 | private:
|
---|
| 95 | void printEphHeader();
|
---|
| 96 | void printGPSEph(gpsephemeris* ep, bool printFile);
|
---|
| 97 | void printGlonassEph(glonassephemeris* ep, bool printFile, const QString& staID);
|
---|
| 98 | void printGalileoEph(galileoephemeris* ep, bool printFile);
|
---|
| 99 | void printOutput(bool printFile, QTextStream* stream,
|
---|
| 100 | const QString& strV2, const QString& strV3);
|
---|
| 101 | void dumpCorrs(bncTime minTime, bncTime maxTime);
|
---|
| 102 | void dumpCorrs();
|
---|
| 103 | void dumpCorrs(const QStringList& allCorrs);
|
---|
| 104 | void messagePrivate(const QByteArray& msg);
|
---|
| 105 | void checkEphemeris(gpsephemeris* oldEph, gpsephemeris* newEph);
|
---|
| 106 |
|
---|
| 107 | QSettings::SettingsMap _settings;
|
---|
| 108 | QFile* _logFile;
|
---|
| 109 | QTextStream* _logStream;
|
---|
| 110 | int _logFileFlag;
|
---|
| 111 | QMutex _mutex;
|
---|
| 112 | QMutex _mutexMessage;
|
---|
| 113 | QString _ephPath;
|
---|
| 114 | QString _ephFileNameGPS;
|
---|
| 115 | int _rinexVers;
|
---|
| 116 | QFile* _ephFileGPS;
|
---|
| 117 | QTextStream* _ephStreamGPS;
|
---|
| 118 | QFile* _ephFileGlonass;
|
---|
| 119 | QTextStream* _ephStreamGlonass;
|
---|
| 120 | QFile* _ephFileGalileo;
|
---|
| 121 | QTextStream* _ephStreamGalileo;
|
---|
| 122 | gpsephemeris* _gpsEph[PRN_GPS_END - PRN_GPS_START + 1];
|
---|
| 123 | glonassephemeris* _glonassEph[PRN_GLONASS_END - PRN_GLONASS_START + 1];
|
---|
| 124 | galileoephemeris* _galileoEph[PRN_GALILEO_END - PRN_GALILEO_START + 1];
|
---|
| 125 | QString _userName;
|
---|
| 126 | QString _pgmName;
|
---|
| 127 | int _port;
|
---|
| 128 | QTcpServer* _server;
|
---|
| 129 | QList<QTcpSocket*>* _sockets;
|
---|
| 130 | int _portCorr;
|
---|
| 131 | QTcpServer* _serverCorr;
|
---|
| 132 | QList<QTcpSocket*>* _socketsCorr;
|
---|
| 133 | int _portNMEA;
|
---|
| 134 | QTcpServer* _serverNMEA;
|
---|
| 135 | QList<QTcpSocket*>* _socketsNMEA;
|
---|
| 136 | bncCaster* _caster;
|
---|
| 137 | QMap<QString, bncTime> _lastCorrDumpTime;
|
---|
| 138 | double _waitCoTime;
|
---|
| 139 | QMultiMap<bncTime, QString>* _corrs;
|
---|
| 140 | QString _confFileName;
|
---|
| 141 | QDate _fileDate;
|
---|
| 142 | bncRawFile* _rawFile;
|
---|
| 143 | int _GLOFreq[PRN_GLONASS_NUM];
|
---|
| 144 | bncComb* _bncComb;
|
---|
| 145 | e_mode _mode;
|
---|
| 146 | QWidget* _mainWindow;
|
---|
| 147 | bool _GUIenabled;
|
---|
| 148 | QDateTime* _dateAndTimeGPS;
|
---|
| 149 | mutable QMutex _mutexDateAndTimeGPS;
|
---|
[82] | 150 | };
|
---|
[5066] | 151 |
|
---|
[5861] | 152 | #define BNC_CORE (t_bncCore::instance())
|
---|
[5066] | 153 |
|
---|
[82] | 154 | #endif
|
---|