Added ability for sub windows to get frames much more rapidly than

before. Decoupled SerialWorker from MainWindow a bit and refactored
things.
This commit is contained in:
Collin Kidder
2016-02-28 16:10:55 -05:00
parent 07b63ac127
commit 4767a7349f
5 changed files with 55 additions and 31 deletions
+7 -2
View File
@@ -6,7 +6,12 @@
int CANFrameModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return filteredFrames.count();
if (filteredFrames.data()) return filteredFrames.count();
//just in case somehow data is invalid which I have seen before.
//But, this should not happen so issue a debugging message too
qDebug() << "Invalid data for filteredFrames. Returning 0.";
return 0;
}
int CANFrameModel::totalFrameCount()
@@ -341,7 +346,7 @@ void CANFrameModel::sendRefresh()
}
}
filteredFrames.clear();
filteredFrames = tempContainer;
filteredFrames.append(tempContainer);
lastUpdateNumFrames = filteredFrames.count();
endResetModel();
mutex.unlock();