Changeset 6442 in ntrip


Ignore:
Timestamp:
Dec 26, 2014, 12:03:26 PM (9 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM/RTCM2Decoder.cpp

    r6441 r6442  
    291291      prn = sys + QString("%1").arg(corr->PRN - 200, 2, 10, QChar('0'));
    292292    }
    293 
    294     const t_ephPair* ePair = ephPair(prn);
    295293
    296294    double L1 = 0;
     
    354352
    355353      // Select corresponding ephemerides
    356       if (ePair) {
    357         if      (ePair->last && ePair->last->IOD() == IODcorr) {
    358           eph = ePair->last;
    359         }
    360         else if (ePair->prev && ePair->prev->IOD() == IODcorr) {
    361           eph = ePair->prev;
    362         }
     354      if      (ephLast(prn) && ephLast(prn)->IOD() == IODcorr) {
     355        eph = ephLast(prn);
     356      }
     357      else if (ephPrev(prn) && ephPrev(prn)->IOD() == IODcorr) {
     358        eph = ephPrev(prn);
    363359      }
    364360
  • trunk/BNC/src/bncephuser.h

    r6441 r6442  
    4040 Q_OBJECT
    4141
     42 public slots:
     43  void slotNewGPSEph(t_ephGPS);
     44  void slotNewGlonassEph(t_ephGlo);
     45  void slotNewGalileoEph(t_ephGal);
     46  void slotNewSBASEph(t_ephSBAS);
     47
    4248 public:
    4349  bncEphUser(bool connectSlots);
    4450  virtual ~bncEphUser();
     51
     52  t_irc putNewEph(const t_eph* newEph);
     53
     54  const t_eph* ephLast(const QString& prn) {
     55    if (_eph.contains(prn)) {
     56      return _eph[prn]->last;
     57    }
     58    return 0;
     59  }
     60
     61  const t_eph* ephPrev(const QString& prn) {
     62    if (_eph.contains(prn)) {
     63      return _eph[prn]->prev;
     64    }
     65    return 0;
     66  }
     67
     68 protected:
     69  virtual void ephBufferChanged() {}
    4570
    4671  class t_ephPair {
     
    5883  };
    5984
    60   const t_ephPair* ephPair(const QString& prn) {
    61     if (_eph.contains(prn)) {
    62       return _eph[prn];
    63     }
    64     else {
    65       return 0;
    66     }
    67   }
    68 
    69   t_irc putNewEph(const t_eph* newEph);
    70 
    71  public slots:
    72   void slotNewGPSEph(t_ephGPS);
    73   void slotNewGlonassEph(t_ephGlo);
    74   void slotNewGalileoEph(t_ephGal);
    75   void slotNewSBASEph(t_ephSBAS);
    76 
    77  protected:
    78   virtual void ephBufferChanged() {}
    7985  QMutex                    _mutex;
    8086  QMap<QString, t_ephPair*> _eph;
  • trunk/BNC/src/upload/bncrtnetuploadcaster.cpp

    r6441 r6442  
    7373  }
    7474  else {
    75     _usedEph = new QMap<QString, t_eph*>;
     75    _usedEph = new QMap<QString, const t_eph*>;
    7676  }
    7777
     
    348348    in >> prn;
    349349
    350     t_eph* eph = 0;
    351     const bncEphUser::t_ephPair* ephPair = _ephUser->ephPair(prn);
    352     if (ephPair) {
    353 
    354       eph = ephPair->last;
     350    const t_eph* ephLast = _ephUser->ephLast(prn);
     351    const t_eph* ephPrev = _ephUser->ephPrev(prn);
     352    const t_eph* eph     = ephLast;
     353
     354    if (eph) {
    355355
    356356      // Use previous ephemeris if the last one is too recent
    357357      // ----------------------------------------------------
    358358      const int MINAGE = 60; // seconds
    359       if (ephPair->prev && eph->receptDateTime().isValid() &&
     359      if (ephPrev && eph->receptDateTime().isValid() &&
    360360          eph->receptDateTime().secsTo(currentDateAndTimeGPS()) < MINAGE) {
    361         eph = ephPair->prev;
     361        eph = ephPrev;
    362362      }
    363363
     
    371371          eph = 0;
    372372          if (_usedEph->contains(prn)) {
    373             t_eph* usedEph = _usedEph->value(prn);
    374             if      (usedEph == ephPair->last) {
    375               eph = ephPair->last;
    376             }
    377             else if (usedEph == ephPair->prev) {
    378               eph = ephPair->prev;
     373            const t_eph* usedEph = _usedEph->value(prn);
     374            if      (usedEph == ephLast) {
     375              eph = ephLast;
     376            }
     377            else if (usedEph == ephPrev) {
     378              eph = ephPrev;
    379379            }
    380380          }
     
    638638//
    639639////////////////////////////////////////////////////////////////////////////
    640 void bncRtnetUploadCaster::processSatellite(t_eph* eph, int GPSweek,
     640void bncRtnetUploadCaster::processSatellite(const t_eph* eph, int GPSweek,
    641641                                            double GPSweeks, const QString& prn,
    642642                                            const ColumnVector& rtnAPC,
  • trunk/BNC/src/upload/bncrtnetuploadcaster.h

    r5130 r6442  
    2929  virtual ~bncRtnetUploadCaster();
    3030 private:
    31   void processSatellite(t_eph* eph, int GPSweek,
     31  void processSatellite(const t_eph* eph, int GPSweek,
    3232                        double GPSweeks, const QString& prn,
    3333                        const ColumnVector& rtnAPC,
     
    6565  bncClockRinex* _rnx;
    6666  bncSP3*        _sp3;
    67   QMap<QString, t_eph*>* _usedEph;
     67  QMap<QString, const t_eph*>* _usedEph;
    6868};
    6969
Note: See TracChangeset for help on using the changeset viewer.