104 lines
5.1 KiB
C#
104 lines
5.1 KiB
C#
|
|
using MainShell.Process;
|
|||
|
|
using System;
|
|||
|
|
|
|||
|
|
namespace MainShell.ProcessResult
|
|||
|
|
{
|
|||
|
|
public class AutoProductionResumeValidator
|
|||
|
|
{
|
|||
|
|
public bool IsStateConsistentForResume(
|
|||
|
|
string resumeStepId,
|
|||
|
|
PreparationAreaProcessState preparationState,
|
|||
|
|
CurrentChipProcessState currentChipState)
|
|||
|
|
{
|
|||
|
|
if (string.IsNullOrWhiteSpace(resumeStepId))
|
|||
|
|
{
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (preparationState != null && preparationState.Status == ChipPreparationStatus.Faulted)
|
|||
|
|
{
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CurrentChipLifecycleState chipState = currentChipState == null
|
|||
|
|
? CurrentChipLifecycleState.Empty
|
|||
|
|
: currentChipState.State;
|
|||
|
|
|
|||
|
|
if (string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.SubstrateLoadEntry, StringComparison.OrdinalIgnoreCase) ||
|
|||
|
|
string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.PreparationSignalEntry, StringComparison.OrdinalIgnoreCase))
|
|||
|
|
{
|
|||
|
|
return preparationState == null || preparationState.Status != ChipPreparationStatus.Faulted;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.ChipPreparationSyncEntry, StringComparison.OrdinalIgnoreCase))
|
|||
|
|
{
|
|||
|
|
return chipState == CurrentChipLifecycleState.Loading ||
|
|||
|
|
chipState == CurrentChipLifecycleState.LoadedPendingTransfer ||
|
|||
|
|
chipState == CurrentChipLifecycleState.InUse ||
|
|||
|
|
(preparationState != null && preparationState.Status == ChipPreparationStatus.Loaded);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.PreTransferValidationEntry, StringComparison.OrdinalIgnoreCase) ||
|
|||
|
|
string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.ChipStraighteningEntry, StringComparison.OrdinalIgnoreCase) ||
|
|||
|
|
string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.DiePositionEntry, StringComparison.OrdinalIgnoreCase) ||
|
|||
|
|
string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.DieTransferEntry, StringComparison.OrdinalIgnoreCase) ||
|
|||
|
|
string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.DieRecheckEntry, StringComparison.OrdinalIgnoreCase))
|
|||
|
|
{
|
|||
|
|
return chipState == CurrentChipLifecycleState.LoadedPendingTransfer ||
|
|||
|
|
chipState == CurrentChipLifecycleState.InUse ||
|
|||
|
|
(preparationState != null && preparationState.Status == ChipPreparationStatus.Loaded);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.ChipUnloadEntry, StringComparison.OrdinalIgnoreCase))
|
|||
|
|
{
|
|||
|
|
return chipState == CurrentChipLifecycleState.PendingUnload ||
|
|||
|
|
chipState == CurrentChipLifecycleState.Unloading ||
|
|||
|
|
chipState == CurrentChipLifecycleState.InUse;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.SubstrateUnloadEntry, StringComparison.OrdinalIgnoreCase))
|
|||
|
|
{
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public string BuildResumeValidationError(
|
|||
|
|
string resumeStepId,
|
|||
|
|
PreparationAreaProcessState preparationState,
|
|||
|
|
CurrentChipProcessState currentChipState)
|
|||
|
|
{
|
|||
|
|
if (IsStateConsistentForResume(resumeStepId, preparationState, currentChipState))
|
|||
|
|
{
|
|||
|
|
return string.Empty;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (preparationState != null && preparationState.Status == ChipPreparationStatus.Faulted)
|
|||
|
|
{
|
|||
|
|
return "<22>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ָ̻<CCBB>ʧ<EFBFBD>ܣ<EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD>ڹ<EFBFBD><DAB9><EFBFBD>״̬<D7B4><CCAC>";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.DieTransferEntry, StringComparison.OrdinalIgnoreCase) ||
|
|||
|
|
string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.DieRecheckEntry, StringComparison.OrdinalIgnoreCase) ||
|
|||
|
|
string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.DiePositionEntry, StringComparison.OrdinalIgnoreCase) ||
|
|||
|
|
string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.ChipStraighteningEntry, StringComparison.OrdinalIgnoreCase) ||
|
|||
|
|
string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.PreTransferValidationEntry, StringComparison.OrdinalIgnoreCase))
|
|||
|
|
{
|
|||
|
|
return "<22>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ָ̻<CCBB>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>ǰоƬ״̬<D7B4><CCAC><EFBFBD><EFBFBD>װǰ<D7B0><C7B0><EFBFBD><EFBFBD>״̬<D7B4><CCAC>һ<EFBFBD>¡<EFBFBD>";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.ChipPreparationSyncEntry, StringComparison.OrdinalIgnoreCase))
|
|||
|
|
{
|
|||
|
|
return "<22>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ָ̻<CCBB>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>ǰоƬ<D0BE><C6AC><EFBFBD><EFBFBD>״̬<D7B4><CCAC>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>״̬<D7B4><CCAC>һ<EFBFBD>¡<EFBFBD>";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (string.Equals(resumeStepId, WorkflowStepIds.AutoProduction.ChipUnloadEntry, StringComparison.OrdinalIgnoreCase))
|
|||
|
|
{
|
|||
|
|
return "<22>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ָ̻<CCBB>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>ǰоƬ״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>оƬ<D0BE><C6AC><EFBFBD>ϻָ<CFBB><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return "<22>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ָ̻<CCBB>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>ǰ<EFBFBD><C7B0>Դ״̬<D7B4><CCAC><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>ڲ<EFBFBD>һ<EFBFBD>¡<EFBFBD>";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|