first commit
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
#ifndef DASHBOARDPAGE_H
|
||||
#define DASHBOARDPAGE_H
|
||||
|
||||
#include "../services/productionservice.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QVector>
|
||||
|
||||
class QComboBox;
|
||||
class QTableWidget;
|
||||
class QGroupBox;
|
||||
class QResizeEvent;
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
class QTimer;
|
||||
|
||||
namespace Ui { class DashboardPage; }
|
||||
|
||||
class DashboardPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DashboardPage(QWidget *parent = nullptr);
|
||||
~DashboardPage();
|
||||
void addLog(const QString &type, const QString &module, const QString &content,
|
||||
const QString &status);
|
||||
|
||||
signals:
|
||||
void systemStateChanged(const QString &state);
|
||||
void currentStepChanged(const QString &step);
|
||||
void logRequested(const QString &type, const QString &module, const QString &action,
|
||||
const QString &content, const QString &status);
|
||||
|
||||
private slots:
|
||||
void startProduction();
|
||||
void pauseProduction();
|
||||
void stopProduction();
|
||||
void resetProduction();
|
||||
void clearAlarm();
|
||||
void onOrderChanged(int index);
|
||||
void onProductionStateChanged(ProductionService::State state,
|
||||
const QString &name);
|
||||
void onCurrentWorkpieceChanged(int workpieceId, const QString &barcode);
|
||||
void onProductionError(const QString &error);
|
||||
void onProductionFinished(int orderId);
|
||||
void onDeviceStatusChanged(const DeviceStatus &status);
|
||||
void onProcessElapsedChanged(const QString &processStep, int elapsedMs);
|
||||
void onTimeoutRecoveryRequired(const QString &state, const QString &message);
|
||||
void onRecoveryCompleted(const QString &mode);
|
||||
void recoverProduction();
|
||||
void retryRecovery();
|
||||
void markWorkpieceNg();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
private:
|
||||
void loadOrderOptions();
|
||||
void updateOrderSummary();
|
||||
void updateProductionStats();
|
||||
void updateRackSize();
|
||||
void updateRecoveryButtons();
|
||||
void refreshProcessRecords();
|
||||
void updateCurrentProcessDuration(int elapsedMs);
|
||||
static QString formatDuration(int elapsedMs);
|
||||
|
||||
Ui::DashboardPage *ui;
|
||||
QComboBox *orderCombo;
|
||||
QGroupBox *rackBox;
|
||||
QVector<QLabel *> rackTrayCells;
|
||||
QLabel *deviceStatusLabel;
|
||||
QPushButton *recoverButton;
|
||||
QPushButton *retryButton;
|
||||
QPushButton *markNgButton;
|
||||
QPushButton *stopButton;
|
||||
QGroupBox *processBox;
|
||||
QLabel *currentProcessLabel;
|
||||
QLabel *processElapsedLabel;
|
||||
QLabel *processTotalElapsedLabel;
|
||||
QTableWidget *processTable;
|
||||
QTimer *processRefreshTimer;
|
||||
int currentProcessElapsedMs;
|
||||
};
|
||||
|
||||
#endif // DASHBOARDPAGE_H
|
||||
Reference in New Issue
Block a user