Added two modes - millisecond timestamps for frames and a way to
ignore colors set in DBC files
This commit is contained in:
+22
-2
@@ -103,6 +103,16 @@ void CANFrameModel::setSysTimeMode(bool mode)
|
||||
}
|
||||
}
|
||||
|
||||
void CANFrameModel::setMillisMode(bool mode)
|
||||
{
|
||||
if (Utility::millisMode != mode)
|
||||
{
|
||||
this->beginResetModel();
|
||||
Utility::millisMode = mode;
|
||||
this->endResetModel();
|
||||
}
|
||||
}
|
||||
|
||||
void CANFrameModel::setInterpretMode(bool mode)
|
||||
{
|
||||
//if the state of interpretFrames changes then we need to reset the model
|
||||
@@ -127,6 +137,16 @@ void CANFrameModel::setTimeFormat(QString format)
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
void CANFrameModel::setIgnoreDBCColors(bool mode)
|
||||
{
|
||||
if(ignoreDBCColors != mode)
|
||||
{
|
||||
beginResetModel(); //reset model to update the view
|
||||
ignoreDBCColors = mode;
|
||||
endResetModel();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Scan all frames for the smallest timestamp and offset all timestamps so that smallest one is at 0
|
||||
*/
|
||||
@@ -385,7 +405,7 @@ QVariant CANFrameModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
if (role == Qt::BackgroundColorRole)
|
||||
{
|
||||
if (dbcHandler != nullptr && interpretFrames)
|
||||
if (dbcHandler != nullptr && interpretFrames && !ignoreDBCColors)
|
||||
{
|
||||
DBC_MESSAGE *msg = dbcHandler->findMessage(thisFrame);
|
||||
if (msg != nullptr)
|
||||
@@ -418,7 +438,7 @@ QVariant CANFrameModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
if (role == Qt::TextColorRole)
|
||||
{
|
||||
if (dbcHandler != nullptr && interpretFrames)
|
||||
if (dbcHandler != nullptr && interpretFrames && !ignoreDBCColors)
|
||||
{
|
||||
DBC_MESSAGE *msg = dbcHandler->findMessage(thisFrame);
|
||||
if (msg != nullptr)
|
||||
|
||||
Reference in New Issue
Block a user