Changeset 1024 in ntrip for trunk/BNC/bncrinex.cpp


Ignore:
Timestamp:
Aug 7, 2008, 4:01:56 PM (16 years ago)
Author:
zdenek
Message:

Zdenek Lukes: added logic for decoding of message 20/21 from RTCM 2.3 streams

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncrinex.cpp

    r843 r1024  
    9393    _rinexVers = 2;
    9494  }
     95
     96  _approxPos[0] = _approxPos[1] = _approxPos[2] = 0.0;
    9597}
    9698
     
    447449  // ------------------
    448450  else {
    449     double approxPos[3];  approxPos[0]  = approxPos[1]  = approxPos[2]  = 0.0;
    450451    double antennaNEU[3]; antennaNEU[0] = antennaNEU[1] = antennaNEU[2] = 0.0;
    451452   
     
    477478         << setw(20) << " "                                          << "ANT # / TYPE"         << endl;
    478479    _out.unsetf(ios::left);
    479     _out << setw(14) << setprecision(4) << approxPos[0]
    480          << setw(14) << setprecision(4) << approxPos[1]
    481          << setw(14) << setprecision(4) << approxPos[2]
     480    _out << setw(14) << setprecision(4) << _approxPos[0]
     481         << setw(14) << setprecision(4) << _approxPos[1]
     482         << setw(14) << setprecision(4) << _approxPos[2]
    482483         << "                  "                                     << "APPROX POSITION XYZ"  << endl;
    483484    _out << setw(14) << setprecision(4) << antennaNEU[0]
     
    565566  double sec = double(datTim.time().second()) + fmod(fObs->_o.GPSWeeks,1.0);
    566567
    567   // RINEX Version 3
    568   // ---------------
     568  // Epoch header line: RINEX Version 3
     569  // ----------------------------------
    569570  if (_rinexVers == 3) {
    570     char sbasflag = 'S';
    571571    _out << datTim.toString("> yyyy MM dd hh mm ").toAscii().data()
    572572         << setw(10) << setprecision(7) << sec
    573573         << "  " << 0 << setw(3)  << dumpList.size() << endl;
    574 
    575     QListIterator<p_obs> it(dumpList);
    576     while (it.hasNext()) {
    577       p_obs obs = it.next();
    578 // Changed data output, C1P, C2C|X, L2C|X, S2C|X added. Changed Output for SBAS Perlt 
    579       if (sbasflag != obs->_o.satSys) {
    580       _out << obs->_o.satSys
    581            << setw(2) << setfill('0') << obs->_o.satNum << setfill(' ')
    582            << setw(14) << setprecision(3) << obs->_o.C1 << "  " 
    583            << setw(14) << setprecision(3) << obs->_o.P1 << "  " 
    584            << setw(14) << setprecision(3) << obs->_o.L1 << " "
    585            << setw(1)                     << obs->_o.SNR1
    586            << setw(14) << setprecision(3) << obs->_o.S1 << "  "
    587            << setw(14) << setprecision(3) << obs->_o.C2 << "  " 
    588            << setw(14) << setprecision(3) << obs->_o.P2 << "  " ;
    589       if ((obs->_o.C2 != 0.0) && (obs->_o.P2 == 0.0)) {
    590        _out << setw(14) << setprecision(3) << obs->_o.L2 << " "
    591             << setw(1)                     << obs->_o.SNR2
    592             << setw(14) << setprecision(3) << obs->_o.S2 << "  "
    593             << "         0.000           0.000  ";
    594       }
    595       else {
    596        _out << "         0.000           0.000  "
    597             << setw(14) << setprecision(3) << obs->_o.L2 << " "
    598             << setw(1)                     << obs->_o.SNR2
    599             << setw(14) << setprecision(3) << obs->_o.S2;
    600       }
    601       _out << endl;
    602       }
    603       else {
    604       _out << obs->_o.satSys
    605            << setw(2) << setfill('0') << obs->_o.satNum << setfill(' ')
    606            << setw(14) << setprecision(3) << obs->_o.C1 << "  " 
    607            << setw(14) << setprecision(3) << obs->_o.P1 << "  " 
    608            << setw(14) << setprecision(3) << obs->_o.L1 << " "
    609            << setw(1)                     << obs->_o.SNR1
    610            << setw(14) << setprecision(3) << obs->_o.S1 << endl;
    611       }
    612       delete obs;
    613     }
    614   }
    615 
    616   // RINEX Version 2
    617   // ---------------
     574  }
     575  // Epoch header line: RINEX Version 2
     576  // ----------------------------------
    618577  else {
    619578    _out << datTim.toString(" yy MM dd hh mm ").toAscii().data()
    620579         << setw(10) << setprecision(7) << sec
    621580         << "  " << 0 << setw(3)  << dumpList.size();
    622    
     581
    623582    QListIterator<p_obs> it(dumpList); int iSat = 0;
    624583    while (it.hasNext()) {
     
    632591    }
    633592    _out << endl;
    634    
    635     it.toFront();
    636     while (it.hasNext()) {
    637       p_obs obs = it.next();
    638    
     593  }
     594
     595  QListIterator<p_obs> it(dumpList);
     596  while (it.hasNext()) {
     597    p_obs obs = it.next();
     598
     599    // Cycle slips detection
     600    // ---------------------
     601    int prn = 0;
     602    switch (obs->_o.satSys) {
     603    case 'G': prn = obs->_o.satNum;       break;
     604    case 'R': prn = obs->_o.satNum + 200; break;
     605    default:  prn = obs->_o.satNum;
     606    }
     607
     608    int lli1 = 0;
     609    int lli2 = 0;
     610    if ( _slip_cnt_L1.find(prn) != _slip_cnt_L1.end() &&
     611         _slip_cnt_L1.find(prn).value() != obs->_o.slip_cnt_L1 ) {
     612      lli1 = 1;
     613    }
     614    if ( _slip_cnt_L2.find(prn) != _slip_cnt_L2.end() &&
     615         _slip_cnt_L2.find(prn).value() != obs->_o.slip_cnt_L2 ) {
     616      lli2 = 1;
     617    }
     618    _slip_cnt_L1[prn]= obs->_o.slip_cnt_L1;
     619    _slip_cnt_L2[prn]= obs->_o.slip_cnt_L2;
     620
     621    // RINEX Version 3
     622    // ---------------
     623    if (_rinexVers == 3) {
     624      char sbasflag = 'S';
     625      // Changed data output, C1P, C2C|X, L2C|X, S2C|X added. Changed Output for SBAS Perlt 
     626      if (sbasflag != obs->_o.satSys) {
     627        _out << obs->_o.satSys
     628             << setw(2) << setfill('0') << obs->_o.satNum << setfill(' ')
     629             << setw(14) << setprecision(3) << obs->_o.C1 << "  " 
     630             << setw(14) << setprecision(3) << obs->_o.P1 << "  " 
     631             << setw(14) << setprecision(3) << obs->_o.L1 << lli1
     632             << setw(1)                     << obs->_o.SNR1
     633             << setw(14) << setprecision(3) << obs->_o.S1 << "  "
     634             << setw(14) << setprecision(3) << obs->_o.C2 << "  " 
     635             << setw(14) << setprecision(3) << obs->_o.P2 << "  " ;
     636        if ((obs->_o.C2 != 0.0) && (obs->_o.P2 == 0.0)) {
     637          _out << setw(14) << setprecision(3) << obs->_o.L2 << lli2
     638               << setw(1)                     << obs->_o.SNR2
     639               << setw(14) << setprecision(3) << obs->_o.S2 << "  "
     640               << "         0.000           0.000  ";
     641        }
     642        else {
     643          _out << "         0.000           0.000  "
     644               << setw(14) << setprecision(3) << obs->_o.L2 << " "
     645               << setw(1)                     << obs->_o.SNR2
     646               << setw(14) << setprecision(3) << obs->_o.S2;
     647        }
     648        _out << endl;
     649      }
     650      else {
     651        _out << obs->_o.satSys
     652             << setw(2) << setfill('0') << obs->_o.satNum << setfill(' ')
     653             << setw(14) << setprecision(3) << obs->_o.C1 << "  " 
     654             << setw(14) << setprecision(3) << obs->_o.P1 << "  " 
     655             << setw(14) << setprecision(3) << obs->_o.L1 << lli1
     656             << setw(1)                     << obs->_o.SNR1
     657             << setw(14) << setprecision(3) << obs->_o.S1 << endl;
     658      }
     659    }
     660
     661    // RINEX Version 2
     662    // ---------------
     663    else {
    639664      char lli = ' ';
    640665      char snr = ' ';
     
    643668      _out << setw(14) << setprecision(3) << obs->_o.P1 << lli << snr;
    644669      _out << setw(14) << setprecision(3) << obs->_o.P2 << lli << snr;
    645       _out << setw(14) << setprecision(3) << obs->_o.L1 << lli
     670      _out << setw(14) << setprecision(3) << obs->_o.L1 << lli1
    646671           << setw(1) << obs->_o.SNR1 << endl;
    647       _out << setw(14) << setprecision(3) << obs->_o.L2 << lli
     672      _out << setw(14) << setprecision(3) << obs->_o.L2 << lli2
    648673           << setw(1) << obs->_o.SNR2;
    649674      _out << setw(14) << setprecision(3) << obs->_o.S1 ;
    650675      _out << setw(16) << setprecision(3) << obs->_o.S2 ;
    651676      _out << endl;
    652    
    653       delete obs;
    654     }
     677    }
     678
     679    delete obs;
    655680  }
    656681
Note: See TracChangeset for help on using the changeset viewer.