diff --git a/canframemodel.cpp b/canframemodel.cpp index 4bd04c9..a130a13 100644 --- a/canframemodel.cpp +++ b/canframemodel.cpp @@ -61,6 +61,9 @@ CANFrameModel::CANFrameModel(QObject *parent) QSettings settings; preallocSize = settings.value("Main/MaximumFrames", maxFramesDefault).toInt(); + //Each CANFrame object takes up 56 bytes and we're allocating two arrays here so take the + //# of pre-alloc frames and multiply by 112 to get the RAM usage. This is around 1GiB for the default. + //the goal is to prevent a reallocation from ever happening frames.reserve(preallocSize); filteredFrames.reserve(preallocSize); diff --git a/framefileio.cpp b/framefileio.cpp index f2853aa..40977d4 100644 --- a/framefileio.cpp +++ b/framefileio.cpp @@ -2024,6 +2024,9 @@ bool FrameFileIO::loadNativeCSVFile(QString filename, QVector* frames) if (tokens[2].toUpper().contains("TRUE")) thisFrame.setExtendedFrameFormat(true); else thisFrame.setExtendedFrameFormat(false); + //fix for faulty files that fail to set the extended flag when they should + if (thisFrame.frameId() > 0x7FF) thisFrame.setExtendedFrameFormat(true); + thisFrame.setFrameType(QCanBusFrame::DataFrame); if (fileVersion == 1) diff --git a/ui/mainsettingsdialog.ui b/ui/mainsettingsdialog.ui index a034b1c..b073d43 100644 --- a/ui/mainsettingsdialog.ui +++ b/ui/mainsettingsdialog.ui @@ -7,7 +7,7 @@ 0 0 965 - 815 + 852 @@ -115,7 +115,7 @@ - Maximum Frames to Capture + CAN Frame Pre-allocation Size diff --git a/utility.h b/utility.h index e86b69c..d70c074 100644 --- a/utility.h +++ b/utility.h @@ -216,7 +216,7 @@ public: } /* A unified function that can extract a signal from the (up to) 64 bits of data bytes in a CAN frame - * handles both little and big endian signals (and floats too but that's untested). + * handles both little and big endian signals (and floats too). */ static int64_t processIntegerSignal(const QByteArray data, int startBit, int sigSize, bool littleEndian, bool isSigned) {