source: ntrip/trunk/BNC/src/bnccore.h@ 6141

Last change on this file since 6141 was 6141, checked in by mervart, 10 years ago
File size: 5.8 KB
RevLine 
[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]35class bncComb;
[3232]36class bncTableItem;
[5899]37namespace BNC_PPP {
38 class t_pppMain;
39}
[2865]40
[5072]41class t_bncCore : public QObject {
[5861]42Q_OBJECT
43friend class bncSettings;
[4070]44
[5861]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;}
[5946]73 void startPPP();
[5900]74 void stopPPP();
[4070]75
[5861]76 QMap<int, bncTableItem*> _uploadTableItems;
[1538]77
[5861]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);
[6141]83 void slotNewOrbCorrections(QList<t_orbCorr> orbCorr);
84 void slotNewClkCorrections(QList<t_clkCorr> clkCorr);
[5861]85 void slotQuit();
[994]86
[5861]87 signals:
88 void newMessage(QByteArray msg, bool showOnScreen);
89 void newEphGPS(gpsephemeris gpseph);
90 void newEphGlonass(glonassephemeris glonasseph);
91 void newEphGalileo(galileoephemeris galileoeph);
[6141]92 void newOrbCorrections(QList<t_orbCorr> orbCorr);
93 void newClkCorrections(QList<t_clkCorr> clkCorr);
[5861]94 void providerIDChanged(QString);
[5954]95 void newPosition(QByteArray staID, bncTime time, QVector<double> xx);
[5991]96 void newNMEAstr(QByteArray staID, QByteArray str);
[5941]97 void progressRnxPPP(int);
98 void finishedRnxPPP();
[5950]99 void mapSpeedSliderChanged(int);
[5972]100 void stopRinexPPP();
[621]101
[589]102 private slots:
[5861]103 void slotNewConnection();
104 void slotNewConnectionCorr();
[516]105
[5861]106 private:
107 void printEphHeader();
108 void printGPSEph(gpsephemeris* ep, bool printFile);
109 void printGlonassEph(glonassephemeris* ep, bool printFile, const QString& staID);
110 void printGalileoEph(galileoephemeris* ep, bool printFile);
111 void printOutput(bool printFile, QTextStream* stream,
112 const QString& strV2, const QString& strV3);
113 void dumpCorrs(bncTime minTime, bncTime maxTime);
114 void dumpCorrs();
[6141]115 void dumpCorrs(const QList<t_clkCorr>& allCorrs);
[5861]116 void messagePrivate(const QByteArray& msg);
117 void checkEphemeris(gpsephemeris* oldEph, gpsephemeris* newEph);
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 gpsephemeris* _gpsEph[PRN_GPS_END - PRN_GPS_START + 1];
135 glonassephemeris* _glonassEph[PRN_GLONASS_END - PRN_GLONASS_START + 1];
136 galileoephemeris* _galileoEph[PRN_GALILEO_END - PRN_GALILEO_START + 1];
137 QString _userName;
138 QString _pgmName;
139 int _port;
140 QTcpServer* _server;
141 QList<QTcpSocket*>* _sockets;
142 int _portCorr;
143 QTcpServer* _serverCorr;
144 QList<QTcpSocket*>* _socketsCorr;
145 int _portNMEA;
146 QTcpServer* _serverNMEA;
147 QList<QTcpSocket*>* _socketsNMEA;
148 bncCaster* _caster;
149 QMap<QString, bncTime> _lastCorrDumpTime;
150 double _waitCoTime;
[6141]151 QMultiMap<bncTime, t_clkCorr>* _corrs;
[5861]152 QString _confFileName;
153 QDate _fileDate;
154 bncRawFile* _rawFile;
155 int _GLOFreq[PRN_GLONASS_NUM];
156 bncComb* _bncComb;
157 e_mode _mode;
158 QWidget* _mainWindow;
159 bool _GUIenabled;
160 QDateTime* _dateAndTimeGPS;
161 mutable QMutex _mutexDateAndTimeGPS;
[5899]162 BNC_PPP::t_pppMain* _pppMain;
[82]163};
[5066]164
[5861]165#define BNC_CORE (t_bncCore::instance())
[5066]166
[82]167#endif
Note: See TracBrowser for help on using the repository browser.