ATBUpdateTool/UpdatePTUDevCtrl/mainwindow.h

86 lines
2.1 KiB
C
Raw Normal View History

2023-07-31 16:55:36 +02:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTimer>
#include <QStatusBar>
2023-07-31 16:55:36 +02:00
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
#include "worker.h"
#include "update.h"
#include "update_dc_event.h"
#define EMERGENCY_LEAVE_BL 0
class hwinf;
2023-07-31 16:55:36 +02:00
class MainWindow : public QMainWindow {
Q_OBJECT
protected:
void customEvent(QEvent *event) override;
2023-07-31 16:55:36 +02:00
public:
MainWindow(Worker *worker, QWidget *parent = nullptr);
2023-07-31 16:55:36 +02:00
~MainWindow();
static const int START_PROGRESS_LOOP = -1;
static const int STOP_PROGRESS_LOOP = -2;
static const int BL_START_COUNT = 5;
static const int BL_CHECK_COUNT = 5;
static const int BL_IS_UP_COUNT = 5;
static const int BL_STOP_COUNT = 5;
UpdateDcEvent::UpdateStep updateStep() const { return m_updateStep; }
void setUpdateStep(UpdateDcEvent::UpdateStep updateStep) { m_updateStep = updateStep; }
2024-12-20 13:01:34 +01:00
QString targetDcVersion() {return m_targetDcVersion; }
public slots:
void onAppendText(QString, QString suffix = "");
2024-12-20 13:01:34 +01:00
void onInsertText(QString);
void onReplaceLast(QStringList, QString suffix = "");
2023-08-07 13:53:48 +02:00
void onReplaceLast(QString, QString suffix = "");
void onShowErrorMessage(QString, QString);
void onShowStatusMessage(QString, QString);
2023-10-23 16:16:11 +02:00
void onShowErrorMessage(QStringList);
void onShowStatusMessage(QStringList);
void onStopStartTimer();
void onRestartExitTimer();
void onEnableExit();
void onDisableExit();
2024-12-20 13:01:34 +01:00
void onShowDcDownload(QString);
void onSetDcDownloadProgress(int);
void onShowSummary(QString);
#if EMERGENCY_LEAVE_BL==1
void emergencyLeaveBL();
#endif
signals:
#if EMERGENCY_LEAVE_BL==1
void leaveBL();
#endif
2023-07-31 16:55:36 +02:00
private slots:
void onQuit();
2023-07-31 16:55:36 +02:00
private:
void scrollDownTextEdit();
void onShowMessage(QString, QString);
2023-07-31 16:55:36 +02:00
Ui::MainWindow *ui;
Worker *m_worker;
int const m_width;
QTimer *m_startTimer;
QTimer *m_exitTimer;
bool m_progressRunning;
2023-10-20 13:55:18 +02:00
//int m_progressValue;
UpdateDcEvent::UpdateStep m_updateStep;
QTimer *m_statusTimer;
2024-12-20 13:01:34 +01:00
QString m_targetDcVersion;
2023-07-31 16:55:36 +02:00
};
#endif // MAINWINDOW_H