LogCompressor.h 1.05 KB
Newer Older
pixhawk's avatar
pixhawk committed
1 2 3 4 5 6 7
#ifndef LOGCOMPRESSOR_H
#define LOGCOMPRESSOR_H

#include <QThread>

class LogCompressor : public QThread
{
8
    Q_OBJECT
pixhawk's avatar
pixhawk committed
9
public:
10
    /** @brief Create the log compressor. It will only get active upon calling startCompression() */
11
    LogCompressor(QString logFileName, QString outFileName="", int uasid = 0);
12 13
    /** @brief Start the compression of a raw, line-based logfile into a CSV file */
    void startCompression(bool holeFilling=false);
14 15 16
    bool isFinished();
    int getDataLines();
    int getCurrentLine();
17

pixhawk's avatar
pixhawk committed
18 19 20
protected:
    void run();
    QString logFileName;
21 22 23 24
    QString outFileName;
    bool running;
    int currentDataLine;
    int dataLines;
pixhawk's avatar
pixhawk committed
25
    int uasid;
26
    bool holeFillingEnabled;       ///< Enables the filling of holes in the dataset with the previous value (or NaN if none exists)
27 28 29 30 31

signals:
    /** @brief This signal is emitted once a logfile has been finished writing
     * @param fileName The name out the output (CSV) file
     */
lm's avatar
lm committed
32
    void logProcessingStatusChanged(QString);
33
    void finishedFile(QString fileName);
pixhawk's avatar
pixhawk committed
34 35 36
};

#endif // LOGCOMPRESSOR_H