- Timestamp:
- Dec 20, 2014, 10:40:33 AM (10 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/ephemeris.cpp
r6389 r6390 1102 1102 // Constructor 1103 1103 ////////////////////////////////////////////////////////////////////////////// 1104 t_ephSBAS::t_ephSBAS(float /* rnxVersion */, const QStringList& /* lines */) { 1105 qDebug() << "not yet implemented"; 1104 t_ephSBAS::t_ephSBAS(float rnxVersion, const QStringList& lines) { 1105 1106 const int nLines = 4; 1107 1108 _ok = false; 1109 1110 if (lines.size() != nLines) { 1111 return; 1112 } 1113 1114 // RINEX Format 1115 // ------------ 1116 int fieldLen = 19; 1117 1118 int pos[4]; 1119 pos[0] = (rnxVersion <= 2.12) ? 3 : 4; 1120 pos[1] = pos[0] + fieldLen; 1121 pos[2] = pos[1] + fieldLen; 1122 pos[3] = pos[2] + fieldLen; 1123 1124 // Read four lines 1125 // --------------- 1126 for (int iLine = 0; iLine < nLines; iLine++) { 1127 QString line = lines[iLine]; 1128 1129 if ( iLine == 0 ) { 1130 QTextStream in(line.left(pos[1]).toAscii()); 1131 1132 int year, month, day, hour, min; 1133 double sec; 1134 1135 QString prnStr; 1136 in >> prnStr >> year >> month >> day >> hour >> min >> sec; 1137 if (prnStr.at(0) == 'S') { 1138 _prn.set('S', prnStr.mid(1).toInt()); 1139 } 1140 else { 1141 _prn.set('S', prnStr.toInt()); 1142 } 1143 1144 if (year < 80) { 1145 year += 2000; 1146 } 1147 else if (year < 100) { 1148 year += 1900; 1149 } 1150 1151 _TOC.set(year, month, day, hour, min, sec); 1152 1153 if ( readDbl(line, pos[1], fieldLen, _agf0 ) || 1154 readDbl(line, pos[2], fieldLen, _agf1 ) || 1155 readDbl(line, pos[3], fieldLen, _TOW ) ) { 1156 return; 1157 } 1158 } 1159 1160 else if ( iLine == 1 ) { 1161 if ( readDbl(line, pos[0], fieldLen, _x_pos ) || 1162 readDbl(line, pos[1], fieldLen, _x_velocity ) || 1163 readDbl(line, pos[2], fieldLen, _x_acceleration) || 1164 readDbl(line, pos[3], fieldLen, _health ) ) { 1165 return; 1166 } 1167 } 1168 1169 else if ( iLine == 2 ) { 1170 if ( readDbl(line, pos[0], fieldLen, _y_pos ) || 1171 readDbl(line, pos[1], fieldLen, _y_velocity ) || 1172 readDbl(line, pos[2], fieldLen, _y_acceleration ) || 1173 readDbl(line, pos[3], fieldLen, _ura ) ) { 1174 return; 1175 } 1176 } 1177 1178 else if ( iLine == 3 ) { 1179 if ( readDbl(line, pos[0], fieldLen, _z_pos ) || 1180 readDbl(line, pos[1], fieldLen, _z_velocity ) || 1181 readDbl(line, pos[2], fieldLen, _z_acceleration) || 1182 readDbl(line, pos[3], fieldLen, _IODN ) ) { 1183 return; 1184 } 1185 } 1186 } 1187 1188 _x_pos *= 1.e3; 1189 _y_pos *= 1.e3; 1190 _z_pos *= 1.e3; 1191 _x_velocity *= 1.e3; 1192 _y_velocity *= 1.e3; 1193 _z_velocity *= 1.e3; 1194 _x_acceleration *= 1.e3; 1195 _y_acceleration *= 1.e3; 1196 _z_acceleration *= 1.e3; 1197 1198 _ok = true; 1106 1199 } 1107 1200 … … 1132 1225 1133 1226 _ura = ee->URA; 1227 1228 _ok = true; 1229 _health = 0; 1134 1230 } 1135 1231 … … 1163 1259 1164 1260 out << QString("%1%2%3\n") 1165 .arg(_agf0, 1166 .arg(_agf1, 1167 .arg( double(_TOW),19, 'e', 12);1261 .arg(_agf0, 19, 'e', 12) 1262 .arg(_agf1, 19, 'e', 12) 1263 .arg(_TOW, 19, 'e', 12); 1168 1264 1169 1265 QString fmt = version < 3.0 ? " %1%2%3%4\n" : " %1%2%3%4\n"; … … 1173 1269 .arg(1.e-3*_x_velocity, 19, 'e', 12) 1174 1270 .arg(1.e-3*_x_acceleration, 19, 'e', 12) 1175 .arg( 0.0,19, 'e', 12);1271 .arg(_health, 19, 'e', 12); 1176 1272 1177 1273 out << QString(fmt) … … 1179 1275 .arg(1.e-3*_y_velocity, 19, 'e', 12) 1180 1276 .arg(1.e-3*_y_acceleration, 19, 'e', 12) 1181 .arg( double(_ura),19, 'e', 12);1277 .arg(_ura, 19, 'e', 12); 1182 1278 1183 1279 out << QString(fmt) … … 1185 1281 .arg(1.e-3*_z_velocity, 19, 'e', 12) 1186 1282 .arg(1.e-3*_z_acceleration, 19, 'e', 12) 1187 .arg( double(_IODN),19, 'e', 12);1283 .arg(_IODN, 19, 'e', 12); 1188 1284 1189 1285 return rnxStr; -
trunk/BNC/src/ephemeris.h
r6387 r6390 216 216 virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const; 217 217 218 int_IODN;219 int_TOW; // not used (set to 0.9999e9)218 double _IODN; 219 double _TOW; // not used (set to 0.9999e9) 220 220 double _agf0; // [s] clock correction 221 221 double _agf1; // [s/s] clock correction drift … … 233 233 double _z_acceleration; // [m/s^2] 234 234 235 int _ura; 235 double _ura; 236 double _health; 236 237 }; 237 238
Note:
See TracChangeset
for help on using the changeset viewer.