Changeset 1316 in ntrip


Ignore:
Timestamp:
Dec 20, 2008, 4:53:04 PM (15 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncapp.cpp

    r1305 r1316  
    437437  QByteArray allLines;
    438438
    439   line.sprintf("     %18.11e %18.11e %18.11e %18.11e\n", (double)ep->IODE,
    440                ep->Crs, ep->Delta_n, ep->M0);
     439  QByteArray fmt;
     440  if (_rinexVers == 2) {
     441    fmt = "    %18.11e %18.11e %18.11e %18.11e\n";
     442  }
     443  else {
     444    fmt = "     %18.11e %18.11e %18.11e %18.11e\n";
     445  }
     446
     447  line.sprintf(fmt.data(), (double)ep->IODE, ep->Crs, ep->Delta_n, ep->M0);
    441448  allLines += line;
    442449 
    443   line.sprintf("     %18.11e %18.11e %18.11e %18.11e\n", ep->Cuc,
    444                ep->e, ep->Cus, ep->sqrt_A);
    445   allLines += line;
    446 
    447   line.sprintf("     %18.11e %18.11e %18.11e %18.11e\n",
    448                (double) ep->TOE, ep->Cic, ep->OMEGA0, ep->Cis);
     450  line.sprintf(fmt.data(), ep->Cuc, ep->e, ep->Cus, ep->sqrt_A);
     451  allLines += line;
     452
     453  line.sprintf(fmt.data(), (double) ep->TOE, ep->Cic, ep->OMEGA0, ep->Cis);
    449454  allLines += line;
    450455 
    451   line.sprintf("     %18.11e %18.11e %18.11e %18.11e\n", ep->i0,
    452                ep->Crc, ep->omega, ep->OMEGADOT);
     456  line.sprintf(fmt.data(), ep->i0, ep->Crc, ep->omega, ep->OMEGADOT);
    453457  allLines += line;
    454458
     
    459463  if(ii & GPSEPHF_L2PCODE)
    460464    dd += 1.0;
    461   line.sprintf("    %18.11e %18.11e %18.11e %18.11e\n", ep->IDOT, dd,
    462                (double) ep->GPSweek, ii & GPSEPHF_L2PCODEDATA ? 1.0 : 0.0);
     465  line.sprintf(fmt.data(), ep->IDOT, dd, (double) ep->GPSweek,
     466               ii & GPSEPHF_L2PCODEDATA ? 1.0 : 0.0);
    463467  allLines += line;
    464468
     
    467471  else
    468472    dd = ceil(10.0*pow(2.0, ((double)ep->URAindex)/2.0))/10.0;
    469   line.sprintf("    %18.11e %18.11e %18.11e %18.11e\n", dd,
    470                ((double) ep->SVhealth), ep->TGD, ((double) ep->IODC));
    471   allLines += line;
    472 
    473   line.sprintf("    %18.11e %18.11e\n", ((double)ep->TOW), 0.0);
     473  line.sprintf(fmt.data(), dd, ((double) ep->SVhealth), ep->TGD,
     474               ((double) ep->IODC));
     475  allLines += line;
     476
     477  line.sprintf(fmt.data(), ((double)ep->TOW), 0.0);
    474478  allLines += line;
    475479
     
    508512  QByteArray allLines;
    509513
    510   line.sprintf("     %18.11e %18.11e %18.11e %18.11e\n", ep->x_pos,
    511                ep->x_velocity, ep->x_acceleration,
     514  QByteArray fmt;
     515  if (_rinexVers == 2) {
     516    fmt = "    %18.11e %18.11e %18.11e %18.11e\n";
     517  }
     518  else {
     519    fmt = "     %18.11e %18.11e %18.11e %18.11e\n";
     520  }
     521
     522  line.sprintf(fmt.data(), ep->x_pos, ep->x_velocity, ep->x_acceleration,
    512523               (ep->flags & GLOEPHF_UNHEALTHY) ? 1.0 : 0.0);
    513524  allLines += line;
    514525   
    515   line.sprintf("     %18.11e %18.11e %18.11e %18.11e\n", ep->y_pos,
    516                ep->y_velocity, ep->y_acceleration,
     526  line.sprintf(fmt.data(), ep->y_pos, ep->y_velocity, ep->y_acceleration,
    517527               (double) ep->frequency_number);
    518528  allLines += line;
    519529 
    520   line.sprintf("     %18.11e %18.11e %18.11e %18.11e\n", ep->z_pos,
    521                ep->z_velocity, ep->z_acceleration, (double) ep->E);
     530  line.sprintf(fmt.data(), ep->z_pos, ep->z_velocity, ep->z_acceleration,
     531               (double) ep->E);
    522532  allLines += line;
    523533
Note: See TracChangeset for help on using the changeset viewer.