Changeset 1387 in ntrip


Ignore:
Timestamp:
Dec 29, 2008, 10:27:05 AM (15 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncgetthread.cpp

    r1377 r1387  
    5454#include "bncrinex.h"
    5555#include "bnczerodecoder.h"
    56 #include "bncnetquery.h"
     56#include "bncnetqueryv1.h"
     57#include "bncnetqueryv2.h"
    5758
    5859#include "RTCM/RTCM2Decoder.h"
     
    188189  else {
    189190    _rnx = new bncRinex(_staID, _mountPoint, _format, _latitude,
    190                         _longitude, _nmea, _ntripVersion);
     191                        _longitude, _nmea);
    191192  }
    192193  _rnx_set_position = false;
    193194
    194195  connect(((bncApp*)qApp), SIGNAL(newEphGPS(gpsephemeris)),
    195           this, SLOT(slotNewEphGPS(gpsephemeris)));
     196          this, SLOT(slotNewEphGPS(gpsephemeris)));
    196197
    197198  if (settings.value("serialMountPoint").toString() == _staID) {
     
    304305  if (!_rawInpFile) {
    305306    delete _query;
    306     _query = new bncNetQuery();
    307     _query->startRequest(_mountPoint);
     307    if (_ntripVersion == "2") {
     308      _query = new bncNetQueryV2();
     309    }
     310    else {
     311      _query = new bncNetQueryV1();
     312    }
     313    if (_nmea == "yes") {
     314      QByteArray gga = ggaString(_latitude, _longitude);
     315      _query->startRequest(_mountPoint, gga);
     316    }
     317    else {
     318      _query->startRequest(_mountPoint, "");
     319    }
    308320  }
    309321
     
    554566        }
    555567
    556         // RTCM scan output
    557         // ----------------
     568        // RTCM scan output
     569        // ----------------
    558570        if ( _checkMountPoint == _staID || _checkMountPoint == "ALL" ) {
    559571          QSettings settings;
     
    589601                ant3 = QString("%1 ").arg(_decoder->_antList[ii].zz,0,'f',4).toAscii();
    590602                switch (_decoder->_antList[ii].type) {
    591                 case GPSDecoder::t_antInfo::ARP: antT = "ARP"; break;
    592                 case GPSDecoder::t_antInfo::APC: antT = "APC"; break;
    593                 }
     603                case GPSDecoder::t_antInfo::ARP: antT = "ARP"; break;
     604                case GPSDecoder::t_antInfo::APC: antT = "APC"; break;
     605                }
    594606                emit(newMessage(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true));
    595607                emit(newMessage(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true));
    596608                emit(newMessage(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true));
    597                 if (_decoder->_antList[ii].height_f) {
    598                   QByteArray ant4 = QString("%1 ").arg(_decoder->_antList[ii].height,0,'f',4).toAscii();
    599                   emit(newMessage(_staID + ": Antenna height above marker "  + ant4 + "m", true));
    600                 }
    601                 emit(newAntCrd(_staID,
    602                              _decoder->_antList[ii].xx, _decoder->_antList[ii].yy, _decoder->_antList[ii].zz,
    603                              antT));
     609                if (_decoder->_antList[ii].height_f) {
     610                  QByteArray ant4 = QString("%1 ").arg(_decoder->_antList[ii].height,0,'f',4).toAscii();
     611                  emit(newMessage(_staID + ": Antenna height above marker "  + ant4 + "m", true));
     612                }
     613                emit(newAntCrd(_staID,
     614                             _decoder->_antList[ii].xx, _decoder->_antList[ii].yy, _decoder->_antList[ii].zz,
     615                             antT));
    604616              }
    605617            }
    606618          }
    607619          if ( _checkMountPoint == "ANTCRD_ONLY" && _decoder->_antList.size() ) {
    608             for (int ii=0;ii<_decoder->_antList.size();++ii) {
    609               QByteArray antT;
    610               switch (_decoder->_antList[ii].type) {
    611               case GPSDecoder::t_antInfo::ARP: antT = "ARP"; break;
    612               case GPSDecoder::t_antInfo::APC: antT = "APC"; break;
    613               }
    614               emit(newAntCrd(_staID,
    615                            _decoder->_antList[ii].xx, _decoder->_antList[ii].yy, _decoder->_antList[ii].zz,
    616                            antT));
    617             }
     620            for (int ii=0;ii<_decoder->_antList.size();++ii) {
     621              QByteArray antT;
     622              switch (_decoder->_antList[ii].type) {
     623              case GPSDecoder::t_antInfo::ARP: antT = "ARP"; break;
     624              case GPSDecoder::t_antInfo::APC: antT = "APC"; break;
     625              }
     626              emit(newAntCrd(_staID,
     627                           _decoder->_antList[ii].xx, _decoder->_antList[ii].yy, _decoder->_antList[ii].zz,
     628                           antT));
     629            }
    618630          }
    619631        }
    620        
     632       
    621633        _decoder->_typeList.clear();
    622634        _decoder->_antType.clear();
    623635        _decoder->_antList.clear();
    624636
    625         // Loop over all observations (observations output)
    626         // ------------------------------------------------
     637        // Loop over all observations (observations output)
     638        // ------------------------------------------------
    627639        QListIterator<p_obs> it(_decoder->_obsList);
    628640        while (it.hasNext()) {
     
    720732          // ------------
    721733          if (_rnx) {
    722             bool dump = true;
     734            bool dump = true;
    723735
    724736            //// // RTCMv2 XYZ
     
    726738            //// RTCM2Decoder* decoder2 = dynamic_cast<RTCM2Decoder*>(_decoder);
    727739            //// if ( decoder2 && !_rnx_set_position ) {
    728             ////   double stax, stay, staz;
    729             ////   double dL1[3], dL2[3];
    730             ////   if ( decoder2->getStaCrd(stax, stay, staz,
     740            ////   double stax, stay, staz;
     741            ////   double dL1[3], dL2[3];
     742            ////   if ( decoder2->getStaCrd(stax, stay, staz,
    731743            ////                            dL1[0], dL1[1], dL1[2],
    732744            ////                            dL2[0], dL2[1], dL2[2]) == success ) {
    733             ////
     745            ////
    734746            ////     if ( _checkMountPoint == _staID || _checkMountPoint == "ALL" ) {
    735747            ////       QString ant1;
     
    753765            ////       emit(newMessage(_staID + ": L2 APC DZ " + ant1.toAscii() + "m" ));
    754766            ////     }
    755             ////        _rnx_set_position = true;
     767            ////        _rnx_set_position = true;
    756768            ////   }
    757769            //// } 
    758770
    759             if ( dump ) {
    760               long iSec    = long(floor(obs->_o.GPSWeeks+0.5));
    761               long newTime = obs->_o.GPSWeek * 7*24*3600 + iSec;
    762               if (_samplingRate == 0 || iSec % _samplingRate == 0) {
    763                 _rnx->deepCopy(obs);
    764               }
    765               _rnx->dumpEpoch(newTime);
     771            if ( dump ) {
     772              long iSec    = long(floor(obs->_o.GPSWeeks+0.5));
     773              long newTime = obs->_o.GPSWeek * 7*24*3600 + iSec;
     774              if (_samplingRate == 0 || iSec % _samplingRate == 0) {
     775                _rnx->deepCopy(obs);
     776              }
     777              _rnx->dumpEpoch(newTime);
    766778            }
    767779          }
    768780
    769           // Emit new observation signal
    770           // ---------------------------
     781          // Emit new observation signal
     782          // ---------------------------
    771783          bool firstObs = (obs == _decoder->_obsList.first());
    772784          obs->_status = t_obs::posted;
     
    881893  }
    882894}
    883 
  • trunk/BNC/bncnetquery.h

    r1383 r1387  
    1616            (bncApp*) qApp, SLOT(slotMessage(const QByteArray,bool)));
    1717  }
    18   virtual ~bncNetQuery();
     18  virtual ~bncNetQuery() {};
    1919
    2020  virtual void waitForRequestResult(const QUrl& url, QByteArray& outData) = 0;
  • trunk/BNC/bncrinex.cpp

    r1386 r1387  
    6363bncRinex::bncRinex(const QByteArray& statID, const QUrl& mountPoint,
    6464                   const QByteArray& format, const QByteArray& latitude,
    65                    const QByteArray& longitude, const QByteArray& nmea,
    66                    const QByteArray& ntripVersion) {
     65                   const QByteArray& longitude, const QByteArray& nmea) {
     66
    6767  _statID        = statID;
    6868  _mountPoint    = mountPoint;
     
    7171  _longitude     = longitude;
    7272  _nmea          = nmea;
    73   _ntripVersion  = ntripVersion;
    7473  _headerWritten = false;
    7574  _reconnectFlag = false;
  • trunk/BNC/bncrinex.h

    r1353 r1387  
    4040   bncRinex(const QByteArray& statID, const QUrl& mountPoint,
    4141            const QByteArray& format, const QByteArray& latitude,
    42             const QByteArray& longitude, const QByteArray& nmea,
    43             const QByteArray& ntripVersion);
     42            const QByteArray& longitude, const QByteArray& nmea);
    4443   ~bncRinex();
    4544   void deepCopy(const p_obs obs);
     
    8281   QByteArray    _longitude;
    8382   QByteArray    _nmea;
    84    QByteArray    _ntripVersion;
    8583   bool          _reconnectFlag;
    8684   QDate         _skeletonDate;
  • trunk/BNC/bnctabledlg.cpp

    r1378 r1387  
    4343#include "bnctabledlg.h"
    4444#include "bncgetthread.h"
    45 #include "bncnetquery.h"
     45#include "bncnetqueryv2.h"
    4646
    4747using namespace std;
     
    171171  url.setPath("/");
    172172
    173   bncNetQuery query;
     173  bncNetQueryV2 query;
    174174  QByteArray outData;
    175175  query.waitForRequestResult(url, outData);
  • trunk/BNC/bncutils.cpp

    r1384 r1387  
    129129//
    130130////////////////////////////////////////////////////////////////////////////
    131 QString ggaString(const QByteArray& latitude, const QByteArray& longitude) {
     131QByteArray ggaString(const QByteArray& latitude, const QByteArray& longitude) {
    132132
    133133  double lat = strtod(latitude,NULL);
     
    166166  gga += QString("*%1").arg(XOR, 2, 16, QLatin1Char('0'));
    167167
    168   return gga;
     168  return gga.toAscii();
    169169}
  • trunk/BNC/bncutils.h

    r1381 r1387  
    3737QDateTime currentDateAndTimeGPS();
    3838
    39 QString ggaString(const QByteArray& latitude, const QByteArray& longitude);
     39QByteArray ggaString(const QByteArray& latitude, const QByteArray& longitude);
    4040
    4141#endif
Note: See TracChangeset for help on using the changeset viewer.