feat(production): 修改订单清除按钮功能---除了清除报警、也复位状态,让订单能继续执行
This commit is contained in:
@@ -52,6 +52,10 @@ void ProductionWorker::ensureService()
|
||||
this, &ProductionWorker::recoveryDecisionRequired);
|
||||
connect(m_service, &ProductionService::recoveryBusyChanged,
|
||||
this, &ProductionWorker::recoveryBusyChanged);
|
||||
connect(m_service, &ProductionService::alarmOperationBusyChanged,
|
||||
this, &ProductionWorker::alarmOperationBusyChanged);
|
||||
connect(m_service, &ProductionService::alarmOperationFinished,
|
||||
this, &ProductionWorker::alarmOperationFinished);
|
||||
}
|
||||
|
||||
void ProductionWorker::requestStopImmediate()
|
||||
@@ -123,7 +127,22 @@ void ProductionWorker::requestClearAlarm()
|
||||
{
|
||||
ensureService();
|
||||
QString error;
|
||||
reportFailure(m_service->clearAlarm(&error), error);
|
||||
if (!m_service->clearAlarm(&error))
|
||||
emit alarmOperationFinished(false, false, error);
|
||||
}
|
||||
|
||||
void ProductionWorker::requestResetContext()
|
||||
{
|
||||
ensureService();
|
||||
emit resetContextReady(m_service->resetContext());
|
||||
}
|
||||
|
||||
void ProductionWorker::requestReset(const QJsonObject &context)
|
||||
{
|
||||
ensureService();
|
||||
QString error;
|
||||
if (!m_service->resetProduction(context, &error))
|
||||
emit alarmOperationFinished(true, false, error);
|
||||
}
|
||||
|
||||
void ProductionWorker::requestRecover()
|
||||
@@ -160,10 +179,14 @@ void ProductionWorker::requestRestore()
|
||||
void ProductionWorker::requestShutdown()
|
||||
{
|
||||
ensureService();
|
||||
const bool resetShutdown = m_service->snapshot().resetRequired;
|
||||
m_service->shutdown(
|
||||
[this](bool success, const QString &error) {
|
||||
[this, resetShutdown](bool success, const QString &error) {
|
||||
if (!success) {
|
||||
reportFailure(false, error);
|
||||
// Reset has already persisted its unfinished marker. Report
|
||||
// cleanup failure but let the worker exit with that marker.
|
||||
if (resetShutdown) emit shutdownReady();
|
||||
return;
|
||||
}
|
||||
emit shutdownReady();
|
||||
|
||||
Reference in New Issue
Block a user