- Timestamp:
- Oct 18, 2007, 12:52:57 PM (17 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncapp.cpp
r512 r516 58 58 59 59 _bncVersion = "BNC 1.4"; 60 // Lists of Ephemeris 61 // ------------------ 62 _ephFile = 0; 63 _ephStream = 0; 64 for (int ii = PRN_GPS_START; ii <= PRN_GPS_END; ii++) { 65 _gpsEph[ii-PRN_GPS_START] = 0; 66 } 67 for (int ii = PRN_GLONASS_START; ii <= PRN_GLONASS_END; ii++) { 68 _glonassEph[ii-PRN_GLONASS_START] = 0; 69 } 70 71 // Eph file 72 // -------- 73 _ephFile = 0; 74 _ephStream = 0; 75 QString ephFileName = "TEST.EPH"; 76 //// QString ephFileName = settings.value("ephFile").toString(); 77 if ( !ephFileName.isEmpty() ) { 78 expandEnvVar(ephFileName); 79 _ephFile = new QFile(ephFileName); 80 _ephFile->open(QIODevice::WriteOnly); 81 _ephStream = new QTextStream(); 82 _ephStream->setDevice(_ephFile); 83 printEphHeader(); 84 } 60 85 } 61 86 … … 65 90 delete _logStream; 66 91 delete _logFile; 92 delete _ephStream; 93 delete _ephFile; 94 for (int ii = PRN_GPS_START; ii <= PRN_GPS_END; ii++) { 95 delete _gpsEph[ii-PRN_GPS_START]; 96 } 97 for (int ii = PRN_GLONASS_START; ii <= PRN_GLONASS_END; ii++) { 98 delete _glonassEph[ii-PRN_GLONASS_START]; 99 } 67 100 } 68 101 … … 104 137 //////////////////////////////////////////////////////////////////////////// 105 138 void bncApp::slotNewGPSEph(gpsephemeris* gpseph) { 106 cout << "GPS: " << gpseph->satellite << endl; 107 delete gpseph; 139 140 QMutexLocker locker(&_mutex); 141 142 gpsephemeris** ee = &_gpsEph[gpseph->satellite-PRN_GPS_START]; 143 if ( *ee == 0 || (*ee)->IODE != gpseph->IODE ) { 144 cout << "new GPS: " << gpseph->satellite << endl; 145 delete *ee; 146 *ee = gpseph; 147 printGPSEph(gpseph); 148 } 149 else { 150 cout << "GPS: " << gpseph->satellite << endl; 151 delete gpseph; 152 } 108 153 } 109 154 … … 111 156 //////////////////////////////////////////////////////////////////////////// 112 157 void bncApp::slotNewGlonassEph(glonassephemeris* glonasseph) { 158 159 QMutexLocker locker(&_mutex); 160 113 161 cout << "GLONASS: " << glonasseph->almanac_number << endl; 114 162 delete glonasseph; 115 163 } 116 164 165 // 166 //////////////////////////////////////////////////////////////////////////// 167 void bncApp::printEphHeader() { 168 169 } 170 171 // 172 //////////////////////////////////////////////////////////////////////////// 173 void bncApp::printGPSEph(gpsephemeris* ep) { 174 175 } 176 177 // 178 //////////////////////////////////////////////////////////////////////////// 179 void bncApp::printGlonassEph(glonassephemeris* ep) { 180 181 } -
trunk/BNC/bncapp.h
r511 r516 44 44 void slotNewGlonassEph(glonassephemeris* glonasseph); 45 45 private: 46 QFile* _logFile; 47 QTextStream* _logStream; 48 int _logFileFlag; 49 QString _bncVersion; 50 QMutex _mutex; 46 void printEphHeader(); 47 void printGPSEph(gpsephemeris* ep); 48 void printGlonassEph(glonassephemeris* ep); 49 50 QFile* _logFile; 51 QTextStream* _logStream; 52 int _logFileFlag; 53 QString _bncVersion; 54 QMutex _mutex; 55 QFile* _ephFile; 56 QTextStream* _ephStream; 57 gpsephemeris* _gpsEph[PRN_GPS_END - PRN_GPS_START + 1]; 58 glonassephemeris* _glonassEph[PRN_GLONASS_END - PRN_GLONASS_START + 1]; 51 59 }; 52 60 #endif
Note:
See TracChangeset
for help on using the changeset viewer.