Added two modes - millisecond timestamps for frames and a way to

ignore colors set in DBC files
This commit is contained in:
Collin Kidder
2022-01-19 21:34:49 -05:00
parent a8f4a51131
commit c4a9f99445
8 changed files with 92 additions and 13 deletions
+22 -2
View File
@@ -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)