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

Last change on this file since 5873 was 5873, checked in by mervart, 10 years ago
File size: 5.4 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 slotNewPosition(bncTime time, double x, double y, double z);
79 void slotQuit();
80
81 signals:
82 void newMessage(QByteArray msg, bool showOnScreen);
83 void newEphGPS(gpsephemeris gpseph);
84 void newEphGlonass(glonassephemeris glonasseph);
85 void newEphGalileo(galileoephemeris galileoeph);
86 void newCorrections(QStringList);
87 void providerIDChanged(QString);
88 void newPosition(bncTime time, double x, double y, double z);
89
90 private slots:
91 void slotNewConnection();
92 void slotNewConnectionCorr();
93
94 private:
95 void printEphHeader();
96 void printGPSEph(gpsephemeris* ep, bool printFile);
97 void printGlonassEph(glonassephemeris* ep, bool printFile, const QString& staID);
98 void printGalileoEph(galileoephemeris* ep, bool printFile);
99 void printOutput(bool printFile, QTextStream* stream,
100 const QString& strV2, const QString& strV3);
101 void dumpCorrs(bncTime minTime, bncTime maxTime);
102 void dumpCorrs();
103 void dumpCorrs(const QStringList& allCorrs);
104 void messagePrivate(const QByteArray& msg);
105 void checkEphemeris(gpsephemeris* oldEph, gpsephemeris* newEph);
106
107 QSettings::SettingsMap _settings;
108 QFile* _logFile;
109 QTextStream* _logStream;
110 int _logFileFlag;
111 QMutex _mutex;
112 QMutex _mutexMessage;
113 QString _ephPath;
114 QString _ephFileNameGPS;
115 int _rinexVers;
116 QFile* _ephFileGPS;
117 QTextStream* _ephStreamGPS;
118 QFile* _ephFileGlonass;
119 QTextStream* _ephStreamGlonass;
120 QFile* _ephFileGalileo;
121 QTextStream* _ephStreamGalileo;
122 gpsephemeris* _gpsEph[PRN_GPS_END - PRN_GPS_START + 1];
123 glonassephemeris* _glonassEph[PRN_GLONASS_END - PRN_GLONASS_START + 1];
124 galileoephemeris* _galileoEph[PRN_GALILEO_END - PRN_GALILEO_START + 1];
125 QString _userName;
126 QString _pgmName;
127 int _port;
128 QTcpServer* _server;
129 QList<QTcpSocket*>* _sockets;
130 int _portCorr;
131 QTcpServer* _serverCorr;
132 QList<QTcpSocket*>* _socketsCorr;
133 int _portNMEA;
134 QTcpServer* _serverNMEA;
135 QList<QTcpSocket*>* _socketsNMEA;
136 bncCaster* _caster;
137 QMap<QString, bncTime> _lastCorrDumpTime;
138 double _waitCoTime;
139 QMultiMap<bncTime, QString>* _corrs;
140 QString _confFileName;
141 QDate _fileDate;
142 bncRawFile* _rawFile;
143 int _GLOFreq[PRN_GLONASS_NUM];
144 bncComb* _bncComb;
145 e_mode _mode;
146 QWidget* _mainWindow;
147 bool _GUIenabled;
148 QDateTime* _dateAndTimeGPS;
149 mutable QMutex _mutexDateAndTimeGPS;
150};
151
152#define BNC_CORE (t_bncCore::instance())
153
154#endif
Note: See TracBrowser for help on using the repository browser.