Changeset 4904 in ntrip


Ignore:
Timestamp:
Feb 9, 2013, 10:20:20 AM (11 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
4 edited

Legend:

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

    r4891 r4904  
    375375// Set Glonass Ephemeris
    376376////////////////////////////////////////////////////////////////////////////
    377 void t_ephGlo::set(const glonassephemeris* ee) {
     377void t_ephGlo::set(const glonassephemeris* ee, bool& timeChanged) {
    378378
    379379  _receptDateTime = currentDateAndTimeGPS();
     
    387387  // Check the day once more
    388388  // -----------------------
     389  timeChanged = false;
    389390  {
    390391    const double secPerDay  = 24 * 3600.0;
     
    398399    bncTime hTime(ww, (double) tow);
    399400
    400     bool changed = false;
    401401    if      (hTime - currentTime >  secPerDay/2.0) {
    402       changed = true;
     402      timeChanged = true;
    403403      tow -= int(secPerDay);
    404404      if (tow < 0) {
     
    408408    }
    409409    else if (hTime - currentTime < -secPerDay/2.0) {
    410       changed = true;
     410      timeChanged = true;
    411411      tow += int(secPerDay);
    412412      if (tow > secPerWeek) {
     
    416416    }
    417417
    418     if (changed && ((bncApp*) qApp)->mode() == bncApp::batchPostProcessing) {
     418    if (timeChanged && ((bncApp*) qApp)->mode() == bncApp::batchPostProcessing) {
    419419      bncTime newHTime(ww, (double) tow);
    420420      cout << "GLONASS " << ee->almanac_number <<  " Time Changed at "
  • trunk/BNC/src/RTCM3/ephemeris.h

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

    r4747 r4904  
    515515
    516516  t_ephGlo eph;
    517   eph.set(ep);
     517  bool timeChanged;
     518  eph.set(ep, timeChanged);
    518519
    519520  QString strV2 = eph.toString(2.11);
  • trunk/BNC/src/bncephuser.cpp

    r4784 r4904  
    111111    bncTime toc(ww, tow);
    112112    if (eLast->TOC() < toc) {
    113       delete static_cast<t_ephGlo*>(_eph.value(prn)->prev);
    114       _eph.value(prn)->prev = _eph.value(prn)->last;
    115       _eph.value(prn)->last = new t_ephGlo();
    116       static_cast<t_ephGlo*>(_eph.value(prn)->last)->set(&gloeph);
     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      }
    117124    }
    118125  }
    119126  else {
    120127    t_ephGlo* eLast = new t_ephGlo();
    121     eLast->set(&gloeph);
    122     _eph.insert(prn, new t_ephPair(eLast));
     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    }
    123136  }
    124137  ephBufferChanged();
Note: See TracChangeset for help on using the changeset viewer.