订单流程添加修改
This commit is contained in:
@@ -20,9 +20,16 @@ public:
|
||||
Idle,
|
||||
Preparing,
|
||||
WaitingDeviceReady,
|
||||
RackPicking,
|
||||
FrontLoading,
|
||||
Loading,
|
||||
FrontChecking,
|
||||
FrontUnloading,
|
||||
Flipping,
|
||||
BackLoading,
|
||||
BackChecking,
|
||||
BackUnloading,
|
||||
RackPlacing,
|
||||
Judging,
|
||||
Unloading,
|
||||
Paused,
|
||||
@@ -41,6 +48,9 @@ public:
|
||||
State state() const;
|
||||
QString stateName() const;
|
||||
int orderId() const;
|
||||
int currentTrayNo() const;
|
||||
int currentSlotNo() const;
|
||||
QString inspectionMode() const;
|
||||
Workpiece currentWorkpiece() const;
|
||||
|
||||
bool start(int orderId, QString *error = nullptr);
|
||||
@@ -56,6 +66,8 @@ public:
|
||||
signals:
|
||||
void stateChanged(ProductionService::State state, const QString &name);
|
||||
void currentWorkpieceChanged(int workpieceId, const QString &barcode);
|
||||
void currentWorkpieceSnapshotChanged(const Workpiece &workpiece);
|
||||
void currentPositionChanged(int trayNo, int slotNo);
|
||||
void productionFinished(int orderId);
|
||||
void productionError(const QString &error);
|
||||
void alarmRaised(const QString &code, const QString &message);
|
||||
@@ -69,8 +81,10 @@ private slots:
|
||||
void onDeviceStatusChanged(const DeviceStatus &status);
|
||||
void onCommunicationError(const QString &error);
|
||||
|
||||
private:
|
||||
public:
|
||||
explicit ProductionService(QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
ProductionService(const ProductionService &) = delete;
|
||||
ProductionService &operator=(const ProductionService &) = delete;
|
||||
|
||||
@@ -85,6 +99,12 @@ private:
|
||||
void tickProduction();
|
||||
bool processProductionStep(State state, QString *error);
|
||||
bool recoverFromPlcStep(QString *error);
|
||||
bool executeCurrentAction(DeviceService::ProductionAction action,
|
||||
const QString &nextProcessStep,
|
||||
State nextState, QString *error);
|
||||
bool recordInspection(const QString &side, int rawResult,
|
||||
const QString &resultState, QString *error);
|
||||
QString resultStateForRawResult(int rawResult) const;
|
||||
bool ensureOrderRunning(QString *error);
|
||||
bool checkRecoverySafety(QString *error) const;
|
||||
bool mapPlcStepToState(State *state, QString *processStep) const;
|
||||
@@ -118,8 +138,16 @@ private:
|
||||
bool m_deviceStatusValid;
|
||||
int m_recoveryRetryCount;
|
||||
int m_processElapsedMs;
|
||||
int m_currentTrayNo;
|
||||
int m_currentSlotNo;
|
||||
int m_frontRawResult;
|
||||
QString m_inspectionMode;
|
||||
QString m_frontResultState;
|
||||
QString m_currentProcessStep;
|
||||
QString m_lastError;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(ProductionService::State)
|
||||
Q_DECLARE_METATYPE(Workpiece)
|
||||
|
||||
#endif // PRODUCTIONSERVICE_H
|
||||
|
||||
Reference in New Issue
Block a user