Ignore:
Timestamp:
Dec 25, 2011, 7:27:03 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/BNC_LM/GPSS/hassDecoder.cpp

    r3508 r3571  
    1616 * -----------------------------------------------------------------------*/
    1717
     18#include <iostream>
    1819#include "hassDecoder.h"
    1920#include "bnctime.h"
     21#include "bncutils.h"
    2022
    2123using namespace std;
     
    4446  while ( (indexEOL = _buffer.indexOf('\n')) != -1) {
    4547    QByteArray line = _buffer.left(indexEOL-1);
    46     _buffer = _buffer.mid(indexEOL);
     48    _buffer = _buffer.mid(indexEOL+1);
    4749
    48     if (QString(line).split(QRegExp("\\s+")).count() != 11) {
     50    if (QString(line).split(QRegExp("\\s+"), QString::SkipEmptyParts).count() != 11) {
    4951      continue;
    5052    }
     
    5658    int     mjd, IOD;
    5759    double  daySec;
    58     double  deltaX, deltaY, deltaZ, deltaClk;
    59     double  rateDeltaX, rateDeltaY, rateDeltaZ;
     60    ColumnVector dx(3);
     61    ColumnVector dxRate(3);
     62    double clkFull;
     63
    6064    QString prn;
    6165   
    62     in >> mjd >> daySec >> prn >> IOD >> deltaX >> deltaY >> deltaZ
    63        >> deltaClk >> rateDeltaX >> rateDeltaY >> rateDeltaZ;
     66    in >> mjd >> daySec >> prn >> IOD >> dx[0] >> dx[1] >> dx[2] >> clkFull
     67       >> dxRate[0] >> dxRate[1] >> dxRate[2];
    6468
     69    // Correction Time
     70    // ---------------
    6571    bncTime tt;
    6672    tt.setmjd(daySec, mjd);
     
    6975    long coTime = tt.gpsw() * 7*24*3600 + long(floor(_GPSweeks+0.5));
    7076
     77    // Transform Correction
     78    // --------------------
     79    dx     = -dx;
     80    dxRate = -dxRate;
     81
     82    //// beg test
     83    continue;
     84    //// end test
     85    ////  t_eph* eph = 0;
     86    ////  if (_eph.contains(prn)) {
     87    ////    if      (_eph.value(prn)->last && _eph.value(prn)->last->IOD() == IOD) {
     88    ////      eph = _eph.value(prn)->last;
     89    ////    }
     90    ////    else if (_eph.value(prn)->prev && _eph.value(prn)->prev->IOD() == IOD) {
     91    ////      eph = _eph.value(prn)->prev;
     92    ////    }
     93    ////  }
     94    ////  if (!eph) {
     95    ////    continue;
     96    ////  }
     97
     98    ColumnVector xc(4);
     99    ColumnVector vv(3);
     100    ////  eph->position(tt.gpsw(), tt.gpssec(), xc.data(), vv.data());
     101
     102    ColumnVector rao(3);
     103    XYZ_to_RSW(xc.Rows(1,3), vv, dx,     rao);
     104
     105    ColumnVector dotRao(3);
     106    XYZ_to_RSW(xc.Rows(1,3), vv, dxRate, dotRao);
     107
     108    double dClk = clkFull - xc[3] * t_CST::c;
     109
     110    // Print Correction Line
     111    // ---------------------
    71112    QString corrLine;
    72113
    73     int updateInterval =  0;
    74     int messageType = 0;
     114    int updateInterval = 0;
     115    int messageType    = 0;
    75116    if      (prn[0] == 'G') {
    76       messageType = -COTYPE_GPSCOMBINED;
     117      messageType = COTYPE_GPSCOMBINED;
    77118    }
    78119    else if (prn[0] == 'R') {
    79       messageType = -COTYPE_GLONASSCOMBINED;
     120      messageType = COTYPE_GLONASSCOMBINED;
    80121    }
    81122
     
    87128                     messageType, updateInterval, tt.gpsw(), _GPSweeks,
    88129                     prn.toAscii().data(), IOD,
    89                      deltaClk, deltaX, deltaY, deltaZ,
    90                      0.0, rateDeltaX, rateDeltaY, rateDeltaZ, 0.0);
    91    
     130                     dClk, rao[0], rao[1], rao[2],
     131                     0.0, dotRao[0], dotRao[1], dotRao[2], 0.0);
     132
     133    reopen(_fileNameSkl, _fileName, _out);   
    92134    printLine(corrLine, coTime);
    93135  }
Note: See TracChangeset for help on using the changeset viewer.