123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- 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<SchedulerPM> pms = GetPmNeeded(cj);
- foreach (var pm in pms)
- {
- pm.PreJobClean();
- }
- }
- //private void PreJobClean(ProcessJobInfo pj)
- //{
- // List<SchedulerPM> pms = GetPmNeeded(pj);
- // foreach (var pm in pms)
- // {
- // pm.PreJobClean();
- // }
- //}
- private void CompleteJobClean(ControlJobInfo cj)
- {
- List<SchedulerPM> pms = GetPmNeeded(cj);
- foreach (var pm in pms)
- {
- pm.CompleteJobClean();
- }
- }
- private List<SchedulerPM> GetPmNeeded(ControlJobInfo cj)
- {
- List<SchedulerPM> result = new List<SchedulerPM>();
- 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;
- }
- }
- }
|