Changeset 1698 in ntrip for trunk/BNS/bnscaster.cpp


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

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.