source: ntrip/branches/BNC_LM/diff.txt@ 10139

Last change on this file since 10139 was 3575, checked in by mervart, 13 years ago

LM: this version works fine, after applying changes in diff.txt we have a problem

File size: 5.6 KB
Line 
1Index: GPSS/hassDecoder.cpp
2===================================================================
382c82,91
4< //// beg test
5---
6> t_eph* eph = 0;
7> if (_eph.contains(prn)) {
8> if (_eph.value(prn)->last && _eph.value(prn)->last->IOD() == IOD) {
9> eph = _eph.value(prn)->last;
10> }
11> else if (_eph.value(prn)->prev && _eph.value(prn)->prev->IOD() == IOD) {
12> eph = _eph.value(prn)->prev;
13> }
14> }
15> if (!eph) {
1684,96c93
17< //// end test
18< //// t_eph* eph = 0;
19< //// if (_eph.contains(prn)) {
20< //// if (_eph.value(prn)->last && _eph.value(prn)->last->IOD() == IOD) {
21< //// eph = _eph.value(prn)->last;
22< //// }
23< //// else if (_eph.value(prn)->prev && _eph.value(prn)->prev->IOD() == IOD) {
24< //// eph = _eph.value(prn)->prev;
25< //// }
26< //// }
27< //// if (!eph) {
28< //// continue;
29< //// }
30---
31> }
32100c97
33< //// eph->position(tt.gpsw(), tt.gpssec(), xc.data(), vv.data());
34---
35> eph->position(tt.gpsw(), tt.gpssec(), xc.data(), vv.data());
36Index: RTCM3/RTCM3coDecoder.h
37===================================================================
3832a33
39> #include "bncephuser.h"
4039c40
41< class RTCM3coDecoder : public QObject, public GPSDecoder {
42---
43> class RTCM3coDecoder : public bncEphUser, public GPSDecoder {
44Index: RTCM/RTCM2Decoder.h
45===================================================================
4636a37
47> #include "bncephuser.h"
4838c39
49< class RTCM2Decoder: public GPSDecoder {
50---
51> class RTCM2Decoder: public bncEphUser, public GPSDecoder {
5245,47d45
53< bool storeEph(const gpsephemeris& gpseph, std::string& storedPRN, std::vector<int>& IODs);
54< bool storeEph(const t_ephGPS& gpseph, std::string& storedPRN, std::vector<int>& IODs);
55<
5660,121d57
57< class t_ephList {
58< public:
59< t_ephList() {}
60<
61< ~t_ephList() {
62< for (std::list<t_eph*>::iterator ii = _eph.begin(); ii != _eph.end(); ii++) {
63< delete (*ii);
64< }
65< }
66<
67< bool store(t_eph* eph) {
68< if ( _eph.size() == 0 ) {
69< _eph.push_back(eph);
70< return true;
71< }
72<
73< std::list<t_eph*>::iterator ii = _eph.begin();
74< while (ii != _eph.end()) {
75< if ( eph->IOD() == (*ii)->IOD() ) {
76< return false;
77< }
78< if ( ! eph->isNewerThan(*ii) ) {
79< break;
80< }
81< ++ii;
82< }
83<
84< if ( ii == _eph.begin() && _eph.size() == MAXSIZE) {
85< return false;
86< }
87<
88< _eph.insert(ii, eph);
89<
90< while ( _eph.size() > MAXSIZE ) {
91< delete _eph.front();
92< _eph.pop_front();
93< }
94<
95< return true;
96< }
97<
98< const t_eph* getEph(int IOD) const {
99< for (std::list<t_eph*>::const_iterator ii = _eph.begin(); ii != _eph.end(); ii++) {
100< if ( (*ii)->IOD() == IOD ) {
101< return (*ii);
102< }
103< }
104< return 0;
105< }
106<
107< void getIODs(std::vector<int>& IODs) const {
108< IODs.clear();
109< for (std::list<t_eph*>::const_iterator ii = _eph.begin(); ii != _eph.end(); ii++) {
110< IODs.push_back((*ii)->IOD());
111< }
112< }
113<
114< static const unsigned MAXSIZE = 5;
115<
116< std::list<t_eph*> _eph;
117< };
118<
119138,140d73
120< std::map<std::string, t_ephList*> _ephList;
121<
122< typedef std::map<std::string, t_ephList*> t_listMap;
123Index: RTCM/RTCM2Decoder.cpp
124===================================================================
12567,69d66
126< for (t_listMap::iterator ii = _ephList.begin(); ii != _ephList.end(); ii++) {
127< delete ii->second;
128< }
129224,257d220
130<
131<
132< bool RTCM2Decoder::storeEph(const gpsephemeris& gpseph, string& storedPRN, vector<int>& IODs) {
133< t_ephGPS eph; eph.set(&gpseph);
134<
135< return storeEph(eph, storedPRN, IODs);
136< }
137<
138<
139< bool RTCM2Decoder::storeEph(const t_ephGPS& gpseph, string& storedPRN, vector<int>& IODs) {
140< t_ephGPS* eph = new t_ephGPS(gpseph);
141<
142< string prn = eph->prn().toAscii().data();
143<
144< t_listMap::iterator ip = _ephList.find(prn);
145< if (ip == _ephList.end() ) {
146< ip = _ephList.insert(pair<string, t_ephList*>(prn, new t_ephList)).first;
147< }
148< t_ephList* ephList = ip->second;
149<
150< bool stored = ephList->store(eph);
151<
152< if ( stored ) {
153< storedPRN = string(eph->prn().toAscii().data());
154< ephList->getIODs(IODs);
155< return true;
156< }
157<
158< delete eph;
159<
160< return false;
161< }
162<
163<
164299a263,269
165> QString prn;
166> if (corr->PRN < 200) {
167> prn = 'G' + QString("%1").arg(corr->PRN, 2, 10, QChar('0'));
168> }
169> else {
170> prn = 'R' + QString("%1").arg(corr->PRN - 200, 2, 10, QChar('0'));
171> }
172301,308c271
173< ostringstream oPRN; oPRN.fill('0');
174<
175< oPRN << (corr->PRN < 200 ? 'G' : 'R')
176< << setw(2) << (corr->PRN < 200 ? corr->PRN : corr->PRN - 200);
177<
178< string PRN(oPRN.str());
179<
180< t_listMap::const_iterator ieph = _ephList.find(PRN);
181---
182> const t_ephPair* ePair = ephPair(prn);
183358,359c321,327
184< if ( ieph != _ephList.end() ) {
185< eph = ieph->second->getEph(IODcorr);
186---
187> if (ePair) {
188> if (ePair->last && ePair->last->IOD() == IODcorr) {
189> eph = ePair->last;
190> }
191> else if (ePair->prev && ePair->prev->IOD() == IODcorr) {
192> eph = ePair->prev;
193> }
194433c401
195< errmsg.push_back("missing eph for " + PRN + " , IODs " + missingIODstr.str());
196---
197> errmsg.push_back("missing eph for " + string(prn.toAscii().data()) + " , IODs " + missingIODstr.str());
Note: See TracBrowser for help on using the repository browser.