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

Last change on this file since 6184 was 6151, checked in by mervart, 10 years ago
File size: 5.8 KB
Line 
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 "RTCM3/RTCM3Decoder.h"
34
35class bncComb;
36class bncTableItem;
37namespace BNC_PPP {
38 class t_pppMain;
39}
40
41class t_bncCore : public QObject {
42Q_OBJECT
43friend 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 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 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(gpsephemeris* gpseph);
79 void slotNewGlonassEph(glonassephemeris* glonasseph, const QString& staID);
80 void slotNewGalileoEph(galileoephemeris* galileoeph);
81 void slotNewOrbCorrections(QList<t_orbCorr> orbCorr);
82 void slotNewClkCorrections(QList<t_clkCorr> clkCorr);
83 void slotQuit();
84
85 signals:
86 void newMessage(QByteArray msg, bool showOnScreen);
87 void newEphGPS(gpsephemeris gpseph);
88 void newEphGlonass(glonassephemeris glonasseph);
89 void newEphGalileo(galileoephemeris galileoeph);
90 void newOrbCorrections(QList<t_orbCorr> orbCorr);
91 void newClkCorrections(QList<t_clkCorr> clkCorr);
92 void providerIDChanged(QString);
93 void newPosition(QByteArray staID, bncTime time, QVector<double> xx);
94 void newNMEAstr(QByteArray staID, QByteArray str);
95 void progressRnxPPP(int);
96 void finishedRnxPPP();
97 void mapSpeedSliderChanged(int);
98 void stopRinexPPP();
99
100 private slots:
101 void slotNewConnection();
102 void slotNewConnectionCorr();
103
104 private:
105 void printEphHeader();
106 void printGPSEph(gpsephemeris* ep, bool printFile);
107 void printGlonassEph(glonassephemeris* ep, bool printFile, const QString& staID);
108 void printGalileoEph(galileoephemeris* ep, bool printFile);
109 void printOutput(bool printFile, QTextStream* stream,
110 const QString& strV2, const QString& strV3);
111 void messagePrivate(const QByteArray& msg);
112 void checkEphemeris(gpsephemeris* oldEph, gpsephemeris* newEph);
113
114 QSettings::SettingsMap _settings;
115 QFile* _logFile;
116 QTextStream* _logStream;
117 int _logFileFlag;
118 QMutex _mutex;
119 QMutex _mutexMessage;
120 QString _ephPath;
121 QString _ephFileNameGPS;
122 int _rinexVers;
123 QFile* _ephFileGPS;
124 QTextStream* _ephStreamGPS;
125 QFile* _ephFileGlonass;
126 QTextStream* _ephStreamGlonass;
127 QFile* _ephFileGalileo;
128 QTextStream* _ephStreamGalileo;
129 gpsephemeris* _gpsEph[PRN_GPS_END - PRN_GPS_START + 1];
130 glonassephemeris* _glonassEph[PRN_GLONASS_END - PRN_GLONASS_START + 1];
131 galileoephemeris* _galileoEph[PRN_GALILEO_END - PRN_GALILEO_START + 1];
132 QString _userName;
133 QString _pgmName;
134 int _port;
135 QTcpServer* _server;
136 QList<QTcpSocket*>* _sockets;
137 int _portCorr;
138 QTcpServer* _serverCorr;
139 QList<QTcpSocket*>* _socketsCorr;
140 int _portNMEA;
141 QTcpServer* _serverNMEA;
142 QList<QTcpSocket*>* _socketsNMEA;
143 bncCaster* _caster;
144 QString _confFileName;
145 QDate _fileDate;
146 bncRawFile* _rawFile;
147 bncComb* _bncComb;
148 e_mode _mode;
149 QWidget* _mainWindow;
150 bool _GUIenabled;
151 QDateTime* _dateAndTimeGPS;
152 mutable QMutex _mutexDateAndTimeGPS;
153 BNC_PPP::t_pppMain* _pppMain;
154};
155
156#define BNC_CORE (t_bncCore::instance())
157
158#endif
Note: See TracBrowser for help on using the repository browser.