Changeset 2778 in ntrip


Ignore:
Timestamp:
Dec 12, 2010, 6:09:08 PM (13 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncconst.cpp

    r2063 r2778  
    2626
    2727const double t_CST::c       = 299792458.0;
    28 const double t_CST::freq1   = 1575420000.0;
    29 const double t_CST::freq2   = 1227600000.0;
     28const double t_CST::freq1   = 1575420000.0; // GPS and Galileo E1
     29const double t_CST::freq2   = 1227600000.0; // GPS only
     30const double t_CST::freq5   = 1176450000.0; // GPS and Galileo E5a
    3031const double t_CST::lambda1 = c / freq1;
    3132const double t_CST::lambda2 = c / freq2;
     33const double t_CST::lambda5 = c / freq5;
    3234const double t_CST::omega   = 7292115.1467e-11;
    3335const double t_CST::aell    = 6378137.000;
  • trunk/BNC/bncconst.h

    r2063 r2778  
    3030class t_CST {
    3131  public:
    32     static const double c      ;
    33     static const double freq1  ;
    34     static const double freq2  ;
     32    static const double c;
     33    static const double freq1; // GPS and Galileo E1
     34    static const double freq2; // GPS only           
     35    static const double freq5; // GPS and Galileo E5a
    3536    static const double lambda1;
    3637    static const double lambda2;
     38    static const double lambda5;
    3739    static const double omega;
    3840    static const double aell;
  • trunk/BNC/bncpppclient.cpp

    r2777 r2778  
    147147  slipInfo& sInfo  = _slips[satData->prn];
    148148  if ( sInfo.slipCntL1 == obs.slip_cnt_L1  &&
    149        sInfo.slipCntL2 == obs.slip_cnt_L2 ) {
     149       sInfo.slipCntL2 == obs.slip_cnt_L2  &&
     150       sInfo.slipCntL5 == obs.slip_cnt_L5 ) {
    150151    satData->slipFlag = false;
    151152  }
     
    163164  }
    164165
    165   // Set Code Observations
    166   // --------------------- 
     166  // Set Code Observations - P1 or C1
     167  // --------------------------------
     168  bool haveP1 = false;
    167169  if      (obs.P1) {
    168170    satData->P1         = obs.P1 + (bb ? bb->p1 : 0.0);
    169171    satData->codeTypeF1 = t_satData::P_CODE;
     172    haveP1 = true;
    170173  }
    171174  else if (obs.C1) {
    172175    satData->P1         = obs.C1 + (bb ? bb->c1 : 0.0);
    173176    satData->codeTypeF1 = t_satData::C_CODE;
    174   }
    175   else {
     177    haveP1 = true;
     178  }
     179
     180  if (!haveP1) {
    176181    delete satData;
    177182    return;
    178183  }
    179    
     184
     185  // P2 or C2, and C5
     186  // ----------------   
     187  bool haveP2 = false;
    180188  if      (obs.P2) {
    181189    satData->P2         = obs.P2 + (bb ? bb->p2 : 0.0);
    182190    satData->codeTypeF2 = t_satData::P_CODE;
     191    haveP2 = true;
    183192  }
    184193  else if (obs.C2) {
    185194    satData->P2         = obs.C2;
    186195    satData->codeTypeF2 = t_satData::C_CODE;
    187   }
    188   else {
     196    haveP2 = true;
     197  }
     198
     199  bool haveP5 = false;
     200  if      (obs.C5) {
     201    satData->P5         = obs.C5;
     202    satData->codeTypeF2 = t_satData::P_CODE;
     203    haveP5 = true;
     204  }
     205
     206  if (!haveP2 && !haveP5) {
    189207    delete satData;
    190208    return;
    191209  }
    192 
    193   double f1 = t_CST::freq1;
    194   double f2 = t_CST::freq2;
    195 
    196   if (obs.satSys == 'R') {
    197     f1 = 1602000000.0 + 562500.0 * obs.slotNum;
    198     f2 = 1246000000.0 + 437500.0 * obs.slotNum;
    199   }
    200 
    201   // Ionosphere-Free Combination
    202   // ---------------------------
    203   double c1 =   f1 * f1 / (f1 * f1 - f2 * f2);
    204   double c2 = - f2 * f2 / (f1 * f1 - f2 * f2);
    205  
    206   satData->P3 =  c1 * satData->P1 + c2 * satData->P2;
    207 
    208   // Set Phase Observations
    209   // ---------------------- 
    210   if (obs.L1() && obs.L2()) {
    211     satData->L1 = obs.L1() * t_CST::c / f1;
    212     satData->L2 = obs.L2() * t_CST::c / f2;
    213   }
    214   else {
    215     delete satData;
    216     return;
    217   }
    218   satData->L3 =  c1 * satData->L1 + c2 * satData->L2;
    219 
    220   // Set Ionosphere-Free Wavelength
    221   // ------------------------------
    222   satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2;
    223210
    224211  // Add new Satellite to the epoch
     
    237224  }
    238225
     226  // Set Ionosphere-Free Combinations
     227  // --------------------------------
    239228  if      (obs.satSys == 'G') {
     229    double f1 = t_CST::freq1;
     230    double f2 = t_CST::freq2;
     231    double c1 =   f1 * f1 / (f1 * f1 - f2 * f2);
     232    double c2 = - f2 * f2 / (f1 * f1 - f2 * f2);
     233
     234    if (obs.L1() && obs.L2()) {
     235      satData->L1 = obs.L1() * t_CST::c / f1;
     236      satData->L2 = obs.L2() * t_CST::c / f2;
     237    }
     238    else {
     239      delete satData;
     240      return;
     241    }
     242
     243    satData->P3      = c1 * satData->P1 + c2 * satData->P2;
     244    satData->L3      = c1 * satData->L1 + c2 * satData->L2;
     245    satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2;
     246
    240247    _epoData->satDataGPS[satData->prn] = satData;
    241248  }
    242249  else if (obs.satSys == 'R') {
     250    double f1 = 1602000000.0 + 562500.0 * obs.slotNum;
     251    double f2 = 1246000000.0 + 437500.0 * obs.slotNum;
     252    double c1 =   f1 * f1 / (f1 * f1 - f2 * f2);
     253    double c2 = - f2 * f2 / (f1 * f1 - f2 * f2);
     254
     255    if (obs.L1() && obs.L2()) {
     256      satData->L1 = obs.L1() * t_CST::c / f1;
     257      satData->L2 = obs.L2() * t_CST::c / f2;
     258    }
     259    else {
     260      delete satData;
     261      return;
     262    }
     263
     264    satData->P3      = c1 * satData->P1 + c2 * satData->P2;
     265    satData->L3      = c1 * satData->L1 + c2 * satData->L2;
     266    satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2;
     267
    243268    _epoData->satDataGlo[satData->prn] = satData;
     269  }
     270  else if (obs.satSys == 'E') {
     271    double f1 = t_CST::freq1;
     272    double f5 = t_CST::freq5;
     273    double c1 =   f1 * f1 / (f1 * f1 - f5 * f5);
     274    double c5 = - f5 * f5 / (f1 * f1 - f5 * f5);
     275
     276    if (obs.L1() && obs.L5) {
     277      satData->L1 = obs.L1() * t_CST::c / f1;
     278      satData->L5 = obs.L5   * t_CST::c / f5;
     279    }
     280    else {
     281      delete satData;
     282      return;
     283    }
     284
     285    satData->P3      = c1 * satData->P1 + c5 * satData->P5;
     286    satData->L3      = c1 * satData->L1 + c5 * satData->L5;
     287    satData->lambda3 = c1 * t_CST::c / f1 + c5 * t_CST::c / f5;
     288
     289    _epoData->satDataGal[satData->prn] = satData;
    244290  }
    245291}
     
    294340    t_ephGlo* eLast = new t_ephGlo();
    295341    eLast->set(&gloeph);
     342    _eph.insert(prn, new t_ephPair());
     343    _eph[prn]->last = eLast;
     344  }
     345}
     346
     347//
     348////////////////////////////////////////////////////////////////////////////
     349void bncPPPclient::slotNewEphGalileo(galileoephemeris galeph) {
     350  QMutexLocker locker(&_mutex);
     351
     352  QString prn = QString("E%1").arg(galeph.satellite, 2, 10, QChar('0'));
     353
     354  if (_eph.contains(prn)) {
     355    t_ephGal* eLast = static_cast<t_ephGal*>(_eph.value(prn)->last);
     356    if ( (eLast->GPSweek() <  galeph.Week) ||
     357         (eLast->GPSweek() == galeph.Week && 
     358          eLast->TOC()     <  galeph.TOC) ) {
     359      delete static_cast<t_ephGal*>(_eph.value(prn)->prev);
     360      _eph.value(prn)->prev = _eph.value(prn)->last;
     361      _eph.value(prn)->last = new t_ephGal();
     362      static_cast<t_ephGal*>(_eph.value(prn)->last)->set(&galeph);
     363    }
     364  }
     365  else {
     366    t_ephGal* eLast = new t_ephGal();
     367    eLast->set(&galeph);
    296368    _eph.insert(prn, new t_ephPair());
    297369    _eph[prn]->last = eLast;
     
    557629  }
    558630}
    559 
    560 //
    561 ////////////////////////////////////////////////////////////////////////////
    562 void bncPPPclient::slotNewEphGalileo(galileoephemeris galeph) {
    563   QMutexLocker locker(&_mutex);
    564 
    565   QString prn = QString("E%1").arg(galeph.satellite, 2, 10, QChar('0'));
    566 
    567   if (_eph.contains(prn)) {
    568     t_ephGal* eLast = static_cast<t_ephGal*>(_eph.value(prn)->last);
    569     if ( (eLast->GPSweek() <  galeph.Week) ||
    570          (eLast->GPSweek() == galeph.Week && 
    571           eLast->TOC()     <  galeph.TOC) ) {
    572       delete static_cast<t_ephGal*>(_eph.value(prn)->prev);
    573       _eph.value(prn)->prev = _eph.value(prn)->last;
    574       _eph.value(prn)->last = new t_ephGal();
    575       static_cast<t_ephGal*>(_eph.value(prn)->last)->set(&galeph);
    576     }
    577   }
    578   else {
    579     t_ephGal* eLast = new t_ephGal();
    580     eLast->set(&galeph);
    581     _eph.insert(prn, new t_ephPair());
    582     _eph[prn]->last = eLast;
    583   }
    584 }
  • trunk/BNC/bncpppclient.h

    r2776 r2778  
    4343  double       P1;
    4444  double       P2;
     45  double       P5;
    4546  double       P3;
    4647  double       L1;
    4748  double       L2;
     49  double       L5;
    4850  double       L3;
    4951  codeType     codeTypeF1;
    5052  codeType     codeTypeF2;
     53  codeType     codeTypeF5;
    5154  ColumnVector xx;
    5255  ColumnVector vv;
     
    7376      delete itGlo.value();
    7477    }
     78    QMapIterator<QString, t_satData*> itGal(satDataGal);
     79    while (itGal.hasNext()) {
     80      itGal.next();
     81      delete itGal.value();
     82    }
    7583  }
    7684  unsigned sizeGPS() const {return satDataGPS.size();}
    7785  unsigned sizeGlo() const {return satDataGlo.size();}
    78   unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size();}
     86  unsigned sizeGal() const {return satDataGal.size();}
     87  unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size() +
     88                                   satDataGal.size();}
    7989  bncTime                    tt;
    8090  QMap<QString, t_satData*> satDataGPS;
    8191  QMap<QString, t_satData*> satDataGlo;
     92  QMap<QString, t_satData*> satDataGal;
    8293};
    8394
     
    139150      slipCntL1 = -1;
    140151      slipCntL2 = -1;
     152      slipCntL5 = -1;
    141153    }
    142154    ~slipInfo(){}
    143155    int slipCntL1;
    144156    int slipCntL2;
     157    int slipCntL5;
    145158  };
    146159
Note: See TracChangeset for help on using the changeset viewer.