Changeset 2791 in ntrip for trunk/BNC/bncmodel.cpp


Ignore:
Timestamp:
Dec 14, 2010, 2:06:28 PM (13 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncmodel.cpp

    r2790 r2791  
    296296
    297297  QMapIterator<QString, t_satData*> it(epoData->satDataGPS);
    298   int iObs = 0;
     298  int iObsBanc = 0;
    299299  while (it.hasNext()) {
    300     ++iObs;
     300    ++iObsBanc;
    301301    it.next();
    302302    QString    prn     = it.key();
    303303    t_satData* satData = it.value();
    304     BB(iObs, 1) = satData->xx(1);
    305     BB(iObs, 2) = satData->xx(2);
    306     BB(iObs, 3) = satData->xx(3);
    307     BB(iObs, 4) = satData->P3 + satData->clk;
     304    BB(iObsBanc, 1) = satData->xx(1);
     305    BB(iObsBanc, 2) = satData->xx(2);
     306    BB(iObsBanc, 3) = satData->xx(3);
     307    BB(iObsBanc, 4) = satData->P3 + satData->clk;
    308308  }
    309309
     
    691691    vv = ll - AA * dx;
    692692
    693     ostringstream strA;
    694     strA.setf(ios::fixed);
    695     ColumnVector vv_code(epoData->sizeGPS());
    696     ColumnVector vv_phase(epoData->sizeGPS());
    697     ColumnVector vv_glo(epoData->sizeGlo());
    698     ColumnVector vv_gal_code(epoData->sizeGal());
    699     ColumnVector vv_gal_phase(epoData->sizeGal());
    700 
    701     for (unsigned iobs = 1; iobs <= epoData->sizeGPS(); ++iobs) {
    702       if (_usePhase) {
    703         vv_code(iobs)  = vv(2*iobs-1);
    704         vv_phase(iobs) = vv(2*iobs);
    705       }
    706       else {
    707         vv_code(iobs)  = vv(iobs);
    708       }
    709     }
    710     if (_useGlonass) {
    711       for (unsigned iobs = 1; iobs <= epoData->sizeGlo(); ++iobs) {
    712         vv_glo(iobs)  = vv(2*epoData->sizeGPS()+iobs);
    713       }
    714     }
    715     if (_useGalileo) {
    716       for (unsigned iobs = 1; iobs <= epoData->sizeGal(); ++iobs) {
    717         if (_usePhase) {
    718           vv_gal_code(iobs)  = vv(2*iobs-1);
    719           vv_gal_phase(iobs) = vv(2*iobs);
    720         }
    721         else {
    722           vv_gal_code(iobs)  = vv(iobs);
    723         }
    724       }
    725     }
    726 
    727     strA   << "residuals code  " << setw(8) << setprecision(3) << vv_code.t();
    728     if (_usePhase) {
    729       strA << "residuals phase " << setw(8) << setprecision(3) << vv_phase.t();
    730     }
    731     if (_useGlonass) {
    732       strA << "residuals glo   " << setw(8) << setprecision(3) << vv_glo.t();
    733     }
    734     if (_useGalileo) {
    735       strA << "Galileo code    " << setw(8) << setprecision(3) << vv_gal_code.t();
    736       if (_usePhase) {
    737         strA << "Galileo phase   " << setw(8) << setprecision(3) << vv_gal_phase.t();
    738       }
    739     }
    740     _log += strA.str().c_str();
     693    // Print Residuals
     694    // ---------------
     695    if (true) {
     696      ostringstream str;
     697      str.setf(ios::fixed);
     698
     699      QMapIterator<QString, t_satData*> itGPS(epoData->satDataGPS);
     700      while (itGPS.hasNext()) {
     701        itGPS.next();
     702        t_satData* satData = itGPS.value();
     703        printRes(vv, str, satData);
     704      }
     705      QMapIterator<QString, t_satData*> itGlo(epoData->satDataGlo);
     706      while (itGlo.hasNext()) {
     707        itGlo.next();
     708        t_satData* satData = itGlo.value();
     709        printRes(vv, str, satData);
     710      }
     711      QMapIterator<QString, t_satData*> itGal(epoData->satDataGal);
     712      while (itGal.hasNext()) {
     713        itGal.next();
     714        t_satData* satData = itGal.value();
     715        printRes(vv, str, satData);
     716      }
     717      _log += str.str().c_str();
     718    }
    741719
    742720  } while (outlierDetection(QQsav, vv, epoData->satDataGPS,
     
    12971275                      Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP) {
    12981276
     1277  // Code Observations
     1278  // -----------------
    12991279  if (satData->system() != 'R') {
    13001280    ++iObs;
     
    13041284      AA(iObs, iPar) = _params[iPar-1]->partial(satData, false);
    13051285    }
     1286    satData->indexCode = iObs;
    13061287  }
    13071288 
     1289  // Phase Observations
     1290  // ------------------
    13081291  if (_usePhase) {
    13091292    ++iObs;
     
    13171300      AA(iObs, iPar) = _params[iPar-1]->partial(satData, true);
    13181301    }
    1319   }
    1320 }
     1302    satData->indexPhase = iObs;
     1303  }
     1304}
     1305
     1306//
     1307///////////////////////////////////////////////////////////////////////////
     1308void bncModel::printRes(const ColumnVector& vv,
     1309                        ostringstream& str, t_satData* satData) {
     1310  if (satData->indexCode) {
     1311    str << "RES P3 " << satData->prn.toAscii().data() << " "
     1312        << setw(9) << setprecision(4) << vv(satData->indexCode) << endl;
     1313  }
     1314  if (satData->indexPhase) {
     1315    str << "RES L3 " << satData->prn.toAscii().data() << " "
     1316        << setw(9) << setprecision(4) << vv(satData->indexPhase) << endl;
     1317  }
     1318}
Note: See TracChangeset for help on using the changeset viewer.