- Timestamp:
- Dec 27, 2008, 12:23:20 PM (16 years ago)
- Location:
- trunk/BNC
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnc.pro
r1317 r1345 29 29 bnccaster.h bncrinex.h bncapp.h bncutils.h bnchlpdlg.h \ 30 30 bncconst.h bnchtml.h bnctableitem.h bnczerodecoder.h \ 31 bncsocket.h \ 31 32 RTCM/GPSDecoder.h RTCM/RTCM2.h RTCM/RTCM2Decoder.h \ 32 33 RTCM/RTCM2_2021.h RTCM/rtcm_utils.h \ … … 46 47 bnccaster.cpp bncrinex.cpp bncapp.cpp bncutils.cpp \ 47 48 bncconst.cpp bnchtml.cpp bnchlpdlg.cpp bnctableitem.cpp \ 48 bnczerodecoder.cpp 49 bnczerodecoder.cpp bncsocket.cpp \ 49 50 RTCM/RTCM2.cpp RTCM/RTCM2Decoder.cpp \ 50 51 RTCM/RTCM2_2021.cpp RTCM/rtcm_utils.cpp \ -
trunk/BNC/bncgetthread.cpp
r1331 r1345 54 54 #include "bncrinex.h" 55 55 #include "bnczerodecoder.h" 56 #include "bncsocket.h" 56 57 57 58 #include "RTCM/RTCM2Decoder.h" … … 303 304 // Connect to Caster, send the Request (static) 304 305 //////////////////////////////////////////////////////////////////////////// 305 QTcpSocket* bncGetThread::request(const QUrl& mountPoint,306 307 308 306 bncSocket* bncGetThread::request(const QUrl& mountPoint, 307 QByteArray& latitude, QByteArray& longitude, 308 QByteArray& nmea, int timeOut, 309 QString& msg) { 309 310 310 311 // Connect the Socket … … 314 315 int proxyPort = settings.value("proxyPort").toInt(); 315 316 316 QTcpSocket* socket = new QTcpSocket();317 bncSocket* socket = new bncSocket(new QTcpSocket()); 317 318 if ( proxyHost.isEmpty() ) { 318 319 socket->connectToHost(mountPoint.host(), mountPoint.port()); -
trunk/BNC/bncgetthread.h
r1319 r1345 37 37 class bncRinex; 38 38 class QextSerialPort; 39 class bncSocket; 39 40 40 41 class bncGetThread : public QThread { … … 51 52 ~bncGetThread(); 52 53 53 static QTcpSocket* request(const QUrl& mountPoint, QByteArray& latitude, QByteArray& longitude,54 54 static bncSocket* request(const QUrl& mountPoint, QByteArray& latitude, QByteArray& longitude, 55 QByteArray& nmea, int timeOut, QString& msg); 55 56 56 57 QByteArray staID() const {return _staID;} … … 80 81 void callScript(const char* _comment); 81 82 GPSDecoder* _decoder; 82 QTcpSocket*_socket;83 bncSocket* _socket; 83 84 QUrl _mountPoint; 84 85 QByteArray _staID; -
trunk/BNC/bncnetrequest.cpp
r1343 r1345 99 99 while (it.hasNext()) { 100 100 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; 102 110 delete obs; 103 111 } -
trunk/BNC/bncrinex.cpp
r1154 r1345 54 54 #include "bnctabledlg.h" 55 55 #include "bncgetthread.h" 56 #include "bncsocket.h" 56 57 #include "RTCM3/rtcm3torinex.h" 57 58 … … 156 157 QByteArray _longitude; 157 158 QByteArray _nmea; 158 QTcpSocket* socket = bncGetThread::request(url, _latitude, _longitude, _nmea, timeOut, msg);159 bncSocket* socket = bncGetThread::request(url, _latitude, _longitude, _nmea, timeOut, msg); 159 160 160 161 if (socket) { -
trunk/BNC/bncsocket.cpp
r1344 r1345 36 36 //////////////////////////////////////////////////////////////////////////// 37 37 void bncSocket::connectToHost(const QString &hostName, quint16 port, 38 OpenMode mode) {38 QIODevice::OpenMode mode) { 39 39 _socket->connectToHost(hostName, port, mode); 40 40 } … … 54 54 // 55 55 //////////////////////////////////////////////////////////////////////////// 56 qint64 bncSocket::readData(char* data, qint64 maxSize) {57 return _socket->read(data, maxSize);56 void bncSocket::close() { 57 _socket->close(); 58 58 } 59 59 60 60 // 61 61 //////////////////////////////////////////////////////////////////////////// 62 qint64 bncSocket:: writeData(const char* data, qint64 maxSize){63 return _socket-> write(data, maxSize);62 qint64 bncSocket::bytesAvailable() const { 63 return _socket->bytesAvailable(); 64 64 } 65 65 66 // 67 //////////////////////////////////////////////////////////////////////////// 68 bool bncSocket::canReadLine() const { 69 return _socket->canReadLine(); 70 } 71 72 // 73 //////////////////////////////////////////////////////////////////////////// 74 QByteArray bncSocket::readLine(qint64 maxlen) { 75 return _socket->readLine(maxlen); 76 } 77 78 // 79 //////////////////////////////////////////////////////////////////////////// 80 bool bncSocket::waitForReadyRead(int msecs) { 81 return _socket->waitForReadyRead(msecs); 82 } 83 84 // 85 //////////////////////////////////////////////////////////////////////////// 86 qint64 bncSocket::read(char* data, qint64 maxlen) { 87 return _socket->read(data, maxlen); 88 } 89 90 // 91 //////////////////////////////////////////////////////////////////////////// 92 qint64 bncSocket::write(const char* data, qint64 len) { 93 return _socket->write(data, len); 94 } 95 96 // 97 //////////////////////////////////////////////////////////////////////////// 98 bool bncSocket::waitForBytesWritten(int msecs) { 99 return _socket->waitForBytesWritten(msecs); 100 } -
trunk/BNC/bncsocket.h
r1344 r1345 4 4 #include <QtNetwork> 5 5 6 class bncSocket : public QIODevice { 7 Q_OBJECT 6 class bncSocket : public QObject { 8 7 9 8 public: … … 11 10 ~bncSocket(); 12 11 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); 18 23 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:27 24 28 25 private: -
trunk/BNC/bnctabledlg.cpp
r1334 r1345 41 41 #include "bnctabledlg.h" 42 42 #include "bncgetthread.h" 43 #include "bncsocket.h" 43 44 44 45 // Constructor … … 162 163 QByteArray _longitude; 163 164 QByteArray _nmea; 164 QTcpSocket* socket = bncGetThread::request(url, _latitude, _longitude, _nmea, timeOut, msg);165 bncSocket* socket = bncGetThread::request(url, _latitude, _longitude, _nmea, timeOut, msg); 165 166 166 167 if (!socket) { -
trunk/BNC/ntrip2test.cpp
r1342 r1345 13 13 14 14 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); 18 18 19 19 bncNetRequest* req2 = new bncNetRequest(); 20 QUrl url2("http://ntrip2c:rtcm2c@euref-ip.bkg.bund.de:2111/TEST 1");20 QUrl url2("http://ntrip2c:rtcm2c@euref-ip.bkg.bund.de:2111/TEST2"); 21 21 req2->request(url2); 22 22
Note:
See TracChangeset
for help on using the changeset viewer.