Changeset 9786 in ntrip
- Timestamp:
- Jun 30, 2022, 5:23:55 PM (3 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/ephemeris.cpp
r9785 r9786 244 244 t_ephGPS::t_ephGPS(double rnxVersion, const QStringList& lines) { 245 245 246 const int nLines = 8; 246 int nLines = 8; 247 248 if (navType() == t_eph::CNAV) { 249 nLines += 1; 250 } 251 else if (navType() == t_eph::CNV2) { 252 nLines += 2; 253 } 247 254 248 255 if (lines.size() != nLines) { … … 305 312 _TOC.set(year, month, day, hour, min, sec); 306 313 307 if( readDbl(line, pos[1], fieldLen, _clock_bias ) ||314 if ( readDbl(line, pos[1], fieldLen, _clock_bias ) || 308 315 readDbl(line, pos[2], fieldLen, _clock_drift ) || 309 316 readDbl(line, pos[3], fieldLen, _clock_driftrate) ) { … … 312 319 } 313 320 } 314 315 else if ( iLine == 1 ) { 316 if ( readDbl(line, pos[0], fieldLen, _IODE ) || 317 readDbl(line, pos[1], fieldLen, _Crs ) || 318 readDbl(line, pos[2], fieldLen, _Delta_n) || 319 readDbl(line, pos[3], fieldLen, _M0 ) ) { 320 _checkState = bad; 321 return; 322 } 323 } 324 321 // ===================== 322 // BROADCAST ORBIT - 1 323 // ===================== 324 else if ( iLine == 1) { 325 326 if (navType() == t_eph::CNAV || 327 navType() == t_eph::CNV2) { 328 if ( readDbl(line, pos[0], fieldLen, _ADOT ) || 329 readDbl(line, pos[1], fieldLen, _Crs ) || 330 readDbl(line, pos[2], fieldLen, _Delta_n) || 331 readDbl(line, pos[3], fieldLen, _M0 ) ) { 332 _checkState = bad; 333 return; 334 } 335 } 336 else { // LNAV, undefined 337 if ( readDbl(line, pos[0], fieldLen, _IODE ) || 338 readDbl(line, pos[1], fieldLen, _Crs ) || 339 readDbl(line, pos[2], fieldLen, _Delta_n) || 340 readDbl(line, pos[3], fieldLen, _M0 ) ) { 341 _checkState = bad; 342 return; 343 } 344 } 345 } 346 // ===================== 347 // BROADCAST ORBIT - 2 348 // ===================== 325 349 else if ( iLine == 2 ) { 326 350 if ( readDbl(line, pos[0], fieldLen, _Cuc ) || … … 332 356 } 333 357 } 334 358 // ===================== 359 // BROADCAST ORBIT - 3 360 // ===================== 335 361 else if ( iLine == 3 ) { 336 if ( readDbl(line, pos[0], fieldLen, _TOEsec) || 337 readDbl(line, pos[1], fieldLen, _Cic ) || 338 readDbl(line, pos[2], fieldLen, _OMEGA0) || 339 readDbl(line, pos[3], fieldLen, _Cis ) ) { 340 _checkState = bad; 341 return; 342 } 343 } 344 362 363 if (navType() == t_eph::CNAV || 364 navType() == t_eph::CNV2) { 365 if ( readDbl(line, pos[0], fieldLen, _top) || 366 readDbl(line, pos[1], fieldLen, _Cic ) || 367 readDbl(line, pos[2], fieldLen, _OMEGA0) || 368 readDbl(line, pos[3], fieldLen, _Cis ) ) { 369 _checkState = bad; 370 return; 371 } 372 } 373 else { // LNAV, undefined 374 if ( readDbl(line, pos[0], fieldLen, _TOEsec) || 375 readDbl(line, pos[1], fieldLen, _Cic ) || 376 readDbl(line, pos[2], fieldLen, _OMEGA0) || 377 readDbl(line, pos[3], fieldLen, _Cis ) ) { 378 _checkState = bad; 379 return; 380 } 381 } 382 } 383 // ===================== 384 // BROADCAST ORBIT - 4 385 // ===================== 345 386 else if ( iLine == 4 ) { 346 387 if ( readDbl(line, pos[0], fieldLen, _i0 ) || … … 352 393 } 353 394 } 354 395 // ===================== 396 // BROADCAST ORBIT - 5 397 // ===================== 355 398 else if ( iLine == 5 && type() != t_eph::IRNSS) { 356 if ( readDbl(line, pos[0], fieldLen, _IDOT ) || 357 readDbl(line, pos[1], fieldLen, _L2Codes) || 358 readDbl(line, pos[2], fieldLen, _TOEweek ) || 359 readDbl(line, pos[3], fieldLen, _L2PFlag) ) { 360 _checkState = bad; 361 return; 399 400 if (navType() == t_eph::CNAV || 401 navType() == t_eph::CNV2) { 402 if ( readDbl(line, pos[0], fieldLen, _IDOT ) || 403 readDbl(line, pos[1], fieldLen, _DN0DOT ) || 404 readDbl(line, pos[2], fieldLen, _URAI_NED0 ) || 405 readDbl(line, pos[3], fieldLen, _URAI_NED1) ) { 406 _checkState = bad; 407 return; 408 } 409 } 410 else { // LNAV, undefined 411 if ( readDbl(line, pos[0], fieldLen, _IDOT ) || 412 readDbl(line, pos[1], fieldLen, _L2Codes) || 413 readDbl(line, pos[2], fieldLen, _TOEweek ) || 414 readDbl(line, pos[3], fieldLen, _L2PFlag) ) { 415 _checkState = bad; 416 return; 417 } 362 418 } 363 419 } … … 369 425 } 370 426 } 371 427 // ===================== 428 // BROADCAST ORBIT - 6 429 // ===================== 372 430 else if ( iLine == 6 && type() != t_eph::IRNSS) { 373 if ( readDbl(line, pos[0], fieldLen, _ura ) || 374 readDbl(line, pos[1], fieldLen, _health) || 375 readDbl(line, pos[2], fieldLen, _TGD ) || 376 readDbl(line, pos[3], fieldLen, _IODC ) ) { 377 _checkState = bad; 378 return; 431 432 if (navType() == t_eph::CNAV || 433 navType() == t_eph::CNV2 ) { 434 if ( readDbl(line, pos[0], fieldLen, _URAI_ED) || 435 readDbl(line, pos[1], fieldLen, _health ) || 436 readDbl(line, pos[2], fieldLen, _TGD ) || 437 readDbl(line, pos[3], fieldLen, _URAI_NED2) ) { 438 _checkState = bad; 439 return; 440 } 441 } 442 else { // LNAV, undefined 443 if ( readDbl(line, pos[0], fieldLen, _ura ) || 444 readDbl(line, pos[1], fieldLen, _health) || 445 readDbl(line, pos[2], fieldLen, _TGD ) || 446 readDbl(line, pos[3], fieldLen, _IODC ) ) { 447 _checkState = bad; 448 return; 449 } 379 450 } 380 451 } … … 387 458 } 388 459 } 460 // ===================== 461 // BROADCAST ORBIT - 7 462 // ===================== 389 463 else if ( iLine == 7 ) { 390 if ( readDbl(line, pos[0], fieldLen, _TOT) ) {391 _checkState = bad;392 return; 393 }394 // fitInterval is not valid for IRNSS395 if (type() != t_eph::IRNSS) {396 double fitIntervalRnx;397 readDbl(line, pos[1], fieldLen, fitIntervalRnx); 398 if (type() == t_eph::GPS) { // in RINEX specified allways as time period for GPS399 _fitInterval =fitIntervalRnx;400 } else if (type() == t_eph::QZSS) { // specified as flag for QZSS401 if (rnxVersion == 3.02) {402 _fitInterval = fitIntervalRnx; // specified as time period464 if (navType() == t_eph::LNAV || 465 navType() == t_eph::undefined) { 466 467 if ( readDbl(line, pos[0], fieldLen, _TOT) ) { 468 _checkState = bad; 469 return; 470 } 471 472 if (type() != t_eph::IRNSS) { 473 double fitIntervalRnx; 474 if ( readDbl(line, pos[1], fieldLen, fitIntervalRnx) ) { 475 _checkState = bad; 476 return; 403 477 } 404 else { 405 _fitInterval = fitIntervalFromFlag(fitIntervalRnx, _IODC, t_eph::QZSS); 478 if (type() == t_eph::GPS) { // in RINEX specified always as time period for GPS 479 _fitInterval = fitIntervalRnx; 480 } else if (type() == t_eph::QZSS) { // specified as flag for QZSS 481 if (rnxVersion == 3.02) { 482 _fitInterval = fitIntervalRnx; // specified as time period 483 } 484 else { 485 _fitInterval = fitIntervalFromFlag(fitIntervalRnx, _IODC, t_eph::QZSS); 486 } 406 487 } 488 } 489 } 490 491 else if (navType() == t_eph::CNAV || 492 navType() == t_eph::CNV2) { 493 if ( readDbl(line, pos[0], fieldLen, _ISC_L1CA) || 494 readDbl(line, pos[1], fieldLen, _ISC_L2C ) || 495 readDbl(line, pos[2], fieldLen, _ISC_L5I5) || 496 readDbl(line, pos[3], fieldLen, _ISC_L5Q5) ) { 497 _checkState = bad; 498 return; 499 } 500 501 } 502 503 } 504 // ===================== 505 // BROADCAST ORBIT - 8 506 // ===================== 507 else if ( iLine == 8 ) { 508 if (navType() == t_eph::CNAV) { 509 if ( readDbl(line, pos[0], fieldLen, _TOT) || 510 readDbl(line, pos[1], fieldLen, _wnop) ) { 511 _checkState = bad; 512 return; 513 } 514 } 515 else if (navType() == t_eph::CNV2) { 516 if ( readDbl(line, pos[0], fieldLen, _ISC_L1Cd) || 517 readDbl(line, pos[1], fieldLen, _ISC_L1Cp)) { 518 _checkState = bad; 519 return; 520 } 521 } 522 } 523 // ===================== 524 // BROADCAST ORBIT - 9 525 // ===================== 526 else if ( iLine == 9 ) { 527 if (navType() == t_eph::CNV2) { 528 if ( readDbl(line, pos[0], fieldLen, _TOT) || 529 readDbl(line, pos[1], fieldLen, _wnop) ) { 530 _checkState = bad; 531 return; 407 532 } 408 533 } … … 517 642 QString fmt = version < 3.0 ? " %1%2%3%4\n" : " %1%2%3%4\n"; 518 643 519 out << QString(fmt) 520 .arg(_IODE, 19, 'e', 12) 521 .arg(_Crs, 19, 'e', 12) 522 .arg(_Delta_n, 19, 'e', 12) 523 .arg(_M0, 19, 'e', 12); 524 644 645 // ===================== 646 // BROADCAST ORBIT - 1 647 // ===================== 648 if (navType() == t_eph::CNAV || 649 navType() == t_eph::CNV2) { 650 out << QString(fmt) 651 .arg(_ADOT, 19, 'e', 12) 652 .arg(_Crs, 19, 'e', 12) 653 .arg(_Delta_n, 19, 'e', 12) 654 .arg(_M0, 19, 'e', 12); 655 } 656 else { // LNAV, undefinded 657 out << QString(fmt) 658 .arg(_IODE, 19, 'e', 12) 659 .arg(_Crs, 19, 'e', 12) 660 .arg(_Delta_n, 19, 'e', 12) 661 .arg(_M0, 19, 'e', 12); 662 } 663 // ===================== 664 // BROADCAST ORBIT - 2 665 // ===================== 525 666 out << QString(fmt) 526 667 .arg(_Cuc, 19, 'e', 12) … … 528 669 .arg(_Cus, 19, 'e', 12) 529 670 .arg(_sqrt_A, 19, 'e', 12); 530 531 out << QString(fmt) 532 .arg(_TOEsec, 19, 'e', 12) 533 .arg(_Cic, 19, 'e', 12) 534 .arg(_OMEGA0, 19, 'e', 12) 535 .arg(_Cis, 19, 'e', 12); 536 671 // ===================== 672 // BROADCAST ORBIT - 3 673 // ===================== 674 if (navType() == t_eph::CNAV || 675 navType() == t_eph::CNV2) { 676 out << QString(fmt) 677 .arg(_top, 19, 'e', 12) 678 .arg(_Cic, 19, 'e', 12) 679 .arg(_OMEGA0, 19, 'e', 12) 680 .arg(_Cis, 19, 'e', 12); 681 } 682 else { 683 out << QString(fmt) 684 .arg(_TOEsec, 19, 'e', 12) 685 .arg(_Cic, 19, 'e', 12) 686 .arg(_OMEGA0, 19, 'e', 12) 687 .arg(_Cis, 19, 'e', 12); 688 } 689 // ===================== 690 // BROADCAST ORBIT - 4 691 // ===================== 537 692 out << QString(fmt) 538 693 .arg(_i0, 19, 'e', 12) … … 540 695 .arg(_omega, 19, 'e', 12) 541 696 .arg(_OMEGADOT, 19, 'e', 12); 542 697 // ===================== 698 // BROADCAST ORBIT - 5 699 // ===================== 543 700 if (type() == t_eph::IRNSS) { 544 701 out << QString(fmt) … … 549 706 } 550 707 else { 551 out << QString(fmt) 552 .arg(_IDOT, 19, 'e', 12) 553 .arg(_L2Codes, 19, 'e', 12) 554 .arg(_TOEweek, 19, 'e', 12) 555 .arg(_L2PFlag, 19, 'e', 12); 556 } 557 708 if (navType() == t_eph::CNAV || 709 navType() == t_eph::CNV2) { 710 out << QString(fmt) 711 .arg(_IDOT, 19, 'e', 12) 712 .arg(_DN0DOT, 19, 'e', 12) 713 .arg(_URAI_NED0, 19, 'e', 12) 714 .arg(_URAI_NED1, 19, 'e', 12); 715 716 } 717 else { // LNAV, undefined 718 out << QString(fmt) 719 .arg(_IDOT, 19, 'e', 12) 720 .arg(_L2Codes, 19, 'e', 12) 721 .arg(_TOEweek, 19, 'e', 12) 722 .arg(_L2PFlag, 19, 'e', 12); 723 724 } 725 } 726 // ===================== 727 // BROADCAST ORBIT - 6 728 // ===================== 558 729 if (type() == t_eph::IRNSS) { 559 730 out << QString(fmt) … … 564 735 } 565 736 else { 737 if (navType() == t_eph::CNAV || 738 navType() == t_eph::CNV2) { 739 out << QString(fmt) 740 .arg(_URAI_ED, 19, 'e', 12) 741 .arg(_health, 19, 'e', 12) 742 .arg(_TGD, 19, 'e', 12) 743 .arg(_URAI_NED2,19, 'e', 12); 744 745 } 746 else { // LNAV, undefined 747 out << QString(fmt) 748 .arg(_ura, 19, 'e', 12) 749 .arg(_health, 19, 'e', 12) 750 .arg(_TGD, 19, 'e', 12) 751 .arg(_IODC, 19, 'e', 12); 752 } 753 } 754 // ===================== 755 // BROADCAST ORBIT - 7 756 // ===================== 757 if (navType() == t_eph::LNAV || 758 navType() == t_eph::undefined) { 759 760 double tot = _TOT; 761 if (tot == 0.9999e9 && version < 3.0) { 762 tot = 0.0; 763 } 764 // fitInterval 765 if (type() == t_eph::IRNSS) {// not valid for IRNSS 766 out << QString(fmt) 767 .arg(tot, 19, 'e', 12) 768 .arg(0.0, 19, 'e', 12) 769 .arg("", 19, QChar(' ')) 770 .arg("", 19, QChar(' ')); 771 } 772 else { 773 // for GPS and QZSS in version 3.02 specified in hours 774 double fitIntervalRnx = _fitInterval; 775 // otherwise specified as flag 776 if (type() == t_eph::QZSS && version != 3.02) { 777 (_fitInterval == 2.0) ? fitIntervalRnx = 0.0 : fitIntervalRnx = 1.0; 778 } 779 out << QString(fmt) 780 .arg(tot, 19, 'e', 12) 781 .arg(fitIntervalRnx, 19, 'e', 12) 782 .arg("", 19, QChar(' ')) 783 .arg("", 19, QChar(' ')); 784 } 785 } 786 else if (navType() == t_eph::CNAV || 787 navType() == t_eph::CNV2) { 566 788 out << QString(fmt) 567 .arg(_ura, 19, 'e', 12) 568 .arg(_health, 19, 'e', 12) 569 .arg(_TGD, 19, 'e', 12) 570 .arg(_IODC, 19, 'e', 12); 571 } 572 573 double tot = _TOT; 574 if (tot == 0.9999e9 && version < 3.0) { 575 tot = 0.0; 576 } 577 // fitInterval 578 if (type() == t_eph::IRNSS) {// not valid for IRNSS 789 .arg(_ISC_L1CA, 19, 'e', 12) 790 .arg(_ISC_L2C, 19, 'e', 12) 791 .arg(_ISC_L5I5, 19, 'e', 12) 792 .arg(_ISC_L5Q5, 19, 'e', 12); 793 } 794 // ===================== 795 // BROADCAST ORBIT - 8 796 // ===================== 797 if (navType() == t_eph::CNAV) { 579 798 out << QString(fmt) 580 .arg(tot, 19, 'e', 12) 581 .arg(0.0, 19, 'e', 12) 582 .arg("", 19, QChar(' ')) 583 .arg("", 19, QChar(' ')); 584 } 585 else { 586 // for GPS and QZSS in version 3.02 specified in hours 587 double fitIntervalRnx = _fitInterval; 588 // otherwise specified as flag 589 if (type() == t_eph::QZSS && version != 3.02) { 590 (_fitInterval == 2.0) ? fitIntervalRnx = 0.0 : fitIntervalRnx = 1.0; 591 } 799 .arg(_TOT, 19, 'e', 12) 800 .arg(_wnop, 19, 'e', 12) 801 .arg("", 19, QChar(' ')) 802 .arg("", 19, QChar(' ')); 803 } 804 else if (navType() == t_eph::CNV2) { 592 805 out << QString(fmt) 593 .arg(tot, 19, 'e', 12) 594 .arg(fitIntervalRnx, 19, 'e', 12) 595 .arg("", 19, QChar(' ')) 596 .arg("", 19, QChar(' ')); 597 } 806 .arg(_ISC_L1Cd, 19, 'e', 12) 807 .arg(_ISC_L1Cp, 19, 'e', 12) 808 .arg("", 19, QChar(' ')) 809 .arg("", 19, QChar(' ')); 810 } 811 812 // ===================== 813 // BROADCAST ORBIT - 9 814 // ===================== 815 if (navType() == t_eph::CNV2) { 816 out << QString(fmt) 817 .arg(_TOT, 19, 'e', 12) 818 .arg(_wnop, 19, 'e', 12) 819 .arg("", 19, QChar(' ')) 820 .arg("", 19, QChar(' ')); 821 } 822 598 823 return rnxStr; 599 824 } -
trunk/BNC/src/ephemeris.h
r9785 r9786 104 104 _TOT = 0.0; 105 105 _fitInterval = 0.0; 106 _ADOT = 0.0; 107 _top = 0.0; 108 _DN0DOT = 0.0; 109 _URAI_NED0 = 0.0; 110 _URAI_NED1 = 0.0; 111 _URAI_NED2 = 0.0; 112 _URAI_ED = 0.0; 113 _ISC_L1CA = 0.0; 114 _ISC_L2C = 0.0; 115 _ISC_L5I5 = 0.0; 116 _ISC_L5Q5 = 0.0; 117 _ISC_L1Cd = 0.0; 118 _ISC_L1Cp = 0.0; 106 119 _receptStaID = ""; 107 120 } … … 136 149 137 150 double _Cuc; // [rad] 138 double _e; // 151 double _e; // [] 139 152 double _Cus; // [rad] 140 153 double _sqrt_A; // [m^0.5] 141 154 142 double _TOEsec; // [s ]155 double _TOEsec; // [s of GPS week] 143 156 double _Cic; // [rad] 144 157 double _OMEGA0; // [rad] … … 152 165 double _IDOT; // [rad/s] 153 166 double _L2Codes; // Codes on L2 channel (not valid for IRNSS) 154 double _TOEweek; 167 double _TOEweek; // GPS week # to go with TOE, cont. number, not mode 1024 155 168 double _L2PFlag; // L2 P data flag (not valid for IRNSS and QZSS) 156 169 … … 162 175 double _TOT; // Transmission time 163 176 double _fitInterval; // Fit interval in hours (not valid for IRNSS) 177 178 double _ADOT; // [m/s] 179 double _top; // [s] 180 double _DN0DOT; // [rad/s^2] 181 182 double _URAI_NED0; // [] 183 double _URAI_NED1; // [] 184 double _URAI_NED2; // [] 185 double _URAI_ED; // [] 186 187 double _ISC_L1CA; // [s] 188 double _ISC_L2C; // [s] 189 double _ISC_L5I5; // [s] 190 double _ISC_L5Q5; // [s] 191 double _ISC_L1Cd; // [s] 192 double _ISC_L1Cp; // [s] 193 194 double _wnop; // GPS continuous week number with the ambiguity resolved 164 195 }; 165 196
Note:
See TracChangeset
for help on using the changeset viewer.