Changeset 7629 in ntrip for trunk/BNC/src/RTCM/RTCM2.h
- Timestamp:
- Dec 10, 2015, 3:35:44 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM/RTCM2.h
r1105 r7629 2 2 // 3 3 // RTCM2.h 4 // 5 // Purpose: 4 // 5 // Purpose: 6 6 // 7 7 // Module for extraction of RTCM2 messages … … 11 11 // RTCM 10402.3 Recommended Standards for Differential GNSS (Global 12 12 // Navigation Satellite Systems) Service; RTCM Paper 136-2001/SC104-STD, 13 // Version 2.3, 20 Aug. 2001; Radio Technical Commission For Maritime 13 // Version 2.3, 20 Aug. 2001; Radio Technical Commission For Maritime 14 14 // Services, Alexandria, Virgina (2001). 15 15 // ICD-GPS-200; Navstar GPS Space Segment / Navigation User Interfaces; … … 38 38 #define INC_RTCM2_H 39 39 40 #include <bitset> 40 #include <bitset> 41 41 #include <fstream> 42 42 #include <string> … … 55 55 // 56 56 // Purpose: 57 // 57 // 58 58 // Handling of RTCM2 30bit words 59 59 // … … 63 63 64 64 public: 65 65 66 66 // Constructor and initialization 67 67 68 68 ThirtyBitWord(); 69 69 70 70 void clear(); 71 71 72 72 // Status queries 73 73 74 74 bool fail() const; 75 75 bool validParity() const; … … 77 77 78 78 // Access methods 79 79 80 80 unsigned int all() const; 81 81 unsigned int value() const; 82 82 83 83 // Input 84 84 85 85 void get(const std::string& buf); 86 86 void get(std::istream& inp); 87 87 void getHeader(std::string& buf); 88 88 void getHeader(std::istream& inp); 89 90 private: 91 89 90 private: 91 92 92 // Input 93 93 … … 102 102 // parity bits retained from the previous word 103 103 // 104 // Bits 31..30 (from left to right) hold the parity bits D29*..D30* of 104 // Bits 31..30 (from left to right) hold the parity bits D29*..D30* of 105 105 // the previous 30-bit word 106 106 // Bits 29..06 (from left to right) hold the current data bits D01..D24 … … 108 108 // 109 109 110 unsigned int W; 111 110 unsigned int W; 111 112 112 }; 113 113 … … 125 125 126 126 class RTCM2packet { 127 128 public: 129 127 128 public: 129 130 130 // Constructor and initialization 131 131 132 132 RTCM2packet(); 133 133 134 134 void clear(); 135 135 136 136 // Status queries 137 137 138 bool valid() const; 139 140 // Input 138 bool valid() const; 139 140 // Input 141 141 142 142 void getPacket(std::string& buf); 143 143 void getPacket(std::istream& inp); 144 144 friend std::istream& operator >> (std::istream& is, RTCM2packet& p); 145 145 146 146 // 147 147 // Access methods 148 // 149 148 // 149 150 150 // Header and data words contents (parity corrected) 151 151 152 152 unsigned int header1() const; 153 153 unsigned int header2() const; 154 154 unsigned int dataWord(int i) const; 155 155 156 156 // Header information 157 157 158 158 unsigned int msgType() const; 159 159 unsigned int ID() const { return msgType(); }; … … 174 174 175 175 // All input of RTCM data uses a single instance, W, of a 30-bit word 176 // to maintain parity bits between consecutive inputs. 177 176 // to maintain parity bits between consecutive inputs. 177 178 178 ThirtyBitWord W; 179 179 180 180 // Two 30-bit words make up the header of an RTCM2 message 181 // (parity corrected) 182 181 // (parity corrected) 182 183 183 unsigned int H1; 184 184 unsigned int H2; … … 187 187 188 188 std::vector<unsigned int> DW; 189 190 }; 189 190 }; 191 191 192 192 … … 202 202 203 203 class RTCM2_03 { 204 204 205 205 public: 206 206 // Constructor 207 RTCM2_03(); 208 207 RTCM2_03() { 208 validMsg = false; 209 x = 0.0; 210 y = 0.0; 211 z = 0.0; 212 } 209 213 void extract(const RTCM2packet& P); 210 211 public:212 213 214 bool validMsg; // Validity flag 214 215 double x,y,z; // Station coordinates … … 230 231 231 232 public: 232 233 RTCM2_23 () { 234 validMsg = false; 235 } 233 236 void extract(const RTCM2packet& P); 234 235 public:236 237 237 bool validMsg; // Validity flag 238 238 std::string antType; // Antenna descriptor … … 248 248 // Purpose: 249 249 // 250 // A class for handling RTCM 2 Reference Station Antenna 250 // A class for handling RTCM 2 Reference Station Antenna 251 251 // Reference Point Parameter messages 252 252 // … … 256 256 257 257 public: 258 258 RTCM2_24 () { 259 validMsg = false; 260 isGPS = false; 261 isGLONASS = false; 262 x = 0.0; 263 y = 0.0; 264 z = 0.0; 265 h = 0.0; 266 } 259 267 void extract(const RTCM2packet& P); 260 261 public:262 263 268 bool validMsg; // Validity flag 264 269 bool isGPS; // Flag for GPS supporting station … … 277 282 // Purpose: 278 283 // 279 // A class for handling blocks of RTCM2 18 & 19 packets that need to be 284 // A class for handling blocks of RTCM2 18 & 19 packets that need to be 280 285 // combined to get a complete set of measurements 281 286 // … … 284 289 class RTCM2_Obs { 285 290 286 public: 291 public: 287 292 288 293 RTCM2_Obs(); // Constructor 289 294 290 295 void extract(const RTCM2packet& P); // Packet handler 291 296 void clear(); // Initialization 292 bool valid() const; // Check for complete obs block 297 bool valid() const; // Check for complete obs block 293 298 294 299 double resolvedPhase_L1(int i) const; // L1 & L2 carrier phase of i-th sat 295 double resolvedPhase_L2(int i) const; // with resolved 2^24 cy ambiguity 300 double resolvedPhase_L2(int i) const; // with resolved 2^24 cy ambiguity 296 301 // (based on rng_C1) 297 302 … … 300 305 int& epochWeek, 301 306 double& epochSecs ) const; 302 303 304 public: 307 308 309 public: 305 310 306 311 double secs; // Seconds of hour (GPS time) … … 325 330 326 331 typedef std::bitset<8> msgflags; 327 332 328 333 msgflags availability; // Msg availability flags 329 334 bool GPSonly; // Flag for GPS-only station 330 335 331 }; 336 }; 332 337 333 338
Note:
See TracChangeset
for help on using the changeset viewer.