Changeset 9370 in ntrip for branches/BNC_2.12/src/ephemeris.cpp
- Timestamp:
- Mar 11, 2021, 2:50:05 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/BNC_2.12/src/ephemeris.cpp
r9291 r9370 153 153 // Constructor 154 154 ////////////////////////////////////////////////////////////////////////////// 155 t_ephGPS::t_ephGPS( floatrnxVersion, const QStringList& lines) {155 t_ephGPS::t_ephGPS(double rnxVersion, const QStringList& lines) { 156 156 157 157 const int nLines = 8; … … 511 511 // Constructor 512 512 ////////////////////////////////////////////////////////////////////////////// 513 t_ephGlo::t_ephGlo(float rnxVersion, const QStringList& lines) { 514 515 const int nLines = 4; 513 t_ephGlo::t_ephGlo(double rnxVersion, const QStringList& lines) { 514 515 int nLines = 4; 516 if (rnxVersion >= 3.05) { 517 nLines += 1; 518 _flags_unknown = false; 519 } 520 else { 521 _M_delta_tau = 0.9999e9; // unknown 522 _M_FT = 1.5e1; // unknown 523 _flags_unknown = true; 524 } 516 525 517 526 if (lines.size() != nLines) { … … 523 532 // ------------ 524 533 int fieldLen = 19; 534 double statusflags = 0.0; 535 double healthflags = 0.0; 525 536 526 537 int pos[4]; … … 604 615 _checkState = bad; 605 616 return; 617 } 618 } 619 620 else if ( iLine == 4 ) { 621 if ( readDbl(line, pos[0], fieldLen, statusflags ) || 622 readDbl(line, pos[1], fieldLen, _M_delta_tau ) || 623 readDbl(line, pos[2], fieldLen, _M_FT ) || 624 readDbl(line, pos[3], fieldLen, healthflags ) ) { 625 _checkState = bad; 626 return; 627 } 628 else { 629 // status flags 630 // ============ 631 // bit 0-1 632 _M_P = double(bitExtracted(statusflags, 2, 0)); 633 // bit 2-3 634 _P1 = double(bitExtracted(statusflags, 2, 2)); 635 // bit 4 636 _P2 = double(bitExtracted(statusflags, 1, 4)); 637 // bit 5 638 _P3 = double(bitExtracted(statusflags, 1, 5)); 639 // bit 6 640 _M_P4 = double(bitExtracted(statusflags, 1, 6)); 641 // bit 7-8 642 _M_M = double(bitExtracted(statusflags, 2, 7)); 643 /// GLO M/K exclusive flags/values only valid if flag M is set to '01' 644 if (!_M_M) { 645 _M_P4 = 0.0; 646 _M_P = 0.0; 647 } 648 // health flags 649 // ============ 650 // bit 0 (is to be ignored, if bit 1 is zero) 651 _almanac_health = double(bitExtracted(healthflags, 1, 0)); 652 // bit 1 653 _almanac_health_availablility_indicator = double(bitExtracted(healthflags, 1, 1)); 654 // bit 2 655 _M_l3 = double(bitExtracted(healthflags, 1, 2)); 606 656 } 607 657 } … … 702 752 .arg(_E, 19, 'e', 12); 703 753 754 if (version >= 3.05) { 755 // unknown (RINEX version < 3.05) 756 if (_flags_unknown) { 757 out << QString(fmt) 758 .arg("", 19, QChar(' ')) // statusflags blank if unknown 759 .arg(_M_delta_tau, 19, 'e', 12) 760 .arg(_M_FT, 19, 'e', 12) 761 .arg("", 19, QChar(' ')); // healthflags blank if unknown 762 } 763 else { 764 int statusflags = 0; 765 // bit 7-8 766 if (_M_M == 2.0) { 767 statusflags |= (1<<7); 768 } 769 // bit 6 770 if (_M_P4) { 771 statusflags |= (1<<6); 772 } 773 // bit 5 774 if (_P3) { 775 statusflags |= (1<<5); 776 } 777 // bit 4 778 if (_P2) { 779 statusflags |= (1<<4); 780 } 781 // bit 2-3 782 if (_P1 == 2.0) { 783 statusflags |= (1<<2); 784 } 785 else if (_P1 == 1.0) { 786 statusflags |= (1<<3); 787 } 788 else if (_P1 == 3.0) { 789 statusflags |= (1<<2); 790 statusflags |= (1<<3); 791 } 792 // bit 0-1 793 if (_M_P == 2.0) { 794 statusflags |= (1<<0); 795 } 796 else if (_M_P == 1.0) { 797 statusflags |= (1<<1); 798 } 799 else if (_M_P == 3.0) { 800 statusflags |= (1<<0); 801 statusflags |= (1<<1); 802 } 803 // health flags 804 // ============ 805 int healthflags = 0; 806 // bit 0 (is to be ignored, if bit 1 is zero) 807 if (_almanac_health) { 808 healthflags |= (1<<0); 809 } 810 // bit 1 811 if (_almanac_health_availablility_indicator) { 812 healthflags |= (1<<1); 813 } 814 // bit 2 815 if (_M_l3) { 816 healthflags |= (1<<2); 817 } 818 out << QString(fmt) 819 .arg(double(statusflags), 19, 'e', 12) 820 .arg(_M_delta_tau, 19, 'e', 12) 821 .arg(_M_FT, 19, 'e', 12) 822 .arg(double(healthflags), 19, 'e', 12); 823 } 824 } 825 704 826 return rnxStr; 705 827 } … … 770 892 // Constructor 771 893 ////////////////////////////////////////////////////////////////////////////// 772 t_ephGal::t_ephGal( floatrnxVersion, const QStringList& lines) {894 t_ephGal::t_ephGal(double rnxVersion, const QStringList& lines) { 773 895 int year, month, day, hour, min; 774 896 double sec; … … 890 1012 } else { 891 1013 // Bit 0 892 _e1DataInValid = (int(SVhealth) & (1<<0));1014 _e1DataInValid = (int(SVhealth) & (1<<0)); 893 1015 // Bit 1-2 894 _E1_bHS = double((int(SVhealth) >> 1) & 0x3);1016 _E1_bHS = double((int(SVhealth) >> 1) & 0x3); 895 1017 // Bit 3 896 1018 _e5aDataInValid = (int(SVhealth) & (1<<3)); 897 1019 // Bit 4-5 898 _E5aHS = double((int(SVhealth) >> 4) & 0x3);1020 _E5aHS = double((int(SVhealth) >> 4) & 0x3); 899 1021 // Bit 6 900 1022 _e5bDataInValid = (int(SVhealth) & (1<<6)); 901 1023 // Bit 7-8 902 _E5bHS = double((int(SVhealth) >> 7) & 0x3);1024 _E5bHS = double((int(SVhealth) >> 7) & 0x3); 903 1025 904 1026 if (prnStr.at(0) == 'E') { … … 1161 1283 // Constructor 1162 1284 ////////////////////////////////////////////////////////////////////////////// 1163 t_ephSBAS::t_ephSBAS( floatrnxVersion, const QStringList& lines) {1285 t_ephSBAS::t_ephSBAS(double rnxVersion, const QStringList& lines) { 1164 1286 1165 1287 const int nLines = 4; … … 1354 1476 // Constructor 1355 1477 ////////////////////////////////////////////////////////////////////////////// 1356 t_ephBDS::t_ephBDS( floatrnxVersion, const QStringList& lines) {1478 t_ephBDS::t_ephBDS(double rnxVersion, const QStringList& lines) { 1357 1479 1358 1480 const int nLines = 8;
Note:
See TracChangeset
for help on using the changeset viewer.