54 lines
1.1 KiB
C++
Executable File
54 lines
1.1 KiB
C++
Executable File
#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_
|