Files
VX5_KRO_GearPump/oldProject/UpdateFPGA.h
T
2026-06-29 14:54:30 +08:00

44 lines
972 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);
void closeUI();
private:
QString m_PythonScriptPath;
QLabel* m_Title;
QPushButton* m_CloseBtn;
QPushButton* m_UpdateButton;
QLabel* logLabel;
QTextEdit* logTextEdit;
QProcess* conversionProcess;
bool showChinese;
QString getErrorDescription(int errorCode);
QString findValidPythonInterpreter();
bool isValidPythonWithSerial(const QString& pythonPath);
signals:
void upgradeFPGAFinished(bool);
};