Files
edgetx-gx12/companion/src/process_flash.h
T
2015-09-26 07:59:04 +02:00

54 lines
1.1 KiB
C++

#ifndef FLASHPROCESS_H_
#define FLASHPROCESS_H_
#include <QObject>
#include <QString>
#include <QStringList>
class ProgressWidget;
class QProcess;
class QTimer;
class FlashProcess : public QObject
{
Q_OBJECT
public:
FlashProcess(const QString &cmd, const QStringList &args, ProgressWidget *progress);
~FlashProcess();
bool run();
signals:
void finished();
protected slots:
void onStarted();
void onReadyReadStandardOutput();
void onReadyReadStandardError();
void onFinished(int);
void onKillTimerElapsed();
protected:
void analyseStandardOutput(const QString &text);
void analyseStandardError(const QString &text);
void errorWizard();
void addReadFuses();
ProgressWidget *progress;
const QString cmd;
const QStringList args;
QProcess *process;
bool hasErrors;
QString currStdoutLine;
QString currStderrLine;
unsigned int lfuse;
unsigned int hfuse;
unsigned int efuse;
enum FlashPhase { READING, WRITING, VERIFYING };
FlashPhase flashPhase;
#if !__GNUC__
QTimer *killTimer;
#endif
};
#endif // FLASHPROCESS_H_