- Timestamp:
- Oct 20, 2007, 2:45:50 PM (17 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncapp.cpp
r533 r534 87 87 // Eph file(s) 88 88 // ----------- 89 _rinex 3 = -1;89 _rinexVers = 0; 90 90 _ephFileGPS = 0; 91 91 _ephStreamGPS = 0; … … 101 101 delete _ephStreamGPS; 102 102 delete _ephFileGPS; 103 if (_rinex 3 == 0) {103 if (_rinexVers == 2) { 104 104 delete _ephStreamGlonass; 105 105 delete _ephFileGlonass; … … 153 153 QMutexLocker locker(&_mutex); 154 154 155 printEphHeader(); 156 155 157 if (!_ephStreamGPS) { 156 158 delete gpseph; … … 175 177 QMutexLocker locker(&_mutex); 176 178 179 printEphHeader(); 180 177 181 if (!_ephStreamGlonass) { 178 182 delete glonasseph; … … 197 201 void bncApp::printEphHeader() { 198 202 199 if (_rinex3 == -1) { 203 // Initialization 204 // -------------- 205 if (_rinexVers == 0) { 200 206 QSettings settings; 201 207 202 208 if ( Qt::CheckState(settings.value("ephV3").toInt()) == Qt::Checked) { 203 _rinex 3 = 1;209 _rinexVers = 3; 204 210 } 205 211 else { 206 _rinex 3 = 0;212 _rinexVers = 2; 207 213 } 208 214 … … 217 223 } 218 224 225 // (Re-)Open output File(s) 226 // ------------------------ 219 227 if (!_ephPath.isEmpty()) { 220 228 … … 224 232 QString("%1").arg(date.dayOfYear(), 3, 10, QChar('0')) + 225 233 date.toString("0.yyN"); 226 227 cout << ephFileNameGPS.toAscii().data() << endl;228 234 229 235 if (_ephFileNameGPS == ephFileNameGPS) { … … 242 248 _ephStreamGPS->setDevice(_ephFileGPS); 243 249 244 if (_rinex 3 == 1) {250 if (_rinexVers == 3) { 245 251 _ephFileGlonass = _ephFileGPS; 246 252 _ephStreamGlonass = _ephStreamGPS; 247 253 } 248 else if (_rinex 3 == 0) {254 else if (_rinexVers == 2) { 249 255 QString ephFileNameGlonass = _ephPath + "GLO_" + 250 256 QString("%1").arg(date.dayOfYear(), 3, 10, QChar('0')) + 251 257 date.toString("0.yyN"); 252 253 cout << ephFileNameGlonass.toAscii().data() << endl;254 258 255 259 delete _ephStreamGlonass; … … 260 264 _ephStreamGlonass = new QTextStream(); 261 265 _ephStreamGlonass->setDevice(_ephFileGlonass); 262 263 } 264 265 266 if (_rinex 3 == 1) {266 } 267 268 // Header - RINEX Version 3 269 // ------------------------ 270 if (_rinexVers == 3) { 267 271 QString line; 268 272 … … 273 277 274 278 char buffer[100]; 275 HandleRunBy(buffer, sizeof(buffer), 0, _rinex3);279 HandleRunBy(buffer, sizeof(buffer), 0, 1); 276 280 line.sprintf("%s\n%60sEND OF HEADER\n", buffer, ""); 277 281 *_ephStreamGPS << line; … … 279 283 _ephStreamGPS->flush(); 280 284 } 281 else if (_rinex3 == 0) { 282 283 } 284 } 285 } 286 285 286 // Header - RINEX Version 2 287 // ------------------------ 288 else if (_rinexVers == 2) { 289 290 } 291 } 292 } 287 293 288 294 // 289 295 //////////////////////////////////////////////////////////////////////////// 290 296 void bncApp::printGPSEph(gpsephemeris* ep) { 291 292 printEphHeader();293 297 294 298 if (_ephStreamGPS) { … … 299 303 converttime(&cti, ep->GPSweek, ep->TOC); 300 304 301 if (_rinex 3 == 1) {305 if (_rinexVers == 3) { 302 306 line.sprintf("G%02d %04d %02d %02d %02d %02d %02d%19.12e%19.12e%19.12e", 303 307 ep->satellite, cti.year, cti.month, cti.day, cti.hour, … … 305 309 ep->clock_driftrate); 306 310 } 307 else if (_rinex 3 == 0) {311 else if (_rinexVers == 2) { 308 312 line.sprintf("%02d %02d %02d %02d %02d %02d%05.1f%19.12e%19.12e%19.12e", 309 313 ep->satellite, cti.year%100, cti.month, cti.day, cti.hour, … … 358 362 void bncApp::printGlonassEph(glonassephemeris* ep) { 359 363 360 printEphHeader();361 362 364 if (_ephStreamGlonass) { 363 365 int ww = ep->GPSWeek; … … 375 377 QString line; 376 378 377 if (_rinex 3 == 1) {379 if (_rinexVers == 3) { 378 380 line.sprintf("R%02d %04d %02d %02d %02d %02d %02d%19.12e%19.12e%19.12e", 379 381 ep->almanac_number, cti.year, cti.month, cti.day, cti.hour, 380 382 cti.minute, cti.second, -ep->tau, ep->gamma, (double) ii); 381 383 } 382 else if (_rinex 3 == 0) {384 else if (_rinexVers == 2) { 383 385 line.sprintf("%02d %02d %02d %02d %02d %02d%5.1f%19.12e%19.12e%19.12e", 384 386 ep->almanac_number, cti.year%100, cti.month, cti.day, -
trunk/BNC/bncapp.h
r533 r534 55 55 QString _ephPath; 56 56 QString _ephFileNameGPS; 57 int _rinex 3;57 int _rinexVers; 58 58 QFile* _ephFileGPS; 59 59 QTextStream* _ephStreamGPS;
Note:
See TracChangeset
for help on using the changeset viewer.