Changeset 1384 in ntrip


Ignore:
Timestamp:
Dec 29, 2008, 9:51:43 AM (15 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncnetqueryv1.cpp

    r1383 r1384  
    4040//
    4141////////////////////////////////////////////////////////////////////////////
    42 void bncNetQueryV1::close() {
    43   if (_socket) {
    44     _socket->close();
    45   }
     42void bncNetQueryV1::waitForRequestResult(const QUrl& url, QByteArray& outData) {
    4643}
    4744
    4845//
    4946////////////////////////////////////////////////////////////////////////////
    50 qint64 bncNetQueryV1::bytesAvailable() const {
    51   if (_socket) {
    52     return _socket->bytesAvailable();
    53   }
    54   else {
    55     return 0;
    56   }
    57 }
     47void bncNetQueryV1::waitForReadyRead(QByteArray& outData) {
    5848
    59 //
    60 ////////////////////////////////////////////////////////////////////////////
    61 bool bncNetQueryV1::canReadLine() const {
    62   if (_socket) {
    63     return _socket->canReadLine();
    64   }
    65   else {
    66     return false;
    67   }
    68 }
    69 
    70 //
    71 ////////////////////////////////////////////////////////////////////////////
    72 QByteArray bncNetQueryV1::readLine() {
    73   if (_socket) {
    74     return _socket->readLine();
    75   }
    76   else {
    77     return "";
    78   }
    79 }
    80 
    81 //
    82 ////////////////////////////////////////////////////////////////////////////
    83 void bncNetQueryV1::waitForReadyRead(int msecs) {
    84   if (_socket) {
    85     _socket->waitForReadyRead(msecs);
    86   }
    87 }
    88 
    89 //
    90 ////////////////////////////////////////////////////////////////////////////
    91 QByteArray bncNetQueryV1::read(qint64 maxSize) {
    92   if (_socket) {
    93     return _socket->read(maxSize);
    94   }
    95   else {
    96     return "";
    97   }
    9849}
    9950
    10051// Connect to Caster, send the Request
    10152////////////////////////////////////////////////////////////////////////////
    102 t_irc bncNetQueryV1::request(const QUrl& mountPoint, const QByteArray& latitude,
    103                          const QByteArray& longitude, const QByteArray& nmea,
    104                          const QByteArray& ntripVersion,
    105                          int timeOut, QString& msg) {
     53void bncNetQueryV1::startRequest(const QUrl& url, const QByteArray& gga) {
    10654
    10755  delete _socket;
     
    161109  // --------------------------------
    162110  if ((nmea == "yes") && (hlp.path().length() > 2) && (hlp.path().indexOf(".skl") < 0)) {
    163     reqStr += "$" + ggaString(latitude, longitude) + "\r\n";
     111    reqStr += ggaString(latitude, longitude) + "\r\n";
    164112  }
    165113
  • trunk/BNC/bncnetqueryv1.h

    r1383 r1384  
    55
    66class bncNetQueryV1 : public bncNetQuery {
    7  Q_OBJECT
    8 
    97 public:
    108  bncNetQueryV1();
    11   ~bncNetQueryV1();
     9  virtual ~bncNetQueryV1();
    1210
    13   void       close();
    14   qint64     bytesAvailable() const;
    15   bool       canReadLine() const;
    16   QByteArray readLine();
    17   void       waitForReadyRead(int msecs = 30000);
    18   QByteArray read(qint64 maxSize);
    19 
    20   t_irc request(const QUrl& mountPoint, const QByteArray& latitude,
    21                 const QByteArray& longitude, const QByteArray& nmea,
    22                 const QByteArray& ntripVersion, int timeOut, QString& msg);
    23 
    24  signals:
    25   void newMessage(QByteArray msg, bool showOnScreen);
    26 
    27  private slots:
     11  virtual void waitForRequestResult(const QUrl& url, QByteArray& outData);
     12  virtual void startRequest(const QUrl& url, const QByteArray& gga);
     13  virtual void waitForReadyRead(QByteArray& outData);
    2814
    2915 private:
    30   QTcpSocket*            _socket;
     16  QTcpSocket* _socket;
    3117};
    3218
  • trunk/BNC/bncnetqueryv2.h

    r1380 r1384  
    1515  virtual void waitForReadyRead(QByteArray& outData);
    1616
    17  signals:
    18 
    1917 private slots:
    2018  void slotError(QNetworkReply::NetworkError);
  • trunk/BNC/bncutils.cpp

    r1381 r1384  
    151151  ss=(double)ttime.second()+0.001*ttime.msec();
    152152  QString gga;
    153   gga += "GPGGA,";
     153  gga += "$GPGGA,";
    154154  gga += QString("%1%2%3,").arg((int)hh, 2, 10, QLatin1Char('0')).arg((int)mm, 2, 10, QLatin1Char('0')).arg((int)ss, 2, 10, QLatin1Char('0'));
    155155  gga += QString("%1%2,").arg((int)lat_deg,2, 10, QLatin1Char('0')).arg(lat_min, 7, 'f', 4, QLatin1Char('0'));
Note: See TracChangeset for help on using the changeset viewer.