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

Last change on this file since 5861 was 5861, checked in by mervart, 10 years ago
File size: 5.3 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 bncTableItem;
36
37class t_bncCore : public QObject {
38Q_OBJECT
39friend class bncSettings;
40
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;}
69
70 QMap<int, bncTableItem*> _uploadTableItems;
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
92 private:
93 void printEphHeader();
94 void printGPSEph(gpsephemeris* ep, bool printFile);
95 void printGlonassEph(glonassephemeris* ep, bool printFile, const QString& staID);
96 void printGalileoEph(galileoephemeris* ep, bool printFile);
97 void printOutput(bool printFile, QTextStream* stream,
98 const QString& strV2, const QString& strV3);
99 void dumpCorrs(bncTime minTime, bncTime maxTime);
100 void dumpCorrs();
101 void dumpCorrs(const QStringList& allCorrs);
102 void messagePrivate(const QByteArray& msg);
103 void checkEphemeris(gpsephemeris* oldEph, gpsephemeris* newEph);
104
105 QSettings::SettingsMap _settings;
106 QFile* _logFile;
107 QTextStream* _logStream;
108 int _logFileFlag;
109 QMutex _mutex;
110 QMutex _mutexMessage;
111 QString _ephPath;
112 QString _ephFileNameGPS;
113 int _rinexVers;
114 QFile* _ephFileGPS;
115 QTextStream* _ephStreamGPS;
116 QFile* _ephFileGlonass;
117 QTextStream* _ephStreamGlonass;
118 QFile* _ephFileGalileo;
119 QTextStream* _ephStreamGalileo;
120 gpsephemeris* _gpsEph[PRN_GPS_END - PRN_GPS_START + 1];
121 glonassephemeris* _glonassEph[PRN_GLONASS_END - PRN_GLONASS_START + 1];
122 galileoephemeris* _galileoEph[PRN_GALILEO_END - PRN_GALILEO_START + 1];
123 QString _userName;
124 QString _pgmName;
125 int _port;
126 QTcpServer* _server;
127 QList<QTcpSocket*>* _sockets;
128 int _portCorr;
129 QTcpServer* _serverCorr;
130 QList<QTcpSocket*>* _socketsCorr;
131 int _portNMEA;
132 QTcpServer* _serverNMEA;
133 QList<QTcpSocket*>* _socketsNMEA;
134 bncCaster* _caster;
135 QMap<QString, bncTime> _lastCorrDumpTime;
136 double _waitCoTime;
137 QMultiMap<bncTime, QString>* _corrs;
138 QString _confFileName;
139 QDate _fileDate;
140 bncRawFile* _rawFile;
141 int _GLOFreq[PRN_GLONASS_NUM];
142 bncComb* _bncComb;
143 e_mode _mode;
144 QWidget* _mainWindow;
145 bool _GUIenabled;
146 QDateTime* _dateAndTimeGPS;
147 mutable QMutex _mutexDateAndTimeGPS;
148};
149
150#define BNC_CORE (t_bncCore::instance())
151
152#endif
Note: See TracBrowser for help on using the repository browser.