Changeset 2265 in ntrip


Ignore:
Timestamp:
Jan 16, 2010, 3:52:59 PM (14 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncmodel.cpp

    r2248 r2265  
    6060const double   sig_crd_0        =  100.0;
    6161const double   sig_crd_p        =  100.0;
    62 const double   sig_clk_0        = 1000.0;
     62const double   sig_clk_0        =  100.0;
    6363const double   sig_trp_0        =    0.01;
    6464const double   sig_trp_p        =    1e-6;
    65 const double   sig_amb_0        = 1000.0;
     65const double   sig_amb_0_GPS    =  100.0;
     66const double   sig_amb_0_GLO    = 1000.0;
    6667const double   sig_P3           =    1.0;
    6768const double   sig_L3_GPS       =    0.01;
     
    102103  // Receiver Clocks
    103104  // ---------------
    104   else if (type == RECCLK_GPS) {
    105     if (satData->prn[0] == 'G') {
    106       return 1.0;
    107     }
    108     else {
    109       return 0.0;
    110     }
    111   }
    112   else if (type == RECCLK_GLO) {
    113     if (satData->prn[0] == 'R') {
    114       return 1.0;
    115     }
    116     else {
    117       return 0.0;
    118     }
     105  else if (type == RECCLK) {
     106    return 1.0;
    119107  }
    120108
     
    170158  _ellBanc.ReSize(3); _ellBanc = 0.0;
    171159
    172   if ( Qt::CheckState(settings.value("pppGLONASS").toInt()) == Qt::Checked) {
     160  if (_usePhase &&
     161      Qt::CheckState(settings.value("pppGLONASS").toInt()) == Qt::Checked) {
    173162    _useGlonass = true;
    174163  }
     
    178167
    179168  int nextPar = 0;
    180   _params.push_back(new bncParam(bncParam::CRD_X,      ++nextPar, ""));
    181   _params.push_back(new bncParam(bncParam::CRD_Y,      ++nextPar, ""));
    182   _params.push_back(new bncParam(bncParam::CRD_Z,      ++nextPar, ""));
    183   _params.push_back(new bncParam(bncParam::RECCLK_GPS, ++nextPar, ""));
    184   if (_useGlonass) {
    185     _params.push_back(new bncParam(bncParam::RECCLK_GLO,  ++nextPar, ""));
    186   }
     169  _params.push_back(new bncParam(bncParam::CRD_X,  ++nextPar, ""));
     170  _params.push_back(new bncParam(bncParam::CRD_Y,  ++nextPar, ""));
     171  _params.push_back(new bncParam(bncParam::CRD_Z,  ++nextPar, ""));
     172  _params.push_back(new bncParam(bncParam::RECCLK, ++nextPar, ""));
    187173  if (_estTropo) {
    188174    _params.push_back(new bncParam(bncParam::TROPO,       ++nextPar, ""));
     
    200186      _QQ(iPar,iPar) = sig_crd_0 * sig_crd_0;
    201187    }
    202     else if (pp->isClk()) {
     188    else if (pp->type == bncParam::RECCLK) {
    203189      _QQ(iPar,iPar) = sig_clk_0 * sig_clk_0;
    204190    }
     
    347333                     trp() / sin(satData->eleSat);
    348334
    349   double clk = 0.0;
    350   if      (satData->prn[0] == 'G') {
    351     clk = clkGPS();
    352   }
    353   else if (satData->prn[0] == 'R') {
    354     clk = clkGlo();
    355   }
    356 
    357   return satData->rho + clk - satData->clk + tropDelay;
     335  return satData->rho + clk() - satData->clk + tropDelay;
    358336}
    359337
     
    425403    // Receiver Clocks
    426404    // ---------------
    427     else if (pp->isClk()) {
     405    else if (pp->type == bncParam::RECCLK) {
    428406      pp->xx = _xcBanc(4);
    429407      for (int jj = 1; jj <= _params.size(); jj++) {
     
    534512      bncParam* par = _params[ii-1];
    535513      if (par->index_old == 0) {
    536         _QQ(par->index, par->index) = sig_amb_0 * sig_amb_0;
     514        if (par->prn[0] == 'R') {
     515          _QQ(par->index, par->index) = sig_amb_0_GLO * sig_amb_0_GLO;
     516        }
     517        else {
     518          _QQ(par->index, par->index) = sig_amb_0_GPS * sig_amb_0_GPS;
     519        }
    537520      }
    538521      par->index_old = par->index;
     
    646629          AA(iObs, iPar) = _params[iPar-1]->partial(satData, true);
    647630        }
    648      
    649         ostringstream str;
    650         str.setf(ios::fixed);
    651         str << "\niObs = " << iObs << " " << prn.toAscii().data() << " "
    652             << setprecision(3) << rhoCmp << " "
    653             << setprecision(3) << satData->P3 << " "
    654             << setprecision(3) << satData->L3 << " "
    655             << ll(iObs) << endl;
    656         _log += str.str().c_str();
    657631      }
    658632    }
     
    669643    vv    = ll - AA * dx;
    670644
    671     //// beg test
    672     {
    673       ostringstream str;
    674       str.setf(ios::fixed);
    675       ColumnVector vv_code(epoData->sizeGPS());
    676       ColumnVector vv_phase(epoData->sizeGPS());
    677       ColumnVector vv_glo(epoData->sizeGlo());
    678 
    679       for (unsigned iobs = 1; iobs <= epoData->sizeGPS(); ++iobs) {
     645    ostringstream str;
     646    str.setf(ios::fixed);
     647    ColumnVector vv_code(epoData->sizeGPS());
     648    ColumnVector vv_phase(epoData->sizeGPS());
     649    ColumnVector vv_glo(epoData->sizeGlo());
     650
     651    for (unsigned iobs = 1; iobs <= epoData->sizeGPS(); ++iobs) {
     652      if (_usePhase) {
    680653        vv_code(iobs)  = vv(2*iobs-1);
    681654        vv_phase(iobs) = vv(2*iobs);
    682655      }
     656      else {
     657        vv_code(iobs)  = vv(iobs);
     658      }
     659    }
     660    if (_useGlonass) {
    683661      for (unsigned iobs = 1; iobs <= epoData->sizeGlo(); ++iobs) {
    684662        vv_glo(iobs)  = vv(2*epoData->sizeGPS()+iobs);
    685663      }
    686 
    687       str << "\nresiduals code  " << setprecision(3) << vv_code.t();
     664    }
     665
     666    str << "\nresiduals code  " << setprecision(3) << vv_code.t();
     667    if (_usePhase) {
    688668      str <<  "residuals phase " << setprecision(3) << vv_phase.t();
     669    }
     670    if (_useGlonass) {
    689671      str <<  "residuals glo   " << setprecision(3) << vv_glo.t();
    690      _log += str.str().c_str();
    691     }
    692     //// end test
     672    }
     673    _log += str.str().c_str();
    693674
    694675  } while (outlierDetection(QQsav, vv, epoData->satDataGPS,
     
    697678  // Set Solution Vector
    698679  // -------------------
    699   ostringstream str1;
    700   str1.setf(ios::fixed);
     680  ostringstream strB;
     681  strB.setf(ios::fixed);
    701682  QVectorIterator<bncParam*> itPar(_params);
    702683  while (itPar.hasNext()) {
    703684    bncParam* par = itPar.next();
    704685    par->xx += dx(par->index);
    705     if      (par->type == bncParam::RECCLK_GPS) {
    706       str1 << "\n    clk GPS = " << setw(6) << setprecision(3) << par->xx
     686
     687    if      (par->type == bncParam::RECCLK) {
     688      strB << "\n    clk = " << setw(6) << setprecision(3) << par->xx
    707689           << " +- " << setw(6) << setprecision(3)
    708690           << sqrt(_QQ(par->index,par->index));
    709691    }
    710     if      (par->type == bncParam::RECCLK_GLO) {
    711       str1 << "\n    clk GLO = " << setw(6) << setprecision(3) << par->xx
    712            << " +- " << setw(6) << setprecision(3)
    713            << sqrt(_QQ(par->index,par->index));
    714     }
    715692    else if (par->type == bncParam::AMB_L3) {
    716       str1 << "\n    amb " << par->prn.toAscii().data() << " = "
     693      strB << "\n    amb " << par->prn.toAscii().data() << " = "
    717694           << setw(6) << setprecision(3) << par->xx
    718695           << " +- " << setw(6) << setprecision(3)
     
    720697    }
    721698    else if (par->type == bncParam::TROPO) {
    722       str1 << "\n    trp = " << par->prn.toAscii().data()
     699      strB << "\n    trp = " << par->prn.toAscii().data()
    723700           << setw(7) << setprecision(3) << delay_saast(M_PI/2.0) << " "
    724701           << setw(6) << setprecision(3) << showpos << par->xx << noshowpos
     
    727704    }
    728705  }
    729   _log += str1.str().c_str();
     706  strB << '\n';
    730707
    731708  // Message (both log file and screen)
    732709  // ----------------------------------
    733   ostringstream str2;
    734   str2.setf(ios::fixed);
    735   str2 << _staID.data() << ": PPP "
     710  ostringstream strA;
     711  strA.setf(ios::fixed);
     712  strA << _staID.data() << ": PPP "
    736713       << epoData->tt.timestr(1) << " " << epoData->sizeAll() << " "
    737714       << setw(14) << setprecision(3) << x()                  << " +- "
     
    742719       << setw(6)  << setprecision(3) << sqrt(_QQ(3,3));
    743720
     721  emit newMessage(QByteArray(strA.str().c_str()), true);
     722
     723  _log += strB.str().c_str();
    744724  emit newMessage(_log, false);
    745   emit newMessage(QByteArray(str2.str().c_str()), true);
    746725
    747726  // NMEA Output
  • trunk/BNC/bncmodel.h

    r2240 r2265  
    3838class bncParam {
    3939 public:
    40   enum parType {CRD_X, CRD_Y, CRD_Z, RECCLK_GPS, RECCLK_GLO, TROPO, AMB_L3};
     40  enum parType {CRD_X, CRD_Y, CRD_Z, RECCLK, TROPO, AMB_L3};
    4141  bncParam(parType typeIn, int indexIn, const QString& prn);
    4242  ~bncParam();
     
    4444  bool isCrd() const {
    4545    return (type == CRD_X || type == CRD_Y || type == CRD_Z);
    46   }
    47   bool isClk() const {
    48     return (type == RECCLK_GPS|| type == RECCLK_GLO);
    4946  }
    5047  parType  type;
     
    6663  double y()      const {return _params[1]->xx;}
    6764  double z()      const {return _params[2]->xx;}
    68   double clkGPS() const {
    69     for (int ii = 0; ii < _params.size(); ++ii) {
    70       bncParam* pp = _params[ii];
    71       if (pp->type == bncParam::RECCLK_GPS) {
    72         return pp->xx;
    73       }
    74     }
    75     return 0.0;
    76   }
    77   double clkGlo() const {
    78     for (int ii = 0; ii < _params.size(); ++ii) {
    79       bncParam* pp = _params[ii];
    80       if (pp->type == bncParam::RECCLK_GLO) {
    81         return pp->xx;
    82       }
    83     }
    84     return 0.0;
    85   }
     65  double clk()    const {return _params[3]->xx;}
    8666  double trp() const {
    8767    for (int ii = 0; ii < _params.size(); ++ii) {
Note: See TracChangeset for help on using the changeset viewer.