From 3c07785040461c2cddad0f691ada5ae0fb57d765 Mon Sep 17 00:00:00 2001 From: Andy Huska Date: Mon, 3 Oct 2022 17:02:13 -0500 Subject: [PATCH] Buffer for partially received and/or leftover frame fragments now working with multiple active busses. Removed commented out test code and put a fix in for for the filters list not having its capacity properly reserved in recalcOverwrite so multiple entries of the same message show up in the filtered view --- canframemodel.cpp | 1 + connections/socketcand.cpp | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/canframemodel.cpp b/canframemodel.cpp index e061a57..5f84930 100644 --- a/canframemodel.cpp +++ b/canframemodel.cpp @@ -381,6 +381,7 @@ void CANFrameModel::recalcOverwrite() //Then replace the old list of frames with just the unique list frames.clear(); frames.append(overWriteFrames.values().toVector()); + frames.reserve(preallocSize); filteredFrames.clear(); filteredFrames.reserve(preallocSize); diff --git a/connections/socketcand.cpp b/connections/socketcand.cpp index c290204..8a6e5da 100644 --- a/connections/socketcand.cpp +++ b/connections/socketcand.cpp @@ -426,13 +426,7 @@ void SocketCANd::procRXData(QString data, int busNum) } break; case RAWMODE: - //if(!unprocessedData[busNum].isEmpty()) - //{ - // qDebug() << "busNum: " << busNum << "- " << unprocessedData[busNum].length() << " bytes of unprocessedData: " << unprocessedData[busNum] << " adding it to new data: " + data.left(50) + "..."; - // } unprocessedData[busNum] = decodeFrames(unprocessedData[busNum] + data, busNum); - //if(unprocessedData[busNum].length() > 0) - // qDebug() << "busNum: " << busNum << " has data left over, what was at the end of the last packet?: " << data.right(20); if(unprocessedData[busNum].length() > 128) {