- Timestamp:
- Mar 1, 2010, 2:48:25 PM (15 years ago)
- Location:
- trunk/rtcm3torinex
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/rtcm3torinex/rtcm3torinex.c
r1824 r2346 1 1 /* 2 2 Converter for RTCM3 data to RINEX. 3 $Id: rtcm3torinex.c,v 1.3 6 2008/12/03 08:33:16 stoecker Exp $3 $Id: rtcm3torinex.c,v 1.31 2010/01/16 11:07:57 weber Exp $ 4 4 Copyright (C) 2005-2008 by Dirk Stöcker <stoecker@alberding.eu> 5 5 … … 48 48 #endif 49 49 50 #ifndef isinf 51 #define isinf(x) 0 52 #endif 53 50 54 #include "rtcm3torinex.h" 51 55 52 56 /* CVS revision and version */ 53 static char revisionstr[] = "$Revision: 1.3 6$";57 static char revisionstr[] = "$Revision: 1.31 $"; 54 58 55 59 #ifndef COMPILEDATE … … 234 238 } 235 239 236 staticint gnumleap(int year, int month, int day)240 int gnumleap(int year, int month, int day) 237 241 { 238 242 int ls = 0; … … 247 251 } 248 252 249 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) 250 255 { 251 256 int y,m,d,k,l, nul; 252 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; 253 258 int glo_daynumber = 0, glo_timeofday; 254 259 for(y = 1980; j >= (unsigned int)(k = (l = (365+longyear(y,0)))*24*60*60) … … 268 273 glo_timeofday = j-nul; 269 274 270 if( tk < 5*60*1000 && glo_timeofday > 23*60*60)271 * tow+= 24*60*60;272 else if(glo_timeofday < 5*60 && tk > 23*60*60*1000)273 * tow-= 24*60*60;274 * 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; 275 280 if(fixnumleap) 276 * tow-= nul;277 if(* tow < 0) {*tow+= 24*60*60*7; --*week; }278 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; } 279 284 } 280 285 … … 635 640 GETBITS(i,27) /* tk */ 636 641 637 updatetime(&handle->GPSWeek, &handle->GPSTOW, i, 0); 642 updatetime(&handle->GPSWeek, &handle->GPSTOW, i, 0); /* Moscow -> GPS */ 638 643 i = handle->GPSTOW*1000; 639 644 if(gnss->week && (gnss->timeofweek != i || gnss->week … … 671 676 GETBITS(code, 1) 672 677 GETBITS(freq, 5) 678 679 gnss->channels[num] = freq - 7; 680 673 681 if(code) 674 682 { … … 828 836 } data; 829 837 int numheaders; 830 };831 832 struct converttimeinfo {833 int second; /* seconds of GPS time [0..59] */834 int minute; /* minutes of GPS time [0..59] */835 int hour; /* hour of GPS time [0..24] */836 int day; /* day of GPS time [1..28..30(31)*/837 int month; /* month of GPS time [1..12]*/838 int year; /* year of GPS time [1980..] */839 838 }; 840 839 … … 1398 1397 struct converttimeinfo cti; 1399 1398 1400 updatetime(&w, &tow, e->tb*1000, 1); 1399 updatetime(&w, &tow, e->tb*1000, 1); /* Moscow - > UTC */ 1401 1400 converttime(&cti, w, tow); 1402 1401 … … 1685 1684 1686 1685 #ifndef NO_RTCM3_MAIN 1687 static char datestr[] = "$Date: 20 08/12/03 08:33:16$";1686 static char datestr[] = "$Date: 2010/01/16 11:07:57 $"; 1688 1687 1689 1688 /* The string, which is send as agent in HTTP request */ -
trunk/rtcm3torinex/rtcm3torinex.h
r1237 r2346 4 4 /* 5 5 Converter for RTCM3 data to RINEX. 6 $Id: rtcm3torinex.h,v 1.1 4 2008/11/10 18:07:35 weberExp $6 $Id: rtcm3torinex.h,v 1.19 2010/01/12 12:13:23 mervart Exp $ 7 7 Copyright (C) 2005-2006 by Dirk Stöcker <stoecker@alberding.eu> 8 8 … … 22 22 or read http://www.gnu.org/licenses/gpl.txt 23 23 */ 24 25 #include <stdio.h> 24 26 25 27 #define PRN_GPS_START 1 … … 98 100 #define GNSSDF_LOCKLOSSL2 (1<<30) /* lost lock on L2 */ 99 101 102 struct converttimeinfo { 103 int second; /* seconds of GPS time [0..59] */ 104 int minute; /* minutes of GPS time [0..59] */ 105 int hour; /* hour of GPS time [0..24] */ 106 int day; /* day of GPS time [1..28..30(31)*/ 107 int month; /* month of GPS time [1..12]*/ 108 int year; /* year of GPS time [1980..] */ 109 }; 110 100 111 struct gnssdata { 101 112 int flags; /* GPSF_xxx */ … … 106 117 int dataflags[24]; /* GPSDF_xxx */ 107 118 int satellites[24]; /* SV - IDs */ 119 int channels[24]; /* Glonass channels - valid of Glonass SV only */ 108 120 int snrL1[24]; /* Important: all the 5 SV-specific fields must */ 109 121 int snrL2[24]; /* have the same SV-order */ … … 230 242 #endif /* PRINTFARG */ 231 243 244 int gnumleap(int year, int month, int day); 245 void updatetime(int *week, int *tow, int tk, int fixnumleap); 246 void converttime(struct converttimeinfo *c, int week, int tow); 247 232 248 void HandleHeader(struct RTCM3ParserData *Parser); 233 249 int RTCM3Parser(struct RTCM3ParserData *handle);
Note:
See TracChangeset
for help on using the changeset viewer.