Changeset 2256 in ntrip for trunk/BNS/RTCM
- Timestamp:
- Jan 16, 2010, 11:22:15 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/RTCM/rtcm3torinex.c
r2236 r2256 1 1 /* 2 2 Converter for RTCM3 data to RINEX. 3 $Id: rtcm3torinex.c,v 1. 28 2010/01/12 12:13:23mervart Exp $3 $Id: rtcm3torinex.c,v 1.30 2010/01/16 10:21:09 mervart Exp $ 4 4 Copyright (C) 2005-2008 by Dirk Stöcker <stoecker@alberding.eu> 5 5 … … 55 55 56 56 /* CVS revision and version */ 57 static char revisionstr[] = "$Revision: 1. 28$";57 static char revisionstr[] = "$Revision: 1.30 $"; 58 58 59 59 #ifndef COMPILEDATE … … 251 251 } 252 252 253 void updatetime(int *week, int *tow, int tk, int fixnumleap) 253 // Convert Moscow time into UTC (fixnumleap == 1) or GPS (fixnumleap == 0) 254 void updatetime(int *week, int *secOfWeek, int mSecOfWeek, int fixnumleap) 254 255 { 255 256 int y,m,d,k,l, nul; 256 unsigned int j = *week*(7*24*60*60) + * tow+ 5*24*60*60+3*60*60;257 unsigned int j = *week*(7*24*60*60) + *secOfWeek + 5*24*60*60+3*60*60; 257 258 int glo_daynumber = 0, glo_timeofday; 258 259 for(y = 1980; j >= (unsigned int)(k = (l = (365+longyear(y,0)))*24*60*60) … … 272 273 glo_timeofday = j-nul; 273 274 274 if( tk < 5*60*1000 && glo_timeofday > 23*60*60)275 * tow+= 24*60*60;276 else if(glo_timeofday < 5*60 && tk > 23*60*60*1000)277 * tow-= 24*60*60;278 * tow += tk/1000-glo_timeofday;275 if(mSecOfWeek < 5*60*1000 && glo_timeofday > 23*60*60) 276 *secOfWeek += 24*60*60; 277 else if(glo_timeofday < 5*60 && mSecOfWeek > 23*60*60*1000) 278 *secOfWeek -= 24*60*60; 279 *secOfWeek += mSecOfWeek/1000-glo_timeofday; 279 280 if(fixnumleap) 280 * tow-= nul;281 if(* tow < 0) {*tow+= 24*60*60*7; --*week; }282 if(* tow >= 24*60*60*7) {*tow-= 24*60*60*7; ++*week; }281 *secOfWeek -= nul; 282 if(*secOfWeek < 0) {*secOfWeek += 24*60*60*7; --*week; } 283 if(*secOfWeek >= 24*60*60*7) {*secOfWeek -= 24*60*60*7; ++*week; } 283 284 } 284 285 … … 639 640 GETBITS(i,27) /* tk */ 640 641 641 updatetime(&handle->GPSWeek, &handle->GPSTOW, i, 0);642 642 i = handle->GPSTOW*1000; 643 updatetime(&handle->GPSWeek, &handle->GPSTOW, i, 0); // Moscow -> GPS 643 644 if(gnss->week && (gnss->timeofweek != i || gnss->week 644 645 != handle->GPSWeek)) … … 1396 1397 struct converttimeinfo cti; 1397 1398 1398 updatetime(&w, &tow, e->tb*1000, 1); 1399 updatetime(&w, &tow, e->tb*1000, 1); // Moscow - > UTC 1399 1400 converttime(&cti, w, tow); 1400 1401 … … 1683 1684 1684 1685 #ifndef NO_RTCM3_MAIN 1685 static char datestr[] = "$Date: 2010/01/1 2 12:13:23$";1686 static char datestr[] = "$Date: 2010/01/16 10:21:09 $"; 1686 1687 1687 1688 /* The string, which is send as agent in HTTP request */
Note:
See TracChangeset
for help on using the changeset viewer.