Fix for a variety of small issues with sniffer window.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user