using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Aitex.Core.RT.Routine; using EfemDualSchedulerLib.Schedulers; using MECF.Framework.Common.Equipment; using MECF.Framework.Common.Jobs; namespace EfemDualSchedulerLib { public partial class AutoTransfer { private bool _isInited; private void InitClean() { foreach (var pm in _lstPms) { pm.InitClean(); } } private void ClearCleanInfo() { foreach (var pm in _lstPms) { pm.ResetClean(true, true, true); } } public void ResetIdleCleanTime(string module) { if (string.IsNullOrEmpty(module)) { foreach (var schedulerPm in _lstPms) { schedulerPm.ResetIdleCleanTime(); } } else { SchedulerPM pm = _lstPms.Find(x => x.Module.ToString() == module); if (pm != null) { pm.ResetIdleCleanTime(); } } } public void ResetIdlePurgeTime(string module) { if (string.IsNullOrEmpty(module)) { foreach (var schedulerPm in _lstPms) { schedulerPm.ResetIdlePurgeTime(); } } else { SchedulerPM pm = _lstPms.Find(x => x.Module.ToString() == module); if (pm != null) { pm.ResetIdlePurgeTime(); } } } public Result MonitorCleanTasks() { if (!_isInited) { _isInited = true; InitClean(); } foreach (var pm in _lstPms) { pm.MonitorCleanTasks(); } return Result.RUN; } private void PreJobClean(ControlJobInfo cj) { if (cj.IsPreJobCleanDone) return; cj.IsPreJobCleanDone = true; List pms = GetPmNeeded(cj); foreach (var pm in pms) { pm.PreJobClean(); } } //private void PreJobClean(ProcessJobInfo pj) //{ // List pms = GetPmNeeded(pj); // foreach (var pm in pms) // { // pm.PreJobClean(); // } //} private void CompleteJobClean(ControlJobInfo cj) { List pms = GetPmNeeded(cj); foreach (var pm in pms) { pm.CompleteJobClean(); } } private List GetPmNeeded(ControlJobInfo cj) { List result = new List(); foreach (var pj in _lstProcessJobs) { if (pj.ControlJobName != cj.Name) continue; var seq = pj.Sequence; for (int i = 0; i < seq.Steps.Count; i++) { SequenceStepInfo stepInfo = seq.Steps[i]; foreach (var module in stepInfo.StepModules) { if (ModuleHelper.IsPm(module)) { var pm = _lstPms.Find(x => x.Module == module); if (pm != null && !result.Contains(pm)) { result.Add(pm); } } } } } return result; } } }