订单流程添加修改
This commit is contained in:
+256
-106
@@ -3,6 +3,7 @@
|
||||
#include "../config/configmanager.h"
|
||||
#include "../repositories/productionrepository.h"
|
||||
#include "orderservice.h"
|
||||
#include "trayservice.h"
|
||||
#include "workpieceservice.h"
|
||||
|
||||
#include <QDebug>
|
||||
@@ -24,6 +25,9 @@ ProductionService::ProductionService(QObject *parent)
|
||||
, m_deviceStatusValid(false)
|
||||
, m_recoveryRetryCount(0)
|
||||
, m_processElapsedMs(0)
|
||||
, m_currentTrayNo(0)
|
||||
, m_currentSlotNo(0)
|
||||
, m_frontRawResult(0)
|
||||
{
|
||||
connect(m_timer, &QTimer::timeout, this, &ProductionService::tick);
|
||||
connect(&DeviceService::instance(), &DeviceService::statusChanged,
|
||||
@@ -48,9 +52,16 @@ QString ProductionService::stateNameForState(State state) const
|
||||
case Idle: return "IDLE";
|
||||
case Preparing: return "PREPARING";
|
||||
case WaitingDeviceReady: return "WAITING_DEVICE_READY";
|
||||
case RackPicking: return "RACK_PICKING";
|
||||
case FrontLoading: return "FRONT_LOADING";
|
||||
case Loading: return "LOADING";
|
||||
case FrontChecking: return "FRONT_CHECKING";
|
||||
case FrontUnloading: return "FRONT_UNLOADING";
|
||||
case Flipping: return "FLIPPING";
|
||||
case BackLoading: return "BACK_LOADING";
|
||||
case BackChecking: return "BACK_CHECKING";
|
||||
case BackUnloading: return "BACK_UNLOADING";
|
||||
case RackPlacing: return "RACK_PLACING";
|
||||
case Judging: return "JUDGING";
|
||||
case Unloading: return "UNLOADING";
|
||||
case Paused: return "PAUSED";
|
||||
@@ -70,6 +81,21 @@ int ProductionService::orderId() const
|
||||
return m_orderId;
|
||||
}
|
||||
|
||||
int ProductionService::currentTrayNo() const
|
||||
{
|
||||
return m_currentTrayNo;
|
||||
}
|
||||
|
||||
int ProductionService::currentSlotNo() const
|
||||
{
|
||||
return m_currentSlotNo;
|
||||
}
|
||||
|
||||
QString ProductionService::inspectionMode() const
|
||||
{
|
||||
return m_inspectionMode;
|
||||
}
|
||||
|
||||
Workpiece ProductionService::currentWorkpiece() const
|
||||
{
|
||||
return m_currentWorkpiece;
|
||||
@@ -101,6 +127,16 @@ bool ProductionService::start(int orderId, QString *error)
|
||||
return false;
|
||||
}
|
||||
|
||||
m_inspectionMode = order.inspectionMode;
|
||||
m_currentTrayNo = 0;
|
||||
m_currentSlotNo = 0;
|
||||
m_frontRawResult = 0;
|
||||
m_frontResultState.clear();
|
||||
|
||||
if (!DeviceService::instance().setInspectionMode(
|
||||
m_inspectionMode, error)) {
|
||||
return false;
|
||||
}
|
||||
if (!DeviceService::instance().start(error)
|
||||
|| !OrderService::instance().startOrder(orderId, error)) {
|
||||
return false;
|
||||
@@ -115,7 +151,9 @@ bool ProductionService::start(int orderId, QString *error)
|
||||
|
||||
QString persistenceError;
|
||||
m_runId = ProductionRepository().createRun(
|
||||
m_orderId, "PREPARING", "PREPARING", &persistenceError);
|
||||
m_orderId, "PREPARING", "PREPARING", order.inspectionMode,
|
||||
order.startTrayNo, order.startSlotNo, order.planNum,
|
||||
&persistenceError);
|
||||
if (m_runId <= 0) {
|
||||
DeviceService::instance().pause();
|
||||
OrderService::instance().pauseOrder(m_orderId);
|
||||
@@ -168,6 +206,8 @@ bool ProductionService::resume(QString *error)
|
||||
}
|
||||
|
||||
if (!checkRecoverySafety(error)
|
||||
|| !DeviceService::instance().setInspectionMode(
|
||||
m_inspectionMode, error)
|
||||
|| !DeviceService::instance().start(error)
|
||||
|| !OrderService::instance().resumeOrder(m_orderId, error)) {
|
||||
return false;
|
||||
@@ -235,6 +275,8 @@ bool ProductionService::stop(QString *error)
|
||||
m_currentWorkpiece = Workpiece();
|
||||
clearProcessTimer();
|
||||
emit currentWorkpieceChanged(0, QString());
|
||||
emit currentWorkpieceSnapshotChanged(m_currentWorkpiece);
|
||||
emit currentPositionChanged(0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -298,6 +340,7 @@ bool ProductionService::restoreActiveRun(QString *error)
|
||||
|
||||
m_runId = run.id;
|
||||
m_orderId = run.orderId;
|
||||
m_inspectionMode = run.inspectionMode;
|
||||
m_recoveryRetryCount = run.recoveryRetryCount;
|
||||
m_lastError = run.lastError;
|
||||
|
||||
@@ -312,6 +355,8 @@ bool ProductionService::restoreActiveRun(QString *error)
|
||||
}
|
||||
emit currentWorkpieceChanged(m_currentWorkpiece.id,
|
||||
m_currentWorkpiece.barcode);
|
||||
emit currentWorkpieceSnapshotChanged(m_currentWorkpiece);
|
||||
emit currentPositionChanged(m_currentTrayNo, m_currentSlotNo);
|
||||
startProcessTimer(m_currentWorkpiece.processStep);
|
||||
emitProcessElapsed();
|
||||
}
|
||||
@@ -351,6 +396,8 @@ bool ProductionService::recover(QString *error)
|
||||
|
||||
QString operationError;
|
||||
if (!ensureOrderRunning(&operationError)
|
||||
|| !DeviceService::instance().setInspectionMode(
|
||||
m_inspectionMode, &operationError)
|
||||
|| !DeviceService::instance().start(&operationError)) {
|
||||
if (error) {
|
||||
*error = operationError;
|
||||
@@ -392,6 +439,8 @@ bool ProductionService::retry(QString *error)
|
||||
|
||||
QString operationError;
|
||||
if (!ensureOrderRunning(&operationError)
|
||||
|| !DeviceService::instance().setInspectionMode(
|
||||
m_inspectionMode, &operationError)
|
||||
|| !DeviceService::instance().start(&operationError)) {
|
||||
if (error) {
|
||||
*error = operationError;
|
||||
@@ -454,7 +503,8 @@ bool ProductionService::markCurrentWorkpieceNg(QString *error)
|
||||
const QString previousProcessStep = m_currentWorkpiece.processStep;
|
||||
if (!WorkpieceService::instance().completeWithInspection(
|
||||
m_currentWorkpiece.id, "NG", "COMPLETE", previousProcessStep,
|
||||
durationMs, -1, "NG", m_deviceStatus.currentStep, "MANUAL",
|
||||
durationMs, -1, "NG", m_deviceStatus.currentStep,
|
||||
m_inspectionMode, "MANUAL",
|
||||
&operationError)) {
|
||||
if (error) {
|
||||
*error = operationError;
|
||||
@@ -471,6 +521,8 @@ bool ProductionService::markCurrentWorkpieceNg(QString *error)
|
||||
m_recoveryRetryCount = 0;
|
||||
m_lastError.clear();
|
||||
emit currentWorkpieceChanged(0, QString());
|
||||
emit currentWorkpieceSnapshotChanged(m_currentWorkpiece);
|
||||
emit currentPositionChanged(0, 0);
|
||||
setState(Preparing);
|
||||
const int interval = qMax(100, ConfigManager::instance()
|
||||
.modbusConfig().pollIntervalMs);
|
||||
@@ -525,12 +577,35 @@ bool ProductionService::claimNextWorkpiece(QString *error)
|
||||
|
||||
m_currentWorkpiece = workpiece;
|
||||
m_recoveryRetryCount = 0;
|
||||
m_currentTrayNo = 0;
|
||||
m_currentSlotNo = workpiece.trayPos;
|
||||
QString trayError;
|
||||
const QList<Tray> trays = TrayService::instance().listTrays(&trayError);
|
||||
if (!trayError.isEmpty()) {
|
||||
if (error) {
|
||||
*error = trayError;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
for (int index = 0; index < trays.size(); ++index) {
|
||||
if (trays.at(index).id == workpiece.trayId) {
|
||||
m_currentTrayNo = index + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (m_currentTrayNo <= 0 || m_currentSlotNo < 1 || m_currentSlotNo > 49) {
|
||||
if (error) {
|
||||
*error = "Current workpiece tray position cannot be mapped to PLC";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QString persistenceError;
|
||||
const QString source = ConfigManager::instance().simulationMode()
|
||||
? "SIMULATION" : "PLC";
|
||||
if (!ProductionRepository().startWorkpieceProcess(
|
||||
m_orderId, workpiece.id, workpiece.processStep,
|
||||
m_deviceStatus.currentStep,
|
||||
m_inspectionMode, m_deviceStatus.currentStep,
|
||||
source, &persistenceError)) {
|
||||
if (error) {
|
||||
*error = persistenceError;
|
||||
@@ -539,6 +614,8 @@ bool ProductionService::claimNextWorkpiece(QString *error)
|
||||
}
|
||||
startProcessTimer(workpiece.processStep);
|
||||
emit currentWorkpieceChanged(workpiece.id, workpiece.barcode);
|
||||
emit currentWorkpieceSnapshotChanged(m_currentWorkpiece);
|
||||
emit currentPositionChanged(m_currentTrayNo, m_currentSlotNo);
|
||||
emitProcessElapsed();
|
||||
setState(WaitingDeviceReady);
|
||||
return true;
|
||||
@@ -559,8 +636,9 @@ bool ProductionService::updateCurrentProcessStep(const QString &processStep,
|
||||
? "SIMULATION" : "PLC";
|
||||
const int durationMs = currentProcessElapsedMs();
|
||||
if (!WorkpieceService::instance().updateProcessStepWithRecord(
|
||||
m_currentWorkpiece.id, processStep, m_deviceStatus.currentStep,
|
||||
source, durationMs, error, forceRestart)) {
|
||||
m_currentWorkpiece.id, processStep, m_inspectionMode,
|
||||
m_deviceStatus.currentStep, source, durationMs, error,
|
||||
forceRestart)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -570,6 +648,55 @@ bool ProductionService::updateCurrentProcessStep(const QString &processStep,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ProductionService::executeCurrentAction(
|
||||
DeviceService::ProductionAction action,
|
||||
const QString &nextProcessStep, State nextState, QString *error)
|
||||
{
|
||||
if (m_currentWorkpiece.id <= 0) {
|
||||
if (error) {
|
||||
*error = "No current workpiece";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!DeviceService::instance().executeProductionAction(
|
||||
action, m_currentTrayNo, m_currentSlotNo, error)) {
|
||||
return false;
|
||||
}
|
||||
if (!updateCurrentProcessStep(nextProcessStep, error)) {
|
||||
return false;
|
||||
}
|
||||
setState(nextState);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ProductionService::recordInspection(const QString &side, int rawResult,
|
||||
const QString &resultState,
|
||||
QString *error)
|
||||
{
|
||||
const QString source = ConfigManager::instance().simulationMode()
|
||||
? "SIMULATION" : "PLC";
|
||||
return WorkpieceService::instance().recordInspection(
|
||||
m_currentWorkpiece.id, side, rawResult, resultState,
|
||||
m_deviceStatus.currentStep, m_inspectionMode, source,
|
||||
QString("%1 inspection result").arg(side), error);
|
||||
}
|
||||
|
||||
QString ProductionService::resultStateForRawResult(int rawResult) const
|
||||
{
|
||||
const ProductionConfig config = ConfigManager::instance().productionConfig();
|
||||
if (rawResult == config.okResult) {
|
||||
return "OK";
|
||||
}
|
||||
if (rawResult == config.ngResult) {
|
||||
return "NG";
|
||||
}
|
||||
if (rawResult == config.errorResult) {
|
||||
return "ERROR";
|
||||
}
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
void ProductionService::startProcessTimer(const QString &processStep)
|
||||
{
|
||||
m_currentProcessStep = processStep;
|
||||
@@ -751,17 +878,18 @@ bool ProductionService::finishCurrentWorkpiece(const QString &state,
|
||||
const QString source = ConfigManager::instance().simulationMode()
|
||||
? "SIMULATION" : "PLC";
|
||||
|
||||
setState(Unloading);
|
||||
if (!WorkpieceService::instance().completeWithInspection(
|
||||
m_currentWorkpiece.id, state, processStep,
|
||||
previousProcessStep, processDurationMs, rawResult, state,
|
||||
m_deviceStatus.currentStep, source, error)) {
|
||||
m_deviceStatus.currentStep, m_inspectionMode, source, error)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
clearProcessTimer();
|
||||
m_currentWorkpiece = Workpiece();
|
||||
emit currentWorkpieceChanged(0, QString());
|
||||
emit currentWorkpieceSnapshotChanged(m_currentWorkpiece);
|
||||
emit currentPositionChanged(0, 0);
|
||||
setState(Preparing);
|
||||
return true;
|
||||
}
|
||||
@@ -842,10 +970,10 @@ void ProductionService::tick()
|
||||
if (m_state == WaitingDeviceReady) {
|
||||
if (m_deviceStatus.plcReady && m_deviceStatus.robotReady) {
|
||||
QString error;
|
||||
if (!updateCurrentProcessStep("LOADING", &error)) {
|
||||
if (!updateCurrentProcessStep("RACK_PICKING", &error)) {
|
||||
fail(error);
|
||||
} else {
|
||||
setState(Loading);
|
||||
setState(RackPicking);
|
||||
}
|
||||
}
|
||||
emitProcessElapsed();
|
||||
@@ -871,65 +999,14 @@ void ProductionService::tickSimulation()
|
||||
return;
|
||||
}
|
||||
|
||||
switch (m_state) {
|
||||
case Loading: {
|
||||
QString error;
|
||||
if (!updateCurrentProcessStep("FRONT_CHECKING", &error)) {
|
||||
fail(error);
|
||||
} else {
|
||||
setState(FrontChecking);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FrontChecking: {
|
||||
QString error;
|
||||
if (!updateCurrentProcessStep("BACK_CHECKING", &error)) {
|
||||
fail(error);
|
||||
} else {
|
||||
setState(BackChecking);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BackChecking: {
|
||||
QString error;
|
||||
if (!updateCurrentProcessStep("JUDGING", &error)) {
|
||||
fail(error);
|
||||
} else {
|
||||
setState(Judging);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Judging: {
|
||||
const ProductionConfig config = ConfigManager::instance().productionConfig();
|
||||
QString resultState;
|
||||
if (config.simulationResult == config.okResult) {
|
||||
resultState = "OK";
|
||||
} else if (config.simulationResult == config.ngResult) {
|
||||
resultState = "NG";
|
||||
}
|
||||
QString error;
|
||||
if (resultState.isEmpty()) {
|
||||
fail("Invalid simulation inspection result");
|
||||
} else if (!finishCurrentWorkpiece(resultState, "COMPLETE", &error)) {
|
||||
fail(error);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
QString error;
|
||||
if (!processProductionStep(m_state, &error) && !error.isEmpty()) {
|
||||
fail(error);
|
||||
}
|
||||
}
|
||||
|
||||
void ProductionService::tickProduction()
|
||||
{
|
||||
if (m_state == TimeoutWarning) {
|
||||
QString error;
|
||||
if (!processProductionStep(m_timeoutState, &error) && !error.isEmpty()) {
|
||||
fail(error);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_state == RecoveryChecking) {
|
||||
QString error;
|
||||
if (!recoverFromPlcStep(&error) && !error.isEmpty()) {
|
||||
@@ -951,62 +1028,117 @@ void ProductionService::tickProduction()
|
||||
|
||||
bool ProductionService::processProductionStep(State state, QString *error)
|
||||
{
|
||||
const ProductionConfig config = ConfigManager::instance().productionConfig();
|
||||
QString resultState;
|
||||
switch (state) {
|
||||
case Loading:
|
||||
if (m_deviceStatus.currentStep == config.frontCheckStep) {
|
||||
if (!updateCurrentProcessStep("FRONT_CHECKING", error)) {
|
||||
case RackPicking:
|
||||
return executeCurrentAction(DeviceService::RackPick,
|
||||
"FRONT_LOADING", FrontLoading, error);
|
||||
case FrontLoading:
|
||||
return executeCurrentAction(DeviceService::FrontLoad,
|
||||
"FRONT_CHECKING", FrontChecking, error);
|
||||
case FrontChecking: {
|
||||
if (!DeviceService::instance().executeProductionAction(
|
||||
DeviceService::Inspect, m_currentTrayNo, m_currentSlotNo, error)) {
|
||||
return false;
|
||||
}
|
||||
if (!ConfigManager::instance().simulationMode()) {
|
||||
DeviceStatus status;
|
||||
if (!DeviceService::instance().readStatus(&status, error)) {
|
||||
return false;
|
||||
} else {
|
||||
setState(FrontChecking);
|
||||
}
|
||||
onDeviceStatusChanged(status);
|
||||
}
|
||||
break;
|
||||
case FrontChecking:
|
||||
if (m_deviceStatus.currentStep == config.backCheckStep) {
|
||||
if (!updateCurrentProcessStep("BACK_CHECKING", error)) {
|
||||
return false;
|
||||
} else {
|
||||
setState(BackChecking);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case BackChecking:
|
||||
if (m_deviceStatus.currentStep == config.unloadStep) {
|
||||
if (!updateCurrentProcessStep("JUDGING", error)) {
|
||||
return false;
|
||||
} else {
|
||||
setState(Judging);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Judging:
|
||||
if (m_deviceStatus.currentStep != config.cycleCompleteStep) {
|
||||
return true;
|
||||
}
|
||||
if (m_deviceStatus.checkResult == config.okResult) {
|
||||
resultState = "OK";
|
||||
} else if (m_deviceStatus.checkResult == config.ngResult) {
|
||||
resultState = "NG";
|
||||
} else if (m_deviceStatus.checkResult == config.errorResult) {
|
||||
const int frontRawResult = ConfigManager::instance().simulationMode()
|
||||
? ConfigManager::instance().productionConfig().simulationResult
|
||||
: static_cast<int>(m_deviceStatus.checkResult);
|
||||
const QString frontResultState =
|
||||
resultStateForRawResult(frontRawResult);
|
||||
if (frontResultState == "UNKNOWN" || frontResultState == "ERROR") {
|
||||
if (error) {
|
||||
*error = QString("PLC inspection error result: %1")
|
||||
.arg(m_deviceStatus.checkResult);
|
||||
*error = QString("Invalid front inspection result: %1")
|
||||
.arg(frontRawResult);
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
}
|
||||
if (!recordInspection("FRONT", frontRawResult,
|
||||
frontResultState, error)) {
|
||||
return false;
|
||||
}
|
||||
m_frontRawResult = frontRawResult;
|
||||
m_frontResultState = frontResultState;
|
||||
if (!updateCurrentProcessStep("FRONT_UNLOADING", error)) {
|
||||
return false;
|
||||
}
|
||||
setState(FrontUnloading);
|
||||
return true;
|
||||
}
|
||||
case FrontUnloading:
|
||||
return executeCurrentAction(
|
||||
DeviceService::FrontUnload,
|
||||
m_inspectionMode == "AFTER_PLATING" ? "RACK_PLACING" : "FLIPPING",
|
||||
m_inspectionMode == "AFTER_PLATING" ? RackPlacing : Flipping,
|
||||
error);
|
||||
case Flipping:
|
||||
return executeCurrentAction(DeviceService::Flip,
|
||||
"BACK_LOADING", BackLoading, error);
|
||||
case BackLoading:
|
||||
return executeCurrentAction(DeviceService::BackLoad,
|
||||
"BACK_CHECKING", BackChecking, error);
|
||||
case BackChecking: {
|
||||
if (!DeviceService::instance().executeProductionAction(
|
||||
DeviceService::Inspect, m_currentTrayNo, m_currentSlotNo, error)) {
|
||||
return false;
|
||||
}
|
||||
if (!ConfigManager::instance().simulationMode()) {
|
||||
DeviceStatus status;
|
||||
if (!DeviceService::instance().readStatus(&status, error)) {
|
||||
return false;
|
||||
}
|
||||
onDeviceStatusChanged(status);
|
||||
}
|
||||
const int backRawResult = ConfigManager::instance().simulationMode()
|
||||
? ConfigManager::instance().productionConfig().simulationResult
|
||||
: static_cast<int>(m_deviceStatus.checkResult);
|
||||
const QString backResultState =
|
||||
resultStateForRawResult(backRawResult);
|
||||
if (backResultState == "UNKNOWN" || backResultState == "ERROR") {
|
||||
if (error) {
|
||||
*error = QString("Unknown PLC inspection result: %1")
|
||||
.arg(m_deviceStatus.checkResult);
|
||||
*error = QString("Invalid back inspection result: %1")
|
||||
.arg(backRawResult);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!finishCurrentWorkpiece(resultState, "COMPLETE", error)) {
|
||||
if (!recordInspection("BACK", backRawResult,
|
||||
backResultState, error)) {
|
||||
return false;
|
||||
}
|
||||
const QString finalState =
|
||||
m_frontResultState == "OK" && backResultState == "OK"
|
||||
? "OK" : "NG";
|
||||
if (!updateCurrentProcessStep("BACK_UNLOADING", error)) {
|
||||
return false;
|
||||
}
|
||||
m_frontResultState = finalState;
|
||||
setState(BackUnloading);
|
||||
break;
|
||||
}
|
||||
case BackUnloading:
|
||||
return executeCurrentAction(DeviceService::BackUnload,
|
||||
"RACK_PLACING", RackPlacing, error);
|
||||
case RackPlacing: {
|
||||
if (!DeviceService::instance().executeProductionAction(
|
||||
DeviceService::RackPlace, m_currentTrayNo, m_currentSlotNo,
|
||||
error)) {
|
||||
return false;
|
||||
}
|
||||
QString finalState = m_frontResultState;
|
||||
if (finalState != "OK" && finalState != "NG") {
|
||||
if (error) {
|
||||
*error = "Final inspection result is not available";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return finishCurrentWorkpiece(finalState, "COMPLETE", error);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1075,8 +1207,12 @@ bool ProductionService::recoverFromPlcStep(QString *error)
|
||||
bool ProductionService::isTimedState(State state) const
|
||||
{
|
||||
return state == Preparing || state == WaitingDeviceReady
|
||||
|| state == RackPicking || state == FrontLoading
|
||||
|| state == Loading || state == FrontChecking
|
||||
|| state == BackChecking || state == Judging;
|
||||
|| state == FrontUnloading || state == Flipping
|
||||
|| state == BackLoading || state == BackChecking
|
||||
|| state == BackUnloading || state == RackPlacing
|
||||
|| state == Judging;
|
||||
}
|
||||
|
||||
QString ProductionService::processStepForState(State state) const
|
||||
@@ -1084,9 +1220,16 @@ QString ProductionService::processStepForState(State state) const
|
||||
switch (state) {
|
||||
case Preparing: return "PREPARING";
|
||||
case WaitingDeviceReady: return "WAITING_DEVICE_READY";
|
||||
case RackPicking: return "RACK_PICKING";
|
||||
case FrontLoading: return "FRONT_LOADING";
|
||||
case Loading: return "LOADING";
|
||||
case FrontChecking: return "FRONT_CHECKING";
|
||||
case FrontUnloading: return "FRONT_UNLOADING";
|
||||
case Flipping: return "FLIPPING";
|
||||
case BackLoading: return "BACK_LOADING";
|
||||
case BackChecking: return "BACK_CHECKING";
|
||||
case BackUnloading: return "BACK_UNLOADING";
|
||||
case RackPlacing: return "RACK_PLACING";
|
||||
case Judging: return "JUDGING";
|
||||
default: return QString();
|
||||
}
|
||||
@@ -1117,9 +1260,16 @@ ProductionService::State ProductionService::stateFromName(const QString &name) c
|
||||
{
|
||||
if (name == "PREPARING") return Preparing;
|
||||
if (name == "WAITING_DEVICE_READY") return WaitingDeviceReady;
|
||||
if (name == "RACK_PICKING") return RackPicking;
|
||||
if (name == "FRONT_LOADING") return FrontLoading;
|
||||
if (name == "LOADING") return Loading;
|
||||
if (name == "FRONT_CHECKING") return FrontChecking;
|
||||
if (name == "FRONT_UNLOADING") return FrontUnloading;
|
||||
if (name == "FLIPPING") return Flipping;
|
||||
if (name == "BACK_LOADING") return BackLoading;
|
||||
if (name == "BACK_CHECKING") return BackChecking;
|
||||
if (name == "BACK_UNLOADING") return BackUnloading;
|
||||
if (name == "RACK_PLACING") return RackPlacing;
|
||||
if (name == "JUDGING") return Judging;
|
||||
if (name == "UNLOADING") return Unloading;
|
||||
if (name == "PAUSED") return Paused;
|
||||
|
||||
Reference in New Issue
Block a user