Changeset 2239 in ntrip
- Timestamp:
- Jan 12, 2010, 3:17:14 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncmodel.cpp
r2238 r2239 84 84 // Partial 85 85 //////////////////////////////////////////////////////////////////////////// 86 double bncParam::partial(t_satData* satData, const QString& prnIn) { 86 double bncParam::partial(t_satData* satData, bool phase) { 87 88 // Coordinates 89 // ----------- 87 90 if (type == CRD_X) { 88 91 return (xx - satData->xx(1)) / satData->rho; … … 94 97 return (xx - satData->xx(3)) / satData->rho; 95 98 } 96 else if (type == RECCLK) { 97 return 1.0; 98 } 99 100 // Receiver Clocks 101 // --------------- 102 else if (type == RECCLK_GPS) { 103 if (satData->prn[0] == 'G') { 104 return 1.0; 105 } 106 else { 107 return 0.0; 108 } 109 } 110 else if (type == RECCLK_GLO) { 111 if (satData->prn[0] == 'R') { 112 return 1.0; 113 } 114 else { 115 return 0.0; 116 } 117 } 118 119 // Troposphere 120 // ----------- 99 121 else if (type == TROPO) { 100 122 return 1.0 / sin(satData->eleSat); 101 123 } 124 125 // Ambiguities 126 // ----------- 102 127 else if (type == AMB_L3) { 103 if (p rnIn == prn) {128 if (phase && satData->prn == prn) { 104 129 return 1.0; 105 130 } … … 108 133 } 109 134 } 135 136 // Default return 137 // -------------- 110 138 return 0.0; 111 139 } … … 140 168 _ellBanc.ReSize(3); _ellBanc = 0.0; 141 169 142 _params.push_back(new bncParam(bncParam::CRD_X, 1, "")); 143 _params.push_back(new bncParam(bncParam::CRD_Y, 2, "")); 144 _params.push_back(new bncParam(bncParam::CRD_Z, 3, "")); 145 _params.push_back(new bncParam(bncParam::RECCLK, 4, "")); 170 if ( Qt::CheckState(settings.value("pppGLONASS").toInt()) == Qt::Checked) { 171 _useGlonass = true; 172 } 173 else { 174 _useGlonass = false; 175 } 176 177 int nextPar = 0; 178 _params.push_back(new bncParam(bncParam::CRD_X, ++nextPar, "")); 179 _params.push_back(new bncParam(bncParam::CRD_Y, ++nextPar, "")); 180 _params.push_back(new bncParam(bncParam::CRD_Z, ++nextPar, "")); 181 _params.push_back(new bncParam(bncParam::RECCLK_GPS, ++nextPar, "")); 182 if (_useGlonass) { 183 _params.push_back(new bncParam(bncParam::RECCLK_GLO, ++nextPar, "")); 184 } 146 185 if (_estTropo) { 147 _params.push_back(new bncParam(bncParam::TROPO, 5, ""));186 _params.push_back(new bncParam(bncParam::TROPO, ++nextPar, "")); 148 187 } 149 188 … … 151 190 152 191 _QQ.ReSize(nPar); 192 153 193 _QQ = 0.0; 154 194 155 _QQ(1,1) = sig_crd_0 * sig_crd_0; 156 _QQ(2,2) = sig_crd_0 * sig_crd_0; 157 _QQ(3,3) = sig_crd_0 * sig_crd_0; 158 _QQ(4,4) = sig_clk_0 * sig_clk_0; 159 if (_estTropo) { 160 _QQ(5,5) = sig_trp_0 * sig_trp_0; 195 for (int iPar = 1; iPar <= _params.size(); iPar++) { 196 bncParam* pp = _params[iPar-1]; 197 if (pp->isCrd()) { 198 _QQ(iPar,iPar) = sig_crd_0 * sig_crd_0; 199 } 200 else if (pp->isClk()) { 201 _QQ(iPar,iPar) = sig_clk_0 * sig_clk_0; 202 } 203 else if (pp->type == bncParam::TROPO) { 204 _QQ(iPar,iPar) = sig_trp_0 * sig_trp_0; 205 } 161 206 } 162 207 … … 300 345 trp() / sin(satData->eleSat); 301 346 302 return satData->rho + clk() - satData->clk + tropDelay; 347 double clk = 0.0; 348 if (satData->prn[0] == 'G') { 349 clk = clkGPS(); 350 } 351 else if (satData->prn[0] == 'R') { 352 clk = clkGlo(); 353 } 354 355 cout << satData->prn.toAscii().data() << " " 356 << clk << " " << satData->rho + clk - satData->clk + tropDelay << endl; 357 358 return satData->rho + clk - satData->clk + tropDelay; 303 359 } 304 360 … … 378 434 iGPS.next(); 379 435 QString prn = iGPS.key(); 380 t_satData* satData = iGPS.value();381 436 bool found = false; 382 437 for (int iPar = 1; iPar <= _params.size(); iPar++) { … … 437 492 } 438 493 439 // Coordinates 440 // ----------- 441 if (_static) { 442 if (x() == 0.0 && y() == 0.0 && z() == 0.0) { 443 _params[0]->xx = _xcBanc(1); 444 _params[1]->xx = _xcBanc(2); 445 _params[2]->xx = _xcBanc(3); 446 } 447 } 448 else { 449 _params[0]->xx = _xcBanc(1); 450 _params[1]->xx = _xcBanc(2); 451 _params[2]->xx = _xcBanc(3); 452 453 _QQ(1,1) += sig_crd_p * sig_crd_p; 454 _QQ(2,2) += sig_crd_p * sig_crd_p; 455 _QQ(3,3) += sig_crd_p * sig_crd_p; 456 } 457 458 // Receiver Clocks 459 // --------------- 460 _params[3]->xx = _xcBanc(4); 494 bool firstCrd = x() == 0.0 && y() == 0.0 && z() == 0.0; 495 461 496 for (int iPar = 1; iPar <= _params.size(); iPar++) { 462 _QQ(iPar, 4) = 0.0; 463 } 464 _QQ(4,4) = sig_clk_0 * sig_clk_0; 465 466 // Tropospheric Delay 467 // ------------------ 468 if (_estTropo) { 469 _QQ(5,5) += sig_trp_p * sig_trp_p; 497 bncParam* pp = _params[iPar-1]; 498 499 // Coordinates 500 // ----------- 501 if (pp->type == bncParam::CRD_X) { 502 if (firstCrd || !_static) { 503 pp->xx = _xcBanc(1); 504 } 505 _QQ(iPar,iPar) += sig_crd_p * sig_crd_p; 506 } 507 else if (pp->type == bncParam::CRD_Y) { 508 if (firstCrd || !_static) { 509 pp->xx = _xcBanc(2); 510 } 511 _QQ(iPar,iPar) += sig_crd_p * sig_crd_p; 512 } 513 else if (pp->type == bncParam::CRD_Z) { 514 if (firstCrd || !_static) { 515 pp->xx = _xcBanc(3); 516 } 517 _QQ(iPar,iPar) += sig_crd_p * sig_crd_p; 518 } 519 520 // Receiver Clocks 521 // --------------- 522 else if (pp->isClk()) { 523 pp->xx = _xcBanc(4); 524 for (int jj = 1; jj <= _params.size(); jj++) { 525 _QQ(iPar, jj) = 0.0; 526 } 527 _QQ(iPar,iPar) = sig_clk_0 * sig_clk_0; 528 } 529 530 // Tropospheric Delay 531 // ------------------ 532 else if (pp->type == bncParam::TROPO) { 533 _QQ(iPar,iPar) += sig_trp_p * sig_trp_p; 534 } 470 535 } 471 536 } … … 543 608 PP(iObs,iObs) = 1.0 / (sig_P3 * sig_P3) / ellWgtCoeff; 544 609 for (int iPar = 1; iPar <= _params.size(); iPar++) { 545 AA(iObs, iPar) = _params[iPar-1]->partial(satData, "");610 AA(iObs, iPar) = _params[iPar-1]->partial(satData, false); 546 611 } 547 612 … … 555 620 ll(iObs) -= _params[iPar-1]->xx; 556 621 } 557 AA(iObs, iPar) = _params[iPar-1]->partial(satData, prn);622 AA(iObs, iPar) = _params[iPar-1]->partial(satData, true); 558 623 } 559 624 } … … 586 651 ll(iObs) -= _params[iPar-1]->xx; 587 652 } 588 AA(iObs, iPar) = _params[iPar-1]->partial(satData, prn);653 AA(iObs, iPar) = _params[iPar-1]->partial(satData, true); 589 654 } 590 655 … … 623 688 bncParam* par = itPar.next(); 624 689 par->xx += dx(par->index); 625 if (par->type == bncParam::RECCLK) { 626 str1 << "\n clk = " << setw(6) << setprecision(3) << par->xx 690 if (par->type == bncParam::RECCLK_GPS) { 691 str1 << "\n clk GPS = " << setw(6) << setprecision(3) << par->xx 692 << " +- " << setw(6) << setprecision(3) 693 << sqrt(_QQ(par->index,par->index)); 694 } 695 if (par->type == bncParam::RECCLK_GLO) { 696 str1 << "\n clk GLO = " << setw(6) << setprecision(3) << par->xx 627 697 << " +- " << setw(6) << setprecision(3) 628 698 << sqrt(_QQ(par->index,par->index)); … … 656 726 << setw(14) << setprecision(3) << z() << " +- " 657 727 << setw(6) << setprecision(3) << sqrt(_QQ(3,3)); 658 if (_estTropo) {659 str2 << " " << setw(6) << setprecision(3) << trp() << " +- "660 << setw(6) << setprecision(3) << sqrt(_QQ(5,5));661 }662 728 663 729 emit newMessage(_log, false);
Note:
See TracChangeset
for help on using the changeset viewer.