- Timestamp:
- Jan 16, 2010, 3:52:59 PM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncmodel.cpp
r2248 r2265 60 60 const double sig_crd_0 = 100.0; 61 61 const double sig_crd_p = 100.0; 62 const double sig_clk_0 = 1000.0;62 const double sig_clk_0 = 100.0; 63 63 const double sig_trp_0 = 0.01; 64 64 const double sig_trp_p = 1e-6; 65 const double sig_amb_0 = 1000.0; 65 const double sig_amb_0_GPS = 100.0; 66 const double sig_amb_0_GLO = 1000.0; 66 67 const double sig_P3 = 1.0; 67 68 const double sig_L3_GPS = 0.01; … … 102 103 // Receiver Clocks 103 104 // --------------- 104 else if (type == RECCLK_GPS) { 105 if (satData->prn[0] == 'G') { 106 return 1.0; 107 } 108 else { 109 return 0.0; 110 } 111 } 112 else if (type == RECCLK_GLO) { 113 if (satData->prn[0] == 'R') { 114 return 1.0; 115 } 116 else { 117 return 0.0; 118 } 105 else if (type == RECCLK) { 106 return 1.0; 119 107 } 120 108 … … 170 158 _ellBanc.ReSize(3); _ellBanc = 0.0; 171 159 172 if ( Qt::CheckState(settings.value("pppGLONASS").toInt()) == Qt::Checked) { 160 if (_usePhase && 161 Qt::CheckState(settings.value("pppGLONASS").toInt()) == Qt::Checked) { 173 162 _useGlonass = true; 174 163 } … … 178 167 179 168 int nextPar = 0; 180 _params.push_back(new bncParam(bncParam::CRD_X, ++nextPar, "")); 181 _params.push_back(new bncParam(bncParam::CRD_Y, ++nextPar, "")); 182 _params.push_back(new bncParam(bncParam::CRD_Z, ++nextPar, "")); 183 _params.push_back(new bncParam(bncParam::RECCLK_GPS, ++nextPar, "")); 184 if (_useGlonass) { 185 _params.push_back(new bncParam(bncParam::RECCLK_GLO, ++nextPar, "")); 186 } 169 _params.push_back(new bncParam(bncParam::CRD_X, ++nextPar, "")); 170 _params.push_back(new bncParam(bncParam::CRD_Y, ++nextPar, "")); 171 _params.push_back(new bncParam(bncParam::CRD_Z, ++nextPar, "")); 172 _params.push_back(new bncParam(bncParam::RECCLK, ++nextPar, "")); 187 173 if (_estTropo) { 188 174 _params.push_back(new bncParam(bncParam::TROPO, ++nextPar, "")); … … 200 186 _QQ(iPar,iPar) = sig_crd_0 * sig_crd_0; 201 187 } 202 else if (pp-> isClk()) {188 else if (pp->type == bncParam::RECCLK) { 203 189 _QQ(iPar,iPar) = sig_clk_0 * sig_clk_0; 204 190 } … … 347 333 trp() / sin(satData->eleSat); 348 334 349 double clk = 0.0; 350 if (satData->prn[0] == 'G') { 351 clk = clkGPS(); 352 } 353 else if (satData->prn[0] == 'R') { 354 clk = clkGlo(); 355 } 356 357 return satData->rho + clk - satData->clk + tropDelay; 335 return satData->rho + clk() - satData->clk + tropDelay; 358 336 } 359 337 … … 425 403 // Receiver Clocks 426 404 // --------------- 427 else if (pp-> isClk()) {405 else if (pp->type == bncParam::RECCLK) { 428 406 pp->xx = _xcBanc(4); 429 407 for (int jj = 1; jj <= _params.size(); jj++) { … … 534 512 bncParam* par = _params[ii-1]; 535 513 if (par->index_old == 0) { 536 _QQ(par->index, par->index) = sig_amb_0 * sig_amb_0; 514 if (par->prn[0] == 'R') { 515 _QQ(par->index, par->index) = sig_amb_0_GLO * sig_amb_0_GLO; 516 } 517 else { 518 _QQ(par->index, par->index) = sig_amb_0_GPS * sig_amb_0_GPS; 519 } 537 520 } 538 521 par->index_old = par->index; … … 646 629 AA(iObs, iPar) = _params[iPar-1]->partial(satData, true); 647 630 } 648 649 ostringstream str;650 str.setf(ios::fixed);651 str << "\niObs = " << iObs << " " << prn.toAscii().data() << " "652 << setprecision(3) << rhoCmp << " "653 << setprecision(3) << satData->P3 << " "654 << setprecision(3) << satData->L3 << " "655 << ll(iObs) << endl;656 _log += str.str().c_str();657 631 } 658 632 } … … 669 643 vv = ll - AA * dx; 670 644 671 //// beg test 672 { 673 ostringstream str; 674 str.setf(ios::fixed); 675 ColumnVector vv_code(epoData->sizeGPS()); 676 ColumnVector vv_phase(epoData->sizeGPS()); 677 ColumnVector vv_glo(epoData->sizeGlo()); 678 679 for (unsigned iobs = 1; iobs <= epoData->sizeGPS(); ++iobs) { 645 ostringstream str; 646 str.setf(ios::fixed); 647 ColumnVector vv_code(epoData->sizeGPS()); 648 ColumnVector vv_phase(epoData->sizeGPS()); 649 ColumnVector vv_glo(epoData->sizeGlo()); 650 651 for (unsigned iobs = 1; iobs <= epoData->sizeGPS(); ++iobs) { 652 if (_usePhase) { 680 653 vv_code(iobs) = vv(2*iobs-1); 681 654 vv_phase(iobs) = vv(2*iobs); 682 655 } 656 else { 657 vv_code(iobs) = vv(iobs); 658 } 659 } 660 if (_useGlonass) { 683 661 for (unsigned iobs = 1; iobs <= epoData->sizeGlo(); ++iobs) { 684 662 vv_glo(iobs) = vv(2*epoData->sizeGPS()+iobs); 685 663 } 686 687 str << "\nresiduals code " << setprecision(3) << vv_code.t(); 664 } 665 666 str << "\nresiduals code " << setprecision(3) << vv_code.t(); 667 if (_usePhase) { 688 668 str << "residuals phase " << setprecision(3) << vv_phase.t(); 669 } 670 if (_useGlonass) { 689 671 str << "residuals glo " << setprecision(3) << vv_glo.t(); 690 _log += str.str().c_str(); 691 } 692 //// end test 672 } 673 _log += str.str().c_str(); 693 674 694 675 } while (outlierDetection(QQsav, vv, epoData->satDataGPS, … … 697 678 // Set Solution Vector 698 679 // ------------------- 699 ostringstream str 1;700 str 1.setf(ios::fixed);680 ostringstream strB; 681 strB.setf(ios::fixed); 701 682 QVectorIterator<bncParam*> itPar(_params); 702 683 while (itPar.hasNext()) { 703 684 bncParam* par = itPar.next(); 704 685 par->xx += dx(par->index); 705 if (par->type == bncParam::RECCLK_GPS) { 706 str1 << "\n clk GPS = " << setw(6) << setprecision(3) << par->xx 686 687 if (par->type == bncParam::RECCLK) { 688 strB << "\n clk = " << setw(6) << setprecision(3) << par->xx 707 689 << " +- " << setw(6) << setprecision(3) 708 690 << sqrt(_QQ(par->index,par->index)); 709 691 } 710 if (par->type == bncParam::RECCLK_GLO) {711 str1 << "\n clk GLO = " << setw(6) << setprecision(3) << par->xx712 << " +- " << setw(6) << setprecision(3)713 << sqrt(_QQ(par->index,par->index));714 }715 692 else if (par->type == bncParam::AMB_L3) { 716 str 1<< "\n amb " << par->prn.toAscii().data() << " = "693 strB << "\n amb " << par->prn.toAscii().data() << " = " 717 694 << setw(6) << setprecision(3) << par->xx 718 695 << " +- " << setw(6) << setprecision(3) … … 720 697 } 721 698 else if (par->type == bncParam::TROPO) { 722 str 1<< "\n trp = " << par->prn.toAscii().data()699 strB << "\n trp = " << par->prn.toAscii().data() 723 700 << setw(7) << setprecision(3) << delay_saast(M_PI/2.0) << " " 724 701 << setw(6) << setprecision(3) << showpos << par->xx << noshowpos … … 727 704 } 728 705 } 729 _log += str1.str().c_str();706 strB << '\n'; 730 707 731 708 // Message (both log file and screen) 732 709 // ---------------------------------- 733 ostringstream str 2;734 str 2.setf(ios::fixed);735 str 2<< _staID.data() << ": PPP "710 ostringstream strA; 711 strA.setf(ios::fixed); 712 strA << _staID.data() << ": PPP " 736 713 << epoData->tt.timestr(1) << " " << epoData->sizeAll() << " " 737 714 << setw(14) << setprecision(3) << x() << " +- " … … 742 719 << setw(6) << setprecision(3) << sqrt(_QQ(3,3)); 743 720 721 emit newMessage(QByteArray(strA.str().c_str()), true); 722 723 _log += strB.str().c_str(); 744 724 emit newMessage(_log, false); 745 emit newMessage(QByteArray(str2.str().c_str()), true);746 725 747 726 // NMEA Output -
trunk/BNC/bncmodel.h
r2240 r2265 38 38 class bncParam { 39 39 public: 40 enum parType {CRD_X, CRD_Y, CRD_Z, RECCLK _GPS, RECCLK_GLO, TROPO, AMB_L3};40 enum parType {CRD_X, CRD_Y, CRD_Z, RECCLK, TROPO, AMB_L3}; 41 41 bncParam(parType typeIn, int indexIn, const QString& prn); 42 42 ~bncParam(); … … 44 44 bool isCrd() const { 45 45 return (type == CRD_X || type == CRD_Y || type == CRD_Z); 46 }47 bool isClk() const {48 return (type == RECCLK_GPS|| type == RECCLK_GLO);49 46 } 50 47 parType type; … … 66 63 double y() const {return _params[1]->xx;} 67 64 double z() const {return _params[2]->xx;} 68 double clkGPS() const { 69 for (int ii = 0; ii < _params.size(); ++ii) { 70 bncParam* pp = _params[ii]; 71 if (pp->type == bncParam::RECCLK_GPS) { 72 return pp->xx; 73 } 74 } 75 return 0.0; 76 } 77 double clkGlo() const { 78 for (int ii = 0; ii < _params.size(); ++ii) { 79 bncParam* pp = _params[ii]; 80 if (pp->type == bncParam::RECCLK_GLO) { 81 return pp->xx; 82 } 83 } 84 return 0.0; 85 } 65 double clk() const {return _params[3]->xx;} 86 66 double trp() const { 87 67 for (int ii = 0; ii < _params.size(); ++ii) {
Note:
See TracChangeset
for help on using the changeset viewer.