- Timestamp:
- Aug 25, 2006, 1:50:34 PM (18 years ago)
- Location:
- trunk/BNC/RTCM3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/rtcm3.cpp
r65 r71 27 27 tim = time(0) - ((10*365+2+5)*24*60*60 + LEAPSECONDS); 28 28 _Parser.GPSWeek = tim/(7*24*60*60); 29 _Parser.GPSTOW = tim%(7*24*60*60);29 _Parser.GPSTOW = tim%(7*24*60*60); 30 30 } 31 31 … … 39 39 void rtcm3::Decode(char* buffer, int bufLen) { 40 40 for (int ii = 0; ii < bufLen; ii++) { 41 HandleByte(&_Parser, buffer[ii]); 41 42 //// HandleByte(&_Parser, buffer[ii]); 43 44 _Parser.Message[_Parser.MessageSize++] = buffer[ii]; 45 if(_Parser.MessageSize >= _Parser.NeedBytes) 46 { 47 int r; 48 while((r = RTCM3Parser(&_Parser))) 49 { 50 int i, j, o; 51 struct converttimeinfo cti; 52 53 if(!_Parser.init) 54 { 55 HandleHeader(&_Parser); 56 _Parser.init = 1; 57 } 58 if(r == 2 && !_Parser.validwarning) 59 { 60 printf("No valid RINEX! All values are modulo 299792.458!" 61 " COMMENT\n"); 62 _Parser.validwarning = 1; 63 } 64 65 converttime(&cti, _Parser.Data.week, 66 floor(_Parser.Data.timeofweek/1000.0)); 67 printf(" %02d %2d %2d %2d %2d %10.7f 0%3d", 68 cti.year%100, cti.month, cti.day, cti.hour, cti.minute, cti.second 69 + fmod(_Parser.Data.timeofweek/1000.0,1.0), _Parser.Data.numsats); 70 for(i = 0; i < 12 && i < _Parser.Data.numsats; ++i) 71 { 72 if(_Parser.Data.satellites[i] <= PRN_GPS_END) 73 printf("G%02d", _Parser.Data.satellites[i]); 74 else if(_Parser.Data.satellites[i] >= PRN_GLONASS_START 75 && _Parser.Data.satellites[i] <= PRN_GLONASS_END) 76 printf("R%02d", _Parser.Data.satellites[i] - (PRN_GLONASS_START-1)); 77 else 78 printf("%3d", _Parser.Data.satellites[i]); 79 } 80 printf("\n"); 81 o = 12; 82 j = _Parser.Data.numsats - 12; 83 while(j > 0) 84 { 85 printf(" "); 86 for(i = o; i < o+12 && i < _Parser.Data.numsats; ++i) 87 { 88 if(_Parser.Data.satellites[i] <= PRN_GPS_END) 89 printf("G%02d", _Parser.Data.satellites[i]); 90 else if(_Parser.Data.satellites[i] >= PRN_GLONASS_START 91 && _Parser.Data.satellites[i] <= PRN_GLONASS_END) 92 printf("R%02d", _Parser.Data.satellites[i] - (PRN_GLONASS_START-1)); 93 else 94 printf("%3d", _Parser.Data.satellites[i]); 95 } 96 printf("\n"); 97 j -= 12; 98 o += 12; 99 } 100 for(i = 0; i < _Parser.Data.numsats; ++i) 101 { 102 for(j = 0; j < _Parser.numdatatypes; ++j) 103 { 104 if(!(_Parser.Data.dataflags[i] & _Parser.dataflag[j]) 105 || isnan(_Parser.Data.measdata[i][_Parser.datapos[j]]) 106 || isinf(_Parser.Data.measdata[i][_Parser.datapos[j]])) 107 { /* no or illegal data */ 108 printf(" "); 109 } 110 else 111 { 112 char lli = ' '; 113 char snr = ' '; 114 if(_Parser.dataflag[j] & (GNSSDF_L1CDATA|GNSSDF_L1PDATA)) 115 { 116 if(_Parser.Data.dataflags[i] & GNSSDF_LOCKLOSSL1) 117 lli = '1'; 118 snr = '0'+_Parser.Data.snrL1[i]; 119 } 120 if(_Parser.dataflag[j] & (GNSSDF_L2CDATA|GNSSDF_L2PDATA)) 121 { 122 if(_Parser.Data.dataflags[i] & GNSSDF_LOCKLOSSL2) 123 lli = '1'; 124 snr = '0'+_Parser.Data.snrL2[i]; 125 } 126 printf("%14.3f%c%c", 127 _Parser.Data.measdata[i][_Parser.datapos[j]],lli,snr); 128 } 129 if(j%5 == 4 || j == _Parser.numdatatypes-1) 130 printf("\n"); 131 } 132 } 133 } 134 } 42 135 } 43 136 } -
trunk/BNC/RTCM3/rtcm3torinex.cpp
r65 r71 1 1 /* 2 2 Converter for RTCM3 data to RINEX. 3 $Id: rtcm3torinex.cpp,v 1. 1 2006/08/24 13:24:14mervart Exp $3 $Id: rtcm3torinex.cpp,v 1.2 2006/08/24 13:56:49 mervart Exp $ 4 4 5 5 Program written bei … … 58 58 59 59 /* CVS revision and version */ 60 static char revisionstr[] = "$Revision: 1. 1$";61 static char datestr[] = "$Date: 2006/08/24 13: 24:14$";60 static char revisionstr[] = "$Revision: 1.2 $"; 61 static char datestr[] = "$Date: 2006/08/24 13:56:49 $"; 62 62 static int stop = 0; 63 63 64 64 65 struct converttimeinfo {66 int second; /* seconds of GPS time [0..59] */67 int minute; /* minutes of GPS time [0..59] */68 int hour; /* hour of GPS time [0..24] */69 int day; /* day of GPS time [1..28..30(31)*/70 int month; /* month of GPS time [1..12]*/71 int year; /* year of GPS time [1980..] */72 };73 65 74 66 #include "rtcm3torinex.h" 75 67 76 /* Additional flags for the data field, which tell us more. */77 #define GNSSDF_LOCKLOSSL1 (1<<29) /* lost lock on L1 */78 #define GNSSDF_LOCKLOSSL2 (1<<30) /* lost lock on L2 */79 68 80 69 struct Args … … 311 300 #define SKIPBITS(b) { LOADBITS(b) numbits -= (b); } 312 301 313 staticint RTCM3Parser(struct RTCM3ParserData *handle)302 int RTCM3Parser(struct RTCM3ParserData *handle) 314 303 { 315 304 int ret=0; … … 484 473 } 485 474 486 staticvoid converttime(struct converttimeinfo *c, int week, int tow)475 void converttime(struct converttimeinfo *c, int week, int tow) 487 476 { 488 477 /* static variables */ … … 534 523 }; 535 524 536 staticvoid HandleHeader(struct RTCM3ParserData *Parser)525 void HandleHeader(struct RTCM3ParserData *Parser) 537 526 { 538 527 struct HeaderData hdata; … … 862 851 } 863 852 864 #ifdef CGPS_TRANSFORM_MAIN853 #ifdef RTCM_TRANSFORM_MAIN 865 854 int main(int argc, char **argv) 866 855 { -
trunk/BNC/RTCM3/rtcm3torinex.h
r65 r71 56 56 #define LEAPSECONDS 14 57 57 58 /* Additional flags for the data field, which tell us more. */ 59 #define GNSSDF_LOCKLOSSL1 (1<<29) /* lost lock on L1 */ 60 #define GNSSDF_LOCKLOSSL2 (1<<30) /* lost lock on L2 */ 61 58 62 struct gnssdata { 59 63 int flags; /* GPSF_xxx */ … … 87 91 }; 88 92 93 struct converttimeinfo { 94 int second; /* seconds of GPS time [0..59] */ 95 int minute; /* minutes of GPS time [0..59] */ 96 int hour; /* hour of GPS time [0..24] */ 97 int day; /* day of GPS time [1..28..30(31)*/ 98 int month; /* month of GPS time [1..12]*/ 99 int year; /* year of GPS time [1980..] */ 100 }; 101 102 void HandleHeader(struct RTCM3ParserData *Parser); 103 int RTCM3Parser(struct RTCM3ParserData *handle); 89 104 void HandleByte(struct RTCM3ParserData *Parser, unsigned int byte); 105 void converttime(struct converttimeinfo *c, int week, int tow); 90 106
Note:
See TracChangeset
for help on using the changeset viewer.