Added a format tester for every input format and an auto-loader that

tries to guess the file type based on its contents.

Not completely stable yet but still a lot more fun than trying to find
the file format in a list of 19 file formats.
This commit is contained in:
Collin Kidder
2019-04-11 22:23:47 -04:00
parent a716eb8a30
commit f14247cc35
2 changed files with 1111 additions and 21 deletions
+1088 -21
View File
File diff suppressed because it is too large Load Diff
+23
View File
@@ -30,6 +30,7 @@ public:
static bool saveFrameFile(QString &, const QVector<CANFrame>*);
//These do the actual loading and saving and can be used directly if you'd prefer
static bool autoDetectLoadFile(QString, QVector<CANFrame>*);
static bool loadCRTDFile(QString, QVector<CANFrame>*);
static bool loadNativeCSVFile(QString, QVector<CANFrame>*);
static bool loadGenericCSVFile(QString, QVector<CANFrame>*);
@@ -47,6 +48,27 @@ public:
static bool loadCANHackerFile(QString filename, QVector<CANFrame>* frames);
static bool loadCabanaFile(QString filename, QVector<CANFrame>* frames);
static bool loadCANOpenFile(QString filename, QVector<CANFrame>* frames);
//functions that pre-scan a file to try to figure out if they could read it. Used to automatically determine
//file type and load it.
static bool isCRTDFile(QString);
static bool isNativeCSVFile(QString);
static bool isGenericCSVFile(QString);
static bool isLogFile(QString);
static bool isMicrochipFile(QString);
static bool isTraceFile(QString);
static bool isIXXATFile(QString);
static bool isCANDOFile(QString);
static bool isVehicleSpyFile(QString);
static bool isCanDumpFile(QString);
static bool isPCANFile(QString);
static bool isKvaserFile(QString);
static bool isCanalyzerASC(QString);
static bool isCanalyzerBLF(QString);
static bool isCANHackerFile(QString filename);
static bool isCabanaFile(QString filename);
static bool isCANOpenFile(QString filename);
static bool saveCRTDFile(QString, const QVector<CANFrame>*);
static bool saveNativeCSVFile(QString, const QVector<CANFrame>*);
static bool saveGenericCSVFile(QString, const QVector<CANFrame>*);
@@ -59,6 +81,7 @@ public:
static bool saveCanDumpFile(QString filename, const QVector<CANFrame> * frames);
static bool saveCabanaFile(QString filename, const QVector<CANFrame>* frames);
static bool saveCanalyzerASC(QString filename, const QVector<CANFrame>* frames);
static bool openContinuousNative();
static bool closeContinuousNative();
static bool writeContinuousNative(const QVector<CANFrame>*, int);