Changeset 72 in ntrip
- Timestamp:
- Aug 25, 2006, 3:56:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/rtcm3.cpp
r71 r72 40 40 for (int ii = 0; ii < bufLen; ii++) { 41 41 42 //// HandleByte(&_Parser, buffer[ii]); 42 #if 0 43 HandleByte(&_Parser, buffer[ii]); 44 continue; 45 #endif 43 46 44 47 _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 { 48 if (_Parser.MessageSize >= _Parser.NeedBytes) { 49 50 while(int rr = RTCM3Parser(&_Parser)) { 51 52 if (!_Parser.init) { 55 53 HandleHeader(&_Parser); 56 54 _Parser.init = 1; 57 55 } 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; 56 57 if (rr == 2) { 58 cerr << "No valid RINEX! All values are modulo 299792.458!\n"; 59 exit(1); 63 60 } 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]); 61 62 for (int ii = 0; ii < _Parser.Data.numsats; ii++) { 63 Observation* obs = new Observation(); 64 65 //// obs->statID = 66 obs->SVPRN = _Parser.Data.satellites[ii]; 67 obs->GPSWeek = _Parser.Data.week; 68 obs->GPSWeeks = (int) (_Parser.Data.timeofweek / 1000.0); 69 obs->sec = fmod(_Parser.Data.timeofweek / 1000.0, 3600.0); 70 71 for (int jj = 0; jj < _Parser.numdatatypes; jj++) { 72 73 if ( !(_Parser.Data.dataflags[ii] & _Parser.dataflag[jj]) 74 || isnan(_Parser.Data.measdata[ii][_Parser.datapos[jj]]) 75 || isinf(_Parser.Data.measdata[ii][_Parser.datapos[jj]]) ) { 76 continue; 77 } 78 79 if (_Parser.dataflag[jj] & GNSSDF_C1DATA) { 80 obs->C1 = _Parser.Data.measdata[ii][_Parser.datapos[jj]]; 81 obs->pCodeIndicator = 0; 82 } 83 else if (_Parser.dataflag[jj] & GNSSDF_P1DATA) { 84 obs->C1 = _Parser.Data.measdata[ii][_Parser.datapos[jj]]; 85 obs->pCodeIndicator = 1; 86 } 87 else if (_Parser.dataflag[jj] & GNSSDF_P2DATA) { 88 obs->P2 = _Parser.Data.measdata[ii][_Parser.datapos[jj]]; 89 } 90 else if (_Parser.dataflag[jj] & (GNSSDF_L1CDATA|GNSSDF_L1PDATA)) { 91 obs->L1 = _Parser.Data.measdata[ii][_Parser.datapos[jj]]; 92 obs->SNR1 = _Parser.Data.snrL1[ii]; 93 } 94 else if (_Parser.dataflag[jj] & (GNSSDF_L2CDATA|GNSSDF_L2PDATA)) { 95 obs->L2 = _Parser.Data.measdata[ii][_Parser.datapos[jj]]; 96 obs->SNR2 = _Parser.Data.snrL2[ii]; 97 } 95 98 } 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 } 99 100 //// obs->cumuLossOfCont = 101 102 m_lObsList.push_back(obs); 132 103 } 133 104 }
Note:
See TracChangeset
for help on using the changeset viewer.