Changeset 7574 in ntrip
- Timestamp:
- Nov 23, 2015, 5:46:50 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/BNC_2.11.0/src/bnccore.cpp
r5577 r7574 35 35 * Created: 29-Aug-2006 36 36 * 37 * Changes: 37 * Changes: 38 38 * 39 39 * -----------------------------------------------------------------------*/ … … 43 43 #include <cmath> 44 44 45 #include "bnccore.h" 46 #include "bncutils.h" 47 #include "bncrinex.h" 48 #include "bncsettings.h" 49 #include "bncversion.h" 50 #include "RTCM3/ephemeris.h" 51 #include "rinex/rnxobsfile.h" 52 #include "rinex/rnxnavfile.h" 45 #include "bnccore.h" 46 #include "bncutils.h" 47 #include "bncrinex.h" 48 #include "bncsettings.h" 49 #include "bncversion.h" 50 #include "RTCM3/ephemeris.h" 51 #include "rinex/rnxobsfile.h" 52 #include "rinex/rnxnavfile.h" 53 53 54 54 #ifdef USE_COMBINATION 55 #include "combination/bnccomb.h" 55 #include "combination/bnccomb.h" 56 56 #endif 57 57 58 58 using namespace std; 59 59 60 // Singleton 60 // Singleton 61 61 //////////////////////////////////////////////////////////////////////////// 62 62 t_bncCore& bncCoreInstance() { … … 191 191 if ( !logFileName.isEmpty() ) { 192 192 expandEnvVar(logFileName); 193 _logFile = new QFile(logFileName + "_" + 193 _logFile = new QFile(logFileName + "_" + 194 194 currDate.toString("yyMMdd").toAscii().data()); 195 195 _fileDate = currDate; … … 218 218 } 219 219 220 // New GPS Ephemeris 220 // New GPS Ephemeris 221 221 //////////////////////////////////////////////////////////////////////////// 222 222 void t_bncCore::slotNewGPSEph(gpsephemeris* gpseph) { … … 231 231 gpsephemeris** ee = &_gpsEph[gpseph->satellite-1]; 232 232 233 if ( *ee != 0 && 233 if ( *ee != 0 && 234 234 gpseph->GPSweek == (*ee)->GPSweek && gpseph->TOC == (*ee)->TOC ) { 235 235 checkEphemeris(*ee, gpseph); 236 236 } 237 237 238 if ( *ee == 0 || 238 if ( *ee == 0 || 239 239 gpseph->GPSweek > (*ee)->GPSweek || 240 240 (gpseph->GPSweek == (*ee)->GPSweek && gpseph->TOC > (*ee)->TOC) ) { … … 248 248 } 249 249 } 250 250 251 251 // New Glonass Ephemeris 252 252 //////////////////////////////////////////////////////////////////////////// … … 257 257 // Check wrong Ephemerides 258 258 // ----------------------- 259 if (glonasseph->x_pos == 0.0 && 260 glonasseph->y_pos == 0.0 && 259 if (glonasseph->x_pos == 0.0 && 260 glonasseph->y_pos == 0.0 && 261 261 glonasseph->z_pos == 0.0) { 262 262 delete glonasseph; 263 263 return; 264 } 264 } 265 265 266 266 glonassephemeris copy_glonasseph = *glonasseph; … … 274 274 if (*ee != 0) { 275 275 wwOld = (*ee)->GPSWeek; 276 towOld = (*ee)->GPSTOW; 276 towOld = (*ee)->GPSTOW; 277 277 updatetime(&wwOld, &towOld, (*ee)->tb*1000, 0); // Moscow -> GPS 278 278 279 279 wwNew = glonasseph->GPSWeek; 280 towNew = glonasseph->GPSTOW; 280 towNew = glonasseph->GPSTOW; 281 281 updatetime(&wwNew, &towNew, glonasseph->tb*1000, 0); // Moscow -> GPS 282 282 } 283 283 284 if ( *ee == 0 || 284 if ( *ee == 0 || 285 285 wwNew > wwOld || 286 286 (wwNew == wwOld && towNew > towOld) ) { … … 312 312 if (galIndex < 0 || galIndex > PRN_GALILEO_END - PRN_GALILEO_START) { 313 313 emit( newMessage("Wrong Galileo Satellite Number", true) ); 314 exit(1); 314 delete galileoeph; 315 return; 315 316 } 316 317 317 318 galileoephemeris** ee = &_galileoEph[galIndex]; 318 319 319 if ( *ee == 0 || 320 if ( *ee == 0 || 320 321 galileoeph->Week > (*ee)->Week || 321 322 (galileoeph->Week == (*ee)->Week && galileoeph->TOC > (*ee)->TOC) ) { … … 341 342 342 343 if ( Qt::CheckState(settings.value("ephV3").toInt()) == Qt::Checked) { 343 _rinexVers = 3; 344 _rinexVers = 3; 344 345 } 345 346 else { … … 363 364 QDateTime datTim = currentDateAndTimeGPS(); 364 365 365 QString ephFileNameGPS = _ephPath + "BRDC" + 366 QString ephFileNameGPS = _ephPath + "BRDC" + 366 367 QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0')); 367 368 368 QString hlpStr = bncRinex::nextEpochStr(datTim, 369 QString hlpStr = bncRinex::nextEpochStr(datTim, 369 370 settings.value("ephIntr").toString()); 370 371 … … 444 445 QString line; 445 446 line.sprintf( 446 "%9.2f%11sN: GNSS NAV DATA M: Mixed%12sRINEX VERSION / TYPE\n", 447 "%9.2f%11sN: GNSS NAV DATA M: Mixed%12sRINEX VERSION / TYPE\n", 447 448 3.0, "", ""); 448 449 *_ephStreamGPS << line; 449 450 450 451 QString hlp = currentDateAndTimeGPS().toString("yyyyMMdd hhmmss UTC").leftJustified(20, ' ', true); 451 *_ephStreamGPS << _pgmName.toAscii().data() 452 << _userName.toAscii().data() 453 << hlp.toAscii().data() 452 *_ephStreamGPS << _pgmName.toAscii().data() 453 << _userName.toAscii().data() 454 << hlp.toAscii().data() 454 455 << "PGM / RUN BY / DATE" << endl; 455 456 456 457 line.sprintf("%60sEND OF HEADER\n", ""); 457 458 *_ephStreamGPS << line; 458 459 459 460 _ephStreamGPS->flush(); 460 461 } … … 469 470 t_rnxNavFile::defaultRnxNavVersion2, "", ""); 470 471 *_ephStreamGPS << line; 471 472 472 473 QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true); 473 *_ephStreamGPS << _pgmName.toAscii().data() 474 << _userName.toAscii().data() 475 << hlp.toAscii().data() 474 *_ephStreamGPS << _pgmName.toAscii().data() 475 << _userName.toAscii().data() 476 << hlp.toAscii().data() 476 477 << "PGM / RUN BY / DATE" << endl; 477 478 … … 486 487 t_rnxNavFile::defaultRnxNavVersion2, "", ""); 487 488 *_ephStreamGlonass << line; 488 489 489 490 QString hlp = currentDateAndTimeGPS().date().toString("dd-MMM-yyyy").leftJustified(20, ' ', true); 490 *_ephStreamGlonass << _pgmName.toAscii().data() 491 << _userName.toAscii().data() 492 << hlp.toAscii().data() 491 *_ephStreamGlonass << _pgmName.toAscii().data() 492 << _userName.toAscii().data() 493 << hlp.toAscii().data() 493 494 << "PGM / RUN BY / DATE" << endl; 494 495 … … 627 628 } 628 629 629 // 630 // 630 631 //////////////////////////////////////////////////////////////////////////// 631 632 void t_bncCore::slotQuit() { … … 635 636 } 636 637 637 // 638 // 638 639 //////////////////////////////////////////////////////////////////////////// 639 640 void t_bncCore::slotNewCorrLine(QString line, QString staID, bncTime coTime) { … … 715 716 } 716 717 717 // Dump List of Corrections 718 // Dump List of Corrections 718 719 //////////////////////////////////////////////////////////////////////////// 719 720 void t_bncCore::dumpCorrs(const QList<QString>& allCorrs) { … … 723 724 while (it.hasNext()) { 724 725 QString corrLine = it.next() + "\n"; 725 726 726 727 QMutableListIterator<QTcpSocket*> is(*_socketsCorr); 727 728 while (is.hasNext()) { … … 742 743 } 743 744 744 // 745 // 745 746 //////////////////////////////////////////////////////////////////////////// 746 747 void t_bncCore::setConfFileName(const QString& confFileName) { 747 748 if (confFileName.isEmpty()) { 748 _confFileName = QDir::homePath() + QDir::separator() 749 _confFileName = QDir::homePath() + QDir::separator() 749 750 + ".config" + QDir::separator() 750 751 + qApp->organizationName() + QDir::separator() … … 802 803 } 803 804 804 // 805 // 805 806 //////////////////////////////////////////////////////////////////////////// 806 807 void t_bncCore::initCombination() { … … 814 815 } 815 816 816 // 817 // 817 818 //////////////////////////////////////////////////////////////////////////// 818 819 void t_bncCore::stopCombination() {
Note:
See TracChangeset
for help on using the changeset viewer.