Changeset 1698 in ntrip for trunk/BNS


Ignore:
Timestamp:
Mar 4, 2009, 11:15:46 AM (15 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bns.cpp

    r1682 r1698  
    7575  // -------------------------------------------
    7676  for (int ic = 1; ic <= 2; ic++) {
    77 
    7877    QString mountpoint  = settings.value(QString("mountpoint_%1").arg(ic)).toString();
    7978    QString outFileName = settings.value(QString("outFile_%1").arg(ic)).toString();
    8079    if (!mountpoint.isEmpty() || !outFileName.isEmpty()) {
    81       QString refSys      = settings.value(QString("refSys_%1").arg(ic)).toString();
    82 
    83       _caster.push_back(new t_bnscaster(mountpoint, outFileName, refSys, ic));
     80      _caster.push_back(new t_bnscaster(mountpoint, outFileName, ic));
    8481      connect(_caster.back(), SIGNAL(error(const QByteArray)),
    8582              this, SLOT(slotError(const QByteArray)));
     
    373370            prns << prn;
    374371            if ( _ephList.contains(prn) ) {
    375               in >> xx(1) >> xx(2) >> xx(3) >> xx(4);
     372              in >> xx(1) >> xx(2) >> xx(3) >> xx(4) >> xx(5);
    376373              xx(1) *= 1e3;
    377374              xx(2) *= 1e3;
     
    379376              xx(4) *= 1e-6;
    380377
    381     //// in >> xx(1) >> xx(2) >> xx(3) >> xx(4) >> xx(5); xx(4) *= 1e-6;
    382     ////
    383     //// beg test (zero clock correction for Gerhard Wuebbena)
    384     ////            xx(4) -= xx(5) / 299792458.0;
    385     //// end test
    386     ////
    387     //// Falls Clocks aus den Broadcast Ephemeris gewuenscht:
    388     //// (2nd order relativistic effect taken out for
    389     //// compatibility with IGS products?)
    390     ////
    391     //// if ( Qt::CheckState(settings.value("beClocks1 oder beClocks2").toInt()) == Qt::Checked) {
    392     ////  .....
    393     //// }
     378              // Clocks without corrections
     379              // --------------------------
     380              if ( _caster.at(ic)->beClocks() ) {
     381                xx(4) -= xx(5) / 299792458.0;
     382              }
    394383     
    395384              t_ephPair* pair = _ephList[prn];
  • trunk/BNS/bnscaster.cpp

    r1668 r1698  
    2424////////////////////////////////////////////////////////////////////////////
    2525t_bnscaster::t_bnscaster(const QString& mountpoint, const QString& outFileName,
    26                          const QString& refSys, const int ic) {
    27 
    28   _mountpoint         = mountpoint;
    29   _outSocket          = 0;
    30   _outSocketOpenTrial = 0;
    31   _ic = ic;
     26                         int ic) {
    3227
    3328  bnsSettings settings;
    3429
    35   QIODevice::OpenMode oMode;
    36   if (Qt::CheckState(settings.value("fileAppend").toInt()) == Qt::Checked) {
    37     oMode = QIODevice::WriteOnly | QIODevice::Unbuffered | QIODevice::Append;
    38   }
    39   else {
    40     oMode = QIODevice::WriteOnly | QIODevice::Unbuffered;
    41   }
     30  _mountpoint = mountpoint;
     31  _ic         = ic;
     32  _outSocket  = 0;
     33  _sOpenTrial = 0;
    4234
    4335  if (outFileName.isEmpty()) {
     
    4739  else {
    4840    _outFile = new QFile(outFileName);
     41
     42    QIODevice::OpenMode oMode;
     43    if (Qt::CheckState(settings.value("fileAppend").toInt()) == Qt::Checked) {
     44      oMode = QIODevice::WriteOnly | QIODevice::Unbuffered | QIODevice::Append;
     45    }
     46    else {
     47      oMode = QIODevice::WriteOnly | QIODevice::Unbuffered;
     48    }
     49
    4950    if (_outFile->open(oMode)) {
    5051      _outStream = new QTextStream(_outFile);
     
    5455  // Reference frame
    5556  // ---------------
    56   _crdTrafo = false;
    57   if (refSys == "ETRF2000") {
     57  if (settings.value(QString("refSys_%1").arg(_ic)).toString() == "ETRF2000") {
    5858    _crdTrafo = true;
     59  }
     60  else {
     61    _crdTrafo = false;
     62  }
     63
     64  if ( Qt::CheckState(settings.value(QString("beClocks%1").arg(_ic)).toInt())
     65       == Qt::Checked ) {
     66    _beClocks = true;
     67  }
     68  else {
     69    _beClocks = false;
    5970  }
    6071}
     
    8394  delete _outSocket; _outSocket = 0;
    8495
    85   double minDt = pow(2.0,_outSocketOpenTrial);
    86   if (++_outSocketOpenTrial > 8) {
    87     _outSocketOpenTrial = 8;
     96  double minDt = pow(2.0,_sOpenTrial);
     97  if (++_sOpenTrial > 8) {
     98    _sOpenTrial = 8;
    8899  }
    89100  if (_outSocketOpenTime.isValid() &&
     
    130141    delete _outSocket;
    131142    _outSocket = 0;
    132 //  emit(newMessage("t_bnscaster::open  socket deleted"));
    133     emit(newMessage("Broadcaster: Connection broken")); // weber
     143    emit(newMessage("Broadcaster: Connection broken"));
    134144  }
    135145  else {
    136 //  emit(newMessage("t_bnscaster::open  socket OK"));
    137     emit(newMessage("Broadcaster: Connection opened")); // weber
    138     _outSocketOpenTrial = 0;
     146    emit(newMessage("Broadcaster: Connection opened"));
     147    _sOpenTrial = 0;
    139148  }
    140149}
  • trunk/BNS/bnscaster.h

    r1262 r1698  
    77 Q_OBJECT
    88 public:
    9   t_bnscaster(const QString& mountpoint, const QString& outFileName,
    10               const QString& refSys, int ic);
     9  t_bnscaster(const QString& mountpoint, const QString& outFileName, int ic);
    1110  virtual ~t_bnscaster();
    1211  void open();
     
    1514  bool usedSocket() const {return _outSocket;}
    1615  bool crdTrafo() const {return _crdTrafo;}
     16  bool beClocks() const {return _beClocks;}
    1717  int  ic() const {return _ic;}
    1818
     
    2424  QString      _mountpoint;
    2525  QTcpSocket*  _outSocket;
    26   int          _outSocketOpenTrial;
     26  int          _sOpenTrial;
    2727  QDateTime    _outSocketOpenTime;
    2828  QFile*       _outFile;
    2929  QTextStream* _outStream;
    3030  bool         _crdTrafo;
     31  bool         _beClocks;
    3132  int          _ic;
    3233};
Note: See TracChangeset for help on using the changeset viewer.