source: ntrip/trunk/BNC/GPSS/hassDecoder.cpp@ 3506

Last change on this file since 3506 was 3506, checked in by mervart, 11 years ago
File size: 1.7 KB
Line 
1
2/* -------------------------------------------------------------------------
3 * BKG NTRIP Client
4 * -------------------------------------------------------------------------
5 *
6 * Class: hassDecoder
7 *
8 * Purpose: Decode Data (PPP Corrections) in HASS Format
9 *
10 * Author: L. Mervart
11 *
12 * Created: 19-Nov-2011
13 *
14 * Changes:
15 *
16 * -----------------------------------------------------------------------*/
17
18#include "hassDecoder.h"
19
20using namespace std;
21
22// Constructor
23////////////////////////////////////////////////////////////////////////////
24hassDecoder::hassDecoder(const QString& staID) : RTCM3coDecoder(staID) {
25 _GPSweeks = -1.0;
26}
27
28// Destructor
29////////////////////////////////////////////////////////////////////////////
30hassDecoder::~hassDecoder() {
31}
32
33//
34////////////////////////////////////////////////////////////////////////////
35t_irc hassDecoder::Decode(char* data, int dataLen, vector<string>& errmsg) {
36
37 errmsg.clear();
38
39 _buffer += QByteArray(data, dataLen);
40
41 bool corrFound = false;
42 int indexEOL = -1;
43 while ( (indexEOL = _buffer.indexOf('\n')) != -1) {
44 QByteArray line = _buffer.left(indexEOL-1);
45 _buffer = _buffer.mid(indexEOL);
46
47 if (QString(line).split(QRegExp("\\s+")).count() != 11) {
48 continue;
49 }
50 else {
51 corrFound = true;
52 }
53
54 QTextStream in(line, QIODevice::ReadOnly | QIODevice::Text);
55 int mjd, IOD;
56 double daySec;
57 double deltaX, deltaY, deltaZ, deltaClk;
58 double rateDeltaX, rateDeltaY, rateDeltaZ;
59 QString prn;
60
61 in >> mjd >> daySec >> prn >> IOD >> deltaX >> deltaY >> deltaZ
62 >> deltaClk >> rateDeltaX >> rateDeltaY >> rateDeltaZ;
63
64 }
65
66 if (corrFound) {
67 return success;
68 }
69 else {
70 return failure;
71 }
72}
Note: See TracBrowser for help on using the repository browser.