43 lines
902 B
C++
43 lines
902 B
C++
#pragma once
|
|
|
|
#include <QDialog>
|
|
#include <QProcess>
|
|
#include <QFileDialog>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QTextEdit>
|
|
|
|
class UpdateFPGA : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
UpdateFPGA(const QString & pythonScriptPath, QWidget *parent = nullptr);
|
|
~UpdateFPGA();
|
|
void init();
|
|
|
|
private slots:
|
|
void startUpdate();
|
|
void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
|
void processError(QProcess::ProcessError error);
|
|
|
|
private:
|
|
QString m_PythonScriptPath;
|
|
QLabel* m_Title;
|
|
QPushButton* m_CloseBtn;
|
|
QPushButton* m_UpdateButton;
|
|
QLabel* logLabel;
|
|
QTextEdit* logTextEdit;
|
|
QProcess* conversionProcess;
|
|
|
|
// void init();
|
|
QString getErrorDescription(int errorCode);
|
|
QString findValidPythonInterpreter();
|
|
bool isValidPythonWithSerial(const QString& pythonPath);
|
|
|
|
signals:
|
|
void upgradeFPGAFinished();
|
|
|
|
};
|
|
|