- Timestamp:
- Oct 6, 2015, 4:07:16 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncgetthread.cpp
r7423 r7486 35 35 * Created: 24-Dec-2005 36 36 * 37 * Changes: 37 * Changes: 38 38 * 39 39 * -----------------------------------------------------------------------*/ … … 85 85 // Constructor 2 86 86 //////////////////////////////////////////////////////////////////////////// 87 bncGetThread::bncGetThread(const QUrl& mountPoint, 87 bncGetThread::bncGetThread(const QUrl& mountPoint, 88 88 const QByteArray& format, 89 89 const QByteArray& latitude, 90 90 const QByteArray& longitude, 91 const QByteArray& nmea, 91 const QByteArray& nmea, 92 92 const QByteArray& ntripVersion) { 93 93 _rawFile = 0; … … 119 119 setTerminationEnabled(true); 120 120 121 connect(this, SIGNAL(newMessage(QByteArray,bool)), 121 connect(this, SIGNAL(newMessage(QByteArray,bool)), 122 122 BNC_CORE, SLOT(slotMessage(const QByteArray,bool))); 123 123 … … 172 172 QString hlp = settings.value("serialBaudRate").toString(); 173 173 if (hlp == "110") { 174 _serialPort->setBaudRate(BAUD110); 174 _serialPort->setBaudRate(BAUD110); 175 175 } 176 176 else if (hlp == "300") { 177 _serialPort->setBaudRate(BAUD300); 177 _serialPort->setBaudRate(BAUD300); 178 178 } 179 179 else if (hlp == "600") { 180 _serialPort->setBaudRate(BAUD600); 180 _serialPort->setBaudRate(BAUD600); 181 181 } 182 182 else if (hlp == "1200") { 183 _serialPort->setBaudRate(BAUD1200); 183 _serialPort->setBaudRate(BAUD1200); 184 184 } 185 185 else if (hlp == "2400") { 186 _serialPort->setBaudRate(BAUD2400); 186 _serialPort->setBaudRate(BAUD2400); 187 187 } 188 188 else if (hlp == "4800") { 189 _serialPort->setBaudRate(BAUD4800); 189 _serialPort->setBaudRate(BAUD4800); 190 190 } 191 191 else if (hlp == "9600") { 192 _serialPort->setBaudRate(BAUD9600); 192 _serialPort->setBaudRate(BAUD9600); 193 193 } 194 194 else if (hlp == "19200") { 195 _serialPort->setBaudRate(BAUD19200); 195 _serialPort->setBaudRate(BAUD19200); 196 196 } 197 197 else if (hlp == "38400") { 198 _serialPort->setBaudRate(BAUD38400); 198 _serialPort->setBaudRate(BAUD38400); 199 199 } 200 200 else if (hlp == "57600") { 201 _serialPort->setBaudRate(BAUD57600); 201 _serialPort->setBaudRate(BAUD57600); 202 202 } 203 203 else if (hlp == "115200") { 204 _serialPort->setBaudRate(BAUD115200); 204 _serialPort->setBaudRate(BAUD115200); 205 205 } 206 206 … … 209 209 hlp = settings.value("serialParity").toString(); 210 210 if (hlp == "NONE") { 211 _serialPort->setParity(PAR_NONE); 211 _serialPort->setParity(PAR_NONE); 212 212 } 213 213 else if (hlp == "ODD") { 214 _serialPort->setParity(PAR_ODD); 214 _serialPort->setParity(PAR_ODD); 215 215 } 216 216 else if (hlp == "EVEN") { 217 _serialPort->setParity(PAR_EVEN); 217 _serialPort->setParity(PAR_EVEN); 218 218 } 219 219 else if (hlp == "SPACE") { 220 _serialPort->setParity(PAR_SPACE); 220 _serialPort->setParity(PAR_SPACE); 221 221 } 222 222 … … 225 225 hlp = settings.value("serialDataBits").toString(); 226 226 if (hlp == "5") { 227 _serialPort->setDataBits(DATA_5); 227 _serialPort->setDataBits(DATA_5); 228 228 } 229 229 else if (hlp == "6") { 230 _serialPort->setDataBits(DATA_6); 230 _serialPort->setDataBits(DATA_6); 231 231 } 232 232 else if (hlp == "7") { 233 _serialPort->setDataBits(DATA_7); 233 _serialPort->setDataBits(DATA_7); 234 234 } 235 235 else if (hlp == "8") { 236 _serialPort->setDataBits(DATA_8); 236 _serialPort->setDataBits(DATA_8); 237 237 } 238 238 hlp = settings.value("serialStopBits").toString(); 239 239 if (hlp == "1") { 240 _serialPort->setStopBits(STOP_1); 240 _serialPort->setStopBits(STOP_1); 241 241 } 242 242 else if (hlp == "2") { 243 _serialPort->setStopBits(STOP_2); 243 _serialPort->setStopBits(STOP_2); 244 244 } 245 245 … … 248 248 hlp = settings.value("serialFlowControl").toString(); 249 249 if (hlp == "XONXOFF") { 250 _serialPort->setFlowControl(FLOW_XONXOFF); 250 _serialPort->setFlowControl(FLOW_XONXOFF); 251 251 } 252 252 else if (hlp == "HARDWARE") { 253 _serialPort->setFlowControl(FLOW_HARDWARE); 253 _serialPort->setFlowControl(FLOW_HARDWARE); 254 254 } 255 255 else { 256 _serialPort->setFlowControl(FLOW_OFF); 256 _serialPort->setFlowControl(FLOW_OFF); 257 257 } 258 258 … … 265 265 emit(newMessage((_staID + ": Cannot open serial port\n"), true)); 266 266 } 267 connect(_serialPort, SIGNAL(readyRead()), 267 connect(_serialPort, SIGNAL(readyRead()), 268 268 this, SLOT(slotSerialReadyRead())); 269 269 … … 323 323 RTCM3Decoder* newDecoder = new RTCM3Decoder(_staID, _rawFile); 324 324 _decoder = newDecoder; 325 connect((RTCM3Decoder*) newDecoder, SIGNAL(newMessage(QByteArray,bool)), 325 connect((RTCM3Decoder*) newDecoder, SIGNAL(newMessage(QByteArray,bool)), 326 326 this, SIGNAL(newMessage(QByteArray,bool))); 327 327 } … … 341 341 342 342 msleep(100); //sleep 0.1 sec 343 344 _decoder->initRinex(_staID, _mountPoint, _latitude, _longitude, 343 344 _decoder->initRinex(_staID, _mountPoint, _latitude, _longitude, 345 345 _nmea, _ntripVersion); 346 346 … … 393 393 } 394 394 395 // 395 // 396 396 //////////////////////////////////////////////////////////////////////////// 397 397 void bncGetThread::terminate() { … … 478 478 // ----------- 479 479 if (_rawOutput) { 480 BNC_CORE->writeRawData(data, _staID, _format); 480 BNC_CORE->writeRawData(data, _staID, _format); 481 481 } 482 482 … … 485 485 _serialPort->write(data); 486 486 } 487 487 488 488 // Decode Data 489 489 // ----------- … … 496 496 t_irc irc = decoder()->Decode(data.data(), data.size(), errmsg); 497 497 498 if (irc == failure) { 499 continue; 500 } 501 498 502 // Perform various scans and checks 499 503 // -------------------------------- … … 502 506 _latencyChecker->checkObsLatency(decoder()->_obsList); 503 507 _latencyChecker->checkCorrLatency(decoder()->corrGPSEpochTime()); 504 508 505 509 emit newLatency(_staID, _latencyChecker->currentLatency()); 506 510 } 507 511 508 miscScanRTCM(); 512 miscScanRTCM(); 509 513 510 514 // Loop over all observations (observations output) … … 542 546 long oldTime = it.value(); 543 547 if (obsTime < oldTime) { 544 emit( newMessage(_staID + 548 emit( newMessage(_staID + 545 549 ": old observation " + prn.toAscii(), false)); 546 550 continue; 547 551 } 548 552 else if (obsTime == oldTime) { 549 emit( newMessage(_staID + 553 emit( newMessage(_staID + 550 554 ": observation coming more than once " + prn.toAscii(), false)); 551 555 continue; … … 581 585 } 582 586 583 // Try Re-Connect 587 // Try Re-Connect 584 588 //////////////////////////////////////////////////////////////////////////// 585 589 t_irc bncGetThread::tryReconnect() { … … 715 719 emit(newMessage(_staID + ": Received message type " + type.toAscii(), true)); 716 720 } 717 721 718 722 // Check Observation Types 719 723 // ----------------------- … … 777 781 } 778 782 if (!allFound) { 779 QString msg; 783 QString msg; 780 784 QTextStream str(&msg); 781 785 QString s; … … 818 822 emit(newMessage(_staID + ": Antenna height above marker " + ant4 + "m", true)); 819 823 } 820 emit(newAntCrd(_staID, decoder()->_antList[ii].xx, 821 decoder()->_antList[ii].yy, decoder()->_antList[ii].zz, 824 emit(newAntCrd(_staID, decoder()->_antList[ii].xx, 825 decoder()->_antList[ii].yy, decoder()->_antList[ii].zz, 822 826 hh, antT)); 823 827 } … … 854 858 hh = decoder()->_antList[ii].height; 855 859 } 856 emit(newAntCrd(_staID, decoder()->_antList[ii].xx, 857 decoder()->_antList[ii].yy, decoder()->_antList[ii].zz, 860 emit(newAntCrd(_staID, decoder()->_antList[ii].xx, 861 decoder()->_antList[ii].yy, decoder()->_antList[ii].zz, 858 862 hh, antT)); 859 863 }
Note:
See TracChangeset
for help on using the changeset viewer.