Changeset 6394 in ntrip
- Timestamp:
- Dec 20, 2014, 11:18:09 AM (10 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncephuser.cpp
r6393 r6394 79 79 void bncEphUser::slotNewEphGPS(gpsephemeris gpseph) { 80 80 QMutexLocker locker(&_mutex); 81 t_ephGPS* eNew = new t_ephGPS(); eNew->set(&gpseph); 82 newEphHlp(eNew); 83 } 81 84 82 t_ephGPS* eNew = new t_ephGPS(); eNew->set(&gpseph); 85 // 86 //////////////////////////////////////////////////////////////////////////// 87 void bncEphUser::slotNewEphGlonass(glonassephemeris gloeph) { 88 QMutexLocker locker(&_mutex); 89 t_ephGlo* eNew = new t_ephGlo(); eNew->set(&gloeph); 90 newEphHlp(eNew); 91 } 83 92 93 // 94 //////////////////////////////////////////////////////////////////////////// 95 void bncEphUser::slotNewEphGalileo(galileoephemeris galeph) { 96 QMutexLocker locker(&_mutex); 97 t_ephGal* eNew = new t_ephGal(); eNew->set(&galeph); 98 newEphHlp(eNew); 99 } 100 101 // 102 //////////////////////////////////////////////////////////////////////////// 103 void 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) { 84 112 QString prn(eNew->prn().toString().c_str()); 85 86 113 if (_eph.contains(prn)) { 87 t_ephGPS* eLast = static_cast<t_ephGPS*>(_eph.value(prn)->last); 88 if (eNew->isNewerThan(eLast)) { 114 if (eNew->isNewerThan(_eph.value(prn)->last)) { 89 115 delete _eph.value(prn)->prev; 90 116 _eph.value(prn)->prev = _eph.value(prn)->last; … … 100 126 ephBufferChanged(); 101 127 } 102 }103 104 //105 ////////////////////////////////////////////////////////////////////////////106 void bncEphUser::slotNewEphGlonass(glonassephemeris gloeph) {107 QMutexLocker locker(&_mutex);108 109 t_ephGlo* eNew = new t_ephGlo(); eNew->set(&gloeph);110 111 QString prn(eNew->prn().toString().c_str());112 113 if (_eph.contains(prn)) {114 t_ephGlo* eLast = static_cast<t_ephGlo*>(_eph.value(prn)->last);115 if (eNew->isNewerThan(eLast)) {116 delete _eph.value(prn)->prev;117 _eph.value(prn)->prev = _eph.value(prn)->last;118 _eph.value(prn)->last = eNew;119 ephBufferChanged();120 }121 else {122 delete eNew;123 }124 }125 else {126 _eph.insert(prn, new t_ephPair(eNew));127 ephBufferChanged();128 }129 }130 131 //132 ////////////////////////////////////////////////////////////////////////////133 void bncEphUser::slotNewEphGalileo(galileoephemeris galeph) {134 QMutexLocker locker(&_mutex);135 136 QString prn = QString("E%1").arg(galeph.satellite, 2, 10, QChar('0'));137 138 if (_eph.contains(prn)) {139 t_ephGal* eLast = static_cast<t_ephGal*>(_eph.value(prn)->last);140 bncTime toc(galeph.Week, galeph.TOC);141 if (eLast->TOC() < toc) {142 delete static_cast<t_ephGal*>(_eph.value(prn)->prev);143 _eph.value(prn)->prev = _eph.value(prn)->last;144 _eph.value(prn)->last = new t_ephGal();145 static_cast<t_ephGal*>(_eph.value(prn)->last)->set(&galeph);146 }147 }148 else {149 t_ephGal* eLast = new t_ephGal();150 eLast->set(&galeph);151 _eph.insert(prn, new t_ephPair(eLast));152 }153 ephBufferChanged();154 128 } 155 129 … … 188 162 return irc; 189 163 } 190 191 //192 ////////////////////////////////////////////////////////////////////////////193 void bncEphUser::slotNewEphSBAS(sbasephemeris sbaseph) {194 QMutexLocker locker(&_mutex);195 196 t_ephSBAS* eNew = new t_ephSBAS(); eNew->set(&sbaseph);197 QString prn = QString(eNew->prn().toString().c_str());198 199 if (_eph.contains(prn)) {200 if (eNew->isNewerThan(_eph.value(prn)->last)) {201 delete _eph.value(prn)->prev;202 _eph.value(prn)->prev = _eph.value(prn)->last;203 _eph.value(prn)->last = eNew;204 }205 else {206 delete eNew;207 return;208 }209 }210 else {211 _eph.insert(prn, new t_ephPair(eNew));212 }213 ephBufferChanged();214 }215 -
trunk/BNC/src/bncephuser.h
r6393 r6394 75 75 void slotNewEphSBAS(sbasephemeris sbaseph); 76 76 77 private: 78 void newEphHlp(t_eph* eNew); 79 77 80 protected: 78 81 virtual void ephBufferChanged() {}
Note:
See TracChangeset
for help on using the changeset viewer.