Changeset 1859 in ntrip for trunk/BNC


Ignore:
Timestamp:
Jul 2, 2009, 1:05:06 PM (15 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM3/RTCM3coDecoder.cpp

    r1852 r1859  
    207207        long coTime = GPSweek * 7*24*3600 + long(floor(_GPSweeks+0.5));
    208208
    209         // Combined message (orbit and clock)
    210         // ----------------------------------
    211         if ( _co.messageType == COTYPE_GPSCOMBINED     ||
    212              _co.messageType == COTYPE_GLONASSCOMBINED ) {
    213           for(int ii = 0; ii < _co.NumberOfGPSSat; ++ii) {
     209        // Loop over all satellites (GPS and Glonass)
     210        // ------------------------------------------
     211        for (int ii = 0; ii < CLOCKORBIT_NUMGPS+_co.NumberOfGLONASSSat; ii++) {
     212          char sysCh = ' ';
     213          if      (ii < _co.NumberOfGPSSat) {
     214            sysCh = 'G';
     215          }
     216          else if (ii >= CLOCKORBIT_NUMGPS) {
     217            sysCh = 'R';
     218          }
     219          if (sysCh != ' ') {
     220
     221            QString linePart;
     222            linePart.sprintf("%d %d %.1f %c%2.2d",
     223                             _co.messageType, GPSweek, _GPSweeks,
     224                             sysCh, _co.Sat[ii].ID);
     225
     226            // Combined message (orbit and clock)
     227            // ----------------------------------
     228            if ( _co.messageType == COTYPE_GPSCOMBINED     ||
     229                 _co.messageType == COTYPE_GLONASSCOMBINED ) {
     230              QString line;
     231              line.sprintf("   %3d"
     232                           "   %8.3f %8.3f %8.3f %8.3f"
     233                           "   %8.3f %8.3f %8.3f %8.3f"
     234                           "   %8.3f %8.3f %8.3f %8.3f",
     235                           _co.Sat[ii].IOD,
     236                           _co.Sat[ii].Clock.DeltaA0,
     237                           _co.Sat[ii].Orbit.DeltaRadial,
     238                           _co.Sat[ii].Orbit.DeltaAlongTrack,
     239                           _co.Sat[ii].Orbit.DeltaCrossTrack,
     240                           _co.Sat[ii].Clock.DeltaA1,
     241                           _co.Sat[ii].Orbit.DotDeltaRadial,
     242                           _co.Sat[ii].Orbit.DotDeltaAlongTrack,
     243                           _co.Sat[ii].Orbit.DotDeltaCrossTrack,
     244                           _co.Sat[ii].Clock.DeltaA2,
     245                           _co.Sat[ii].Orbit.DotDotDeltaRadial,
     246                           _co.Sat[ii].Orbit.DotDotDeltaAlongTrack,
     247                           _co.Sat[ii].Orbit.DotDotDeltaCrossTrack);
     248              printLine(linePart+line, coTime);
     249            }
     250
     251            // Orbits only
     252            // -----------
     253            else if ( _co.messageType == COTYPE_GPSORBIT     ||
     254                      _co.messageType == COTYPE_GLONASSORBIT ) {
     255              QString line;
     256              line.sprintf("   %3d"
     257                           "   %8.3f %8.3f %8.3f"
     258                           "   %8.3f %8.3f %8.3f"
     259                           "   %8.3f %8.3f %8.3f",
     260                           _co.Sat[ii].IOD,
     261                           _co.Sat[ii].Orbit.DeltaRadial,
     262                           _co.Sat[ii].Orbit.DeltaAlongTrack,
     263                           _co.Sat[ii].Orbit.DeltaCrossTrack,
     264                           _co.Sat[ii].Orbit.DotDeltaRadial,
     265                           _co.Sat[ii].Orbit.DotDeltaAlongTrack,
     266                           _co.Sat[ii].Orbit.DotDeltaCrossTrack,
     267                           _co.Sat[ii].Orbit.DotDotDeltaRadial,
     268                           _co.Sat[ii].Orbit.DotDotDeltaAlongTrack,
     269                           _co.Sat[ii].Orbit.DotDotDeltaCrossTrack);
     270              printLine(linePart+line, coTime);
     271            }
     272
     273            // Clocks only
     274            // -----------
     275            else if ( _co.messageType == COTYPE_GPSCLOCK     ||
     276                      _co.messageType == COTYPE_GLONASSCLOCK ) {
     277              QString line;
     278              line.sprintf("   %3d   %8.3f   %8.3f   %8.3f",
     279                           _co.Sat[ii].IOD,
     280                           _co.Sat[ii].Clock.DeltaA0,
     281                           _co.Sat[ii].Clock.DeltaA1,
     282                           _co.Sat[ii].Clock.DeltaA2);
     283              printLine(linePart+line, coTime);
     284            }
     285
     286            // User Range Accuracy
     287            // -------------------
     288            else if ( _co.messageType == COTYPE_GPSURA     ||
     289                      _co.messageType == COTYPE_GLONASSURA ) {
     290              QString line;
     291              line.sprintf("   %3d   %d",
     292                           _co.Sat[ii].IOD, _co.Sat[ii].URA);
     293              printLine(linePart+line, coTime);
     294            }
     295
     296            // High-Resolution Clocks
     297            // ----------------------
     298            else if ( _co.messageType == COTYPE_GPSHR     ||
     299                      _co.messageType == COTYPE_GLONASSHR ) {
     300              QString line;
     301              line.sprintf("   %3d   %8.3f",
     302                           _co.Sat[ii].IOD, _co.Sat[ii].hrclock);
     303              printLine(linePart+line, coTime);
     304            }
     305          }
     306        }
     307
     308        // Loop over all satellites (GPS and Glonass)
     309        // ------------------------------------------
     310        for (int ii = 0; ii < CLOCKORBIT_NUMGPS + _bias.NumberOfGLONASSSat; ii++) {
     311          char sysCh = ' ';
     312          if      (ii < _bias.NumberOfGPSSat) {
     313            sysCh = 'G';
     314          }
     315          else if (ii >= CLOCKORBIT_NUMGPS) {
     316            sysCh = 'R';
     317          }
     318          if (sysCh != ' ') {
    214319            QString line;
    215             line.sprintf("%d %d %.1f G%2.2d   %3d   %8.3f   %8.3f %8.3f %8.3f",
    216                     _co.messageType, GPSweek, _GPSweeks, _co.Sat[ii].ID,
    217                     _co.Sat[ii].IOD,
    218                     _co.Sat[ii].Clock.DeltaA0,
    219                     _co.Sat[ii].Orbit.DeltaRadial,
    220                     _co.Sat[ii].Orbit.DeltaAlongTrack,
    221                     _co.Sat[ii].Orbit.DeltaCrossTrack);
    222             printLine(line, coTime);
    223           }
    224           for(int ii = CLOCKORBIT_NUMGPS;
    225               ii < CLOCKORBIT_NUMGPS + _co.NumberOfGLONASSSat; ++ii) {
    226             QString line;
    227             line.sprintf("%d %d %.1f R%2.2d   %3d   %8.3f   %8.3f %8.3f %8.3f",
    228                     _co.messageType, GPSweek, _GPSweeks, _co.Sat[ii].ID,
    229                     _co.Sat[ii].IOD,
    230                     _co.Sat[ii].Clock.DeltaA0,
    231                     _co.Sat[ii].Orbit.DeltaRadial,
    232                     _co.Sat[ii].Orbit.DeltaAlongTrack,
    233                     _co.Sat[ii].Orbit.DeltaCrossTrack);
    234             printLine(line, coTime);
    235           }
    236         }
    237 
    238         // Orbits only
    239         // -----------
    240         else if ( _co.messageType == COTYPE_GPSORBIT     ||
    241                   _co.messageType == COTYPE_GLONASSORBIT ) {
    242           for(int ii = 0; ii < _co.NumberOfGPSSat; ++ii) {
    243             QString line;
    244             line.sprintf("%d %d %.1f G%2.2d   %3d   %8.3f %8.3f %8.3f",
    245                     _co.messageType, GPSweek, _GPSweeks, _co.Sat[ii].ID,
    246                     _co.Sat[ii].IOD,
    247                     _co.Sat[ii].Orbit.DeltaRadial,
    248                     _co.Sat[ii].Orbit.DeltaAlongTrack,
    249                     _co.Sat[ii].Orbit.DeltaCrossTrack);
    250             printLine(line, coTime);
    251           }
    252           for(int ii = CLOCKORBIT_NUMGPS;
    253               ii < CLOCKORBIT_NUMGPS + _co.NumberOfGLONASSSat; ++ii) {
    254             QString line;
    255             line.sprintf("%d %d %.1f R%2.2d   %3d   %8.3f %8.3f %8.3f",
    256                     _co.messageType, GPSweek, _GPSweeks, _co.Sat[ii].ID,
    257                     _co.Sat[ii].IOD,
    258                     _co.Sat[ii].Orbit.DeltaRadial,
    259                     _co.Sat[ii].Orbit.DeltaAlongTrack,
    260                     _co.Sat[ii].Orbit.DeltaCrossTrack);
    261             printLine(line, coTime);
    262           }
    263         }
    264 
    265         // Clocks only
    266         // -----------
    267         else if ( _co.messageType == COTYPE_GPSCLOCK     ||
    268                   _co.messageType == COTYPE_GLONASSCLOCK ) {
    269           for(int ii = 0; ii < _co.NumberOfGPSSat; ++ii) {
    270             QString line;
    271             line.sprintf("%d %d %.1f G%2.2d   %3d   %8.3f",
    272                     _co.messageType, GPSweek, _GPSweeks, _co.Sat[ii].ID,
    273                     _co.Sat[ii].IOD, _co.Sat[ii].Clock.DeltaA0);
    274             printLine(line, coTime);
    275           }
    276           for(int ii = CLOCKORBIT_NUMGPS;
    277               ii < CLOCKORBIT_NUMGPS + _co.NumberOfGLONASSSat; ++ii) {
    278             QString line;
    279             line.sprintf("%d %d %.1f R%2.2d   %3d   %8.3f",
    280                     _co.messageType, GPSweek, _GPSweeks, _co.Sat[ii].ID,
    281                     _co.Sat[ii].IOD, _co.Sat[ii].Clock.DeltaA0);
    282             printLine(line, coTime);
    283           }
    284         }
    285 
    286         // URA
    287         // ---
    288         else if ( _co.messageType == COTYPE_GPSURA     ||
    289                   _co.messageType == COTYPE_GLONASSURA ) {
    290           for(int ii = 0; ii < _co.NumberOfGPSSat; ++ii) {
    291             QString line;
    292             line.sprintf("%d %d %.1f G%2.2d   %3d   %d",
    293                     _co.messageType, GPSweek, _GPSweeks, _co.Sat[ii].ID,
    294                     _co.Sat[ii].IOD, _co.Sat[ii].URA);
    295             printLine(line, coTime);
    296           }
    297           for(int ii = CLOCKORBIT_NUMGPS;
    298               ii < CLOCKORBIT_NUMGPS + _co.NumberOfGLONASSSat; ++ii) {
    299             QString line;
    300             line.sprintf("%d %d %.1f R%2.2d   %3d   %d",
    301                     _co.messageType, GPSweek, _GPSweeks, _co.Sat[ii].ID,
    302                     _co.Sat[ii].IOD, _co.Sat[ii].URA);
    303             printLine(line, coTime);
    304           }
    305         }
    306 
    307         // HR
    308         // --
    309         else if ( _co.messageType == COTYPE_GPSHR     ||
    310                   _co.messageType == COTYPE_GLONASSHR ) {
    311           for(int ii = 0; ii < _co.NumberOfGPSSat; ++ii) {
    312             QString line;
    313             line.sprintf("%d %d %.1f G%2.2d   %3d   %8.3f",
    314                     _co.messageType, GPSweek, _GPSweeks, _co.Sat[ii].ID,
    315                     _co.Sat[ii].IOD, _co.Sat[ii].hrclock);
    316             printLine(line, coTime);
    317           }
    318           for(int ii = CLOCKORBIT_NUMGPS;
    319               ii < CLOCKORBIT_NUMGPS + _co.NumberOfGLONASSSat; ++ii) {
    320             QString line;
    321             line.sprintf("%d %d %.1f R%2.2d   %3d   %8.3f",
    322                     _co.messageType, GPSweek, _GPSweeks, _co.Sat[ii].ID,
    323                     _co.Sat[ii].IOD, _co.Sat[ii].hrclock);
    324             printLine(line, coTime);
    325           }
    326         }
    327 
    328         // Biases
    329         // ------
    330         else if ( _bias.messageType == BTYPE_GPS     ||
    331                   _bias.messageType == BTYPE_GLONASS ) {
    332           for(int ii = 0; ii < _bias.NumberOfGPSSat; ++ii) {
    333             QString line;
    334             line.sprintf("%d %d %.1f G%2.2d %d ", _bias.messageType,
    335                          GPSweek, _GPSweeks, _bias.Sat[ii].ID,
     320            line.sprintf("%d %d %.1f %c%2.2d %d",
     321                         _bias.messageType, GPSweek, _GPSweeks,
     322                         sysCh, _bias.Sat[ii].ID,
    336323                         _bias.Sat[ii].NumberOfCodeBiases);
    337324            for (int jj = 0; jj < _bias.Sat[ii].NumberOfCodeBiases; jj++) {
    338325              QString hlp;
    339               hlp.sprintf("%d %8.3f ",  _bias.Sat[ii].Biases[jj].Type,
    340                           _bias.Sat[ii].Biases[jj].Bias);
    341               line += hlp;
    342             }
    343             printLine(line, coTime);
    344           }
    345           for(int ii = CLOCKORBIT_NUMGPS;
    346               ii < CLOCKORBIT_NUMGPS + _bias.NumberOfGLONASSSat; ++ii) {
    347             QString line;
    348             line.sprintf("%d %d %.1f R%2.2d %d ", _bias.messageType,
    349                          GPSweek, _GPSweeks, _bias.Sat[ii].ID,
    350                          _bias.Sat[ii].NumberOfCodeBiases);
    351             for (int jj = 0; jj < _bias.Sat[ii].NumberOfCodeBiases; jj++) {
    352               QString hlp;
    353               hlp.sprintf("%d %8.3f ",  _bias.Sat[ii].Biases[jj].Type,
     326              hlp.sprintf(" %d %8.3f",  _bias.Sat[ii].Biases[jj].Type,
    354327                          _bias.Sat[ii].Biases[jj].Bias);
    355328              line += hlp;
Note: See TracChangeset for help on using the changeset viewer.