- Timestamp:
- Dec 20, 2014, 11:27:24 AM (10 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncephuser.cpp
r6394 r6395 78 78 //////////////////////////////////////////////////////////////////////////// 79 79 void 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 } 83 84 } 84 85 … … 86 87 //////////////////////////////////////////////////////////////////////////// 87 88 void 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 } 91 93 } 92 94 … … 94 96 //////////////////////////////////////////////////////////////////////////// 95 97 void 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 } 99 102 } 100 103 … … 102 105 //////////////////////////////////////////////////////////////////////////// 103 106 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) { 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; 127 110 } 128 111 } … … 131 114 //////////////////////////////////////////////////////////////////////////// 132 115 t_irc bncEphUser::putNewEph(t_eph* newEph) { 133 134 116 QMutexLocker locker(&_mutex); 135 117 118 t_irc irc = failure; 119 136 120 if (!newEph) { 137 return failure;121 return irc; 138 122 } 139 123 140 124 QString prn(newEph->prn().toString().c_str()); 141 142 t_irc irc = failure;143 144 125 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)) { 147 127 delete _eph.value(prn)->prev; 148 128 _eph.value(prn)->prev = _eph.value(prn)->last; 149 129 _eph.value(prn)->last = newEph; 130 ephBufferChanged(); 150 131 irc = success; 151 132 } … … 153 134 else { 154 135 _eph.insert(prn, new t_ephPair(newEph)); 136 ephBufferChanged(); 155 137 irc = success; 156 138 } 157 139 158 if (irc == success) { 159 ephBufferChanged(); 160 } 140 return irc 141 } 161 142 162 return irc;163 } -
trunk/BNC/src/bncephuser.h
r6394 r6395 67 67 } 68 68 69 t_irc putNewEph(t_eph* eph);69 t_irc putNewEph(t_eph* newEph); 70 70 71 71 public slots: … … 74 74 void slotNewEphGalileo(galileoephemeris galeph); 75 75 void slotNewEphSBAS(sbasephemeris sbaseph); 76 77 private:78 void newEphHlp(t_eph* eNew);79 76 80 77 protected:
Note:
See TracChangeset
for help on using the changeset viewer.