Changeset 5133 in ntrip for trunk/BNC


Ignore:
Timestamp:
Apr 18, 2013, 5:15:00 PM (11 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM3/ephemeris.cpp

    r5119 r5133  
    375375// Set Glonass Ephemeris
    376376////////////////////////////////////////////////////////////////////////////
    377 void t_ephGlo::set(const glonassephemeris* ee, bool& timeChanged) {
     377void t_ephGlo::set(const glonassephemeris* ee) {
    378378
    379379  _receptDateTime = currentDateAndTimeGPS();
     
    387387  // Check the day once more
    388388  // -----------------------
    389   timeChanged = false;
     389  bool timeChanged = false;
    390390  {
    391391    const double secPerDay  = 24 * 3600.0;
  • trunk/BNC/src/RTCM3/ephemeris.h

    r4904 r5133  
    141141  virtual int  RTCM3(unsigned char *);
    142142
    143   void set(const glonassephemeris* ee, bool& timeChanged);
     143  void set(const glonassephemeris* ee);
    144144
    145145  int  slotNum() const {return int(_frequency_number);}
  • trunk/BNC/src/bnccore.cpp

    r5129 r5133  
    518518
    519519  t_ephGlo eph;
    520   bool timeChanged;
    521   eph.set(ep, timeChanged);
     520  eph.set(ep);
    522521
    523522  QString strV2 = eph.toString(2.11);
  • trunk/BNC/src/bncephuser.cpp

    r5070 r5133  
    7777  QMutexLocker locker(&_mutex);
    7878
    79   QString prn = QString("G%1").arg(gpseph.satellite, 2, 10, QChar('0'));
     79  t_ephGPS* eNew = new t_ephGPS(); eNew->set(&gpseph);
     80
     81  const QString& prn = eNew->prn();
    8082
    8183  if (_eph.contains(prn)) {
    8284    t_ephGPS* eLast = static_cast<t_ephGPS*>(_eph.value(prn)->last);
    83     bncTime toc(gpseph.GPSweek, gpseph.TOC);
    84     if (eLast->TOC() < toc) {
    85       delete static_cast<t_ephGPS*>(_eph.value(prn)->prev);
     85    if (eNew->isNewerThan(eLast)) {
     86      delete _eph.value(prn)->prev;
    8687      _eph.value(prn)->prev = _eph.value(prn)->last;
    87       _eph.value(prn)->last = new t_ephGPS();
    88       static_cast<t_ephGPS*>(_eph.value(prn)->last)->set(&gpseph);
     88      _eph.value(prn)->last = eNew;
     89      ephBufferChanged();
     90    }
     91    else {
     92      delete eNew;
    8993    }
    9094  }
    9195  else {
    92     t_ephGPS* eLast = new t_ephGPS();
    93     eLast->set(&gpseph);
    94     _eph.insert(prn, new t_ephPair(eLast));
    95   }
    96   ephBufferChanged();
     96    _eph.insert(prn, new t_ephPair(eNew));
     97    ephBufferChanged();
     98  }
    9799}
    98100
     
    102104  QMutexLocker locker(&_mutex);
    103105
    104   QString prn = QString("R%1").arg(gloeph.almanac_number, 2, 10, QChar('0'));
     106  t_ephGlo* eNew = new t_ephGlo(); eNew->set(&gloeph);
     107
     108  const QString& prn = eNew->prn();
    105109
    106110  if (_eph.contains(prn)) {
    107     int ww  = gloeph.GPSWeek;
    108     int tow = gloeph.GPSTOW;
    109     updatetime(&ww, &tow, gloeph.tb*1000, 0);  // Moscow -> GPS
    110111    t_ephGlo* eLast = static_cast<t_ephGlo*>(_eph.value(prn)->last);
    111     bncTime toc(ww, tow);
    112     if (eLast->TOC() < toc) {
    113       t_ephGlo* ephGlo = new t_ephGlo();
    114       bool timeChanged;
    115       ephGlo->set(&gloeph, timeChanged);
    116       if (timeChanged) {
    117         delete ephGlo;
    118       }
    119       else {
    120         delete static_cast<t_ephGlo*>(_eph.value(prn)->prev);
    121         _eph.value(prn)->prev = _eph.value(prn)->last;
    122         _eph.value(prn)->last = ephGlo;
    123       }
     112    if (eNew->isNewerThan(eLast)) {
     113      delete _eph.value(prn)->prev;
     114      _eph.value(prn)->prev = _eph.value(prn)->last;
     115      _eph.value(prn)->last = eNew;
     116      ephBufferChanged();
     117    }
     118    else {
     119      delete eNew;
    124120    }
    125121  }
    126122  else {
    127     t_ephGlo* eLast = new t_ephGlo();
    128     bool timeChanged;
    129     eLast->set(&gloeph, timeChanged);
    130     if (timeChanged) {
    131       delete eLast;
    132     }
    133     else {
    134       _eph.insert(prn, new t_ephPair(eLast));
    135     }
    136   }
    137   ephBufferChanged();
     123    _eph.insert(prn, new t_ephPair(eNew));
     124    ephBufferChanged();
     125  }
    138126}
    139127
Note: See TracChangeset for help on using the changeset viewer.