#pragma once #include #include #include #include #include #include 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); };