Merge branch 'collin80-master' into add_allowfilterstostayuponclear
This commit is contained in:
+6
-6
@@ -59,7 +59,7 @@ CANFrameModel::CANFrameModel(QObject *parent)
|
||||
}
|
||||
|
||||
QSettings settings;
|
||||
int preallocSize = settings.value("Main/MaximumFrames", maxFramesDefault).toInt();
|
||||
preallocSize = settings.value("Main/MaximumFrames", maxFramesDefault).toInt();
|
||||
|
||||
//the goal is to prevent a reallocation from ever happening
|
||||
frames.reserve(preallocSize);
|
||||
@@ -749,15 +749,15 @@ void CANFrameModel::addFrames(const CANConnection*, const QVector<CANFrame>& pFr
|
||||
{
|
||||
if(frames.length() > frames.capacity() * 0.99)
|
||||
{
|
||||
qDebug() << "Frames count: " << frames.length() << " of " << frames.capacity() << " capacity, removing first " << frames.capacity() * 0.05 << " frames";
|
||||
frames.remove(0, frames.capacity() * 0.05);
|
||||
qDebug() << "Frames count: " << frames.length() << " of " << frames.capacity() << " capacity, removing first " << (int)(frames.capacity() * 0.05) << " frames";
|
||||
frames.remove(0, (int)(frames.capacity() * 0.05));
|
||||
qDebug() << "Frames removed, new count: " << frames.length();
|
||||
}
|
||||
|
||||
if(filteredFrames.length() > filteredFrames.capacity() * 0.99)
|
||||
{
|
||||
qDebug() << "filteredFrames count: " << filteredFrames.length() << " of " << filteredFrames.capacity() << " capacity, removing first " << filteredFrames.capacity() * 0.05 << " frames";
|
||||
filteredFrames.remove(0, filteredFrames.capacity() * 0.05);
|
||||
qDebug() << "filteredFrames count: " << filteredFrames.length() << " of " << filteredFrames.capacity() << " capacity, removing first " << (int)(filteredFrames.capacity() * 0.05) << " frames";
|
||||
filteredFrames.remove(0, (int)(filteredFrames.capacity() * 0.05));
|
||||
qDebug() << "filteredFrames removed, new count: " << filteredFrames.length();
|
||||
}
|
||||
|
||||
@@ -787,8 +787,8 @@ void CANFrameModel::sendRefresh()
|
||||
mutex.lock();
|
||||
beginResetModel();
|
||||
filteredFrames.clear();
|
||||
filteredFrames.reserve(preallocSize);
|
||||
filteredFrames.append(tempContainer);
|
||||
filteredFrames.reserve(preallocSize);
|
||||
|
||||
lastUpdateNumFrames = 0;
|
||||
endResetModel();
|
||||
|
||||
+5
-1
@@ -351,7 +351,11 @@ DBC_NODE* DBCFile::findNodeByNameAndComment(QString fullname)
|
||||
if (dbc_nodes.length() == 0) return nullptr;
|
||||
for (int i = 0; i < dbc_nodes.length(); i++)
|
||||
{
|
||||
nameAndComment = dbc_nodes[i].name + " - " + dbc_nodes[i].comment;
|
||||
if(dbc_nodes[i].comment.isEmpty())
|
||||
nameAndComment = dbc_nodes[i].name;
|
||||
else
|
||||
nameAndComment = dbc_nodes[i].name + " - " + dbc_nodes[i].comment;
|
||||
|
||||
if (fullname.compare(nameAndComment, Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
return &dbc_nodes[i];
|
||||
|
||||
@@ -111,8 +111,11 @@ void DBCNodeEditor::showEvent(QShowEvent* event)
|
||||
|
||||
void DBCNodeEditor::refreshView()
|
||||
{
|
||||
ui->lineComment->setText(dbcNode->comment);
|
||||
ui->lineMsgName->setText(dbcNode->name);
|
||||
if(dbcNode)
|
||||
{
|
||||
ui->lineComment->setText(dbcNode->comment);
|
||||
ui->lineMsgName->setText(dbcNode->name);
|
||||
}
|
||||
|
||||
//generateSampleText();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user