Changeset 3666 in ntrip for trunk/BNC/RTCM3
- Timestamp:
- Feb 11, 2012, 5:26:09 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/ephemeris.cpp
r3665 r3666 800 800 } 801 801 802 unsigned off = (rnxVersion < 2.12) ? 0 : 1; 802 int pos[4]; 803 pos[0] = (rnxVersion <= 2.12) ? 3 : 4; 804 pos[1] = (rnxVersion <= 2.12) ? 22 : 23; 805 pos[2] = (rnxVersion <= 2.12) ? 41 : 42; 806 pos[3] = (rnxVersion <= 2.12) ? 60 : 61; 807 808 int fieldLen = 19; 803 809 804 810 // Read eight lines … … 808 814 809 815 if ( iLine == 0 ) { 810 int year, month, day, hour, min; 811 double sec = 0.0; 812 if (rnxVersion < 3.0) { 813 if ( readInt(line, 3 + off, 2, year ) || 814 readInt(line, 6 + off, 2, month ) || 815 readInt(line, 9 + off, 2, day ) || 816 readInt(line, 12 + off, 2, hour ) || 817 readInt(line, 15 + off, 2, min ) || 818 readDbl(line, 17 + off, 5, sec ) || 819 readDbl(line, 22 + off, 19, _clock_bias ) || 820 readDbl(line, 41 + off, 19, _clock_drift ) || 821 readDbl(line, 60 + off, 19, _clock_driftrate) ) { 822 return; 823 } 824 if (year < 80) { 825 year += 2000; 826 } 827 else { 828 year += 1900; 829 } 830 } 831 else { 832 int iSec; 833 if ( readInt(line, 4, 4, year ) || 834 readInt(line, 9, 2, month ) || 835 readInt(line, 12, 2, day ) || 836 readInt(line, 15, 2, hour ) || 837 readInt(line, 18, 2, min ) || 838 readInt(line, 21, 2, iSec ) || 839 readDbl(line, 23, 19, _clock_bias ) || 840 readDbl(line, 42, 19, _clock_drift ) || 841 readDbl(line, 61, 19, _clock_driftrate) ) { 842 return; 843 } 844 sec = iSec; 845 } 816 QTextStream in(line.left(pos[1]).toAscii()); 817 818 int year, month, day, hour, min; 819 double sec; 820 821 in >> _prn >> year >> month >> day >> hour >> min >> sec; 822 823 if (_prn.at(0) != 'G') { 824 _prn = QString("G%1").arg(_prn.toInt(), 2, QChar('0')); 825 } 826 827 if (year < 80) { 828 year += 2000; 829 } 830 else if (year < 100) { 831 year += 1900; 832 } 833 846 834 bncTime hlpTime; 847 835 hlpTime.set(year, month, day, hour, min, sec); … … 849 837 _GPSweeks = hlpTime.gpssec(); 850 838 _TOC = _GPSweeks; 839 840 if ( readDbl(line, pos[1], fieldLen, _clock_bias ) || 841 readDbl(line, pos[2], fieldLen, _clock_drift ) || 842 readDbl(line, pos[3], fieldLen, _clock_driftrate) ) { 843 return; 844 } 851 845 } 852 846 853 847 else if ( iLine == 1 ) { 854 if ( readDbl(line, off + 3, 19, _IODE ) ||855 readDbl(line, off + 22, 19, _Crs ) ||856 readDbl(line, off + 41, 19, _Delta_n) ||857 readDbl(line, off + 60, 19, _M0 ) ) {848 if ( readDbl(line, pos[0], fieldLen, _IODE ) || 849 readDbl(line, pos[1], fieldLen, _Crs ) || 850 readDbl(line, pos[2], fieldLen, _Delta_n) || 851 readDbl(line, pos[3], fieldLen, _M0 ) ) { 858 852 return; 859 853 } … … 861 855 862 856 else if ( iLine == 2 ) { 863 if ( readDbl(line, off + 3, 19, _Cuc ) ||864 readDbl(line, off + 22, 19, _e ) ||865 readDbl(line, off + 41, 19, _Cus ) ||866 readDbl(line, off + 60, 19, _sqrt_A) ) {857 if ( readDbl(line, pos[0], fieldLen, _Cuc ) || 858 readDbl(line, pos[1], fieldLen, _e ) || 859 readDbl(line, pos[2], fieldLen, _Cus ) || 860 readDbl(line, pos[3], fieldLen, _sqrt_A) ) { 867 861 return; 868 862 } … … 870 864 871 865 else if ( iLine == 3 ) { 872 if ( readDbl(line, off + 3, 19, _TOE ) ||873 readDbl(line, off + 22, 19, _Cic ) ||874 readDbl(line, off + 41, 19, _OMEGA0) ||875 readDbl(line, off + 60, 19, _Cis ) ) {866 if ( readDbl(line, pos[0], fieldLen, _TOE ) || 867 readDbl(line, pos[1], fieldLen, _Cic ) || 868 readDbl(line, pos[2], fieldLen, _OMEGA0) || 869 readDbl(line, pos[3], fieldLen, _Cis ) ) { 876 870 return; 877 871 } … … 879 873 880 874 else if ( iLine == 4 ) { 881 if ( readDbl(line, off + 3, 19, _i0 ) ||882 readDbl(line, off + 22, 19, _Crc ) ||883 readDbl(line, off + 41, 19, _omega ) ||884 readDbl(line, off + 60, 19, _OMEGADOT) ) {875 if ( readDbl(line, pos[0], fieldLen, _i0 ) || 876 readDbl(line, pos[1], fieldLen, _Crc ) || 877 readDbl(line, pos[2], fieldLen, _omega ) || 878 readDbl(line, pos[3], fieldLen, _OMEGADOT) ) { 885 879 return; 886 880 } … … 889 883 else if ( iLine == 5 ) { 890 884 double dummy, TOEw; 891 if ( readDbl(line, off + 3, 19, _IDOT) ||892 readDbl(line, off + 22, 19, dummy) ||893 readDbl(line, off + 41, 19, TOEw ) ||894 readDbl(line, off + 60, 19, dummy) ) {885 if ( readDbl(line, pos[0], fieldLen, _IDOT) || 886 readDbl(line, pos[1], fieldLen, dummy) || 887 readDbl(line, pos[2], fieldLen, TOEw ) || 888 readDbl(line, pos[3], fieldLen, dummy) ) { 895 889 return; 896 890 } … … 899 893 else if ( iLine == 6 ) { 900 894 double dummy; 901 if ( readDbl(line, off + 3, 19, dummy ) ||902 readDbl(line, off + 22, 19, _health) ||903 readDbl(line, off + 41, 19, _TGD ) ||904 readDbl(line, off + 60, 19, _IODC ) ) {895 if ( readDbl(line, pos[0], fieldLen, dummy ) || 896 readDbl(line, pos[1], fieldLen, _health) || 897 readDbl(line, pos[2], fieldLen, _TGD ) || 898 readDbl(line, pos[3], fieldLen, _IODC ) ) { 905 899 return; 906 900 } … … 909 903 else if ( iLine == 7 ) { 910 904 double TOT; 911 if ( readDbl(line, off + 3, 19, TOT) ) {905 if ( readDbl(line, pos[0], fieldLen, TOT) ) { 912 906 return; 913 907 }
Note:
See TracChangeset
for help on using the changeset viewer.