Changeset 242 in ntrip
- Timestamp:
- Oct 13, 2006, 9:36:48 AM (18 years ago)
- Location:
- trunk/BNC/RTCM
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM/RTCM2.cpp
r241 r242 16 16 // 2006/09/19 OMO Fixed getHeader() methods 17 17 // 2006/09/21 OMO Reduced phase ambiguity to 2^23 cycles 18 // 2006/10/05 OMO Specified const'ness of various member functions 19 // 2006/10/13 LMV Fixed resolvedPhase to handle missing C1 range 18 20 // 19 21 // (c) DLR/GSOC … … 29 31 30 32 #include "RTCM2.h" 33 31 34 32 35 using namespace std; … … 501 504 cerr << "Error: can't handle >32 bits in RTCM2packet::getUnsignedBits" 502 505 << endl; 503 /// exit(-1); 504 return 0; 506 exit(-1); 505 507 }; 506 508 507 509 if ( 24*DW.size() < start+n-1 ) { 508 510 cerr << "Error: Packet too short in RTCM2packet::getUnsignedBits" << endl; 509 //// exit(-1); 510 return 0; 511 exit(-1); 511 512 } 512 513 … … 555 556 cerr << "Error: can't handle >32 bits in RTCM2packet::getBits" 556 557 << endl; 557 //// exit(-1); 558 return 0; 558 exit(-1); 559 559 }; 560 560 561 561 if ( 24*DW.size() < start+n-1 ) { 562 562 cerr << "Error: Packet too short in RTCM2packet::getBits" << endl; 563 return 0;563 exit(-1); 564 564 } 565 565 … … 735 735 // Availability checks 736 736 737 bool RTCM2_Obs::anyGPS() {737 bool RTCM2_Obs::anyGPS() const { 738 738 739 739 return availability.test(bit_L1rngGPS) || … … 744 744 }; 745 745 746 bool RTCM2_Obs::anyGLONASS() {746 bool RTCM2_Obs::anyGLONASS() const { 747 747 748 748 return availability.test(bit_L1rngGLO) || … … 753 753 }; 754 754 755 bool RTCM2_Obs::allGPS() {755 bool RTCM2_Obs::allGPS() const { 756 756 757 757 return availability.test(bit_L1rngGPS) && … … 762 762 }; 763 763 764 bool RTCM2_Obs::allGLONASS() {764 bool RTCM2_Obs::allGLONASS() const { 765 765 766 766 return availability.test(bit_L1rngGLO) && … … 773 773 // Validity 774 774 775 bool RTCM2_Obs::valid() {775 bool RTCM2_Obs::valid() const { 776 776 777 777 return ( allGPS() && (allGLONASS() || !anyGLONASS()) && !pendingMsg ); … … 985 985 // 986 986 987 double RTCM2_Obs::resolvedPhase_L1(int i) {987 double RTCM2_Obs::resolvedPhase_L1(int i) const { 988 988 989 989 //const double ambig = pow(2.0,24); // as per RTCM2 spec … … 1005 1005 }; 1006 1006 1007 double RTCM2_Obs::resolvedPhase_L2(int i) {1007 double RTCM2_Obs::resolvedPhase_L2(int i) const { 1008 1008 1009 1009 //const double ambig = pow(2.0,24); // as per RTCM2 spec … … 1030 1030 1031 1031 void RTCM2_Obs::resolveEpoch (int refWeek, double refSecs, 1032 int& epochWeek, double& epochSecs ) {1032 int& epochWeek, double& epochSecs ) const { 1033 1033 1034 1034 const double secsPerWeek = 604800.0; … … 1043 1043 1044 1044 }; // End of namespace rtcm2 1045 1046 // ---------------- begin added by LM --------------------------------------1047 1048 #include "../bncutils.h"1049 1050 // Constructor1051 ////////////////////////////////////////////////////////////////////////////1052 RTCM2::RTCM2() {1053 1054 }1055 1056 // Destructor1057 ////////////////////////////////////////////////////////////////////////////1058 RTCM2::~RTCM2() {1059 1060 }1061 1062 //1063 ////////////////////////////////////////////////////////////////////////////1064 void RTCM2::Decode(char* buffer, int bufLen) {1065 1066 _buffer.append(buffer, bufLen);1067 int refWeek;1068 double refSecs;1069 currentGPSWeeks(refWeek, refSecs);1070 1071 while(true) {1072 _PP.getPacket(_buffer);1073 if (!_PP.valid()) {1074 return;1075 }1076 1077 if ( _PP.ID()==18 || _PP.ID()==19 ) {1078 1079 _ObsBlock.extract(_PP);1080 1081 if (_ObsBlock.valid()) {1082 1083 int epochWeek;1084 double epochSecs;1085 _ObsBlock.resolveEpoch(refWeek, refSecs, epochWeek, epochSecs);1086 1087 for (int iSat=0; iSat < _ObsBlock.nSat; iSat++) {1088 //// if (_ObsBlock.PRN[iSat] > 32) continue; // Glonass not (yet) wanted1089 Observation* obs = new Observation();1090 1091 obs->SVPRN = _ObsBlock.PRN[iSat];1092 obs->GPSWeek = epochWeek;1093 obs->GPSWeeks = epochSecs;1094 obs->C1 = _ObsBlock.rng_C1[iSat];1095 obs->P1 = _ObsBlock.rng_P1[iSat];1096 obs->P2 = _ObsBlock.rng_P2[iSat];1097 obs->L1 = _ObsBlock.resolvedPhase_L1(iSat);1098 obs->L2 = _ObsBlock.resolvedPhase_L2(iSat);1099 1100 _obsList.push_back(obs);1101 }1102 _ObsBlock.clear();1103 }1104 }1105 }1106 }1107 1108 // ----------------- end added by LM --------------------------------------- -
trunk/BNC/RTCM/RTCM2.h
r227 r242 25 25 // 26 26 // 2006/09/17 OMO Created 27 // 2006/10/05 OMO Specified const'ness of various member functions 27 28 // 28 29 // (c) DLR/GSOC … … 283 284 void extract(const RTCM2packet& P); // Packet handler 284 285 void clear(); // Initialization 285 bool valid() ;// Check for complete obs block286 287 double resolvedPhase_L1(int i) ;// L1 & L2 carrier phase of i-th sat288 double resolvedPhase_L2(int i) ;// with resolved 2^24 cy ambiguity286 bool valid() const; // Check for complete obs block 287 288 double resolvedPhase_L1(int i) const; // L1 & L2 carrier phase of i-th sat 289 double resolvedPhase_L2(int i) const; // with resolved 2^24 cy ambiguity 289 290 // (based on rng_C1) 290 291 … … 292 293 double refSecs, // epoch (GPS week and secs) 293 294 int& epochWeek, 294 double& epochSecs ) ;295 double& epochSecs ) const; 295 296 296 297 … … 308 309 private: 309 310 310 bool anyGPS() ;311 bool anyGLONASS() ;312 bool allGPS() ;313 bool allGLONASS() ;311 bool anyGPS() const; 312 bool anyGLONASS() const; 313 bool allGPS() const; 314 bool allGLONASS() const; 314 315 315 316 private: … … 325 326 }; // End of namespace rtcm2 326 327 327 // ---------------- begin added by LM --------------------------------------328 #include "GPSDecoder.h"329 class RTCM2 : public GPSDecoder {330 public:331 RTCM2();332 ~RTCM2();333 virtual void Decode(char* buffer, int bufLen);334 private:335 std::string _buffer;336 rtcm2::RTCM2_Obs _ObsBlock;337 rtcm2::RTCM2packet _PP;338 };339 // ----------------- end added by LM ---------------------------------------340 341 328 #endif // include blocker
Note:
See TracChangeset
for help on using the changeset viewer.