Changeset 534 in ntrip


Ignore:
Timestamp:
Oct 20, 2007, 2:45:50 PM (17 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncapp.cpp

    r533 r534  
    8787  // Eph file(s)
    8888  // -----------
    89   _rinex3 = -1;
     89  _rinexVers        = 0;
    9090  _ephFileGPS       = 0;
    9191  _ephStreamGPS     = 0;
     
    101101  delete _ephStreamGPS;
    102102  delete _ephFileGPS;
    103   if (_rinex3 == 0) {
     103  if (_rinexVers == 2) {
    104104    delete _ephStreamGlonass;
    105105    delete _ephFileGlonass;
     
    153153  QMutexLocker locker(&_mutex);
    154154
     155  printEphHeader();
     156
    155157  if (!_ephStreamGPS) {
    156158    delete gpseph;
     
    175177  QMutexLocker locker(&_mutex);
    176178
     179  printEphHeader();
     180
    177181  if (!_ephStreamGlonass) {
    178182    delete glonasseph;
     
    197201void bncApp::printEphHeader() {
    198202
    199   if (_rinex3 == -1) {
     203  // Initialization
     204  // --------------
     205  if (_rinexVers == 0) {
    200206    QSettings settings;
    201207
    202208    if ( Qt::CheckState(settings.value("ephV3").toInt()) == Qt::Checked) {
    203       _rinex3 = 1;   
     209      _rinexVers = 3;   
    204210    }
    205211    else {
    206       _rinex3 = 0;
     212      _rinexVers = 2;
    207213    }
    208214
     
    217223  }
    218224
     225  // (Re-)Open output File(s)
     226  // ------------------------
    219227  if (!_ephPath.isEmpty()) {
    220228
     
    224232          QString("%1").arg(date.dayOfYear(), 3, 10, QChar('0')) +
    225233                            date.toString("0.yyN");
    226 
    227     cout << ephFileNameGPS.toAscii().data() << endl;
    228234
    229235    if (_ephFileNameGPS == ephFileNameGPS) {
     
    242248    _ephStreamGPS->setDevice(_ephFileGPS);
    243249
    244     if      (_rinex3 == 1) {
     250    if      (_rinexVers == 3) {
    245251      _ephFileGlonass   = _ephFileGPS;
    246252      _ephStreamGlonass = _ephStreamGPS;
    247253    }
    248     else if (_rinex3 == 0) {
     254    else if (_rinexVers == 2) {
    249255      QString ephFileNameGlonass = _ephPath + "GLO_" +
    250256          QString("%1").arg(date.dayOfYear(), 3, 10, QChar('0')) +
    251257                            date.toString("0.yyN");
    252 
    253       cout << ephFileNameGlonass.toAscii().data() << endl;
    254258
    255259      delete _ephStreamGlonass;
     
    260264      _ephStreamGlonass = new QTextStream();
    261265      _ephStreamGlonass->setDevice(_ephFileGlonass);
    262 
    263     }
    264 
    265 
    266     if (_rinex3 == 1) {
     266    }
     267
     268    // Header - RINEX Version 3
     269    // ------------------------
     270    if (_rinexVers == 3) {
    267271      QString line;
    268272
     
    273277
    274278      char buffer[100];
    275       HandleRunBy(buffer, sizeof(buffer), 0, _rinex3);
     279      HandleRunBy(buffer, sizeof(buffer), 0, 1);
    276280      line.sprintf("%s\n%60sEND OF HEADER\n", buffer, "");
    277281      *_ephStreamGPS << line;
     
    279283      _ephStreamGPS->flush();
    280284    }
    281     else if (_rinex3 == 0) {
    282 
    283     }
    284   }
    285 }
    286 
     285
     286    // Header - RINEX Version 2
     287    // ------------------------
     288    else if (_rinexVers == 2) {
     289
     290    }
     291  }
     292}
    287293
    288294//
    289295////////////////////////////////////////////////////////////////////////////
    290296void bncApp::printGPSEph(gpsephemeris* ep) {
    291 
    292   printEphHeader();
    293297
    294298  if (_ephStreamGPS) {
     
    299303    converttime(&cti, ep->GPSweek, ep->TOC);
    300304
    301     if      (_rinex3 == 1) {
     305    if      (_rinexVers == 3) {
    302306      line.sprintf("G%02d %04d %02d %02d %02d %02d %02d%19.12e%19.12e%19.12e",
    303307                   ep->satellite, cti.year, cti.month, cti.day, cti.hour,
     
    305309                   ep->clock_driftrate);
    306310    }
    307     else if (_rinex3 == 0) {
     311    else if (_rinexVers == 2) {
    308312      line.sprintf("%02d %02d %02d %02d %02d %02d%05.1f%19.12e%19.12e%19.12e",
    309313                   ep->satellite, cti.year%100, cti.month, cti.day, cti.hour,
     
    358362void bncApp::printGlonassEph(glonassephemeris* ep) {
    359363
    360   printEphHeader();
    361 
    362364  if (_ephStreamGlonass) {
    363365    int ww  = ep->GPSWeek;
     
    375377    QString line;
    376378
    377     if      (_rinex3 == 1) {
     379    if      (_rinexVers == 3) {
    378380      line.sprintf("R%02d %04d %02d %02d %02d %02d %02d%19.12e%19.12e%19.12e",
    379381                   ep->almanac_number, cti.year, cti.month, cti.day, cti.hour,
    380382                   cti.minute, cti.second, -ep->tau, ep->gamma, (double) ii);
    381383    }
    382     else if (_rinex3 == 0) {
     384    else if (_rinexVers == 2) {
    383385      line.sprintf("%02d %02d %02d %02d %02d %02d%5.1f%19.12e%19.12e%19.12e",
    384386                   ep->almanac_number, cti.year%100, cti.month, cti.day,
  • trunk/BNC/bncapp.h

    r533 r534  
    5555    QString           _ephPath;
    5656    QString           _ephFileNameGPS;
    57     int               _rinex3;
     57    int               _rinexVers;
    5858    QFile*            _ephFileGPS;
    5959    QTextStream*      _ephStreamGPS;
Note: See TracChangeset for help on using the changeset viewer.