Changeset 811 in ntrip


Ignore:
Timestamp:
Apr 9, 2008, 2:32:02 PM (14 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bns.cpp

    r809 r811  
    5050  // ---------------------------------
    5151  _outSocket = 0;
     52  _outFile   = 0;
     53  QFile outFile(settings.value("outFile").toString());
     54  if (outFile.open(QFile::WriteOnly | QFile::Truncate)) {
     55    _outFile = new QTextStream(&outFile);
     56  }
    5257}
    5358
     
    105110 
    106111  QSettings settings;
    107   QString host = settings.value("outHost").toString();
    108   int     port = settings.value("outPort").toInt();
    109112
    110113  _outSocket = new QTcpSocket();
    111   _outSocket->connectToHost(host, port);
     114  _outSocket->connectToHost(settings.value("outHost").toString(),
     115                            settings.value("outPort").toInt());
    112116
    113117  QString mountpoint = settings.value("mountpoint").toString();
     
    169173  _bnseph->start();
    170174
    171   // Open the connection to NTRIP Caster
    172   // -----------------------------------
    173   openCaster();
    174 
    175175  // Endless loop
    176176  // ------------
     
    178178    if (_clkSocket && _clkSocket->state() == QAbstractSocket::ConnectedState) {
    179179      if ( _clkSocket->canReadLine()) {
     180        if (_outSocket == 0) {
     181          openCaster();
     182        }
    180183        readEpoch();
    181184      }
     
    249252  XYZ_to_RSW(xB.Rows(1,3), vv, dx, rsw);
    250253
    251   cout.setf(ios::showpoint | ios::fixed);
    252   cout << GPSweek << " "
    253        << setprecision(1) << GPSweeks << " " << ep->prn.toAscii().data()
    254        << "   " << int(ep->IODC) << " " << int(ep->IODE) << "   "
    255        << setw(8) << setprecision(3) << dClk << "   "
    256        << setw(8) << setprecision(3) << rsw.t();
    257 }
     254  QString line;
     255  line.sprintf("%d %.1f %s   %d %d   %8.3f   %8.3f %8.3f %8.3f\n",
     256               GPSweek, GPSweeks, ep->prn.toAscii().data(),
     257               int(ep->IODC), int(ep->IODE), dClk, rsw(1), rsw(2), rsw(3));
     258 
     259  if (_outFile) {
     260    *_outFile << line;
     261  }
     262  if (_outSocket) {
     263    _outSocket->write(line.toAscii());
     264  }
     265}
  • trunk/BNS/bns.h

    r799 r811  
    5252  QTcpSocket*               _clkSocket;
    5353  QTcpSocket*               _outSocket;
     54  QTextStream*              _outFile;
    5455  t_bnseph*                 _bnseph;
    5556  QMutex                    _mutex;
Note: See TracChangeset for help on using the changeset viewer.