Changeset 6099 in ntrip for trunk/BNC/src/PPP_free


Ignore:
Timestamp:
Sep 8, 2014, 8:36:22 AM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/PPP_free
Files:
2 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;
  • trunk/BNC/src/PPP_free/pppClient.h

    r6093 r6099  
    2727
    2828#include <vector>
    29 #include "bncephuser.h"
     29#include <QtCore>
     30
     31#include "pppInclude.h"
     32#include "pppOptions.h"
     33
     34class bncEphUser;
     35class t_eph;
    3036
    3137namespace BNC_PPP {
    3238 
    3339class t_pppFilter;
    34 class t_pppOptions;
    35 class t_satObs;
    36 class t_satData;
    37 class t_epoData;
    38 class t_output;
    39 class t_orbCorr;
    40 class t_clkCorr;
    41 class t_satBias;
    42 
    43 class t_pppClient : public bncEphUser {
    44  public:
    45   t_pppClient(const t_pppOptions* opt);
    46   ~t_pppClient();
    47   void                processEpoch(const std::vector<t_satObs*>& satObs, t_output* output);
    48   void                putEphemeris(const t_eph* eph);                 
    49   void                putOrbCorrections(const std::vector<t_orbCorr*>& corr);
    50   void                putClkCorrections(const std::vector<t_clkCorr*>& corr);
    51   void                putBiases(const std::vector<t_satBias*>& satBias);   
    52   QByteArray          staID() const {return _staID;}
    53   const t_pppOptions* opt() const {return _opt;}
    54   static t_pppClient* instance();
    55   std::ostringstream& log() {return *_log;}
    56 
    57  private:
    58   t_irc getSatPos(const bncTime& tt, const QString& prn, ColumnVector& xc, ColumnVector& vv);
    59   void  putNewObs(t_satData* satData);
    60   t_irc cmpToT(t_satData* satData);
    61 
    62   t_pppOptions*       _opt;
    63   QByteArray          _staID;
    64   t_epoData*          _epoData;
    65   t_pppFilter*        _filter;
    66   std::ostringstream* _log;
    67 };
    6840
    6941class t_satData {
     
    148120};
    149121
     122class t_pppClient {
     123 public:
     124  t_pppClient(const t_pppOptions* opt);
     125  ~t_pppClient();
     126  void                processEpoch(const std::vector<t_satObs*>& satObs, t_output* output);
     127  void                putEphemeris(const t_eph* eph);                 
     128  void                putOrbCorrections(const std::vector<t_orbCorr*>& corr);
     129  void                putClkCorrections(const std::vector<t_clkCorr*>& corr);
     130  void                putBiases(const std::vector<t_satBias*>& satBias);   
     131  QByteArray          staID() const {return _staID;}
     132  const t_pppOptions* opt() const {return _opt;}
     133  static t_pppClient* instance();
     134  std::ostringstream& log() {return *_log;}
     135
     136 private:
     137  t_irc getSatPos(const bncTime& tt, const QString& prn, ColumnVector& xc, ColumnVector& vv);
     138  void  putNewObs(t_satData* satData);
     139  t_irc cmpToT(t_satData* satData);
     140
     141  bncEphUser*         _ephUser;
     142  t_pppOptions*       _opt;
     143  QByteArray          _staID;
     144  t_epoData*          _epoData;
     145  t_pppFilter*        _filter;
     146  std::ostringstream* _log;
     147};
     148
    150149}
    151150
Note: See TracChangeset for help on using the changeset viewer.