Ignore:
Timestamp:
Sep 8, 2014, 8:36:22 AM (10 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

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

    r6098 r6099  
    4545#include "pppClient.h"
    4646#include "pppFilter.h"
    47 #include "pppOptions.h"
     47#include "bncephuser.h"
    4848#include "bncutils.h"
    49 #include "bncconst.h"
    5049
    5150using namespace BNC_PPP;
     
    6463// Constructor
    6564////////////////////////////////////////////////////////////////////////////
    66 t_pppClient::t_pppClient(const t_pppOptions* opt) : bncEphUser(false) {
     65t_pppClient::t_pppClient(const t_pppOptions* opt) {
    6766
    6867  _opt     = new t_pppOptions(*opt);
     
    7069  _epoData = new t_epoData();
    7170  _log     = new ostringstream();
     71  _ephUser = new bncEphUser(false);
    7272  _staID   = QByteArray(_opt->_roverName.c_str());
    7373
     
    8181  delete _epoData;
    8282  delete _opt;
     83  delete _ephUser;
    8384  delete _log;
    8485}
     
    8788////////////////////////////////////////////////////////////////////////////
    8889void t_pppClient::processEpoch(const vector<t_satObs*>& satObs, t_output* output) {
    89   QMutexLocker locker(&_mutex);
    9090 
    9191  // Convert and store observations
     
    176176      int channel = 0;
    177177      if (satData->system() == 'R') {
    178         if (_eph.contains(satData->prn)) {
    179           t_eph* eLast =_eph.value(satData->prn)->last;
    180           channel = eLast->slotNum();
     178        const bncEphUser::t_ephPair* ephPair = _ephUser->ephPair(satData->prn);
     179        if (ephPair) {
     180          channel = ephPair->last->slotNum();
    181181        }
    182182        else {
     
    229229////////////////////////////////////////////////////////////////////////////
    230230void t_pppClient::putOrbCorrections(const std::vector<t_orbCorr*>& corr) {
    231   QMutexLocker locker(&_mutex);
    232231  for (unsigned ii = 0; ii < corr.size(); ii++) {
    233232    QString prn = QString(corr[ii]->_prn.toString().c_str());
    234     if (_eph.contains(prn)) {
    235       t_eph* eLast = _eph.value(prn)->last;
    236       t_eph* ePrev = _eph.value(prn)->prev;
     233    const bncEphUser::t_ephPair* ephPair = _ephUser->ephPair(prn);
     234    if (ephPair) {
     235      t_eph* eLast = ephPair->last;
     236      t_eph* ePrev = ephPair->prev;
    237237      if      (eLast && eLast->IOD() == corr[ii]->_iod) {
    238238        eLast->setOrbCorr(corr[ii]);
     
    248248////////////////////////////////////////////////////////////////////////////
    249249void t_pppClient::putClkCorrections(const std::vector<t_clkCorr*>& corr) {
    250   QMutexLocker locker(&_mutex);
    251250  for (unsigned ii = 0; ii < corr.size(); ii++) {
    252251    QString prn = QString(corr[ii]->_prn.toString().c_str());
    253     if (_eph.contains(prn)) {
    254       t_eph* eLast = _eph.value(prn)->last;
    255       t_eph* ePrev = _eph.value(prn)->prev;
     252    const bncEphUser::t_ephPair* ephPair = _ephUser->ephPair(prn);
     253    if (ephPair) {
     254      t_eph* eLast = ephPair->last;
     255      t_eph* ePrev = ephPair->prev;
    256256      if      (eLast && eLast->IOD() == corr[ii]->_iod) {
    257257        eLast->setClkCorr(corr[ii]);
     
    276276  const t_ephGal* ephGal = dynamic_cast<const t_ephGal*>(eph);
    277277  if      (ephGPS) {
    278     putNewEph(new t_ephGPS(*ephGPS));
     278    _ephUser->putNewEph(new t_ephGPS(*ephGPS));
    279279  }
    280280  else if (ephGlo) {
    281     putNewEph(new t_ephGlo(*ephGlo));
     281    _ephUser->putNewEph(new t_ephGlo(*ephGlo));
    282282  }
    283283  else if (ephGal) {
    284     putNewEph(new t_ephGal(*ephGal));
     284    _ephUser->putNewEph(new t_ephGal(*ephGal));
    285285  }
    286286}
     
    290290t_irc t_pppClient::getSatPos(const bncTime& tt, const QString& prn,
    291291                              ColumnVector& xc, ColumnVector& vv) {
    292   if (_eph.contains(prn)) {
    293     t_eph* eLast = _eph.value(prn)->last;
    294     t_eph* ePrev = _eph.value(prn)->prev;
     292
     293  const bncEphUser::t_ephPair* ephPair = _ephUser->ephPair(prn);
     294  if (ephPair) {
     295    t_eph* eLast = ephPair->last;
     296    t_eph* ePrev = ephPair->prev;
    295297    if      (eLast && eLast->getCrd(tt, xc, vv, _opt->useOrbClkCorr()) == success) {
    296298      return success;
Note: See TracChangeset for help on using the changeset viewer.