Changeset 519 in ntrip


Ignore:
Timestamp:
Oct 18, 2007, 2:19:15 PM (17 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncapp.cpp

    r518 r519  
    4242#include <QSettings>
    4343#include <QMessageBox>
     44#include <cmath>
    4445
    4546#include "bncapp.h"
     
    5859
    5960  _bncVersion  = "BNC 1.4";
     61
    6062  // Lists of Ephemeris
    6163  // ------------------
     
    183185////////////////////////////////////////////////////////////////////////////
    184186void bncApp::printGPSEph(gpsephemeris* ep) {
     187
     188  const int RINEX_3 = 1;
     189
    185190  if (_ephStream) {
    186     *_ephStream << "GPS: "  << ep->satellite << endl;
     191
     192    QDateTime datTim = dateAndTimeFromGPSweek(ep->GPSweek, ep->TOC);
     193
     194    QString line;
     195
     196    if (RINEX_3) {
     197      line.sprintf("G%02d %04d %02d %02d %02d %02d %02d%19.12e%19.12e%19.12e\n",
     198                   ep->satellite, datTim.date().year(),
     199                   datTim.date().month(), datTim.date().day(),
     200                   datTim.time().hour(), datTim.time().minute(),
     201                   datTim.time().second(), ep->clock_bias,
     202                   ep->clock_drift, ep->clock_driftrate);
     203    }
     204    else {
     205      line.sprintf("%02d %02d %02d %02d %02d %02d%05.1f%19.12e%19.12e%19.12e\n",
     206                   ep->satellite, datTim.date().year()%100,
     207                   datTim.date().month(), datTim.date().day(),
     208                   datTim.time().hour(), datTim.time().minute(),
     209                   (double) datTim.time().second(), ep->clock_bias,
     210                   ep->clock_drift, ep->clock_driftrate);
     211    }
     212    line.sprintf("   %19.12e%19.12e%19.12e%19.12e\n", (double)ep->IODE,
     213    ep->Crs, ep->Delta_n, ep->M0);
     214    line.sprintf("   %19.12e%19.12e%19.12e%19.12e\n", ep->Cuc,
     215    ep->e, ep->Cus, ep->sqrt_A);
     216    line.sprintf("   %19.12e%19.12e%19.12e%19.12e\n",
     217    (double) ep->TOE, ep->Cic, ep->OMEGA0, ep->Cis);
     218    line.sprintf("   %19.12e%19.12e%19.12e%19.12e\n", ep->i0,
     219    ep->Crc, ep->omega, ep->OMEGADOT);
     220    double dd = 0;
     221    unsigned long ii = ep->flags;
     222    if(ii & GPSEPHF_L2CACODE)
     223      dd += 2.0;
     224    if(ii & GPSEPHF_L2PCODE)
     225      dd += 1.0;
     226    line.sprintf("   %19.12e%19.12e%19.12e%19.12e\n", ep->IDOT, dd,
     227    (double) ep->GPSweek, ii & GPSEPHF_L2PCODEDATA ? 1.0 : 0.0);
     228    if(ep->URAindex <= 6) /* URA index */
     229      dd = ceil(10.0*pow(2.0, 1.0+((double)ep->URAindex)/2.0))/10.0;
     230    else
     231      dd = ceil(10.0*pow(2.0, ((double)ep->URAindex)/2.0))/10.0;
     232    /* 15 indicates not to use satellite. We can't handle this special
     233       case, so we create a high "non"-accuracy value. */
     234    line.sprintf("   %19.12e%19.12e%19.12e%19.12e\n", dd,
     235    ((double) ep->SVhealth), ep->TGD, ((double) ep->IODC));
     236
     237    line.sprintf("   %19.12e%19.12e\n", ((double)ep->TOW), 0.0);
     238
    187239    _ephStream->flush();
    188240  }
Note: See TracChangeset for help on using the changeset viewer.