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