- Timestamp:
- Nov 18, 2009, 2:36:54 PM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncfigurelate.cpp
r1981 r1982 68 68 QMutexLocker locker(&_mutex); 69 69 70 _maxLate = 0;71 70 _latency.clear(); 72 71 … … 86 85 QMutexLocker locker(&_mutex); 87 86 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; 93 88 } 94 89 } … … 122 117 int yLength = int((yMax-yMin)*xLine) - (yMin+10); 123 118 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);127 119 painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+50,15,Qt::AlignRight,tr("0 ms ")); 128 120 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)); 130 133 painter.drawText(0, yMin+25-5, xMin+50,15,Qt::AlignRight,maxLateStr); 131 134 } … … 149 152 painter.restore(); 150 153 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)); 153 156 QColor color = QColor::fromRgb(_rgb[0][anchor],_rgb[1][anchor],_rgb[2][anchor]); 154 157 painter.fillRect(xx-13, int((yMax-yMin)*xLine)-yy, 9, yy, -
trunk/BNC/bncfigurelate.h
r1981 r1982 43 43 QMap<QByteArray, double> _latency; 44 44 QMutex _mutex; 45 double _maxLate;46 45 int _rgb[3][1001]; 47 46 };
Note:
See TracChangeset
for help on using the changeset viewer.