Changeset 6435 in ntrip


Ignore:
Timestamp:
Dec 25, 2014, 6:50:53 PM (9 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
2 edited

Legend:

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

    r6434 r6435  
    105105//
    106106////////////////////////////////////////////////////////////////////////////
    107 t_irc bncEphUser::putNewEph(t_eph* newEph) {
     107t_irc bncEphUser::putNewEph(const t_eph* eph) {
     108
    108109  QMutexLocker locker(&_mutex);
    109110
    110   t_irc irc = failure;
     111  if (eph == 0) {
     112    return failure;
     113  }
    111114
    112   if (newEph == 0) {
    113     return irc;
     115  const t_ephGPS*     ephGPS     = dynamic_cast<const t_ephGPS*>(eph);
     116  const t_ephGlo*     ephGlo     = dynamic_cast<const t_ephGlo*>(eph);
     117  const t_ephGal*     ephGal     = dynamic_cast<const t_ephGal*>(eph);
     118  const t_ephSBAS*    ephSBAS    = dynamic_cast<const t_ephSBAS*>(eph);
     119  const t_ephCompass* ephCompass = dynamic_cast<const t_ephCompass*>(eph);
     120
     121  t_eph* newEph = 0;
     122
     123  if      (ephGPS) {
     124    newEph = new t_ephGPS(*ephGPS);
     125  }
     126  else if (ephGlo) {
     127    newEph = new t_ephGlo(*ephGlo);
     128  }
     129  else if (ephGal) {
     130    newEph = new t_ephGal(*ephGal);
     131  }
     132  else if (ephSBAS) {
     133    newEph = new t_ephSBAS(*ephSBAS);
     134  }
     135  else if (ephCompass) {
     136    newEph = new t_ephCompass(*ephCompass);
     137  }
     138  else {
     139    return failure;
    114140  }
    115141
    116142  QString prn(newEph->prn().toString().c_str());
     143
    117144  if (_eph.contains(prn)) {
    118145    if (newEph->isNewerThan(_eph.value(prn)->last)) {
     
    121148      _eph.value(prn)->last = newEph;
    122149      ephBufferChanged();
    123       irc = success;
     150      return success;
    124151    }
    125152  }
     
    127154    _eph.insert(prn, new t_ephPair(newEph));
    128155    ephBufferChanged();
    129     irc = success;
     156    return success;
    130157  }
    131158
    132   return irc;
     159  return failure;
    133160}
    134161
  • trunk/BNC/src/bncephuser.h

    r6432 r6435  
    6868  }
    6969
    70   t_irc putNewEph(t_eph* newEph);
     70  t_irc putNewEph(const t_eph* newEph);
    7171
    7272 public slots:
Note: See TracChangeset for help on using the changeset viewer.