Changeset 3442 in ntrip for trunk/BNC


Ignore:
Timestamp:
Sep 22, 2011, 12:36:00 PM (13 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/combination
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/combination/bnccomb.cpp

    r3441 r3442  
    3333
    3434const double sig0_offAC    = 1000.0;
    35 const double sig0_offACSat =  100.0;
     35const double sig0_offACSat = 1000.0;
    3636const double sigP_offACSat =    0.0;
    37 const double sig0_clkSat   =  100.0;
    38 const double sigP_clkSat   =  100.0;
     37const double sig0_clkSat   =   10.0;
     38const double sigP_clkSat   =    0.1;
    3939
    4040const double sigObs        =   0.05;
     
    5454  prn    = prn_;
    5555  xx     = 0.0;
     56  eph    = 0;
    5657
    5758  if      (type == offAC) {
     
    185186  }
    186187
    187   // Not yet regularized
    188   // -------------------
    189   _firstReg = false;
    190 
    191188  // Maximal Residuum
    192189  // ----------------
     
    340337  XYZ_to_RSW(newXC.Rows(1,3), newVV, dV, dDotRAO);
    341338
    342   QString msg = "switch " + corr->prn
     339  QString msg = "switch corr " + corr->prn
    343340    + QString(" %1 -> %2 %3").arg(corr->iod,3)
    344341    .arg(lastEph->IOD(),3).arg(dC*t_CST::c, 8, 'f', 4);
     
    386383  ColumnVector x0(nPar);
    387384  for (int iPar = 1; iPar <= _params.size(); iPar++) {
    388     cmbParam* pp = _params[iPar-1];
     385    cmbParam* pp  = _params[iPar-1];
     386    QString   prn = pp->prn;
     387    if (!prn.isEmpty() && _eph.find(prn) != _eph.end()) {
     388      switchToLastEph(_eph[prn]->last, pp);
     389    }
    389390    if (pp->epoSpec) {
    390391      pp->xx = 0.0;
     
    650651  }
    651652
    652   const int nCon = (_firstReg == false) ? 2 + MAXPRN_GPS : 2;
     653  const int nCon = 2;
    653654
    654655  AA.ReSize(nObs+nCon, nPar);  AA = 0.0;
     
    680681  // --------------
    681682  const double Ph = 1.e6;
    682   int iCond = 1;
    683   PP(nObs+iCond)          = Ph;
     683  PP(nObs+1) = Ph;
     684  PP(nObs+2) = Ph;
    684685  for (int iPar = 1; iPar <= _params.size(); iPar++) {
    685686    cmbParam* pp = _params[iPar-1];
    686     if (pp->type == cmbParam::clkSat &&
    687         AA.Column(iPar).maximum_absolute_value() > 0.0) {
    688       AA(nObs+iCond, iPar) = 1.0;
    689     }
    690   }
    691 
    692   ++iCond;
    693   PP(nObs+iCond) = Ph;
    694   for (int iPar = 1; iPar <= _params.size(); iPar++) {
    695     cmbParam* pp = _params[iPar-1];
    696     if (pp->type == cmbParam::offAC &&
    697         AA.Column(iPar).maximum_absolute_value() > 0.0) {
    698       AA(nObs+iCond, iPar) = 1.0;
    699     }
    700   }
    701 
    702   if (!_firstReg) {
    703     _firstReg = true;
    704     for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
    705       ++iCond;
    706       QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
    707       PP(nObs+1+iGps)       = Ph;
    708       for (int iPar = 1; iPar <= _params.size(); iPar++) {
    709         cmbParam* pp = _params[iPar-1];
    710         if (pp->type == cmbParam::offACSat && pp->prn == prn) {
    711           AA(nObs+iCond, iPar) = 1.0;
    712         }
    713       }
     687    if      (pp->type == cmbParam::clkSat) {
     688      AA(nObs+1, iPar) = 1.0;
     689    }
     690    else if (pp->type == cmbParam::offAC) {
     691      AA(nObs+2, iPar) = 1.0;
    714692    }
    715693  }
     
    717695  return success;
    718696}
     697
     698// Change the parameter so that it refers to last received ephemeris
     699////////////////////////////////////////////////////////////////////////////
     700void bncComb::switchToLastEph(const t_eph* lastEph, cmbParam* pp) {
     701
     702  if (pp->type != cmbParam::clkSat) {
     703    return;
     704  }
     705
     706  if (pp->eph == 0) {
     707    pp->eph = lastEph;
     708    return;
     709  }
     710
     711  if (pp->eph == lastEph) {
     712    return;
     713  }
     714
     715  ColumnVector oldXC(4);
     716  ColumnVector oldVV(3);
     717  pp->eph->position(_resTime.gpsw(), _resTime.gpssec(),
     718                      oldXC.data(), oldVV.data());
     719
     720  ColumnVector newXC(4);
     721  ColumnVector newVV(3);
     722  lastEph->position(_resTime.gpsw(), _resTime.gpssec(),
     723                    newXC.data(), newVV.data());
     724
     725  double       dC = newXC(4)        - oldXC(4);
     726
     727  QString msg = "switch param " + pp->prn
     728    + QString(" %1 -> %2 %3").arg(pp->eph->IOD(),3)
     729    .arg(lastEph->IOD(),3).arg(dC*t_CST::c, 8, 'f', 4);
     730
     731  emit newMessage(msg.toAscii(), false);
     732
     733  pp->eph = lastEph;
     734  pp->xx  += dC * t_CST::c;
     735}
     736
  • trunk/BNC/combination/bnccomb.h

    r3440 r3442  
    2626  double  sigP;
    2727  bool    epoSpec;
     28  const t_eph* eph;
    2829};
    2930
     
    7879  void printResults(QTextStream& out, const QMap<QString, t_corr*>& resCorr);
    7980  void switchToLastEph(const t_eph* lastEph, t_corr* corr);
     81  void switchToLastEph(const t_eph* lastEph, cmbParam* pp);
    8082
    8183  QVector<cmbCorr*>& corrs() {return _buffer[_resTime].corrs;}
     
    8789  bncRtnetDecoder*        _rtnetDecoder;
    8890  SymmetricMatrix         _QQ;
    89   bool                    _firstReg;
    9091  QByteArray              _log;
    9192  bncAntex*               _antex;
Note: See TracChangeset for help on using the changeset viewer.