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