Changeset 1387 in ntrip for trunk/BNC/bncgetthread.cpp


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

* empty log message *

File:
1 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 
Note: See TracChangeset for help on using the changeset viewer.