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


Ignore:
Timestamp:
Dec 19, 2008, 12:41:07 PM (15 years ago)
Author:
weber
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncgetthread.cpp

    r1299 r1307  
    173173  // RTCM message types
    174174  // ------------------
    175   _checkMountPoint = settings.value("messTypes").toString();
     175  _checkMountPoint = settings.value("miscMount").toString();
    176176
    177177  // RINEX writer
     
    667667        // ----------------
    668668        if ( _checkMountPoint == _staID || _checkMountPoint == "ALL" ) {
    669 
    670           // RTCMv3 message types
    671           // --------------------
    672           if (0<_decoder->_typeList.size()) {
    673             QString type;
    674             for (int ii=0;ii<_decoder->_typeList.size();ii++) {
    675               type =  QString("%1 ").arg(_decoder->_typeList[ii]);
    676               emit(newMessage(_staID + ": Received message type " + type.toAscii(), true));
    677             }
    678           }
    679 
    680           // RTCMv3 antenna descriptor
    681           // -------------------------
    682           if (0<_decoder->_antType.size()) {
    683             QString ant1;
    684             for (int ii=0;ii<_decoder->_antType.size();ii++) {
    685               ant1 =  QString("%1 ").arg(_decoder->_antType[ii]);
    686               emit(newMessage(_staID + ": Antenna descriptor " + ant1.toAscii(), true));
    687             }
    688           }
    689 
    690           // antenna XYZ
    691           // ------------------
    692           if (0<_decoder->_antList.size()) {
    693             for (int ii=0;ii<_decoder->_antList.size();++ii) {
    694               QByteArray ant1,ant2,ant3, antT;
    695               ant1 = QString("%1 ").arg(_decoder->_antList[ii].xx,0,'f',4).toAscii();
    696               ant2 = QString("%1 ").arg(_decoder->_antList[ii].yy,0,'f',4).toAscii();
    697               ant3 = QString("%1 ").arg(_decoder->_antList[ii].zz,0,'f',4).toAscii();
     669          QSettings settings;
     670          if ( Qt::CheckState(settings.value("scanRTCM").toInt()) == Qt::Checked) {
     671
     672            // RTCMv3 message types
     673            // --------------------
     674            if (0<_decoder->_typeList.size()) {
     675              QString type;
     676              for (int ii=0;ii<_decoder->_typeList.size();ii++) {
     677                type =  QString("%1 ").arg(_decoder->_typeList[ii]);
     678                emit(newMessage(_staID + ": Received message type " + type.toAscii(), true));
     679              }
     680            }
     681 
     682            // RTCMv3 antenna descriptor
     683            // -------------------------
     684            if (0<_decoder->_antType.size()) {
     685              QString ant1;
     686              for (int ii=0;ii<_decoder->_antType.size();ii++) {
     687                ant1 =  QString("%1 ").arg(_decoder->_antType[ii]);
     688                emit(newMessage(_staID + ": Antenna descriptor " + ant1.toAscii(), true));
     689              }
     690            }
     691 
     692            // Antenna XYZ
     693            // ------------------
     694            if (0<_decoder->_antList.size()) {
     695              for (int ii=0;ii<_decoder->_antList.size();++ii) {
     696                QByteArray ant1,ant2,ant3, antT;
     697                ant1 = QString("%1 ").arg(_decoder->_antList[ii].xx,0,'f',4).toAscii();
     698                ant2 = QString("%1 ").arg(_decoder->_antList[ii].yy,0,'f',4).toAscii();
     699                ant3 = QString("%1 ").arg(_decoder->_antList[ii].zz,0,'f',4).toAscii();
     700                switch (_decoder->_antList[ii].type) {
     701                case GPSDecoder::t_antInfo::ARP: antT = "ARP"; break;
     702                case GPSDecoder::t_antInfo::APC: antT = "APC"; break;
     703                }
     704                emit(newMessage(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true));
     705                emit(newMessage(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true));
     706                emit(newMessage(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true));
     707                if (_decoder->_antList[ii].height_f) {
     708                  QByteArray ant4 = QString("%1 ").arg(_decoder->_antList[ii].height,0,'f',4).toAscii();
     709                  emit(newMessage(_staID + ": Antenna height above marker "  + ant4 + "m", true));
     710                }
     711                emit(newAntCrd(_staID,
     712                             _decoder->_antList[ii].xx, _decoder->_antList[ii].yy, _decoder->_antList[ii].zz,
     713                             antT));
     714              }
     715            }
     716          }
     717          if ( _checkMountPoint == "ANTCRD_ONLY" && _decoder->_antList.size() ) {
     718            for (int ii=0;ii<_decoder->_antList.size();++ii) {
     719              QByteArray antT;
    698720              switch (_decoder->_antList[ii].type) {
    699721              case GPSDecoder::t_antInfo::ARP: antT = "ARP"; break;
    700722              case GPSDecoder::t_antInfo::APC: antT = "APC"; break;
    701723              }
    702               emit(newMessage(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true));
    703               emit(newMessage(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true));
    704               emit(newMessage(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true));
    705               if (_decoder->_antList[ii].height_f) {
    706                 QByteArray ant4 = QString("%1 ").arg(_decoder->_antList[ii].height,0,'f',4).toAscii();
    707                 emit(newMessage(_staID + ": Antenna height above marker "  + ant4 + "m", true));
    708               }
    709724              emit(newAntCrd(_staID,
    710                              _decoder->_antList[ii].xx, _decoder->_antList[ii].yy, _decoder->_antList[ii].zz,
    711                              antT));
    712             }
    713           }
    714         }
    715         if ( _checkMountPoint == "ANTCRD_ONLY" && _decoder->_antList.size() ) {
    716           for (int ii=0;ii<_decoder->_antList.size();++ii) {
    717             QByteArray antT;
    718             switch (_decoder->_antList[ii].type) {
    719             case GPSDecoder::t_antInfo::ARP: antT = "ARP"; break;
    720             case GPSDecoder::t_antInfo::APC: antT = "APC"; break;
    721             }
    722             emit(newAntCrd(_staID,
    723725                           _decoder->_antList[ii].xx, _decoder->_antList[ii].yy, _decoder->_antList[ii].zz,
    724726                           antT));
    725           }
    726         }
     727            }
     728          }
     729        }
    727730       
    728731        _decoder->_typeList.clear();
     
    767770              // ------------------------
    768771              if (_perfIntr>0) {
    769                 newSecGPS = static_cast<int>(obs->_o.GPSWeeks);
    770                 if (newSecGPS != oldSecGPS) {
    771                   if (newSecGPS % _perfIntr < oldSecGPS % _perfIntr) {
    772                     if (numLat>0) {
     772                if ( _checkMountPoint == _staID || _checkMountPoint == "ALL" ) {
     773                  newSecGPS = static_cast<int>(obs->_o.GPSWeeks);
     774                  if (newSecGPS != oldSecGPS) {
     775                    if (newSecGPS % _perfIntr < oldSecGPS % _perfIntr) {
     776                      if (numLat>0) {
     777                        if (meanDiff>0.) {
     778                          emit( newMessage(QString("%1: Mean latency %2 sec, min %3, max %4, rms %5, %6 epochs, %7 gaps")
     779                            .arg(_staID.data())
     780                            .arg(int(sumLat/numLat*100)/100.)
     781                            .arg(int(minLat*100)/100.)
     782                            .arg(int(maxLat*100)/100.)
     783                            .arg(int((sqrt((sumLatQ - sumLat * sumLat / numLat)/numLat))*100)/100.)
     784                            .arg(numLat)
     785                            .arg(numGaps)
     786                            .toAscii(), true) );
     787                        } else {
     788                          emit( newMessage(QString("%1: Mean latency %2 sec, min %3, max %4, rms %5, %6 epochs")
     789                            .arg(_staID.data())
     790                            .arg(int(sumLat/numLat*100)/100.)
     791                            .arg(int(minLat*100)/100.)
     792                            .arg(int(maxLat*100)/100.)
     793                            .arg(int((sqrt((sumLatQ - sumLat * sumLat / numLat)/numLat))*100)/100.)
     794                            .arg(numLat)
     795                            .toAscii(), true) );
     796                        }
     797                      }
     798                      meanDiff = diffSecGPS/numLat;
     799                      diffSecGPS = 0;
     800                      numGaps = 0;
     801                      sumLat = 0.;
     802                      sumLatQ = 0.;
     803                      numLat = 0;
     804                      minLat = maxDt;
     805                      maxLat = -maxDt;
     806                    }
     807                    if (followSec) {
     808                      diffSecGPS += newSecGPS - oldSecGPS;
    773809                      if (meanDiff>0.) {
    774                         emit( newMessage(QString("%1: Mean latency %2 sec, min %3, max %4, rms %5, %6 epochs, %7 gaps")
    775                           .arg(_staID.data())
    776                           .arg(int(sumLat/numLat*100)/100.)
    777                           .arg(int(minLat*100)/100.)
    778                           .arg(int(maxLat*100)/100.)
    779                           .arg(int((sqrt((sumLatQ - sumLat * sumLat / numLat)/numLat))*100)/100.)
    780                           .arg(numLat)
    781                           .arg(numGaps)
    782                           .toAscii(), true) );
    783                       } else {
    784                         emit( newMessage(QString("%1: Mean latency %2 sec, min %3, max %4, rms %5, %6 epochs")
    785                           .arg(_staID.data())
    786                           .arg(int(sumLat/numLat*100)/100.)
    787                           .arg(int(minLat*100)/100.)
    788                           .arg(int(maxLat*100)/100.)
    789                           .arg(int((sqrt((sumLatQ - sumLat * sumLat / numLat)/numLat))*100)/100.)
    790                           .arg(numLat)
    791                           .toAscii(), true) );
     810                        if (newSecGPS - oldSecGPS > 1.5 * meanDiff) {
     811                          numGaps += 1;
     812                        }
    792813                      }
    793814                    }
    794                     meanDiff = diffSecGPS/numLat;
    795                     diffSecGPS = 0;
    796                     numGaps = 0;
    797                     sumLat = 0.;
    798                     sumLatQ = 0.;
    799                     numLat = 0;
    800                     minLat = maxDt;
    801                     maxLat = -maxDt;
     815                    curLat = sec - obs->_o.GPSWeeks;
     816                    sumLat += curLat;
     817                    sumLatQ += curLat * curLat;
     818                    if (curLat < minLat) minLat = curLat;
     819                    if (curLat >= maxLat) maxLat = curLat;
     820                    numLat += 1;
     821                    oldSecGPS = newSecGPS;
     822                    followSec = true;
    802823                  }
    803                   if (followSec) {
    804                     diffSecGPS += newSecGPS - oldSecGPS;
    805                     if (meanDiff>0.) {
    806                       if (newSecGPS - oldSecGPS > 1.5 * meanDiff) {
    807                         numGaps += 1;
    808                       }
    809                     }
    810                   }
    811                   curLat = sec - obs->_o.GPSWeeks;
    812                   sumLat += curLat;
    813                   sumLatQ += curLat * curLat;
    814                   if (curLat < minLat) minLat = curLat;
    815                   if (curLat >= maxLat) maxLat = curLat;
    816                   numLat += 1;
    817                   oldSecGPS = newSecGPS;
    818                   followSec = true;
    819824                }
    820825              }
Note: See TracChangeset for help on using the changeset viewer.