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

Last change on this file since 5852 was 5846, checked in by mervart, 10 years ago
File size: 5.6 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 "bnccaster.h"
31#include "bncrawfile.h"
32#include "RTCM3/RTCM3Decoder.h"
33
34class bncComb;
35class bncPPPclient;
36class bncTableItem;
37
38class t_bncCore : public QObject {
39 Q_OBJECT
40
41 friend class bncSettings;
42 QSettings::SettingsMap _settings;
43
44 public:
45 enum e_mode {interactive, nonInteractive, batchPostProcessing};
46 t_bncCore();
47 virtual ~t_bncCore();
48 e_mode mode() const {return _mode;}
49 void setGUIenabled(bool GUIenabled) {_GUIenabled = GUIenabled;}
50 void setMode(e_mode mode) {_mode = mode;}
51 void setPort(int port);
52 void setPortCorr(int port);
53 void setCaster(bncCaster* caster) {_caster = caster;}
54 const bncCaster* caster() const {return _caster;}
55 bool dateAndTimeGPSSet() const;
56 QDateTime dateAndTimeGPS() const;
57 void setDateAndTimeGPS(QDateTime dateTime);
58 void setConfFileName(const QString& confFileName);
59 QString confFileName() const {return _confFileName;}
60 void writeRawData(const QByteArray& data, const QByteArray& staID,
61 const QByteArray& format);
62 void storeGlonassSlotNums(const int GLOFreq[]);
63 void getGlonassSlotNums(int GLOFreq[]);
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
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();
79
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);
87
88 private slots:
89 void slotNewConnection();
90 void slotNewConnectionCorr();
91 private:
92 void printEphHeader();
93 void printGPSEph(gpsephemeris* ep, bool printFile);
94 void printGlonassEph(glonassephemeris* ep, bool printFile, const QString& staID);
95 void printGalileoEph(galileoephemeris* ep, bool printFile);
96 void printOutput(bool printFile, QTextStream* stream,
97 const QString& strV2, const QString& strV3);
98 void dumpCorrs(bncTime minTime, bncTime maxTime);
99 void dumpCorrs();
100 void dumpCorrs(const QStringList& allCorrs);
101 void messagePrivate(const QByteArray& msg);
102 void checkEphemeris(gpsephemeris* oldEph, gpsephemeris* newEph);
103
104 QFile* _logFile;
105 QTextStream* _logStream;
106 int _logFileFlag;
107 QMutex _mutex;
108 QMutex _mutexMessage;
109 QString _ephPath;
110 QString _ephFileNameGPS;
111 int _rinexVers;
112 QFile* _ephFileGPS;
113 QTextStream* _ephStreamGPS;
114 QFile* _ephFileGlonass;
115 QTextStream* _ephStreamGlonass;
116 QFile* _ephFileGalileo;
117 QTextStream* _ephStreamGalileo;
118 gpsephemeris* _gpsEph[PRN_GPS_END - PRN_GPS_START + 1];
119 glonassephemeris* _glonassEph[PRN_GLONASS_END - PRN_GLONASS_START + 1];
120 galileoephemeris* _galileoEph[PRN_GALILEO_END - PRN_GALILEO_START + 1];
121 QString _userName;
122 QString _pgmName;
123 int _port;
124 QTcpServer* _server;
125 QList<QTcpSocket*>* _sockets;
126 int _portCorr;
127 QTcpServer* _serverCorr;
128 QList<QTcpSocket*>* _socketsCorr;
129 int _portNMEA;
130 QTcpServer* _serverNMEA;
131 QList<QTcpSocket*>* _socketsNMEA;
132 bncCaster* _caster;
133 QMap<QString, bncTime> _lastCorrDumpTime;
134 double _waitCoTime;
135 QMultiMap<bncTime, QString>* _corrs;
136 QString _confFileName;
137 QDate _fileDate;
138 bncRawFile* _rawFile;
139 int _GLOFreq[PRN_GLONASS_NUM];
140 bncComb* _bncComb;
141 e_mode _mode;
142 QWidget* _mainWindow;
143 bool _GUIenabled;
144 QDateTime* _dateAndTimeGPS;
145 mutable QMutex _mutexDateAndTimeGPS;
146 public:
147 bncPPPclient* _bncPPPclient;
148 QMap<int, bncTableItem*> _uploadTableItems;
149};
150
151t_bncCore& bncCoreInstance();
152
153#define BNC_CORE (&bncCoreInstance())
154
155#endif
Note: See TracBrowser for help on using the repository browser.