Changeset 1835 in ntrip
- Timestamp:
- May 7, 2009, 11:45:00 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/RTCM3coDecoder.cpp
r1834 r1835 152 152 if (irc == GCOBR_OK) { 153 153 reopen(); 154 155 // Guess GPS week and sec using system time 156 // ---------------------------------------- 154 157 int GPSweek; 155 currentGPSWeeks(GPSweek, _GPSweeks); 158 double GPSweeksHlp; 159 currentGPSWeeks(GPSweek, GPSweeksHlp); 160 161 // Correction Epoch from GPSEpochTime 162 // ---------------------------------- 156 163 if (_co.NumberOfGPSSat > 0) { 157 if ( _GPSweeks> _co.GPSEpochTime + 86400.0) {164 if (GPSweeksHlp > _co.GPSEpochTime + 86400.0) { 158 165 GPSweek += 1; 159 166 } 160 else if ( _GPSweeks< _co.GPSEpochTime - 86400.0) {167 else if (GPSweeksHlp < _co.GPSEpochTime - 86400.0) { 161 168 GPSweek -= 1; 162 169 } 163 170 _GPSweeks = _co.GPSEpochTime; 164 171 } 172 173 // Correction Epoch from Glonass Epoch 174 // ----------------------------------- 165 175 else { 166 167 // Guess GPS week and sec using system time168 // ----------------------------------------169 int week;170 double sec;171 currentGPSWeeks(week, sec);172 int weekDay = int(sec/86400.0);173 int GPSDaySecHlp = int(sec) - weekDay * 86400;174 175 // cout << "week, sec " << week << " " << sec << endl;176 176 177 177 // Second of day (GPS time) from Glonass Epoch 178 178 // ------------------------------------------- 179 QDate date = dateAndTimeFromGPSweek( week, sec).date();179 QDate date = dateAndTimeFromGPSweek(GPSweek, GPSweeksHlp).date(); 180 180 int leapSecond = gnumleap(date.year(), date.month(), date.day()); 181 181 int GPSDaySec = _co.GLONASSEpochTime + 3 * 3600 + leapSecond; 182 182 183 // cout << "GlonassEpoch, leapSecond, GPSDaySec " 184 // << _co.GLONASSEpochTime << " " << leapSecond << " " 185 // << GPSDaySec << endl; 183 int weekDay = int(GPSweeksHlp/86400.0); 184 int GPSDaySecHlp = int(GPSweeksHlp) - weekDay * 86400; 186 185 187 186 // Handle the difference between system clock and correction epoch … … 189 188 if (GPSDaySec < GPSDaySecHlp - 3600) { 190 189 weekDay += 1; 190 if (weekDay > 6) { 191 weekDay = 0; 192 GPSweek += 1; 193 } 191 194 } 192 195 else if (GPSDaySec > GPSDaySecHlp + 3600) { 193 196 weekDay -= 1; 197 if (weekDay < 0) { 198 weekDay = 6; 199 GPSweek -= 1; 200 } 194 201 } 195 202 196 203 _GPSweeks = weekDay * 86400.0 + GPSDaySec; 197 198 // cout << "weekDay, _GPSweeks " << weekDay << " "199 // << _GPSweeks << endl;200 204 } 201 205
Note:
See TracChangeset
for help on using the changeset viewer.