[3528] | 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 | /* -------------------------------------------------------------------------
|
---|
| 26 | * BKG NTRIP Client
|
---|
| 27 | * -------------------------------------------------------------------------
|
---|
| 28 | *
|
---|
| 29 | * Class: GPSDecoder
|
---|
| 30 | *
|
---|
| 31 | * Purpose: Decoder Base Class
|
---|
| 32 | *
|
---|
| 33 | * Author: L. Mervart
|
---|
| 34 | *
|
---|
| 35 | * Created: 16-Dec-2011
|
---|
| 36 | *
|
---|
| 37 | * Changes:
|
---|
| 38 | *
|
---|
| 39 | * -----------------------------------------------------------------------*/
|
---|
| 40 |
|
---|
| 41 | #include <iomanip>
|
---|
| 42 | #include <cmath>
|
---|
| 43 |
|
---|
| 44 | #include "GPSDecoder.h"
|
---|
| 45 | #include "bncsettings.h"
|
---|
[5884] | 46 | #include "bncrinex.h"
|
---|
[3528] | 47 |
|
---|
| 48 | using namespace std;
|
---|
| 49 |
|
---|
| 50 | // Constructor
|
---|
| 51 | //////////////////////////////////////////////////////////////////////////////
|
---|
| 52 | GPSDecoder::GPSDecoder() {
|
---|
[3529] | 53 | _rnx = 0;
|
---|
| 54 | }
|
---|
| 55 |
|
---|
[5884] | 56 | // Destructor
|
---|
| 57 | //////////////////////////////////////////////////////////////////////////////
|
---|
| 58 | GPSDecoder::~GPSDecoder() {
|
---|
| 59 | delete _rnx;
|
---|
| 60 | }
|
---|
| 61 |
|
---|
[3529] | 62 | // Initialize RINEX Writer
|
---|
| 63 | //////////////////////////////////////////////////////////////////////////////
|
---|
| 64 | void GPSDecoder::initRinex(const QByteArray& staID, const QUrl& mountPoint,
|
---|
| 65 | const QByteArray& latitude,
|
---|
| 66 | const QByteArray& longitude, const QByteArray& nmea,
|
---|
| 67 | const QByteArray& ntripVersion) {
|
---|
| 68 | if (_rnx) {
|
---|
| 69 | return;
|
---|
| 70 | }
|
---|
[3528] | 71 | bncSettings settings;
|
---|
[3529] | 72 | if ( !settings.value("rnxPath").toString().isEmpty() ) {
|
---|
| 73 | _rnx = new bncRinex(staID, mountPoint, latitude, longitude,
|
---|
| 74 | nmea, ntripVersion);
|
---|
[3528] | 75 | }
|
---|
| 76 | }
|
---|
| 77 |
|
---|
| 78 | // Write RINEX Epoch
|
---|
| 79 | //////////////////////////////////////////////////////////////////////////////
|
---|
[6137] | 80 | void GPSDecoder::dumpRinexEpoch(const t_satObs& obs, const QByteArray& format) {
|
---|
[3528] | 81 | if (_rnx) {
|
---|
[6137] | 82 | long iSec = long(floor(obs._time.gpssec()+0.5));
|
---|
[3528] | 83 | if (_rnx->samplingRate() == 0 || iSec % _rnx->samplingRate() == 0) {
|
---|
| 84 | _rnx->deepCopy(obs);
|
---|
| 85 | }
|
---|
[6448] | 86 | _rnx->dumpEpoch(format, obs._time);
|
---|
[3528] | 87 | }
|
---|
| 88 | }
|
---|
| 89 |
|
---|
| 90 | // Set RINEX Reconnect Flag
|
---|
| 91 | //////////////////////////////////////////////////////////////////////////////
|
---|
| 92 | void GPSDecoder::setRinexReconnectFlag(bool flag) {
|
---|
| 93 | if (_rnx) {
|
---|
| 94 | _rnx->setReconnectFlag(flag);
|
---|
| 95 | }
|
---|
| 96 | }
|
---|
[4392] | 97 |
|
---|