Ignore:
Timestamp:
Sep 7, 2014, 11:05:26 AM (10 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP_free/bncpppclient.cpp

    r6068 r6072  
    8484//
    8585////////////////////////////////////////////////////////////////////////////
    86 void bncPPPclient::putNewObs(const t_obs& obs, t_output* output) {
     86void bncPPPclient::putNewObs(t_satData* satData, t_output* output) {
    8787  QMutexLocker locker(&_mutex);
    88 
    89   if      (obs.satSys == 'R') {
    90     if (!_opt->useSystem('R')) return;
    91   }
    92   else if (obs.satSys == 'E') {
    93     if (!_opt->useSystem('E')) return;
    94   }
    95   else if (obs.satSys != 'G') {
    96     return;
    97   }
    98 
    99   t_satData* satData = new t_satData();
    100   satData->tt = bncTime(obs.GPSWeek, obs.GPSWeeks);
    101 
    102   // Satellite Number
    103   // ----------------
    104   satData->prn = QString("%1%2").arg(obs.satSys).arg(obs.satNum,2,10,QChar('0'));
    105 
    106   // Check Slips
    107   // -----------
    108   slipInfo& sInfo  = _slips[satData->prn];
    109   if ( sInfo.slipCntL1 == obs.slip_cnt_L1  &&
    110        sInfo.slipCntL2 == obs.slip_cnt_L2  &&
    111        sInfo.slipCntL5 == obs.slip_cnt_L5 ) {
    112     satData->slipFlag = false;
    113   }
    114   else {
    115     satData->slipFlag = true;
    116   }
    117   sInfo.slipCntL1 = obs.slip_cnt_L1;
    118   sInfo.slipCntL2 = obs.slip_cnt_L2;
    119 
    120   // Handle Code Biases
    121   // ------------------
    122   t_bias* bb = 0;
    123   if (_bias.contains(satData->prn)) {
    124     bb = _bias.value(satData->prn);
    125   }
    12688
    12789  // Add new epoch, process the older ones
     
    139101  // Set Observations GPS and Glonass
    140102  // --------------------------------
    141   if      (obs.satSys == 'G' || obs.satSys == 'R') {
    142     const QByteArray preferredTypes("WPC");
    143     for (int ii = preferredTypes.length()-1; ii >= 0; ii--) {
    144       for (int iPhase = 0; iPhase <= 1; iPhase++) {
    145         for (int iFreq = 1; iFreq <= 2; iFreq++) {
    146 
    147           char rnxStr[4]; rnxStr[3] = '\0';
    148           double* p_value = 0;
    149           if      (iPhase == 0 && iFreq == 1) {
    150             rnxStr[0] = 'C';
    151             rnxStr[1] = '1';
    152             p_value = &satData->P1;
    153           }
    154           else if (iPhase == 0 && iFreq == 2) {
    155             rnxStr[0] = 'C';
    156             rnxStr[1] = '2';
    157             p_value = &satData->P2;
    158           }
    159           else if (iPhase == 1 && iFreq == 1) {
    160             rnxStr[0] = 'L';
    161             rnxStr[1] = '1';
    162             p_value = &satData->L1;
    163           }
    164           else if (iPhase == 1 && iFreq == 2) {
    165             rnxStr[0] = 'L';
    166             rnxStr[1] = '2';
    167             p_value = &satData->L2;
    168           }
    169 
    170           rnxStr[2] = preferredTypes[ii];
    171 
    172           double measdata = obs.measdata(rnxStr, 3.0);
    173           if (measdata != 0.0) {
    174             *p_value = measdata;
    175             if (rnxStr[0] == 'C' && bb) {
    176               char biasStr[3];
    177               biasStr[0] = rnxStr[1];
    178               biasStr[1] = rnxStr[2];
    179               biasStr[2] = '\0';
    180               *p_value += bb->value(biasStr);
    181             }
    182           }
    183         }
    184       }
    185     }
    186 
     103  if      (satData->system() == 'G' || satData->system() == 'R') {
    187104    if (satData->P1 != 0.0 && satData->P2 != 0.0 &&
    188105        satData->L1 != 0.0 && satData->L2 != 0.0 ) {
    189       t_frequency::type fType1 = t_lc::toFreq(obs.satSys,t_lc::l1);
    190       t_frequency::type fType2 = t_lc::toFreq(obs.satSys,t_lc::l2);
    191       double f1 = t_CST::freq(fType1, obs.slotNum);
    192       double f2 = t_CST::freq(fType2, obs.slotNum);
     106
     107      int channel = 0;
     108      if (satData->system() == 'R') {
     109        cerr << "not yet implemented" << endl;
     110        exit(0);
     111      }
     112
     113      t_frequency::type fType1 = t_lc::toFreq(satData->system(), t_lc::l1);
     114      t_frequency::type fType2 = t_lc::toFreq(satData->system(), t_lc::l2);
     115      double f1 = t_CST::freq(fType1, channel);
     116      double f2 = t_CST::freq(fType2, channel);
    193117      double a1 =   f1 * f1 / (f1 * f1 - f2 * f2);
    194118      double a2 = - f2 * f2 / (f1 * f1 - f2 * f2);
    195       satData->L1      = satData->L1 * t_CST::c / f1;
    196       satData->L2      = satData->L2 * t_CST::c / f2;
    197119      satData->P3      = a1 * satData->P1 + a2 * satData->P2;
    198120      satData->L3      = a1 * satData->L1 + a2 * satData->L2;
     
    207129  // Set Observations Galileo
    208130  // ------------------------
    209   else if (obs.satSys == 'E') {
    210     satData->P1 = obs.measdata("C1", 3.0);
    211     satData->L1 = obs.measdata("L1", 3.0);
    212     satData->P5 = obs.measdata("C5", 3.0);
    213     satData->L5 = obs.measdata("L5", 3.0);
     131  else if (satData->system() == 'E') {
    214132    if (satData->P1 != 0.0 && satData->P5 != 0.0 &&
    215133        satData->L1 != 0.0 && satData->L5 != 0.0 ) {
     
    218136      double a1 =   f1 * f1 / (f1 * f1 - f5 * f5);
    219137      double a5 = - f5 * f5 / (f1 * f1 - f5 * f5);
    220       satData->L1      = satData->L1 * t_CST::c / f1;
    221       satData->L5      = satData->L5 * t_CST::c / f5;
    222138      satData->P3      = a1 * satData->P1 + a5 * satData->P5;
    223139      satData->L3      = a1 * satData->L1 + a5 * satData->L5;
Note: See TracChangeset for help on using the changeset viewer.