From 8f1280265739e6a42b10cc344fe6e3a27447c359 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Tue, 13 Dec 2016 22:35:29 -0500 Subject: [PATCH] A few small changes, correct dialog title, change memory preallocation, explain file IO a bit. --- canframemodel.cpp | 4 ++-- framefileio.h | 10 ++++++++-- ui/firmwareuploaderwindow.ui | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/canframemodel.cpp b/canframemodel.cpp index 447672c..6263bf9 100644 --- a/canframemodel.cpp +++ b/canframemodel.cpp @@ -47,12 +47,12 @@ CANFrameModel::CANFrameModel(QObject *parent) if (QSysInfo::WordSize > 32) { qDebug() << "64 bit OS detected. Requesting a large preallocation"; - preallocSize = 50000000; + preallocSize = 20000000; } else //if compiling for 32 bit you can't ask for gigabytes of preallocation so tone it down. { qDebug() << "32 bit OS detected. Requesting a much restricted prealloc"; - preallocSize = 5000000; + preallocSize = 4000000; } frames.reserve(preallocSize); diff --git a/framefileio.h b/framefileio.h index 13f6e59..0c45515 100644 --- a/framefileio.h +++ b/framefileio.h @@ -22,6 +22,14 @@ class FrameFileIO: public QObject public: FrameFileIO(); + //these present a GUI to the user and allow them to pick the file to load/save + //The QString returns the filename that was selected and so is really a sort of return value + //The QVector is used as either the target for loading or the source for saving. + //These routines call the below loading/saving functions so no need to use them directly if you don't want. + static bool loadFrameFile(QString &, QVector*); + static bool saveFrameFile(QString &, const QVector*); + + //These do the actual loading and saving and can be used directly if you'd prefer static bool loadCRTDFile(QString, QVector*); static bool loadNativeCSVFile(QString, QVector*); static bool loadGenericCSVFile(QString, QVector*); @@ -40,8 +48,6 @@ public: static bool saveIXXATFile(QString, const QVector*); static bool saveCANDOFile(QString, const QVector*); static bool saveVehicleSpyFile(QString, const QVector*); - static bool loadFrameFile(QString &, QVector*); - static bool saveFrameFile(QString &, const QVector*); static bool loadCanDumpFile(QString, QVector*); static bool loadPCANFile(QString, QVector*); diff --git a/ui/firmwareuploaderwindow.ui b/ui/firmwareuploaderwindow.ui index c49903a..27a4983 100644 --- a/ui/firmwareuploaderwindow.ui +++ b/ui/firmwareuploaderwindow.ui @@ -11,7 +11,7 @@ - Dialog + Firmware Updater