source: ntrip/trunk/BNC/bncapp.h@ 3231

Last change on this file since 3231 was 3231, checked in by mervart, 13 years ago
File size: 4.5 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 <QApplication>
29#include <QFile>
30#include <QTextStream>
31
32#include "bnccaster.h"
33#include "bncrawfile.h"
34#include "RTCM3/RTCM3Decoder.h"
35
36class bncComb;
37class bncPPPclient;
38
39class bncApp : public QApplication {
40 Q_OBJECT
41 public:
42 bncApp(int& argc, char* argv[], bool GUIenabled);
43 virtual ~bncApp();
44 void setPort(int port);
45 void setPortCorr(int port);
46 void setCaster(bncCaster* caster) {_caster = caster;}
47 QDateTime* _currentDateAndTimeGPS;
48 void setConfFileName(const QString& confFileName);
49 QString confFileName() const {return _confFileName;}
50 void writeRawData(const QByteArray& data, const QByteArray& staID,
51 const QByteArray& format);
52 void storeGlonassSlotNums(const int GLOFreq[]);
53 void getGlonassSlotNums(int GLOFreq[]);
54 void initCombination();
55 void stopCombination();
56
57 public slots:
58 void slotMessage(QByteArray msg, bool showOnScreen);
59 void slotNewGPSEph(gpsephemeris* gpseph);
60 void slotNewGlonassEph(glonassephemeris* glonasseph);
61 void slotNewGalileoEph(galileoephemeris* galileoeph);
62 void slotNewCorrLine(QString line, QString staID, long coTime);
63 void slotQuit();
64
65 signals:
66 void newMessage(QByteArray msg, bool showOnScreen);
67 void newEphGPS(gpsephemeris gpseph);
68 void newEphGlonass(glonassephemeris glonasseph);
69 void newEphGalileo(galileoephemeris galileoeph);
70 void newCorrections(QList<QString>);
71
72 private slots:
73 void slotNewConnection();
74 void slotNewConnectionCorr();
75 private:
76 void printEphHeader();
77 void printGPSEph(gpsephemeris* ep, bool printFile);
78 void printGlonassEph(glonassephemeris* ep, bool printFile);
79 void printGalileoEph(galileoephemeris* ep, bool printFile);
80 void printOutput(bool printFile, QTextStream* stream,
81 const QString& lineV2,
82 const QString& lineV3,
83 const QByteArray& allLines);
84 void dumpCorrs(long minTime, long maxTime);
85 void dumpCorrs();
86 void dumpCorrs(const QList<QString>& allCorrs);
87 void messagePrivate(const QByteArray& msg);
88
89 QFile* _logFile;
90 QTextStream* _logStream;
91 int _logFileFlag;
92 QMutex _mutex;
93 QMutex _mutexMessage;
94 QString _ephPath;
95 QString _ephFileNameGPS;
96 int _rinexVers;
97 QFile* _ephFileGPS;
98 QTextStream* _ephStreamGPS;
99 QFile* _ephFileGlonass;
100 QTextStream* _ephStreamGlonass;
101 QFile* _ephFileGalileo;
102 QTextStream* _ephStreamGalileo;
103 gpsephemeris* _gpsEph[PRN_GPS_END - PRN_GPS_START + 1];
104 glonassephemeris* _glonassEph[PRN_GLONASS_END - PRN_GLONASS_START + 1];
105 galileoephemeris* _galileoEph[PRN_GALILEO_END - PRN_GALILEO_START + 1];
106 QString _userName;
107 QString _pgmName;
108 int _port;
109 QTcpServer* _server;
110 QList<QTcpSocket*>* _sockets;
111 int _portCorr;
112 QTcpServer* _serverCorr;
113 QList<QTcpSocket*>* _socketsCorr;
114 int _portNMEA;
115 QTcpServer* _serverNMEA;
116 QList<QTcpSocket*>* _socketsNMEA;
117 bncCaster* _caster;
118 long _lastDumpCoSec;
119 long _waitCoTime;
120 QMultiMap<long, QString>* _corrs;
121 QString _confFileName;
122 QDate _fileDate;
123 bncRawFile* _rawFile;
124 int _GLOFreq[PRN_GLONASS_NUM];
125 bncComb* _bncComb;
126 public:
127 bncPPPclient* _bncPPPclient;
128};
129#endif
Note: See TracBrowser for help on using the repository browser.