Changeset 6395 in ntrip


Ignore:
Timestamp:
Dec 20, 2014, 11:27:24 AM (9 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncephuser.cpp

    r6394 r6395  
    7878////////////////////////////////////////////////////////////////////////////
    7979void bncEphUser::slotNewEphGPS(gpsephemeris gpseph) {
    80   QMutexLocker locker(&_mutex);
    81   t_ephGPS* eNew = new t_ephGPS(); eNew->set(&gpseph);
    82   newEphHlp(eNew);
     80  t_ephGPS* newEph = new t_ephGPS(); newEph->set(&gpseph);
     81  if (putNewEph(newEph) != success) {
     82    delete newEph;
     83  }
    8384}
    8485
     
    8687////////////////////////////////////////////////////////////////////////////
    8788void bncEphUser::slotNewEphGlonass(glonassephemeris gloeph) {
    88   QMutexLocker locker(&_mutex);
    89   t_ephGlo* eNew = new t_ephGlo(); eNew->set(&gloeph);
    90   newEphHlp(eNew);
     89  t_ephGlo* newEph = new t_ephGlo(); newEph->set(&gloeph);
     90  if (putNewEph(newEph) != success) {
     91    delete newEph;
     92  }
    9193}
    9294
     
    9496////////////////////////////////////////////////////////////////////////////
    9597void bncEphUser::slotNewEphGalileo(galileoephemeris galeph) {
    96   QMutexLocker locker(&_mutex);
    97   t_ephGal* eNew = new t_ephGal(); eNew->set(&galeph);
    98   newEphHlp(eNew);
     98  t_ephGal* newEph = new t_ephGal(); newEph->set(&galeph);
     99  if (putNewEph(newEph) != success) {
     100    delete newEph;
     101  }
    99102}
    100103
     
    102105////////////////////////////////////////////////////////////////////////////
    103106void bncEphUser::slotNewEphSBAS(sbasephemeris sbaseph) {
    104   QMutexLocker locker(&_mutex);
    105   t_ephSBAS* eNew = new t_ephSBAS(); eNew->set(&sbaseph);
    106   newEphHlp(eNew);
    107 }
    108 
    109 //
    110 ////////////////////////////////////////////////////////////////////////////
    111 void bncEphUser::newEphHlp(t_eph* eNew) {
    112   QString prn(eNew->prn().toString().c_str());
    113   if (_eph.contains(prn)) {
    114     if (eNew->isNewerThan(_eph.value(prn)->last)) {
    115       delete _eph.value(prn)->prev;
    116       _eph.value(prn)->prev = _eph.value(prn)->last;
    117       _eph.value(prn)->last = eNew;
    118       ephBufferChanged();
    119     }
    120     else {
    121       delete eNew;
    122     }
    123   }
    124   else {
    125     _eph.insert(prn, new t_ephPair(eNew));
    126     ephBufferChanged();
     107  t_ephSBAS* newEph = new t_ephSBAS(); newEph->set(&sbaseph);
     108  if (putNewEph(newEph) != success) {
     109    delete newEph;
    127110  }
    128111}
     
    131114////////////////////////////////////////////////////////////////////////////
    132115t_irc bncEphUser::putNewEph(t_eph* newEph) {
    133 
    134116  QMutexLocker locker(&_mutex);
    135117
     118  t_irc irc = failure;
     119
    136120  if (!newEph) {
    137     return failure;
     121    return irc;
    138122  }
    139123
    140124  QString prn(newEph->prn().toString().c_str());
    141 
    142   t_irc irc = failure;
    143 
    144125  if (_eph.contains(prn)) {
    145     t_eph* eLast = _eph.value(prn)->last;
    146     if (newEph->isNewerThan(eLast)) {
     126    if (newEph->isNewerThan(_eph.value(prn)->last)) {
    147127      delete _eph.value(prn)->prev;
    148128      _eph.value(prn)->prev = _eph.value(prn)->last;
    149129      _eph.value(prn)->last = newEph;
     130      ephBufferChanged();
    150131      irc = success;
    151132    }
     
    153134  else {
    154135    _eph.insert(prn, new t_ephPair(newEph));
     136    ephBufferChanged();
    155137    irc = success;
    156138  }
    157139
    158   if (irc == success) {
    159     ephBufferChanged();
    160   }
     140  return irc
     141}
    161142
    162   return irc;
    163 }
  • trunk/BNC/src/bncephuser.h

    r6394 r6395  
    6767  }
    6868
    69   t_irc putNewEph(t_eph* eph);
     69  t_irc putNewEph(t_eph* newEph);
    7070
    7171 public slots:
     
    7474  void slotNewEphGalileo(galileoephemeris galeph);
    7575  void slotNewEphSBAS(sbasephemeris sbaseph);
    76 
    77  private:
    78   void newEphHlp(t_eph* eNew);
    7976
    8077 protected:
Note: See TracChangeset for help on using the changeset viewer.