Changeset 3562 in ntrip for trunk/BNC/RTCM/RTCM2Decoder.h
- Timestamp:
- Dec 25, 2011, 3:50:24 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM/RTCM2Decoder.h
r2492 r3562 35 35 #include "rtcm3torinex.h" 36 36 #include "ephemeris.h" 37 #include "bncephuser.h" 37 38 38 class RTCM2Decoder: public GPSDecoder {39 class RTCM2Decoder: public bncEphUser, public GPSDecoder { 39 40 40 41 public: … … 42 43 virtual ~RTCM2Decoder(); 43 44 virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg); 44 45 bool storeEph(const gpsephemeris& gpseph, std::string& storedPRN, std::vector<int>& IODs);46 bool storeEph(const t_ephGPS& gpseph, std::string& storedPRN, std::vector<int>& IODs);47 45 48 46 t_irc getStaCrd(double& xx, double& yy, double& zz); … … 57 55 58 56 private: 59 60 class t_ephList {61 public:62 t_ephList() {}63 64 ~t_ephList() {65 for (std::list<t_eph*>::iterator ii = _eph.begin(); ii != _eph.end(); ii++) {66 delete (*ii);67 }68 }69 70 bool store(t_eph* eph) {71 if ( _eph.size() == 0 ) {72 _eph.push_back(eph);73 return true;74 }75 76 std::list<t_eph*>::iterator ii = _eph.begin();77 while (ii != _eph.end()) {78 if ( eph->IOD() == (*ii)->IOD() ) {79 return false;80 }81 if ( ! eph->isNewerThan(*ii) ) {82 break;83 }84 ++ii;85 }86 87 if ( ii == _eph.begin() && _eph.size() == MAXSIZE) {88 return false;89 }90 91 _eph.insert(ii, eph);92 93 while ( _eph.size() > MAXSIZE ) {94 delete _eph.front();95 _eph.pop_front();96 }97 98 return true;99 }100 101 const t_eph* getEph(int IOD) const {102 for (std::list<t_eph*>::const_iterator ii = _eph.begin(); ii != _eph.end(); ii++) {103 if ( (*ii)->IOD() == IOD ) {104 return (*ii);105 }106 }107 return 0;108 }109 110 void getIODs(std::vector<int>& IODs) const {111 IODs.clear();112 for (std::list<t_eph*>::const_iterator ii = _eph.begin(); ii != _eph.end(); ii++) {113 IODs.push_back((*ii)->IOD());114 }115 }116 117 static const unsigned MAXSIZE = 5;118 119 std::list<t_eph*> _eph;120 };121 57 122 58 void translateCorr2Obs(std::vector<std::string>& errmsg); … … 136 72 rtcm2::RTCM2_24 _msg24; 137 73 rtcm2::RTCM2_2021 _msg2021; 138 std::map<std::string, t_ephList*> _ephList;139 140 typedef std::map<std::string, t_ephList*> t_listMap;141 74 }; 142 75
Note:
See TracChangeset
for help on using the changeset viewer.