Changeset 3532 in ntrip
- Timestamp:
- Dec 16, 2011, 6:29:59 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncgetthread.cpp
r3530 r3532 136 136 _serialPort = 0; 137 137 138 if (settings.value("serialMountPoint").toString() == _staID) { 138 if (!_staID.isEmpty() && 139 settings.value("serialMountPoint").toString() == _staID) { 139 140 _serialPort = new QextSerialPort(settings.value("serialPortName").toString() ); 140 141 _serialPort->setTimeout(0,100); … … 264 265 } 265 266 267 if (!_staID.isEmpty()) { 268 _latencyChecker = new latencyChecker(_staID); 269 } 270 else { 271 _latencyChecker = 0; 272 } 273 } 274 275 // Instantiate the decoder 276 ////////////////////////////////////////////////////////////////////////////// 277 t_irc bncGetThread::initDecoder() { 278 279 if (_format.indexOf("RTCM_2") != -1 || _format.indexOf("RTCM2") != -1 || 280 _format.indexOf("RTCM 2") != -1 ) { 281 emit(newMessage(_staID + ": Get data in RTCM 2.x format", true)); 282 _decoders[_staID] = new RTCM2Decoder(_staID.data()); 283 } 284 else if (_format.indexOf("RTCM_3") != -1 || _format.indexOf("RTCM3") != -1 || 285 _format.indexOf("RTCM 3") != -1 ) { 286 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)), 289 this, SIGNAL(newMessage(QByteArray,bool))); 290 } 291 else if (_format.indexOf("GPSS") != -1 || _format.indexOf("BNC") != -1) { 292 emit(newMessage(_staID + ": Get Data in GPSS format", true)); 293 _decoders[_staID] = new gpssDecoder(); 294 } 295 else if (_format.indexOf("ZERO") != -1) { 296 emit(newMessage(_staID + ": Get data in original format", true)); 297 _decoders[_staID] = new bncZeroDecoder(_staID); 298 } 299 else if (_format.indexOf("RTNET") != -1) { 300 emit(newMessage(_staID + ": Get data in RTNet format", true)); 301 _decoders[_staID] = new bncRtnetDecoder(); 302 } 303 else if (_format.indexOf("HASS2ASCII") != -1) { 304 emit(newMessage(_staID + ": Get data in HASS2ASCII format", true)); 305 _decoders[_staID] = new hassDecoder(_staID); 306 } 307 else { 308 emit(newMessage(_staID + ": Unknown data format " + _format, true)); 309 _isToBeDeleted = true; 310 return failure; 311 } 312 313 msleep(100); //sleep 0.1 sec 314 315 if (decoder()) { 316 decoder()->initRinex(_staID, _mountPoint, _latitude, _longitude, 317 _nmea, _ntripVersion); 318 319 } 320 266 321 // Initialize PPP Client? 267 322 // ---------------------- 268 323 #ifndef MLS_SOFTWARE 324 bncSettings settings; 269 325 if (settings.value("pppMount").toString() == _staID) { 270 326 _PPPclient = new bncPPPclient(_staID); 327 bncApp* app = (bncApp*) qApp; 271 328 app->_bncPPPclient = _PPPclient; 272 329 qRegisterMetaType<bncTime>("bncTime"); … … 278 335 #endif 279 336 280 _latencyChecker = new latencyChecker(_staID);281 }282 283 // Instantiate the decoder284 //////////////////////////////////////////////////////////////////////////////285 t_irc bncGetThread::initDecoder() {286 287 if (_format.indexOf("RTCM_2") != -1 || _format.indexOf("RTCM2") != -1 ||288 _format.indexOf("RTCM 2") != -1 ) {289 emit(newMessage(_staID + ": Get data in RTCM 2.x format", true));290 _decoders[_staID] = new RTCM2Decoder(_staID.data());291 }292 else if (_format.indexOf("RTCM_3") != -1 || _format.indexOf("RTCM3") != -1 ||293 _format.indexOf("RTCM 3") != -1 ) {294 emit(newMessage(_staID + ": Get data in RTCM 3.x format", true));295 _decoders[_staID] = new RTCM3Decoder(_staID, _rawFile);296 connect((RTCM3Decoder*) decoder(), SIGNAL(newMessage(QByteArray,bool)),297 this, SIGNAL(newMessage(QByteArray,bool)));298 }299 else if (_format.indexOf("GPSS") != -1 || _format.indexOf("BNC") != -1) {300 emit(newMessage(_staID + ": Get Data in GPSS format", true));301 _decoders[_staID] = new gpssDecoder();302 }303 else if (_format.indexOf("ZERO") != -1) {304 emit(newMessage(_staID + ": Get data in original format", true));305 _decoders[_staID] = new bncZeroDecoder(_staID);306 }307 else if (_format.indexOf("RTNET") != -1) {308 emit(newMessage(_staID + ": Get data in RTNet format", true));309 _decoders[_staID] = new bncRtnetDecoder();310 }311 else if (_format.indexOf("HASS2ASCII") != -1) {312 emit(newMessage(_staID + ": Get data in HASS2ASCII format", true));313 _decoders[_staID] = new hassDecoder(_staID);314 }315 else {316 emit(newMessage(_staID + ": Unknown data format " + _format, true));317 _isToBeDeleted = true;318 return failure;319 }320 321 msleep(100); //sleep 0.1 sec322 323 if (decoder()) {324 decoder()->initRinex(_staID, _mountPoint, _latitude, _longitude,325 _nmea, _ntripVersion);326 327 }328 329 337 return success; 330 338 } … … 386 394 387 395 if (tryReconnect() != success) { 388 _latencyChecker->checkReconnect(); 396 if (_latencyChecker) { 397 _latencyChecker->checkReconnect(); 398 } 389 399 continue; 390 400 } … … 422 432 // ------------------ 423 433 if (nBytes == 0) { 424 _latencyChecker->checkReconnect(); 434 if (_latencyChecker) { 435 _latencyChecker->checkReconnect(); 436 } 425 437 emit(newMessage(_staID + ": Data timeout, reconnecting", true)); 426 438 msleep(10000); //sleep 10 sec, G. Weber … … 455 467 // Perform various scans and checks 456 468 // -------------------------------- 457 _latencyChecker->checkOutage(irc == success); 458 _latencyChecker->checkObsLatency(decoder()->_obsList); 459 _latencyChecker->checkCorrLatency(decoder()->corrGPSEpochTime()); 460 461 emit newLatency(_staID, _latencyChecker->currentLatency()); 469 if (_latencyChecker) { 470 _latencyChecker->checkOutage(irc == success); 471 _latencyChecker->checkObsLatency(decoder()->_obsList); 472 _latencyChecker->checkCorrLatency(decoder()->corrGPSEpochTime()); 473 474 emit newLatency(_staID, _latencyChecker->currentLatency()); 475 } 462 476 463 477 scanRTCM();
Note:
See TracChangeset
for help on using the changeset viewer.