Rev | Line | |
---|
[3504] | 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 |
|
---|
| 20 | using namespace std;
|
---|
| 21 |
|
---|
| 22 | // Constructor
|
---|
| 23 | ////////////////////////////////////////////////////////////////////////////
|
---|
[3505] | 24 | hassDecoder::hassDecoder(const QString& staID) : RTCM3coDecoder(staID) {
|
---|
[3506] | 25 | _GPSweeks = -1.0;
|
---|
[3504] | 26 | }
|
---|
| 27 |
|
---|
| 28 | // Destructor
|
---|
| 29 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 30 | hassDecoder::~hassDecoder() {
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | //
|
---|
| 34 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 35 | t_irc hassDecoder::Decode(char* data, int dataLen, vector<string>& errmsg) {
|
---|
| 36 |
|
---|
| 37 | errmsg.clear();
|
---|
| 38 |
|
---|
| 39 | _buffer += QByteArray(data, dataLen);
|
---|
| 40 |
|
---|
[3506] | 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);
|
---|
[3504] | 46 |
|
---|
[3506] | 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 | }
|
---|
[3504] | 72 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.