Fix for a variety of small issues with sniffer window.

This commit is contained in:
Collin Kidder
2018-10-23 20:42:05 -04:00
parent dd1c6b8a6e
commit fbc71103af
3 changed files with 13 additions and 7 deletions
+5 -3
View File
@@ -68,8 +68,10 @@ QVariant SnifferModel::data(const QModelIndex &index, int role) const
case Qt::ForegroundRole:
{
if (!mFadeInactive || col < 2) return QBrush(Qt::black);
int v = (mTimeSequence - item->getDataTimestamp(col - 2)) * 20;
if (v > 215) v = 215;
int v = (mTimeSequence - item->getDataTimestamp(col - 2)) * 10;
//qDebug() << "mTS: " << mTimeSequence << " gDT(" << (col - 2) << ") " << item->getDataTimestamp(col - 2);
if (v > 225) v = 225;
if (v < 0) v = 0;
return QBrush(QColor(v,v,v,255));
break;
}
@@ -281,7 +283,7 @@ void SnifferModel::update(CANConnection*, QVector<CANFrame>& pFrames)
int index = std::distance(mMap.begin(), mMap.lowerBound(frame.ID));
/* add the frame */
beginInsertRows(QModelIndex(), index, index);
mMap[frame.ID] = new SnifferItem(frame);
mMap[frame.ID] = new SnifferItem(frame, mTimeSequence);
mMap[frame.ID]->update(frame, mTimeSequence);
endInsertRows();