Changeset 8083 in ntrip for branches/BNC_2.12/src/bncgetthread.cpp
- Timestamp:
- Mar 9, 2017, 12:32:12 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/BNC_2.12/src/bncgetthread.cpp
r8022 r8083 74 74 bncGetThread::bncGetThread(bncRawFile* rawFile) { 75 75 76 _rawFile 77 _format 78 _staID 79 _rawOutput 76 _rawFile = rawFile; 77 _format = rawFile->format(); 78 _staID = rawFile->staID(); 79 _rawOutput = false; 80 80 _ntripVersion = "N"; 81 81 … … 85 85 // Constructor 2 86 86 //////////////////////////////////////////////////////////////////////////// 87 bncGetThread::bncGetThread(const QUrl& mountPoint, 88 const QByteArray& format, 89 const QByteArray& latitude, 90 const QByteArray& longitude, 91 const QByteArray& nmea, 92 const QByteArray& ntripVersion) { 93 _rawFile = 0; 94 _mountPoint = mountPoint; 95 _staID = mountPoint.path().mid(1).toAscii(); 96 _format = format; 97 _latitude = latitude; 98 _longitude = longitude; 99 _nmea = nmea; 87 bncGetThread::bncGetThread(const QUrl& mountPoint, const QByteArray& format, 88 const QByteArray& latitude, const QByteArray& longitude, 89 const QByteArray& nmea, const QByteArray& ntripVersion) { 90 _rawFile = 0; 91 _mountPoint = mountPoint; 92 _staID = mountPoint.path().mid(1).toAscii(); 93 _format = format; 94 _latitude = latitude; 95 _longitude = longitude; 96 _nmea = nmea; 100 97 _ntripVersion = ntripVersion; 101 98 … … 120 117 121 118 connect(this, SIGNAL(newMessage(QByteArray,bool)), 122 119 BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 123 120 124 121 _isToBeDeleted = false; 125 _query 126 _nextSleep 127 _miscMount 128 _decoder 122 _query = 0; 123 _nextSleep = 0; 124 _miscMount = settings.value("miscMount").toString(); 125 _decoder = 0; 129 126 130 127 // NMEA Port … … 134 131 while (iSta.hasNext()) { 135 132 QStringList hlp = iSta.next().split(","); 136 if (hlp.size() < 10) {continue;} 133 if (hlp.size() < 10) { 134 continue; 135 } 137 136 QByteArray mp = hlp[0].toAscii(); 138 137 if (_staID == mp) { … … 142 141 if (nmeaPort != 0) { 143 142 _nmeaServer = new QTcpServer; 144 if ( !_nmeaServer->listen(QHostAddress::Any, nmeaPort)) {143 if (!_nmeaServer->listen(QHostAddress::Any, nmeaPort)) { 145 144 emit newMessage("bncCaster: Cannot listen on port", true); 146 } 147 else {148 connect(_nmeaServer, SIGNAL(newConnection()), this,SLOT(slotNewNMEAConnection()));149 connect(BNC_CORE, SIGNAL(newNMEAstr(QByteArray, QByteArray)), 150 this,SLOT(slotNewNMEAstr(QByteArray, QByteArray)));145 } else { 146 connect(_nmeaServer, SIGNAL(newConnection()), this, 147 SLOT(slotNewNMEAConnection())); 148 connect(BNC_CORE, SIGNAL(newNMEAstr(QByteArray, QByteArray)), this, 149 SLOT(slotNewNMEAstr(QByteArray, QByteArray))); 151 150 _nmeaSockets = new QList<QTcpSocket*>; 152 151 _nmeaPortsMap[_staID] = nmeaPort; … … 159 158 // Serial Port 160 159 // ----------- 161 _serialNMEA 160 _serialNMEA = NO_NMEA; 162 161 _serialOutFile = 0; 163 _serialPort = 0; 164 165 if (!_staID.isEmpty() && 166 settings.value("serialMountPoint").toString() == _staID) { 167 _serialPort = new QextSerialPort(settings.value("serialPortName").toString() ); 168 _serialPort->setTimeout(0,100); 162 _serialPort = 0; 163 164 if (!_staID.isEmpty() 165 && settings.value("serialMountPoint").toString() == _staID) { 166 _serialPort = new QextSerialPort( 167 settings.value("serialPortName").toString()); 168 _serialPort->setTimeout(0, 100); 169 169 170 170 // Baud Rate 171 171 // --------- 172 172 QString hlp = settings.value("serialBaudRate").toString(); 173 if 173 if (hlp == "110") { 174 174 _serialPort->setBaudRate(BAUD110); 175 } 176 else if (hlp == "300") { 175 } else if (hlp == "300") { 177 176 _serialPort->setBaudRate(BAUD300); 178 } 179 else if (hlp == "600") { 177 } else if (hlp == "600") { 180 178 _serialPort->setBaudRate(BAUD600); 181 } 182 else if (hlp == "1200") { 179 } else if (hlp == "1200") { 183 180 _serialPort->setBaudRate(BAUD1200); 184 } 185 else if (hlp == "2400") { 181 } else if (hlp == "2400") { 186 182 _serialPort->setBaudRate(BAUD2400); 187 } 188 else if (hlp == "4800") { 183 } else if (hlp == "4800") { 189 184 _serialPort->setBaudRate(BAUD4800); 190 } 191 else if (hlp == "9600") { 185 } else if (hlp == "9600") { 192 186 _serialPort->setBaudRate(BAUD9600); 193 } 194 else if (hlp == "19200") { 187 } else if (hlp == "19200") { 195 188 _serialPort->setBaudRate(BAUD19200); 196 } 197 else if (hlp == "38400") { 189 } else if (hlp == "38400") { 198 190 _serialPort->setBaudRate(BAUD38400); 199 } 200 else if (hlp == "57600") { 191 } else if (hlp == "57600") { 201 192 _serialPort->setBaudRate(BAUD57600); 202 } 203 else if (hlp == "115200") { 193 } else if (hlp == "115200") { 204 194 _serialPort->setBaudRate(BAUD115200); 205 195 } … … 208 198 // ------ 209 199 hlp = settings.value("serialParity").toString(); 210 if 200 if (hlp == "NONE") { 211 201 _serialPort->setParity(PAR_NONE); 212 } 213 else if (hlp == "ODD") { 202 } else if (hlp == "ODD") { 214 203 _serialPort->setParity(PAR_ODD); 215 } 216 else if (hlp == "EVEN") { 204 } else if (hlp == "EVEN") { 217 205 _serialPort->setParity(PAR_EVEN); 218 } 219 else if (hlp == "SPACE") { 206 } else if (hlp == "SPACE") { 220 207 _serialPort->setParity(PAR_SPACE); 221 208 } … … 224 211 // --------- 225 212 hlp = settings.value("serialDataBits").toString(); 226 if 213 if (hlp == "5") { 227 214 _serialPort->setDataBits(DATA_5); 228 } 229 else if (hlp == "6") { 215 } else if (hlp == "6") { 230 216 _serialPort->setDataBits(DATA_6); 231 } 232 else if (hlp == "7") { 217 } else if (hlp == "7") { 233 218 _serialPort->setDataBits(DATA_7); 234 } 235 else if (hlp == "8") { 219 } else if (hlp == "8") { 236 220 _serialPort->setDataBits(DATA_8); 237 221 } 238 222 hlp = settings.value("serialStopBits").toString(); 239 if 223 if (hlp == "1") { 240 224 _serialPort->setStopBits(STOP_1); 241 } 242 else if (hlp == "2") { 225 } else if (hlp == "2") { 243 226 _serialPort->setStopBits(STOP_2); 244 227 } … … 249 232 if (hlp == "XONXOFF") { 250 233 _serialPort->setFlowControl(FLOW_XONXOFF); 251 } 252 else if (hlp == "HARDWARE") { 234 } else if (hlp == "HARDWARE") { 253 235 _serialPort->setFlowControl(FLOW_HARDWARE); 254 } 255 else { 236 } else { 256 237 _serialPort->setFlowControl(FLOW_OFF); 257 238 } … … 259 240 // Open Serial Port 260 241 // ---------------- 261 _serialPort->open(QIODevice::ReadWrite |QIODevice::Unbuffered);242 _serialPort->open(QIODevice::ReadWrite | QIODevice::Unbuffered); 262 243 if (!_serialPort->isOpen()) { 263 244 delete _serialPort; … … 265 246 emit(newMessage((_staID + ": Cannot open serial port\n"), true)); 266 247 } 267 connect(_serialPort, SIGNAL(readyRead()), 268 this,SLOT(slotSerialReadyRead()));248 connect(_serialPort, SIGNAL(readyRead()), this, 249 SLOT(slotSerialReadyRead())); 269 250 270 251 // Automatic NMEA … … 276 257 if (!fName.isEmpty()) { 277 258 _serialOutFile = new QFile(fName); 278 if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) { 259 if (Qt::CheckState(settings.value("rnxAppend").toInt()) 260 == Qt::Checked) { 279 261 _serialOutFile->open(QIODevice::WriteOnly | QIODevice::Append); 280 } 281 else { 262 } else { 282 263 _serialOutFile->open(QIODevice::WriteOnly); 283 264 } … … 286 267 // Manual NMEA 287 268 // ----------- 288 if ((nmeaMode == "Manual GPGGA") || (nmeaMode == "Manual GNGGA")) {269 if ((nmeaMode == "Manual GPGGA") || (nmeaMode == "Manual GNGGA")) { 289 270 _serialNMEA = MANUAL_NMEA; 290 271 bncSettings settings; 291 272 _manualNMEASampl = settings.value("serialManualNMEASampling").toInt(); 292 QString hlp 273 QString hlp = settings.value("serialHeightNMEA").toString(); 293 274 if (hlp.isEmpty()) { 294 275 hlp = "0.0"; 295 276 } 296 277 QByteArray _serialHeightNMEA = hlp.toAscii(); 297 _manualNMEAString = ggaString(_latitude, _longitude, _serialHeightNMEA, nmeaMode); 278 _manualNMEAString = ggaString(_latitude, _longitude, _serialHeightNMEA, 279 nmeaMode); 298 280 } 299 281 } … … 301 283 if (!_staID.isEmpty()) { 302 284 _latencyChecker = new latencyChecker(_staID); 303 } 304 else { 285 obs = false; 286 ssrOrb = false; 287 ssrClk = false; 288 ssrOrbClk = false; 289 ssrCbi = false; 290 ssrPbi = false; 291 ssrVtec = false; 292 ssrUra = false; 293 ssrHr = false; 294 _oldSsrEpoch = 0; 295 _ssrEpoch = 0; 296 } else { 305 297 _latencyChecker = 0; 306 298 } … … 313 305 _decoder = 0; 314 306 315 if (_format.indexOf("RTCM_2") != -1 || _format.indexOf("RTCM2") != -1 ||316 _format.indexOf("RTCM 2") != -1) {307 if (_format.indexOf("RTCM_2") != -1 || _format.indexOf("RTCM2") != -1 308 || _format.indexOf("RTCM 2") != -1) { 317 309 emit(newMessage(_staID + ": Get data in RTCM 2.x format", true)); 318 310 _decoder = new RTCM2Decoder(_staID.data()); 319 } 320 else if (_format.indexOf("RTCM_3") != -1 || _format.indexOf("RTCM3") != -1 || 321 _format.indexOf("RTCM 3") != -1 ) { 311 } else if (_format.indexOf("RTCM_3") != -1 || _format.indexOf("RTCM3") != -1 312 || _format.indexOf("RTCM 3") != -1) { 322 313 emit(newMessage(_staID + ": Get data in RTCM 3.x format", true)); 323 314 RTCM3Decoder* newDecoder = new RTCM3Decoder(_staID, _rawFile); 324 315 _decoder = newDecoder; 325 316 connect((RTCM3Decoder*) newDecoder, SIGNAL(newMessage(QByteArray,bool)), 326 this, SIGNAL(newMessage(QByteArray,bool))); 327 } 328 else if (_format.indexOf("ZERO") != -1) { 317 this, SIGNAL(newMessage(QByteArray,bool))); 318 } else if (_format.indexOf("ZERO") != -1) { 329 319 emit(newMessage(_staID + ": Get data in original format", true)); 330 320 _decoder = new bncZeroDecoder(_staID); 331 } 332 else if (_format.indexOf("RTNET") != -1) { 321 } else if (_format.indexOf("RTNET") != -1) { 333 322 emit(newMessage(_staID + ": Get data in RTNet format", true)); 334 323 _decoder = new bncRtnetDecoder(); 335 } 336 else { 324 } else { 337 325 emit(newMessage(_staID + ": Unknown data format " + _format, true)); 338 326 _isToBeDeleted = true; … … 342 330 msleep(100); //sleep 0.1 sec 343 331 344 _decoder->initRinex(_staID, _mountPoint, _latitude, _longitude, 345 _nmea,_ntripVersion);332 _decoder->initRinex(_staID, _mountPoint, _latitude, _longitude, _nmea, 333 _ntripVersion); 346 334 347 335 if (_rawFile) { … … 357 345 if (!_rawFile) { 358 346 return _decoder; 359 } 360 else { 347 } else { 361 348 if (_decodersRaw.contains(_staID) || initDecoder() == success) { 362 349 return _decodersRaw[_staID]; … … 382 369 delete it.value(); 383 370 } 384 } 385 else { 371 } else { 386 372 delete _decoder; 387 373 } … … 398 384 _isToBeDeleted = true; 399 385 400 if (_nmeaPortsMap.contains(_staID)) {386 if (_nmeaPortsMap.contains(_staID)) { 401 387 _nmeaPortsMap.remove(_staID); 402 388 } … … 410 396 #ifdef BNC_DEBUG 411 397 if (BNC_CORE->mode() != t_bncCore::interactive) { 412 while (!isFinished()) {wait();} 398 while (!isFinished()) { 399 wait(); 400 } 413 401 delete this; 414 } 415 else { 416 if (!isRunning()) {delete this;} 402 } else { 403 if (!isRunning()) { 404 delete this; 405 } 417 406 } 418 407 #else 419 408 if (!isRunning()) {delete this;} 420 409 #endif 421 410 … … 450 439 decoder->_obsList.clear(); 451 440 } 452 } 453 else { 441 } else { 454 442 _decoder->_obsList.clear(); 455 443 } … … 458 446 // --------- 459 447 QByteArray data; 460 if 448 if (_query) { 461 449 _query->waitForReadyRead(data); 462 } 463 else if (_rawFile) { 450 } else if (_rawFile) { 464 451 data = _rawFile->readChunk(); 465 452 _format = _rawFile->format(); 466 _staID 453 _staID = _rawFile->staID(); 467 454 468 455 QCoreApplication::processEvents(); … … 486 473 msleep(10000); //sleep 10 sec, G. Weber 487 474 continue; 488 } 489 else { 475 } else { 490 476 emit newBytes(_staID, nBytes); 491 477 emit newRawData(_staID, data); … … 520 506 if (_latencyChecker) { 521 507 _latencyChecker->checkOutage(irc == success); 522 _latencyChecker->checkObsLatency(decoder()->_obsList); 523 _latencyChecker->checkCorrLatency(decoder()->corrGPSEpochTime()); 524 508 QListIterator<int> it(decoder()->_typeList); 509 _ssrEpoch = decoder()->corrGPSEpochTime(); 510 if (_oldSsrEpoch > 0 && _ssrEpoch && _ssrEpoch > _oldSsrEpoch) { 511 if (ssrOrb) { 512 _latencyChecker->checkCorrLatency(_oldSsrEpoch, 1057); 513 ssrOrb = false; 514 } 515 if (ssrClk) { 516 _latencyChecker->checkCorrLatency(_oldSsrEpoch, 1058); 517 ssrClk = false; 518 } 519 if (ssrOrbClk) { 520 _latencyChecker->checkCorrLatency(_oldSsrEpoch, 1060); 521 ssrOrbClk = false; 522 } 523 if (ssrCbi) { 524 _latencyChecker->checkCorrLatency(_oldSsrEpoch, 1059); 525 ssrCbi = false; 526 } 527 if (ssrPbi) { 528 _latencyChecker->checkCorrLatency(_oldSsrEpoch, 1265); 529 ssrPbi = false; 530 } 531 if (ssrVtec) { 532 _latencyChecker->checkCorrLatency(_oldSsrEpoch, 1264); 533 ssrVtec = false; 534 } 535 if (ssrUra) { 536 _latencyChecker->checkCorrLatency(_oldSsrEpoch, 1061); 537 ssrUra = false; 538 } 539 if (ssrHr) { 540 _latencyChecker->checkCorrLatency(_oldSsrEpoch, 1062); 541 ssrHr = false; 542 } 543 } 544 while (it.hasNext()) { 545 int rtcmType = it.next(); 546 if ((rtcmType >= 1001 && rtcmType <= 1004) || // legacy RTCM OBS 547 (rtcmType >= 1009 && rtcmType <= 1012) || // legacy RTCM OBS 548 (rtcmType >= 1071 && rtcmType <= 1127)) { // MSM RTCM OBS 549 obs = true; 550 } else if ((rtcmType >= 1057 && rtcmType <= 1068) || 551 (rtcmType >= 1240 && rtcmType <= 1270)) { 552 switch (rtcmType) { 553 case 1057: case 1063: case 1240: case 1246: case 1252: case 1258: 554 ssrOrb = true; 555 break; 556 case 1058: case 1064: case 1241: case 1247: case 1253: case 1259: 557 ssrClk = true; 558 break; 559 case 1060: case 1066: case 1243: case 1249: case 1255: case 1261: 560 ssrOrbClk = true; 561 break; 562 case 1059: case 1065: case 1242: case 1248: case 1254: case 1260: 563 ssrCbi = true; 564 break; 565 case 1265: case 1266: case 1267: case 1268: case 1269: case 1270: 566 ssrPbi = true; 567 break; 568 case 1264: 569 ssrVtec = true; 570 break; 571 case 1061: case 1067: case 1244: case 1250: case 1256: case 1262: 572 ssrUra = true; 573 break; 574 case 1062: case 1068: case 1245: case 1251: case 1257: case 1263: 575 ssrHr = true; 576 break; 577 } 578 } 579 } 580 if (obs) { 581 _latencyChecker->checkObsLatency(decoder()->_obsList); 582 } 583 _oldSsrEpoch = _ssrEpoch; 525 584 emit newLatency(_staID, _latencyChecker->currentLatency()); 526 585 } 527 528 586 miscScanRTCM(); 529 587 … … 543 601 if (wrongObservationEpoch) { 544 602 QString prn(obs._prn.toString().c_str()); 545 emit( newMessage(_staID + " (" + prn.toAscii() + ")" + ": Wrong observation epoch(s)", false) ); 603 emit(newMessage( 604 _staID + " (" + prn.toAscii() + ")" 605 + ": Wrong observation epoch(s)", false)); 546 606 continue; 547 607 } … … 552 612 if (!_rawFile) { 553 613 QString prn(obs._prn.toString().c_str()); 554 long iSec = long(floor(obs._time.gpssec()+0.5));555 long obsTime = obs._time.gpsw() *7*24*3600 + iSec;614 long iSec = long(floor(obs._time.gpssec() + 0.5)); 615 long obsTime = obs._time.gpsw() * 7 * 24 * 3600 + iSec; 556 616 QMap<QString, long>::const_iterator it = _prnLastEpo.find(prn); 557 617 if (it != _prnLastEpo.end()) { 558 618 long oldTime = it.value(); 559 if (obsTime <oldTime) {560 emit( newMessage(_staID +561 ": old observation " + prn.toAscii(),false));619 if (obsTime < oldTime) { 620 emit(newMessage(_staID + ": old observation " + prn.toAscii(), 621 false)); 562 622 continue; 563 } 564 else if (obsTime == oldTime) {565 emit( newMessage(_staID +566 ": observation coming more than once "+ prn.toAscii(), false));623 } else if (obsTime == oldTime) { 624 emit(newMessage( 625 _staID + ": observation coming more than once " 626 + prn.toAscii(), false)); 567 627 continue; 568 628 } … … 584 644 } 585 645 586 } 587 catch (Exception& exc) { 646 } catch (Exception& exc) { 588 647 emit(newMessage(_staID + " " + exc.what(), true)); 589 648 _isToBeDeleted = true; 590 } 591 catch (...) { 649 } catch (...) { 592 650 emit(newMessage(_staID + " bncGetThread exception", true)); 593 651 _isToBeDeleted = true; … … 611 669 decoder->setRinexReconnectFlag(false); 612 670 } 613 } 614 else { 671 } else { 615 672 _decoder->setRinexReconnectFlag(false); 616 673 } … … 625 682 if (_nextSleep == 0) { 626 683 _nextSleep = 1; 627 } 628 else { 684 } else { 629 685 _nextSleep = 2 * _nextSleep; 630 686 if (_nextSleep > 256) { … … 640 696 delete _query; 641 697 } 642 if 698 if (_ntripVersion == "U") { 643 699 _query = new bncNetQueryUdp(); 644 } 645 else if (_ntripVersion == "R") { 700 } else if (_ntripVersion == "R") { 646 701 _query = new bncNetQueryRtp(); 647 } 648 else if (_ntripVersion == "S") { 702 } else if (_ntripVersion == "S") { 649 703 _query = new bncNetQueryS(); 650 } 651 else if (_ntripVersion == "N") { 704 } else if (_ntripVersion == "N") { 652 705 _query = new bncNetQueryV0(); 653 } 654 else if (_ntripVersion == "UN") { 706 } else if (_ntripVersion == "UN") { 655 707 _query = new bncNetQueryUdp0(); 656 } 657 else if (_ntripVersion == "2") { 708 } else if (_ntripVersion == "2") { 658 709 _query = new bncNetQueryV2(false); 659 } 660 else if (_ntripVersion == "2s") { 710 } else if (_ntripVersion == "2s") { 661 711 _query = new bncNetQueryV2(true); 662 } 663 else { 712 } else { 664 713 _query = new bncNetQueryV1(); 665 714 } … … 668 717 _query->startRequest(_mountPoint, _manualNMEAString); 669 718 _lastManualNMEA = QDateTime::currentDateTime(); 670 } 671 else if (_serialNMEA == AUTO_NMEA) { 719 } else if (_serialNMEA == AUTO_NMEA) { 672 720 if (_serialPort) { 673 721 int nb = _serialPort->bytesAvailable(); … … 688 736 } 689 737 } 690 } 691 else { 738 } else { 692 739 _query->startRequest(_mountPoint, ""); 693 740 } … … 705 752 decoder->setRinexReconnectFlag(false); 706 753 } 707 } 708 else { 709 _decoder->setRinexReconnectFlag(false); 754 } else { 755 _decoder->setRinexReconnectFlag(false); 710 756 } 711 757 … … 717 763 void bncGetThread::miscScanRTCM() { 718 764 719 if ( !decoder()) {765 if (!decoder()) { 720 766 return; 721 767 } 722 768 723 769 bncSettings settings; 724 if ( Qt::CheckState(settings.value("miscScanRTCM").toInt()) == Qt::Checked) {725 726 if ( _miscMount == _staID || _miscMount == "ALL") {770 if (Qt::CheckState(settings.value("miscScanRTCM").toInt()) == Qt::Checked) { 771 772 if (_miscMount == _staID || _miscMount == "ALL") { 727 773 // RTCM message types 728 774 // ------------------ 729 775 for (int ii = 0; ii < decoder()->_typeList.size(); ii++) { 730 QString type = QString("%1 ").arg(decoder()->_typeList[ii]); 731 emit(newMessage(_staID + ": Received message type " + type.toAscii(), true)); 776 QString type = QString("%1 ").arg(decoder()->_typeList[ii]); 777 emit(newMessage(_staID + ": Received message type " + type.toAscii(), 778 true)); 732 779 } 733 780 … … 742 789 QString rnxStr('C'); 743 790 rnxStr.append(obs._obs[iFrq]->_rnxType2ch.c_str()); 744 if (_format.indexOf("RTCM_2") != -1 ||745 _format.indexOf("RTCM2") != -1 ||746 _format.indexOf("RTCM 2") != -1) {791 if (_format.indexOf("RTCM_2") != -1 792 || _format.indexOf("RTCM2") != -1 793 || _format.indexOf("RTCM 2") != -1) { 747 794 rnxStr = t_rnxObsFile::type3to2(obs._prn.system(), rnxStr); 748 795 } … … 755 802 QString rnxStr('L'); 756 803 rnxStr.append(obs._obs[iFrq]->_rnxType2ch.c_str()); 757 if (_format.indexOf("RTCM_2") != -1 ||758 _format.indexOf("RTCM2") != -1 ||759 _format.indexOf("RTCM 2") != -1) {804 if (_format.indexOf("RTCM_2") != -1 805 || _format.indexOf("RTCM2") != -1 806 || _format.indexOf("RTCM 2") != -1) { 760 807 rnxStr = t_rnxObsFile::type3to2(obs._prn.system(), rnxStr); 761 808 } … … 765 812 } 766 813 } 767 if (obs._obs[iFrq]->_dopplerValid) {814 if (obs._obs[iFrq]->_dopplerValid) { 768 815 QString rnxStr('D'); 769 816 rnxStr.append(obs._obs[iFrq]->_rnxType2ch.c_str()); 770 if (_format.indexOf("RTCM_2") != -1 ||771 _format.indexOf("RTCM2") != -1 ||772 _format.indexOf("RTCM 2") != -1) {817 if (_format.indexOf("RTCM_2") != -1 818 || _format.indexOf("RTCM2") != -1 819 || _format.indexOf("RTCM 2") != -1) { 773 820 rnxStr = t_rnxObsFile::type3to2(obs._prn.system(), rnxStr); 774 821 } … … 778 825 } 779 826 } 780 if (obs._obs[iFrq]->_snrValid) {827 if (obs._obs[iFrq]->_snrValid) { 781 828 QString rnxStr('S'); 782 829 rnxStr.append(obs._obs[iFrq]->_rnxType2ch.c_str()); 783 if (_format.indexOf("RTCM_2") != -1 ||784 _format.indexOf("RTCM2") != -1 ||785 _format.indexOf("RTCM 2") != -1) {830 if (_format.indexOf("RTCM_2") != -1 831 || _format.indexOf("RTCM2") != -1 832 || _format.indexOf("RTCM 2") != -1) { 786 833 rnxStr = t_rnxObsFile::type3to2(obs._prn.system(), rnxStr); 787 834 } … … 796 843 QTextStream str(&msg); 797 844 QString s; 798 str << obs._prn.system() << " " << s.sprintf("%2d", rnxTypes.size()) << " "; 845 str << obs._prn.system() << " " 846 << s.sprintf("%2d", rnxTypes.size()) << " "; 799 847 for (int iType = 0; iType < rnxTypes.size(); iType++) { 800 848 str << " " << rnxTypes[iType]; 801 849 } 802 emit(newMessage(_staID + ": Observation Types: " + msg.toAscii(), true)); 850 emit(newMessage(_staID + ": Observation Types: " + msg.toAscii(), 851 true)); 803 852 } 804 853 } … … 807 856 // ------------------------- 808 857 for (int ii = 0; ii < decoder()->_antType.size(); ii++) { 809 QString ant1 = 858 QString ant1 = QString("%1 ").arg(decoder()->_antType[ii]); 810 859 emit(newMessage(_staID + ": Antenna descriptor " + ant1.toAscii(), true)); 811 860 } … … 813 862 // RTCM Antenna Coordinates 814 863 // ------------------------ 815 for (int ii =0; ii < decoder()->_antList.size(); ii++) {864 for (int ii = 0; ii < decoder()->_antList.size(); ii++) { 816 865 QByteArray antT; 817 if 866 if (decoder()->_antList[ii].type == GPSDecoder::t_antInfo::ARP) { 818 867 antT = "ARP"; 819 } 820 else if (decoder()->_antList[ii].type == GPSDecoder::t_antInfo::APC) { 868 } else if (decoder()->_antList[ii].type == GPSDecoder::t_antInfo::APC) { 821 869 antT = "APC"; 822 870 } 823 871 QByteArray ant1, ant2, ant3; 824 ant1 = QString("%1 ").arg(decoder()->_antList[ii].xx,0,'f',4).toAscii(); 825 ant2 = QString("%1 ").arg(decoder()->_antList[ii].yy,0,'f',4).toAscii(); 826 ant3 = QString("%1 ").arg(decoder()->_antList[ii].zz,0,'f',4).toAscii(); 872 ant1 = 873 QString("%1 ").arg(decoder()->_antList[ii].xx, 0, 'f', 4).toAscii(); 874 ant2 = 875 QString("%1 ").arg(decoder()->_antList[ii].yy, 0, 'f', 4).toAscii(); 876 ant3 = 877 QString("%1 ").arg(decoder()->_antList[ii].zz, 0, 'f', 4).toAscii(); 827 878 emit(newMessage(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true)); 828 879 emit(newMessage(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true)); … … 831 882 if (decoder()->_antList[ii].height_f) { 832 883 hh = decoder()->_antList[ii].height; 833 QByteArray ant4 = QString("%1 ").arg(hh,0,'f',4).toAscii(); 834 emit(newMessage(_staID + ": Antenna height above marker " + ant4 + "m", true)); 884 QByteArray ant4 = QString("%1 ").arg(hh, 0, 'f', 4).toAscii(); 885 emit(newMessage( 886 _staID + ": Antenna height above marker " + ant4 + "m", true)); 835 887 } 836 888 emit(newAntCrd(_staID, decoder()->_antList[ii].xx, 837 decoder()->_antList[ii].yy, decoder()->_antList[ii].zz, 838 hh, antT)); 889 decoder()->_antList[ii].yy, decoder()->_antList[ii].zz, hh, antT)); 839 890 } 840 891 … … 844 895 bool allFound = true; 845 896 QString slot = decoder()->_gloFrq; 846 slot.replace(" ", " ").replace(" ",":");897 slot.replace(" ", " ").replace(" ", ":"); 847 898 if (_gloSlots.indexOf(slot) == -1) { 848 899 _gloSlots.append(slot); … … 851 902 if (!allFound) { 852 903 _gloSlots.sort(); 853 emit(newMessage(_staID + ": GLONASS Slot:Freq " + _gloSlots.join(" ").toAscii(), true)); 904 emit(newMessage( 905 _staID + ": GLONASS Slot:Freq " + _gloSlots.join(" ").toAscii(), 906 true)); 854 907 } 855 908 } … … 859 912 #ifdef MLS_SOFTWARE 860 913 for (int ii=0; ii <decoder()->_antList.size(); ii++) { 861 862 if(decoder()->_antList[ii].type == GPSDecoder::t_antInfo::ARP) {863 864 865 866 867 868 869 870 871 872 873 874 914 QByteArray antT; 915 if (decoder()->_antList[ii].type == GPSDecoder::t_antInfo::ARP) { 916 antT = "ARP"; 917 } 918 else if (decoder()->_antList[ii].type == GPSDecoder::t_antInfo::APC) { 919 antT = "APC"; 920 } 921 double hh = 0.0; 922 if (decoder()->_antList[ii].height_f) { 923 hh = decoder()->_antList[ii].height; 924 } 925 emit(newAntCrd(_staID, decoder()->_antList[ii].xx, 926 decoder()->_antList[ii].yy, decoder()->_antList[ii].zz, 927 hh, antT)); 875 928 } 876 929 … … 930 983 void bncGetThread::slotNewNMEAConnection() { 931 984 _nmeaSockets->push_back(_nmeaServer->nextPendingConnection()); 932 emit( newMessage(QString("New PPP client on port: # %1") 933 .arg(_nmeaSockets->size()).toAscii(), true) ); 985 emit(newMessage( 986 QString("New PPP client on port: # %1").arg(_nmeaSockets->size()).toAscii(), 987 true)); 934 988 } 935 989 … … 945 999 if (sock->state() == QAbstractSocket::ConnectedState) { 946 1000 sock->write(str); 947 } 948 else if (sock->state() != QAbstractSocket::ConnectingState) { 1001 } else if (sock->state() != QAbstractSocket::ConnectingState) { 949 1002 delete sock; 950 1003 is.remove();
Note:
See TracChangeset
for help on using the changeset viewer.