Changeset 2007 in ntrip for trunk/BNC/bncfigure.cpp
- Timestamp:
- Nov 22, 2009, 8:36:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncfigure.cpp
r1994 r2007 94 94 QMap<QByteArray, sumAndMean*>::const_iterator it = _bytes.find(staID); 95 95 if (it != _bytes.end()) { 96 it.value()->_sum += nbyte ;96 it.value()->_sum += nbyte*8.; 97 97 } 98 98 } … … 149 149 painter.drawLine(xMin+60, int((yMax-yMin)*xLine), xMin+60, yMin+10); 150 150 151 double maxRateRounded; 151 152 QString maxRateStr; 152 if (8.0 * _maxRate < 1e3) { 153 maxRateStr = QString("%1 bps ").arg(int(8.0 * _maxRate)); 153 if (_maxRate < 1e3) { 154 maxRateRounded = int(_maxRate/200)*200 + 300; 155 maxRateStr = QString("%1 bps ").arg(int(maxRateRounded/200)*200); 154 156 painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+60,15,Qt::AlignRight,tr("0 bps ")); 155 157 } 156 else if (8.0 * _maxRate < 1e6) { 157 maxRateStr = QString("%1 kbps ").arg(int(8.0 * _maxRate / 1.e3)); 158 else if (_maxRate < 1e6) { 159 maxRateRounded = int(_maxRate/1.e3)*1.e3 + 1500; 160 maxRateStr = QString("%1 kbps ").arg(int(maxRateRounded/1.e3)); 158 161 painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+60,15,Qt::AlignRight,tr("0 kbps ")); 159 162 } 160 163 else { 161 maxRateStr = QString("%1 Mbps ").arg(int(8.0 * _maxRate / 1.e6)); 164 maxRateRounded = int(_maxRate/1.e6)*1.e6 + 1500000; 165 maxRateStr = QString("%1 Mbps ").arg(int(maxRateRounded/1.e6)); 162 166 painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+60,15,Qt::AlignRight,tr("0 Mbps ")); 163 167 } 164 168 165 169 if(_maxRate > 0.0) { 166 painter.drawText(0, yMin+2 5-5, xMin+60,15,Qt::AlignRight,maxRateStr);170 painter.drawText(0, yMin+20-5, xMin+60,15,Qt::AlignRight,maxRateStr); 167 171 } 168 172 … … 180 184 181 185 if(_maxRate > 0.0) { 182 int yy = int(yLength * (it.value()->_mean / _maxRate));186 int yy = int(yLength * (it.value()->_mean / maxRateRounded)); 183 187 QColor color = QColor::fromRgb(_ran[0][anchor],_ran[1][anchor],_ran[2][anchor],150); 184 188 painter.fillRect(xx-13, int((yMax-yMin)*xLine)-yy, 9, yy,
Note:
See TracChangeset
for help on using the changeset viewer.