Changeset 2007 in ntrip
- Timestamp:
- Nov 22, 2009, 8:36:54 PM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 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, -
trunk/BNC/bncfigurelate.cpp
r2006 r2007 127 127 } 128 128 129 double maxLateRounded; 129 130 QString maxLateStr; 130 131 if(maxLate < 1e3) { 131 maxLateStr = QString("%1 ms ").arg(int(maxLate/200)*200); 132 maxLateRounded = int(maxLate/200)*200 + 300; 133 maxLateStr = QString("%1 ms ").arg(int(maxLateRounded/200)*200); 132 134 painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+60,15,Qt::AlignRight,tr("0 ms ")); 133 135 } 134 136 else if (maxLate < 6e4) { 135 maxLateStr = QString("%1 sec ").arg(int(maxLate / 1.e3)); 137 maxLateRounded = int(maxLate/1.e3)*1.e3 + 1500; 138 maxLateStr = QString("%1 sec ").arg(int(maxLateRounded/1.e3)); 136 139 painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+60,15,Qt::AlignRight,tr("0 sec ")); 137 140 } 138 141 else { 139 maxLateStr = QString("%1 min ").arg(int(maxLate / 6.e4)); 142 maxLateRounded = int(maxLate / 6.e4)*6.e4 + 90000; 143 maxLateStr = QString("%1 min ").arg(int(maxLateRounded/6.e4)); 140 144 painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+60,15,Qt::AlignRight,tr("0 min ")); 141 145 } 142 146 143 147 if(maxLate > 0.0) { 144 painter.drawText(0, yMin+2 5-5, xMin+60,15,Qt::AlignRight,maxLateStr);148 painter.drawText(0, yMin+20-5, xMin+60,15,Qt::AlignRight,maxLateStr); 145 149 } 146 150 … … 158 162 159 163 if(maxLate > 0.0) { 160 int yy = int(yLength * (it.value() / maxLate ));164 int yy = int(yLength * (it.value() / maxLateRounded)); 161 165 QColor color = QColor::fromHsv(180,200,120+_ran[2][anchor]); 162 166 painter.fillRect(xx-13, int((yMax-yMin)*xLine)-yy, 9, yy,
Note:
See TracChangeset
for help on using the changeset viewer.