- Timestamp:
- Oct 27, 2012, 12:26:02 PM (12 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncephuser.cpp
r4772 r4784 268 268 return success; 269 269 } 270 271 // 272 //////////////////////////////////////////////////////////////////////////// 273 t_irc t_bias::readLine(const QString& line) { 274 275 if (line[0] == '!') { 276 return failure; 277 } 278 279 QTextStream in(line.toAscii()); 280 281 int messageType; 282 in >> messageType; 283 284 if (messageType != BTYPE_GPS && messageType != BTYPE_GLONASS) { 285 return failure; 286 } 287 288 int updateInterval; 289 int GPSweek; 290 double GPSweeks; 291 int numBiases; 292 in >> updateInterval >> GPSweek >> GPSweeks >> _prn >> numBiases; 293 294 _time.set(GPSweek, GPSweeks); 295 296 for (int ii = 0; ii < numBiases; ii++) { 297 int bType; 298 double bValue; 299 in >> bType >> bValue; 300 if (bType == CODETYPEGPS_L1_CA) { 301 _value["1C"] = bValue; 302 } 303 else if (bType == CODETYPEGPS_L1_P) { 304 _value["1P"] = bValue; 305 } 306 else if (bType == CODETYPEGPS_L1_Z) { 307 _value["1W"] = bValue; 308 } 309 else if (bType == CODETYPEGPS_L2_CA) { 310 _value["2C"] = bValue; 311 } 312 else if (bType == CODETYPEGPS_SEMI_CODELESS) { 313 _value["2N"] = bValue; 314 } 315 else if (bType == CODETYPEGPS_L2_CM) { 316 _value["2M"] = bValue; 317 } 318 else if (bType == CODETYPEGPS_L2_CL) { 319 _value["2L"] = bValue; 320 } 321 else if (bType == CODETYPEGPS_L2_CML) { 322 _value["2X"] = bValue; 323 } 324 else if (bType == CODETYPEGPS_L2_P) { 325 _value["2P"] = bValue; 326 } 327 else if (bType == CODETYPEGPS_L2_Z) { 328 _value["2W"] = bValue; 329 } 330 else if (bType == CODETYPEGPS_L5_I) { 331 _value["5I"] = bValue; 332 } 333 else if (bType == CODETYPEGPS_L5_Q) { 334 _value["5Q"] = bValue; 335 } 336 else if (bType == CODETYPEGLONASS_L1_CA) { 337 _value["1C"] = bValue; 338 } 339 else if (bType == CODETYPEGLONASS_L1_P) { 340 _value["1P"] = bValue; 341 } 342 else if (bType == CODETYPEGLONASS_L2_CA) { 343 _value["2C"] = bValue; 344 } 345 else if (bType == CODETYPEGLONASS_L2_P) { 346 _value["2P"] = bValue; 347 } 348 } 349 350 return success; 351 } -
trunk/BNC/src/bncephuser.h
r4772 r4784 87 87 }; 88 88 89 class t_bias { 90 public: 91 t_bias() {} 92 ~t_bias() {} 93 t_irc readLine(const QString& line); 94 double value(const QByteArray& rnxStr) const { 95 if (_value.contains(rnxStr)) { 96 return _value[rnxStr]; 97 } 98 else { 99 return 0.0; 100 } 101 } 102 QString _prn; 103 bncTime _time; 104 QMap<QByteArray, double> _value; 105 }; 106 89 107 class bncEphUser : public QObject { 90 108 Q_OBJECT -
trunk/BNC/src/bncpppclient.cpp
r4416 r4784 157 157 } 158 158 159 // Set Observations GPS 160 // -------------------- 161 if (obs.satSys == 'G') { 162 double C1 = obs.measdata("C1C", 3.0); 163 double P1 = obs.measdata("C1P", 3.0); 164 double P2 = obs.measdata("C2P", 3.0); 165 double L1 = obs.measdata("L1P", 3.0); if (L1 == 0.0) L1 = obs.measdata("L1C", 3.0); 166 double L2 = obs.measdata("L2P", 3.0); if (L2 == 0.0) L2 = obs.measdata("L2C", 3.0); 167 if ( (C1 || P1) && P2 && L1 && L2 ) { 168 double f1 = t_CST::freq1; 169 double f2 = t_CST::freq2; 170 double c1 = f1 * f1 / (f1 * f1 - f2 * f2); 171 double c2 = - f2 * f2 / (f1 * f1 - f2 * f2); 172 if (P1) { 173 satData->P1 = P1 + (bb ? bb->p1 : 0.0); 174 } 175 else { 176 satData->P1 = C1 + (bb ? bb->c1 : 0.0); 177 } 178 satData->P2 = P2 + (bb ? bb->p2 : 0.0); 179 180 satData->L1 = L1 * t_CST::c / f1; 181 satData->L2 = L2 * t_CST::c / f2; 182 satData->P3 = c1 * satData->P1 + c2 * satData->P2; 183 satData->L3 = c1 * satData->L1 + c2 * satData->L2; 184 satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2; 185 186 _epoData.back()->satData[satData->prn] = satData; 187 } 188 else { 189 delete satData; 190 } 191 } 192 193 // Set Observations GLONASS 194 // ------------------------ 195 else if (obs.satSys == 'R') { 196 double C1 = obs.measdata("C1C", 3.0); 197 double P1 = obs.measdata("C1P", 3.0); 198 double C2 = obs.measdata("C2C", 3.0); 199 double P2 = obs.measdata("C2P", 3.0); 200 double L1 = obs.measdata("L1P", 3.0); if (L1 == 0.0) L1 = obs.measdata("L1C", 3.0); 201 double L2 = obs.measdata("L2P", 3.0); if (L2 == 0.0) L2 = obs.measdata("L2C", 3.0); 202 if ( (P1 || C1) && (P2 || P2) && L1 && L2 ) { 203 double f1 = t_CST::f1(obs.satSys, obs.slotNum); 204 double f2 = t_CST::f2(obs.satSys, obs.slotNum); 205 double c1 = f1 * f1 / (f1 * f1 - f2 * f2); 206 double c2 = - f2 * f2 / (f1 * f1 - f2 * f2); 207 if (P1) { 208 satData->P1 = P1 + (bb ? bb->p1 : 0.0); 209 } 210 else { 211 satData->P1 = C1 + (bb ? bb->c1 : 0.0); 212 } 213 if (P2) { 214 satData->P2 = P2 + (bb ? bb->p2 : 0.0); 215 } 216 else { 217 satData->P2 = C2; 218 } 219 satData->L1 = L1 * t_CST::c / f1; 220 satData->L2 = L2 * t_CST::c / f2; 221 satData->P3 = c1 * satData->P1 + c2 * satData->P2; 222 satData->L3 = c1 * satData->L1 + c2 * satData->L2; 223 satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2; 224 159 // Set Observations GPS and Glonass 160 // -------------------------------- 161 if (obs.satSys == 'G' || obs.satSys == 'R') { 162 const QByteArray preferedTypes("WPC"); 163 for (int ii = preferedTypes.length()-1; ii >= 0; ii--) { 164 double p1 = obs.measdata("C1" + preferedTypes[ii], 3.0); 165 if (p1 != 0.0) { 166 satData->P1 = p1; 167 if (bb) { 168 satData->P1 += bb->value("1" + preferedTypes[ii]); 169 } 170 } 171 double p2 = obs.measdata("C2" + preferedTypes[ii], 3.0); 172 if (p2 != 0.0) { 173 satData->P2 = p2; 174 if (bb) { 175 satData->P1 += bb->value("2" + preferedTypes[ii]); 176 } 177 } 178 double l1 = obs.measdata("L1" + preferedTypes[ii], 3.0); 179 if (l1 != 0.0) { 180 satData->L1 = l1; 181 } 182 double l2 = obs.measdata("L2" + preferedTypes[ii], 3.0); 183 if (l2 != 0.0) { 184 satData->L2 = l2; 185 } 186 } 187 if (satData->P1 != 0.0 && satData->P2 != 0.0 && 188 satData->L1 != 0.0 && satData->L2 != 0.0 ) { 189 double f1 = t_CST::f1(obs.satSys, obs.slotNum); 190 double f2 = t_CST::f2(obs.satSys, obs.slotNum); 191 double a1 = f1 * f1 / (f1 * f1 - f2 * f2); 192 double a2 = - f2 * f2 / (f1 * f1 - f2 * f2); 193 satData->L1 = satData->L1 * t_CST::c / f1; 194 satData->L2 = satData->L2 * t_CST::c / f2; 195 satData->P3 = a1 * satData->P1 + a2 * satData->P2; 196 satData->L3 = a1 * satData->L1 + a2 * satData->L2; 197 satData->lambda3 = a1 * t_CST::c / f1 + a2 * t_CST::c / f2; 225 198 _epoData.back()->satData[satData->prn] = satData; 226 199 } … … 233 206 // ------------------------ 234 207 else if (obs.satSys == 'E') { 235 double C1 = obs.measdata("C1", 3.0); 236 double L1 = obs.measdata("L1", 3.0); 237 double C5 = obs.measdata("C5", 3.0); 238 double L5 = obs.measdata("L5", 3.0); 239 if ( C1 && C5 && L1 && L5) { 208 satData->P1 = obs.measdata("C1", 3.0); 209 satData->L1 = obs.measdata("L1", 3.0); 210 satData->P5 = obs.measdata("C5", 3.0); 211 satData->L5 = obs.measdata("L5", 3.0); 212 if (satData->P1 != 0.0 && satData->P5 != 0.0 && 213 satData->L1 != 0.0 && satData->L5 != 0.0 ) { 240 214 double f1 = t_CST::freq1; 241 215 double f5 = t_CST::freq5; 242 double c1 = f1 * f1 / (f1 * f1 - f5 * f5); 243 double c5 = - f5 * f5 / (f1 * f1 - f5 * f5); 244 245 satData->P1 = C1; 246 satData->P5 = C5; 247 satData->L1 = L1 * t_CST::c / f1; 248 satData->L5 = L5 * t_CST::c / f5; 249 satData->P3 = c1 * satData->P1 + c5 * satData->P5; 250 satData->L3 = c1 * satData->L1 + c5 * satData->L5; 251 satData->lambda3 = c1 * t_CST::c / f1 + c5 * t_CST::c / f5; 216 double a1 = f1 * f1 / (f1 * f1 - f5 * f5); 217 double a5 = - f5 * f5 / (f1 * f1 - f5 * f5); 218 satData->L1 = satData->L1 * t_CST::c / f1; 219 satData->L5 = satData->L5 * t_CST::c / f5; 220 satData->P3 = a1 * satData->P1 + a5 * satData->P5; 221 satData->L3 = a1 * satData->L1 + a5 * satData->L5; 222 satData->lambda3 = a1 * t_CST::c / f1 + a5 * t_CST::c / f5; 252 223 _epoData.back()->satData[satData->prn] = satData; 253 224 } … … 303 274 _corr[prn] = cc; 304 275 } 305 306 276 cc->readLine(line); 307 277 _corr_tt = cc->tClk; 308 278 } 309 else if ( messageType == BTYPE_GPS ) { 310 279 else if ( messageType == BTYPE_GPS || messageType == BTYPE_GLONASS ) { 311 280 t_bias* bb = 0; 312 281 if (_bias.contains(prn)) { … … 317 286 _bias[prn] = bb; 318 287 } 319 320 bb->tt.set(GPSweek, GPSweeks); 321 322 int numBiases; 323 in >> numBiases; 324 for (int ii = 0; ii < numBiases; ++ii) { 325 int bType; 326 double bValue; 327 in >> bType >> bValue; 328 if (bType == CODETYPEGPS_L1_Z) { 329 bb->p1 = bValue; 330 } 331 else if (bType == CODETYPEGPS_L1_CA) { 332 bb->c1 = bValue; 333 } 334 else if (bType == CODETYPEGPS_L2_Z) { 335 bb->p2 = bValue; 336 } 337 } 288 bb->readLine(line); 338 289 } 339 290 } -
trunk/BNC/src/bncpppclient.h
r4278 r4784 37 37 t_satData() { 38 38 obsIndex = 0; 39 P1 = 0.0; 40 P2 = 0.0; 41 P5 = 0.0; 42 P3 = 0.0; 43 L1 = 0.0; 44 L2 = 0.0; 45 L5 = 0.0; 46 L3 = 0.0; 39 47 } 40 48 ~t_satData() {} … … 105 113 }; 106 114 107 class t_bias {108 public:109 t_bias() {110 p1 = 0.0;111 p2 = 0.0;112 c1 = 0.0;113 }114 bncTime tt;115 double p1;116 double p2;117 double c1;118 };119 120 115 class bncPPPclient : public bncEphUser { 121 116 Q_OBJECT
Note:
See TracChangeset
for help on using the changeset viewer.