Changeset 3699 in ntrip
- Timestamp:
- Feb 16, 2012, 1:29:28 PM (13 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/ephemeris.cpp
r3668 r3699 794 794 t_ephGPS::t_ephGPS(float rnxVersion, const QStringList& lines) { 795 795 796 const int nLines = 8; 797 796 798 _ok = false; 797 799 798 if (lines.size() != 8) {800 if (lines.size() != nLines) { 799 801 return; 800 802 } … … 812 814 // Read eight lines 813 815 // ---------------- 814 for ( unsigned iLine = 0; iLine < 8; iLine++) {816 for (int iLine = 0; iLine < nLines; iLine++) { 815 817 QString line = lines[iLine]; 816 818 … … 918 920 t_ephGlo::t_ephGlo(float rnxVersion, const QStringList& lines) { 919 921 922 const int nLines = 4; 923 920 924 _ok = false; 925 926 if (lines.size() != nLines) { 927 return; 928 } 929 930 // RINEX Format 931 // ------------ 932 int fieldLen = 19; 933 934 int pos[4]; 935 pos[0] = (rnxVersion <= 2.12) ? 3 : 4; 936 pos[1] = pos[0] + fieldLen; 937 pos[2] = pos[1] + fieldLen; 938 pos[3] = pos[2] + fieldLen; 939 940 // Read four lines 941 // --------------- 942 for (int iLine = 0; iLine < nLines; iLine++) { 943 QString line = lines[iLine]; 944 945 if ( iLine == 0 ) { 946 QTextStream in(line.left(pos[1]).toAscii()); 947 948 int year, month, day, hour, min; 949 double sec; 950 951 in >> _prn >> year >> month >> day >> hour >> min >> sec; 952 953 if (_prn.at(0) != 'R') { 954 _prn = QString("R%1").arg(_prn.toInt(), 2, 10, QLatin1Char('0')); 955 } 956 957 if (year < 80) { 958 year += 2000; 959 } 960 else if (year < 100) { 961 year += 1900; 962 } 963 964 bncTime hlpTime; 965 hlpTime.set(year, month, day, hour, min, sec); 966 _GPSweek = hlpTime.gpsw(); 967 _GPSweeks = hlpTime.gpssec(); 968 969 _gps_utc = gnumleap(year, month, day); 970 // double _tki; // message frame time 971 972 double second_tot; 973 if ( readDbl(line, pos[1], fieldLen, _tau ) || 974 readDbl(line, pos[2], fieldLen, _gamma ) || 975 readDbl(line, pos[3], fieldLen, second_tot) ) { 976 return; 977 } 978 } 979 980 else if ( iLine == 1 ) { 981 if ( readDbl(line, pos[0], fieldLen, _x_pos ) || 982 readDbl(line, pos[1], fieldLen, _x_velocity ) || 983 readDbl(line, pos[2], fieldLen, _x_acceleration) || 984 readDbl(line, pos[3], fieldLen, _health ) ) { 985 return; 986 } 987 } 988 989 else if ( iLine == 2 ) { 990 if ( readDbl(line, pos[0], fieldLen, _y_pos ) || 991 readDbl(line, pos[1], fieldLen, _y_velocity ) || 992 readDbl(line, pos[2], fieldLen, _y_acceleration ) || 993 readDbl(line, pos[3], fieldLen, _frequency_number) ) { 994 return; 995 } 996 } 997 998 else if ( iLine == 3 ) { 999 if ( readDbl(line, pos[0], fieldLen, _z_pos ) || 1000 readDbl(line, pos[1], fieldLen, _z_velocity ) || 1001 readDbl(line, pos[2], fieldLen, _z_acceleration) || 1002 readDbl(line, pos[3], fieldLen, _E ) ) { 1003 return; 1004 } 1005 } 1006 } 1007 1008 // Initialize status vector 1009 // ------------------------ 1010 _tt = _GPSweeks; 1011 1012 _xv.ReSize(6); 1013 1014 _xv(1) = _x_pos * 1.e3; 1015 _xv(2) = _y_pos * 1.e3; 1016 _xv(3) = _z_pos * 1.e3; 1017 _xv(4) = _x_velocity * 1.e3; 1018 _xv(5) = _y_velocity * 1.e3; 1019 _xv(6) = _z_velocity * 1.e3; 1020 1021 _ok = true; 921 1022 } 922 1023 923 1024 // Constructor 924 1025 ////////////////////////////////////////////////////////////////////////////// 925 t_ephGal::t_ephGal(float rnxVersion, const QStringList& lines) {1026 t_ephGal::t_ephGal(float /* rnxVersion */, const QStringList& /* lines */) { 926 1027 927 1028 _ok = false; -
trunk/BNC/rnxnavfile.cpp
r3683 r3699 146 146 } 147 147 if (eph && eph->ok()) { 148 cout << "prn: " << eph->prn().toAscii().data() << endl; 148 149 return eph; 149 150 }
Note:
See TracChangeset
for help on using the changeset viewer.