Changeset 1345 in ntrip


Ignore:
Timestamp:
Dec 27, 2008, 12:23:20 PM (15 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnc.pro

    r1317 r1345  
    2929          bnccaster.h bncrinex.h bncapp.h bncutils.h   bnchlpdlg.h    \
    3030          bncconst.h bnchtml.h bnctableitem.h bnczerodecoder.h        \
     31          bncsocket.h                                                 \
    3132          RTCM/GPSDecoder.h RTCM/RTCM2.h RTCM/RTCM2Decoder.h          \
    3233          RTCM/RTCM2_2021.h RTCM/rtcm_utils.h                         \
     
    4647          bnccaster.cpp bncrinex.cpp bncapp.cpp bncutils.cpp          \
    4748          bncconst.cpp bnchtml.cpp bnchlpdlg.cpp bnctableitem.cpp     \
    48           bnczerodecoder.cpp                                          \
     49          bnczerodecoder.cpp bncsocket.cpp                            \
    4950          RTCM/RTCM2.cpp RTCM/RTCM2Decoder.cpp                        \
    5051          RTCM/RTCM2_2021.cpp RTCM/rtcm_utils.cpp                     \
  • trunk/BNC/bncgetthread.cpp

    r1331 r1345  
    5454#include "bncrinex.h"
    5555#include "bnczerodecoder.h"
     56#include "bncsocket.h"
    5657
    5758#include "RTCM/RTCM2Decoder.h"
     
    303304// Connect to Caster, send the Request (static)
    304305////////////////////////////////////////////////////////////////////////////
    305 QTcpSocket* bncGetThread::request(const QUrl& mountPoint,
    306                                   QByteArray& latitude, QByteArray& longitude,
    307                                   QByteArray& nmea, int timeOut,
    308                                   QString& msg) {
     306bncSocket* bncGetThread::request(const QUrl& mountPoint,
     307                                 QByteArray& latitude, QByteArray& longitude,
     308                                 QByteArray& nmea, int timeOut,
     309                                 QString& msg) {
    309310
    310311  // Connect the Socket
     
    314315  int     proxyPort = settings.value("proxyPort").toInt();
    315316 
    316   QTcpSocket* socket = new QTcpSocket();
     317  bncSocket* socket = new bncSocket(new QTcpSocket());
    317318  if ( proxyHost.isEmpty() ) {
    318319    socket->connectToHost(mountPoint.host(), mountPoint.port());
  • trunk/BNC/bncgetthread.h

    r1319 r1345  
    3737class bncRinex;
    3838class QextSerialPort;
     39class bncSocket;
    3940
    4041class bncGetThread : public QThread {
     
    5152   ~bncGetThread();
    5253
    53    static QTcpSocket* request(const QUrl& mountPoint, QByteArray& latitude, QByteArray& longitude,
    54                               QByteArray& nmea, int timeOut, QString& msg);
     54   static bncSocket* request(const QUrl& mountPoint, QByteArray& latitude, QByteArray& longitude,
     55                             QByteArray& nmea, int timeOut, QString& msg);
    5556
    5657   QByteArray staID() const {return _staID;}
     
    8081   void  callScript(const char* _comment);
    8182   GPSDecoder* _decoder;
    82    QTcpSocket* _socket;
     83   bncSocket* _socket;
    8384   QUrl        _mountPoint;
    8485   QByteArray  _staID;
  • trunk/BNC/bncnetrequest.cpp

    r1343 r1345  
    9999  while (it.hasNext()) {
    100100    p_obs obs = it.next();
    101     cout << obs->_o.satNum << endl;
     101    cout << obs->_o.satSys   << obs->_o.satNum   << " "
     102         << obs->_o.GPSWeek  << " "
     103         << obs->_o.GPSWeeks << " "
     104         << obs->_o.C1       << " "
     105         << obs->_o.C2       << " "
     106         << obs->_o.P1       << " "
     107         << obs->_o.P2       << " "
     108         << obs->_o.L1       << " "
     109         << obs->_o.L2       << endl;
    102110    delete obs;
    103111  }
  • trunk/BNC/bncrinex.cpp

    r1154 r1345  
    5454#include "bnctabledlg.h"
    5555#include "bncgetthread.h"
     56#include "bncsocket.h"
    5657#include "RTCM3/rtcm3torinex.h"
    5758
     
    156157    QByteArray _longitude;
    157158    QByteArray _nmea;
    158     QTcpSocket* socket = bncGetThread::request(url, _latitude, _longitude, _nmea, timeOut, msg);
     159    bncSocket* socket = bncGetThread::request(url, _latitude, _longitude, _nmea, timeOut, msg);
    159160
    160161    if (socket) {
  • trunk/BNC/bncsocket.cpp

    r1344 r1345  
    3636////////////////////////////////////////////////////////////////////////////
    3737void bncSocket::connectToHost(const QString &hostName, quint16 port,
    38                               OpenMode mode) {
     38                              QIODevice::OpenMode mode) {
    3939  _socket->connectToHost(hostName, port, mode);
    4040}
     
    5454//
    5555////////////////////////////////////////////////////////////////////////////
    56 qint64 bncSocket::readData(char* data, qint64 maxSize) {
    57   return _socket->read(data, maxSize);
     56void bncSocket::close() {
     57  _socket->close();
    5858}
    5959
    6060//
    6161////////////////////////////////////////////////////////////////////////////
    62 qint64 bncSocket::writeData(const char* data, qint64 maxSize) {
    63   return _socket->write(data, maxSize);
     62qint64 bncSocket::bytesAvailable() const {
     63  return _socket->bytesAvailable();
    6464}
    6565
     66//
     67////////////////////////////////////////////////////////////////////////////
     68bool bncSocket::canReadLine() const {
     69  return _socket->canReadLine();
     70}
     71
     72//
     73////////////////////////////////////////////////////////////////////////////
     74QByteArray bncSocket::readLine(qint64 maxlen) {
     75  return _socket->readLine(maxlen);
     76}
     77
     78//
     79////////////////////////////////////////////////////////////////////////////
     80bool bncSocket::waitForReadyRead(int msecs) {
     81  return _socket->waitForReadyRead(msecs);
     82}
     83
     84//
     85////////////////////////////////////////////////////////////////////////////
     86qint64 bncSocket::read(char* data, qint64 maxlen) {
     87  return _socket->read(data, maxlen);
     88}
     89
     90//
     91////////////////////////////////////////////////////////////////////////////
     92qint64 bncSocket::write(const char* data, qint64 len) {
     93  return _socket->write(data, len);
     94}
     95
     96//
     97////////////////////////////////////////////////////////////////////////////
     98bool bncSocket::waitForBytesWritten(int msecs) {
     99  return _socket->waitForBytesWritten(msecs);
     100}
  • trunk/BNC/bncsocket.h

    r1344 r1345  
    44#include <QtNetwork>
    55
    6 class bncSocket : public QIODevice {
    7  Q_OBJECT
     6class bncSocket : public QObject {
    87
    98 public:
     
    1110  ~bncSocket();
    1211
    13   void connectToHost(const QString &hostName, quint16 port,
    14                      OpenMode mode = QIODevice::ReadWrite);
    15 
    16   bool waitForConnected(int msecs = 30000);
    17 
     12  void       close();
     13  qint64     bytesAvailable() const;
     14  bool       canReadLine() const;
     15  QByteArray readLine(qint64 maxlen = 0);
     16  bool       waitForReadyRead(int msecs = 30000);
     17  qint64     read(char *data, qint64 maxlen);
     18  qint64     write(const char *data, qint64 len);
     19  bool       waitForBytesWritten(int msecs = 30000);
     20  void       connectToHost(const QString &hostName, quint16 port,
     21                           QIODevice::OpenMode mode = QIODevice::ReadWrite);
     22  bool       waitForConnected(int msecs = 30000);
    1823  QAbstractSocket::SocketState state() const;
    19 
    20  protected:
    21   virtual qint64 readData(char* data, qint64 maxSize);
    22   virtual qint64 writeData(const char* data, qint64 maxSize);
    23 
    24  signals:
    25 
    26  private slots:
    2724
    2825 private:
  • trunk/BNC/bnctabledlg.cpp

    r1334 r1345  
    4141#include "bnctabledlg.h"
    4242#include "bncgetthread.h"
     43#include "bncsocket.h"
    4344
    4445// Constructor
     
    162163  QByteArray _longitude;
    163164  QByteArray _nmea;
    164   QTcpSocket* socket = bncGetThread::request(url, _latitude, _longitude, _nmea, timeOut, msg);
     165  bncSocket* socket = bncGetThread::request(url, _latitude, _longitude, _nmea, timeOut, msg);
    165166
    166167  if (!socket) {
  • trunk/BNC/ntrip2test.cpp

    r1342 r1345  
    1313
    1414
    15 //  bncNetRequest* req1 = new bncNetRequest();
    16 //  QUrl url1("http://euref-ip.bkg.bund.de:2111/");
    17 //  req1->request(url1);
     15  bncNetRequest* req1 = new bncNetRequest();
     16  QUrl url1("http://euref-ip.bkg.bund.de:2111/");
     17  req1->request(url1);
    1818
    1919  bncNetRequest* req2 = new bncNetRequest();
    20   QUrl url2("http://ntrip2c:rtcm2c@euref-ip.bkg.bund.de:2111/TEST1");
     20  QUrl url2("http://ntrip2c:rtcm2c@euref-ip.bkg.bund.de:2111/TEST2");
    2121  req2->request(url2);
    2222
Note: See TracChangeset for help on using the changeset viewer.