Changeset 1982 in ntrip


Ignore:
Timestamp:
Nov 18, 2009, 2:36:54 PM (14 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncfigurelate.cpp

    r1981 r1982  
    6868  QMutexLocker locker(&_mutex);
    6969
    70   _maxLate = 0;
    7170  _latency.clear();
    7271
     
    8685  QMutexLocker locker(&_mutex);
    8786  if (_latency.find(staID) != _latency.end()) {
    88     double ms = fabs(clate)*1000.0;
    89     _latency[staID] = ms;
    90     if (ms > _maxLate) {
    91       _maxLate = ms;
    92     }
     87    _latency[staID] = fabs(clate)*1000.0;
    9388  }
    9489}
     
    122117  int yLength = int((yMax-yMin)*xLine) - (yMin+10);
    123118  painter.drawLine(xMin+50, int((yMax-yMin)*xLine), xMin+50, yMin+10);
    124 
    125   QString maxLateStr;
    126   maxLateStr = QString("%1 ms  ").arg(int(_maxLate/200)*200);
    127119  painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+50,15,Qt::AlignRight,tr("0 ms  "));
    128120
    129   if(_maxLate > 0.0) {
     121  double maxLate = 0.0;
     122  QMapIterator<QByteArray, double> it1(_latency);
     123  while (it1.hasNext()) {
     124    it1.next();
     125    if (it1.value() > maxLate) {
     126      maxLate = it1.value();
     127    }
     128  }
     129
     130  if(maxLate > 0.0) {
     131    QString maxLateStr;
     132    maxLateStr = QString("%1 ms  ").arg(int(maxLate));
    130133    painter.drawText(0, yMin+25-5, xMin+50,15,Qt::AlignRight,maxLateStr);
    131134  }
     
    149152    painter.restore();
    150153
    151     if(_maxLate > 0.0) {
    152       int yy = int(yLength * (it.value() / _maxLate));
     154    if(maxLate > 0.0) {
     155      int yy = int(yLength * (it.value() / maxLate));
    153156      QColor color = QColor::fromRgb(_rgb[0][anchor],_rgb[1][anchor],_rgb[2][anchor]);
    154157      painter.fillRect(xx-13, int((yMax-yMin)*xLine)-yy, 9, yy,
  • trunk/BNC/bncfigurelate.h

    r1981 r1982  
    4343  QMap<QByteArray, double> _latency;
    4444  QMutex                   _mutex;
    45   double                   _maxLate;
    4645  int                      _rgb[3][1001];
    4746};
Note: See TracChangeset for help on using the changeset viewer.