Changeset 3558 in ntrip


Ignore:
Timestamp:
Dec 24, 2011, 8:30:36 AM (13 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncgetthread.cpp

    r3549 r3558  
    285285           _format.indexOf("RTCM 3") != -1 ) {
    286286    emit(newMessage(_staID + ": Get data in RTCM 3.x format", true));
    287     _decoders[_staID] = new RTCM3Decoder(_staID, _rawFile);
    288     connect((RTCM3Decoder*) decoder(), SIGNAL(newMessage(QByteArray,bool)),
     287    RTCM3Decoder* newDecoder = new RTCM3Decoder(_staID, _rawFile);
     288    _decoders[_staID] = newDecoder;
     289    connect((RTCM3Decoder*) newDecoder, SIGNAL(newMessage(QByteArray,bool)),
    289290            this, SIGNAL(newMessage(QByteArray,bool)));
    290291  }
     
    313314  msleep(100); //sleep 0.1 sec
    314315 
    315   if (decoder()) {
    316     decoder()->initRinex(_staID, _mountPoint, _latitude, _longitude,
    317                          _nmea, _ntripVersion);
    318 
     316  if (_decoders.contains(_staID)) {
     317    _decoders[_staID]->initRinex(_staID, _mountPoint, _latitude, _longitude,
     318                                 _nmea, _ntripVersion);
     319  }
     320  else {
     321    emit(newMessage(_staID + ": no decoder initialized " + _format, true));
     322    _isToBeDeleted = true;
     323    return failure;
    319324  }
    320325
     
    342347GPSDecoder* bncGetThread::decoder() {
    343348  if (_decoders.contains(_staID) || initDecoder() == success) {
    344     return _decoders.value(_staID);
     349    return _decoders[_staID];
    345350  }
    346351  else {
     
    642647void bncGetThread::scanRTCM() {
    643648
     649  if (!decoder()) {
     650    return;
     651  }
     652
    644653  bncSettings settings;
    645654  if ( Qt::CheckState(settings.value("scanRTCM").toInt()) == Qt::Checked ) {
     
    746755//////////////////////////////////////////////////////////////////////////////
    747756void bncGetThread::slotNewEphGPS(gpsephemeris gpseph) {
     757
     758  if (!decoder()) {
     759    return;
     760  }
     761
    748762  RTCM2Decoder* decoder2 = dynamic_cast<RTCM2Decoder*>(decoder());
    749763  RTCM3Decoder* decoder3 = dynamic_cast<RTCM3Decoder*>(decoder());
Note: See TracChangeset for help on using the changeset viewer.