Changeset 3035 in ntrip for trunk


Ignore:
Timestamp:
Feb 25, 2011, 1:35:15 PM (14 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
7 edited

Legend:

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

    r3024 r3035  
    8585// Reopen Output File
    8686////////////////////////////////////////////////////////////////////////
    87 void RTCM3coDecoder::reopen() {
    88 
    89   if (!_fileNameSkl.isEmpty()) {
     87void RTCM3coDecoder::reopen(const QString& fileNameSkl, QString& fileName,
     88                            ofstream*& out) {
     89
     90  if (!fileNameSkl.isEmpty()) {
    9091
    9192    bncSettings settings;
     
    9697                                      settings.value("corrIntr").toString());
    9798
    98     QString fileName = _fileNameSkl
     99    QString fileNameHlp = fileNameSkl
    99100      + QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0'))
    100101      + hlpStr + datTim.toString(".yyC");
    101102
    102     if (_fileName == fileName) {
     103    if (fileName == fileNameHlp) {
    103104      return;
    104105    }
    105106    else {
    106       _fileName = fileName;
    107     }
    108 
    109     delete _out;
     107      fileName = fileNameHlp;
     108    }
     109
     110    delete out;
    110111    if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) {
    111       _out = new ofstream( _fileName.toAscii().data(),
     112      out = new ofstream( fileName.toAscii().data(),
    112113                           ios_base::out | ios_base::app );
    113114    }
    114115    else {
    115       _out = new ofstream( _fileName.toAscii().data() );
     116      out = new ofstream( fileName.toAscii().data() );
    116117    }
    117118  }
     
    154155           (_co.NumberOfGPSSat > 0 || _co.NumberOfGLONASSSat > 0) ) {
    155156
    156         reopen();
     157        reopen(_fileNameSkl, _fileName, _out);
    157158
    158159        // Guess GPS week and sec using system time
  • trunk/BNC/RTCM3/RTCM3coDecoder.h

    r3024 r3035  
    4747  static QStringList corrsToASCIIlines(int GPSweek, double GPSweeks,
    4848                                       const ClockOrbit& co, const Bias* bias);
    49 
     49  static void reopen(const QString& fileNameSkl, QString& fileName,
     50                     std::ofstream*& out);
    5051 signals:
    5152  void newCorrLine(QString line, QString staID, long coTime);
    5253
    5354 private:
    54   void reopen();
    5555  void printLine(const QString& line, long coTime);
    5656
  • trunk/BNC/bncsettings.cpp

    r2999 r3035  
    107107    setValue("cmbMountpoint",    "");
    108108    setValue("cmbPassword",      "");
    109     setValue("cmbOutFile",       "");
    110     setValue("cmbSP3File",       "");
     109    setValue("cmbOutPath",       "");
     110    setValue("cmbSP3Path",       "");
    111111    sync();
    112112  }
  • trunk/BNC/bncwindow.cpp

    r2984 r3035  
    888888  cmbLayout->addWidget(_cmbPasswordLineEdit, 1, 8);
    889889
    890   cmbLayout->addWidget(new QLabel("Output File"), 2, 5);
    891   _cmbOutFileLineEdit = new QLineEdit(settings.value("cmbOutFile").toString());
    892   cmbLayout->addWidget(_cmbOutFileLineEdit, 2, 6);
    893 
    894   cmbLayout->addWidget(new QLabel("Output SP3"), 3, 5);
    895   _cmbSP3FileLineEdit = new QLineEdit(settings.value("cmbSP3File").toString());
    896   cmbLayout->addWidget(_cmbSP3FileLineEdit, 3, 6);
     890  cmbLayout->addWidget(new QLabel("Output Path"), 2, 5);
     891  _cmbOutPathLineEdit = new QLineEdit(settings.value("cmbOutPath").toString());
     892  cmbLayout->addWidget(_cmbOutPathLineEdit, 2, 6);
     893
     894  cmbLayout->addWidget(new QLabel("Output SP3 Path"), 3, 5);
     895  _cmbSP3PathLineEdit = new QLineEdit(settings.value("cmbSP3Path").toString());
     896  cmbLayout->addWidget(_cmbSP3PathLineEdit, 3, 6);
    897897
    898898  cmbgroup->setLayout(cmbLayout);
     
    12811281  settings.setValue("cmbMountpoint", _cmbMountpointLineEdit->text());
    12821282  settings.setValue("cmbPassword",   _cmbPasswordLineEdit->text());
    1283   settings.setValue("cmbOutFile",    _cmbOutFileLineEdit->text());
    1284   settings.setValue("cmbSP3File",    _cmbSP3FileLineEdit->text());
     1283  settings.setValue("cmbOutPath",    _cmbOutPathLineEdit->text());
     1284  settings.setValue("cmbSP3Path",    _cmbSP3PathLineEdit->text());
    12851285
    12861286  if (_caster) {
  • trunk/BNC/bncwindow.h

    r2967 r3035  
    195195    QLineEdit*    _cmbMountpointLineEdit;
    196196    QLineEdit*    _cmbPasswordLineEdit;
    197     QLineEdit*    _cmbOutFileLineEdit;
    198     QLineEdit*    _cmbSP3FileLineEdit;
     197    QLineEdit*    _cmbOutPathLineEdit;
     198    QLineEdit*    _cmbSP3PathLineEdit;
    199199
    200200    bncCaster* _caster;
  • trunk/BNC/combination/bnccomb.cpp

    r3034 r3035  
    158158    _QQ(iPar,iPar) = pp->sig_0 * pp->sig_0;
    159159  }
     160
     161  // Output File (skeleton name)
     162  // ---------------------------
     163  QString path = settings.value("cmbOutPath").toString();
     164  if (!path.isEmpty() && !_caster->mountpoint().isEmpty()) {
     165    expandEnvVar(path);
     166    if ( path.length() > 0 && path[path.length()-1] != QDir::separator() ) {
     167      path += QDir::separator();
     168    }
     169    _outNameSkl = path + _caster->mountpoint();
     170  }
     171  _out = 0;
    160172}
    161173
     
    169181  }
    170182  delete _caster;
     183  delete _out;
    171184}
    172185
     
    341354  }
    342355
    343   // Optionall send new Corrections to PPP client
    344   // --------------------------------------------
     356  // Optionall send new Corrections to PPP client and/or write into file
     357  // -------------------------------------------------------------------
     358  RTCM3coDecoder::reopen(_outNameSkl, _outName, _out);
    345359  bncApp* app = (bncApp*) qApp;
    346   if (app->_bncPPPclient) {
     360  if (app->_bncPPPclient || _out) {
    347361    QStringList corrLines;
    348362    co.messageType = COTYPE_GPSCOMBINED;
     
    350364                                                  resTime.gpssec(), co, 0));
    351365    while (il.hasNext()) {
    352       QString line = il.next() + " " + _caster->mountpoint();
     366      QString line = il.next();
     367      if (_out) {
     368        *_out << line.toAscii().data() << endl;
     369        _out->flush();
     370      }
     371      line += " " + _caster->mountpoint();
    353372      corrLines << line;
    354373    }
    355 
    356     app->_bncPPPclient->slotNewCorrections(corrLines);
     374   
     375    if (app->_bncPPPclient) {
     376      app->_bncPPPclient->slotNewCorrections(corrLines);
     377    }
    357378  }
    358379}
  • trunk/BNC/combination/bnccomb.h

    r3032 r3035  
    33#define BNCCOMB_H
    44
     5#include <fstream>
    56#include <newmat.h>
    67#include "bncephuser.h"
     
    8283  QByteArray            _log;
    8384  QString               _masterAC;
     85  QString               _outNameSkl;
     86  QString               _outName;
     87  std::ofstream*        _out;
    8488};
    8589
Note: See TracChangeset for help on using the changeset viewer.