Changed text in settings window to more clearly explain what the max

frames / prealloc setting does, some other minor bug fixes and extra
comments in code.
This commit is contained in:
Collin Kidder
2023-02-13 19:17:44 -05:00
parent ba77154dc1
commit 4ecffaa76a
4 changed files with 9 additions and 3 deletions
+3
View File
@@ -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);
+3
View File
@@ -2024,6 +2024,9 @@ bool FrameFileIO::loadNativeCSVFile(QString filename, QVector<CANFrame>* 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)
+2 -2
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>965</width>
<height>815</height>
<height>852</height>
</rect>
</property>
<property name="windowTitle">
@@ -115,7 +115,7 @@
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>Maximum Frames to Capture</string>
<string>CAN Frame Pre-allocation Size</string>
</property>
</widget>
</item>
+1 -1
View File
@@ -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)
{