123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771 |
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Linq;
- using Aitex.Core.Common;
- using Aitex.Core.RT.DataCenter;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.Fsm;
- using Aitex.Core.RT.Log;
- using Aitex.Core.RT.OperationCenter;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.Util;
- using Aitex.Sorter.Common;
- using MECF.Framework.Common.DataCenter;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.Schedulers;
- using MECF.Framework.Common.SubstrateTrackings;
- using MECF.Framework.RT.ModuleLibrary.PMModules;
- using MECF.Framework.RT.ModuleLibrary.SystemModules;
- namespace EfemDualSchedulerLib.Schedulers
- {
- public class SchedulerPM : SchedulerModule
- {
- public override bool IsAvailable
- {
- get
- {
- if (!SC.IsATMMode)
- return _pm.IsReady && _pm.IsOnline && CheckTaskDone() && !_waitCompletejobClean;
- return _pm.IsReady && _pm.IsOnline && CheckTaskDone();
- }
- }
- public override bool IsOnline
- {
- get { return _pm.IsOnline; }
- }
- public override bool IsError
- {
- get { return _pm.IsError; }
- }
- public bool IsIdle
- {
- get { return _pm.IsReady && _pm.IsOnline && CheckTaskDone(); }
- }
- private PMModuleBase _pm = null;
- private double _paramTemp1;
- private double _paramTemp2;
- private ModuleName _taskRobot;
- private EnumTransferType _taskTransferType;
- private int[] _taskSlot;
- private DeviceTimer _timer = new DeviceTimer();
- protected readonly string _statNamePM1ProcessedWaferCount;
- protected readonly string _statNamePM2ProcessedWaferCount;
- protected readonly string _statNamePM1ProcessTime;
- protected readonly string _statNamePM2ProcessTime;
- public RD_TRIG IdlePurgeTrig { get; set; } = new RD_TRIG();
- public Stopwatch IdlePurgeTimer { get; set; } = new Stopwatch();
- public int IdlePurgeTime { get; set; }
- public int IdlePurgeNextRunTime { get; set; }
- public RD_TRIG IdleCleanTrig { get; set; } = new RD_TRIG();
- public Stopwatch IdleCleanTimer { get; set; } = new Stopwatch();
- public int IdleCleanTime { get; set; }
- public int IdleCleanNextRunTime { get; set; }
- private bool _waitPreJobClean;
- private bool _waitCompletejobClean;
- private R_TRIG _trigIdleCleanFailed = new R_TRIG();
- private R_TRIG _trigIdlePurgeFailed = new R_TRIG();
- public RD_TRIG PreJobCleanTrig { get; set; } = new RD_TRIG();
- public Stopwatch PreJobCleanTimer { get; set; } = new Stopwatch();
- public int PreJobCleanTime { get; set; }
- //protected readonly string _statNameRFTime;
- //protected readonly string _statNameMWTime;
- public SchedulerPM(ModuleName chamber) : base(chamber.ToString())
- {
- _pm = EquipmentManager.Modules[chamber] as PMModuleBase;
- _pm.IsOnline = true;
- _statNamePM1ProcessedWaferCount = $"{chamber}.ProcessedWaferCount1";
- _statNamePM2ProcessedWaferCount = $"{chamber}.ProcessedWaferCount2";
- _statNamePM1ProcessTime = $"{chamber}.ProcessTime1";
- _statNamePM2ProcessTime = $"{chamber}.ProcessTime2";
- //_statNameRFTime = $"{chamber}.RFTime";
- //_statNameMWTime = $"{chamber}.MWTime";
- System.Diagnostics.Trace.Assert(_pm != null);
- }
- public bool CheckTempReady(double temp1, double temp2)
- {
- return _pm.CheckTempReady(temp1, temp2);
- }
- public bool CheckTransferTempReady(double temp1, double temp2)
- {
- return _pm.CheckTransferTempReady(temp1, temp2);
- }
- public bool CheckTemp1Alarm(double recipeTemp1)
- {
- return _pm.CheckTemp1Alarm(recipeTemp1);
- }
- public bool CheckTemp2Alarm(double recipeTemp2)
- {
- return _pm.CheckTemp2Alarm(recipeTemp2);
- }
- public override bool IsReadyForPick(ModuleName robot, Hand blade, int slot)
- {
- return _pm.CheckReadyForTransfer(robot, blade, slot, EnumTransferType.Pick, out _)
- && WaferManager.Instance.CheckHasWafer(ModuleHelper.Converter(_module), slot);
- }
- public override bool IsReadyForPlace(ModuleName robot, Hand blade, int slot)
- {
- return _pm.CheckReadyForTransfer(robot, blade, slot, EnumTransferType.Place, out _)
- && WaferManager.Instance.CheckNoWafer(ModuleHelper.Converter(_module), slot);
- }
- public override bool PrepareTransfer(ModuleName robot, EnumTransferType type, int[] slot)
- {
- _task = TaskType.PrepareTransfer;
- _taskRobot = robot;
- _taskSlot = slot;
- _taskTransferType = type;
- if (!_pm.PrepareTransfer(robot, Hand.Blade1, slot, type, 0, 0, false, out string reason))
- {
- LOG.Write(reason);
- return false;
- }
- Array.ForEach(slot,p=> LogTaskStart(_task, $"{robot} {type} slot {p + 1}"));
- return true;
- }
- public bool Preheating(double temperature1, double temperature2)
- {
- _task = TaskType.Heating;
- _paramTemp1 = temperature1;
- _paramTemp2 = temperature2;
- if (_pm.InvokePreHeat(temperature1, temperature2))
- {
- LOG.Write("Can not PreHeat");
- return false;
- }
- LogTaskStart(_task, $"preheat to {temperature1},{temperature2}");
- return true;
- }
- //public bool IsPrepareTransfer(ModuleName robot, EnumTransferType type, int slot)
- //{
- // return _task == TaskType.PrepareTransfer && _taskRobot == robot && _taskSlot == slot &&
- // _taskTransferType == type;
- //}
- public override bool Process(string recipeName, bool isCleanRecipe, bool withWafer)
- {
- _task = TaskType.Process;
- //if (SC.GetValue<bool>("System.IsATMMode"))
- //{
- // _timer.Start(SC.GetValue<int>("System.ATMProcessDelayTime") * 1000);
- // //_entityTaskToken = (int)FSM_MSG.TIMER;
- // WaferManager.Instance.GetWafer(Module, 0).ProcessState = EnumWaferProcessStatus.InProcess;
- // WaferManager.Instance.GetWafer(Module, 1).ProcessState = EnumWaferProcessStatus.InProcess;
- //}
- //else
- {
- if (!_pm.Process(recipeName, isCleanRecipe, withWafer, out string reason))
- {
- LOG.Write(reason);
- return false;
- }
- }
- if (HasWafer(0))
- UpdatePM1Stats_data(recipeName, isCleanRecipe);
- if (HasWafer(1))
- UpdatePM2Stats_data(recipeName, isCleanRecipe);
- LogTaskStart(_task, $"recipe: {recipeName}, clean: {isCleanRecipe}, with wafer: {withWafer}");
- return true;
- }
- public virtual void UpdatePM1Stats_data(string recipeName, bool isClean)
- {
- if (!isClean)
- {
- int value1 = StatsDataManager.Instance.Increase(_statNamePM1ProcessedWaferCount);
- int value2 = StatsDataManager.Instance.Increase(_statNamePM1ProcessTime);
- LOG.Write($"{_statNamePM1ProcessedWaferCount} counter increase 1 to {value1}");
- LOG.Write($"{_statNamePM1ProcessTime} counter increase 1 to {value2}");
- }
- }
- public virtual void UpdatePM2Stats_data(string recipeName, bool isClean)
- {
- if (!isClean)
- {
- int value1 = StatsDataManager.Instance.Increase(_statNamePM2ProcessedWaferCount);
- int value2 = StatsDataManager.Instance.Increase(_statNamePM2ProcessTime);
- LOG.Write($"{_statNamePM2ProcessedWaferCount} counter increase 1 to {value1}");
- LOG.Write($"{_statNamePM2ProcessTime} counter increase 1 to {value2}");
- }
- }
- public bool CheckTaskDone()
- {
- bool ret = false;
- switch (_task)
- {
- case TaskType.None:
- ret = true;
- break;
- case TaskType.PrepareTransfer:
- ret = _taskSlot.All(p => _pm.CheckReadyForTransfer(_taskRobot, Hand.Blade1, p, _taskTransferType, out _));
- break;
- case TaskType.Heating:
- ret = CheckTempReady(_paramTemp1, _paramTemp2);
- break;
- case TaskType.Process:
- case TaskType.IdlePurgeProcess:
- case TaskType.IdleCleanProcess:
- case TaskType.PreJobProcess:
- case TaskType.CompleteJobProcess:
- //if (SC.GetValue<bool>("System.IsATMMode"))
- //{
- // ret = _timer.IsTimeout();
- // if (ret)
- // {
- // WaferManager.Instance.GetWafer(Module, 0).ProcessState = EnumWaferProcessStatus.Completed;
- // WaferManager.Instance.GetWafer(Module, 1).ProcessState = EnumWaferProcessStatus.Completed;
- // }
- //}
- //else
- {
- ret = _pm.IsReady;
- }
- break;
- }
- if (ret && _task != TaskType.None)
- {
- LogTaskDone(_task, "");
- _task = TaskType.None;
- }
- return ret;
- }
- public bool CheckInProcess()
- {
- return _task == TaskType.Process;
- }
- public bool CloseSlitValve()
- {
- return _pm.CloseSlitValve(out _);
- }
- public bool CheckSlitValveClose()
- {
- return _pm.CheckSlitValveClose();
- }
- public bool Monitor()
- {
- return true;
- }
- #region clean task
- public void InitClean()
- {
- DATA.Subscribe($"{Module}.IdlePurgeNextRunTime", () => IdlePurgeNextRunTime);
- DATA.Subscribe($"{Module}.IdleCleanNextRunTime", () => IdleCleanNextRunTime);
- OP.Subscribe($"{Module}.ResetIdlePurgeTime", (string cmd, object[] args) =>
- {
- ResetIdlePurgeTime();
- return true;
- });
- OP.Subscribe($"{Module}.ResetIdleCleanTime", (string cmd, object[] args) =>
- {
- ResetIdleCleanTime();
- return true;
- });
- }
- internal void ResetIdlePurgeTime()
- {
- IdlePurgeTimer.Restart();
- }
- internal void ResetIdleCleanTime()
- {
- IdleCleanTimer.Restart();
- }
- public bool ResetClean(bool resetPurge, bool resetClean, bool jobClean)
- {
- if (resetPurge)
- {
- IdlePurgeTrig.RST = true;
- IdlePurgeTimer.Stop();
- IdlePurgeTime = 0;
- }
- if (resetClean)
- {
- IdleCleanTrig.RST = true;
- IdleCleanTimer.Stop();
- IdleCleanTime = 0;
- }
- if (jobClean)
- {
- _waitPreJobClean = false;
- _waitCompletejobClean = false;
- PreJobCleanTrig.RST = true;
- PreJobCleanTimer.Stop();
- }
- return true;
- }
- public void MonitorCleanTasks()
- {
- if (SC.IsATMMode)
- return;
- var hasWafer = WaferManager.Instance.CheckHasWafer(Module, 0) || WaferManager.Instance.CheckHasWafer(Module, 1);
- var enablePurge = false;//SC.GetValue<bool>($"{Module}.IdlePurge.IsEnabled");
- var enableClean = SC.GetValue<bool>($"{Module}.IdleClean.IsEnabled");
- #region Idle Purge
- IdlePurgeTrig.CLK = (IsIdle || _task != TaskType.IdlePurgeProcess) && enablePurge && !hasWafer;
- if (IdlePurgeTrig.R)
- {
- LOG.Write($"{Module} idle purge start calc elapse time");
- IdlePurgeTimer.Restart();
- }
- if (IdlePurgeTrig.T)
- {
- LOG.Write($"{Module} idle purge stopped calc elapse time");
- ResetClean(true, false, false);
- }
- if (IdlePurgeTimer.IsRunning)
- {
- IdlePurgeTime = (int)IdlePurgeTimer.ElapsedMilliseconds / 1000;
- int idlePurgeTimeSetPoint = SC.GetValue<int>($"{Module}.IdlePurge.IdlePurgeTime");
- var nextRunTime = idlePurgeTimeSetPoint - IdlePurgeTime;
- if (nextRunTime < 0)
- nextRunTime = 0;
- if (enablePurge)
- {
- if (nextRunTime <= 0 && IsAvailable)
- {
- var recipe = SC.GetStringValue($"{Module}.IdlePurge.IdlePurgeRecipe");
- if (string.IsNullOrEmpty(recipe))
- {
- _trigIdlePurgeFailed.CLK = true;
- LOG.Write($"{Module} Idle purge can not run, recipe is empty");
- ResetClean(true, false, false);
- }
- else if (hasWafer)
- {
- _trigIdlePurgeFailed.CLK = true;
- LOG.Write($"{Module} Idle purge can not run, has wafer");
- ResetClean(true, false, false);
- }
- else
- {
- _trigIdlePurgeFailed.CLK = false;
- LOG.Write($"{Module} Start run idle purge recipe {recipe}");
- IdlePurgeProcess("ALD\\Process\\" + recipe);
- }
- if (_trigIdlePurgeFailed.Q)
- {
- EV.PostWarningLog(Module.ToString(), "Can not run idle purge recipe");
- }
- }
- }
- else
- {
- nextRunTime = 0;
- }
- IdlePurgeNextRunTime = nextRunTime;
- }
- else
- {
- IdlePurgeNextRunTime = 0;
- }
- #endregion
- #region Idle Clean
- IdleCleanTrig.CLK = (IsIdle || _task != TaskType.IdleCleanProcess) && enableClean && !hasWafer;
- if (IdleCleanTrig.R)
- {
- LOG.Write($"{Module} idle clean start calc elapse time");
- IdleCleanTimer.Restart();
- }
- if (IdleCleanTrig.T)
- {
- LOG.Write($"{Module} idle clean stopped calc elapse time");
- ResetClean(false, true, false);
- }
- if (IdleCleanTimer.IsRunning)
- {
- IdleCleanTime = (int)IdleCleanTimer.ElapsedMilliseconds / 1000;
- int idleCleanTimeSetPoint = SC.GetValue<int>($"{Module}.IdleClean.IdleCleanTime");
- var nextRunTime = idleCleanTimeSetPoint - IdleCleanTime;
- if (nextRunTime < 0)
- nextRunTime = 0;
- if (enableClean)
- {
- if (nextRunTime <= 0 && IsAvailable)
- {
- var recipe = SC.GetStringValue($"{Module}.IdleClean.IdleCleanRecipe");
- if (string.IsNullOrEmpty(recipe))
- {
- _trigIdleCleanFailed.CLK = true;
- LOG.Write($"{Module} Idle clean can not run, recipe is empty");
- ResetClean(false, true, false);
- }
- else if (hasWafer)
- {
- _trigIdleCleanFailed.CLK = true;
- LOG.Write($"{Module} Idle clean can not run, has wafer");
- ResetClean(false, true, false);
- }
- else
- {
- _trigIdleCleanFailed.CLK = false;
- LOG.Write($"{Module} Start run idle Clean recipe {recipe}");
- IdleCleanProcess($"{Module}\\" + recipe);
- }
- if (_trigIdleCleanFailed.Q)
- {
- EV.PostWarningLog(Module.ToString(), "Can not run idle clean recipe");
- }
- }
- }
- else
- {
- nextRunTime = 0;
- }
- IdleCleanNextRunTime = nextRunTime;
- }
- else
- {
- IdleCleanNextRunTime = 0;
- }
- #endregion
- #region PreJob Clean
- var enableJobClean = SC.GetValue<bool>($"{Module}.JobClean.IsEnabled");
- var enablePreJobClean = SC.GetValue<bool>($"{Module}.JobClean.EnablePreJobClean");
- var enableCompleteJobClean = SC.GetValue<bool>($"{Module}.JobClean.EnableCompleteJobClean");
- if (enableJobClean && enableCompleteJobClean && _waitCompletejobClean && IsIdle)
- {
- var recipe = SC.GetStringValue($"{Module}.JobClean.CompleteJobCleanRecipe");
- if (string.IsNullOrEmpty(recipe))
- {
- EV.PostWarningLog(Module.ToString(), "complete job clean can not run, recipe is empty");
- }
- else if (hasWafer)
- {
- EV.PostWarningLog(Module.ToString(), "complete job clean can not run, has wafer");
- }
- else
- {
- EV.PostInfoLog(Module.ToString(), $"Start run complete job clean recipe {recipe}");
- CompleteJobProcess($"{Module}\\" + recipe);
- }
- _waitCompletejobClean = false;
- }
- PreJobCleanTrig.CLK = enableJobClean && enablePreJobClean && IsIdle;
- if (PreJobCleanTrig.R)
- {
- PreJobCleanTimer.Restart();
- }
- if (PreJobCleanTrig.T)
- {
- ResetClean(false, false, true);
- }
- if (enableJobClean && enablePreJobClean && _waitPreJobClean && PreJobCleanTimer.IsRunning && IsIdle)
- {
- PreJobCleanTime = (int)PreJobCleanTimer.ElapsedMilliseconds / 1000;
- int PreJobCleanIdleTimeSP = SC.GetValue<int>($"{Module}.JobClean.IdleCleanTime");
- if (PreJobCleanTime >= PreJobCleanIdleTimeSP)
- {
- var recipe = SC.GetStringValue($"{Module}.JobClean.PreJobCleanRecipe");
- if (string.IsNullOrEmpty(recipe))
- {
- EV.PostWarningLog(Module.ToString(), "pre job clean can not run, recipe is empty");
- }
- else if (hasWafer)
- {
- EV.PostWarningLog(Module.ToString(), "pre job clean can not run, has wafer");
- }
- else
- {
- EV.PostInfoLog(Module.ToString(), $"Start run pre job clean recipe {recipe}");
- PreJobProcess($"{Module}\\" + recipe);
- }
- }
- }
- #endregion
- }
- public bool IdlePurgeProcess(string recipeName)
- {
- _task = TaskType.IdlePurgeProcess;
- if (!_pm.Process(recipeName, true, false, out string reason))
- {
- LOG.Write(reason);
- return false;
- }
- LogTaskStart(_task, $"recipe: {recipeName}, clean: {true}, with wafer: {false}");
- return true;
- }
- public bool IdleCleanProcess(string recipeName)
- {
- _task = TaskType.IdleCleanProcess;
- if (!_pm.Process(recipeName, true, false, out string reason))
- {
- LOG.Write(reason);
- return false;
- }
- LogTaskStart(_task, $"recipe: {recipeName}, clean: {true}, with wafer: {false}");
- return true;
- }
- public void PreJobClean()
- {
- var enableJobClean = SC.GetValue<bool>($"{Module}.JobClean.IsEnabled");
- var enablePreJobClean = SC.GetValue<bool>($"{Module}.JobClean.EnablePreJobClean");
- var enableCompleteJobClean = SC.GetValue<bool>($"{Module}.JobClean.EnableCompleteJobClean");
- _waitPreJobClean = enableJobClean && enablePreJobClean;
- }
- public bool PreJobProcess(string recipeName)
- {
- _task = TaskType.PreJobProcess;
- if (!_pm.Process(recipeName, true, false, out string reason))
- {
- LOG.Write(reason);
- return false;
- }
- LogTaskStart(_task, $"recipe: {recipeName}, clean: {true}, with wafer: {false}");
- return true;
- }
- public void CompleteJobClean()
- {
- var enableJobClean = SC.GetValue<bool>($"{Module}.JobClean.IsEnabled");
- var enablePreJobClean = SC.GetValue<bool>($"{Module}.JobClean.EnablePreJobClean");
- var enableCompleteJobClean = SC.GetValue<bool>($"{Module}.JobClean.EnableCompleteJobClean");
- _waitCompletejobClean = enableJobClean && enableCompleteJobClean;
- }
- public bool CompleteJobProcess(string recipeName)
- {
- _task = TaskType.CompleteJobProcess;
- if (!_pm.Process(recipeName, true, false, out string reason))
- {
- LOG.Write(reason);
- return false;
- }
- LogTaskStart(_task, $"recipe: {recipeName}, clean: {true}, with wafer: {false}");
- return true;
- }
- #endregion
- /// <summary>
- /// 检查参数代表的wafer下一站是否是本模块
- /// </summary>
- /// <param name="module"> 已有wafer的Module</param>
- /// <param name="slot"> 已有wafer的Slot</param>
- /// <returns></returns>
- public override bool CheckWaferNextStepIsThisModule(ModuleName module, int slot)
- {
- if (!WaferManager.Instance.CheckHasWafer(module, slot))
- return false;
- WaferInfo wafer = WaferManager.Instance.GetWafer(module, slot);
- if (wafer.ProcessJob == null || wafer.ProcessJob.Sequence == null)
- return false;
- if (wafer.NextSequenceStep >= wafer.ProcessJob.Sequence.Steps.Count)
- return false;
- if (!wafer.ProcessJob.Sequence.Steps[wafer.NextSequenceStep].StepModules.Contains(module))
- return false;
- return true;
- }
- /// <summary>
- /// 检查参数代表的wafer下一站是否是本模块thisSlot
- /// </summary>
- /// <param name="module"> 已有wafer的Module</param>
- /// <param name="slot"> 已有wafer的Slot</param>
- /// <param name="thisSlot"> 本模块slot位置</param>
- /// <returns></returns>
- public override bool CheckWaferNextStepIsThisModuleSlot(ModuleName module, int slot, int thisSlot)
- {
- if (!WaferManager.Instance.CheckHasWafer(module, slot))
- return false;
- WaferInfo wafer = WaferManager.Instance.GetWafer(module, slot);
- if (wafer.ProcessJob == null || wafer.ProcessJob.Sequence == null)
- return false;
- if (wafer.NextSequenceStep >= wafer.ProcessJob.Sequence.Steps.Count)
- return false;
- if (!wafer.ProcessJob.Sequence.Steps[wafer.NextSequenceStep].StepModules.Contains(module))
- return false;
- if (!wafer.ProcessJob.Sequence.Steps[wafer.NextSequenceStep].StepParameter["SlotSelection"].ToString().Contains(thisSlot.ToString()))
- return false;
- return true;
- }
- /// <summary>
- /// 判断下一步的模块是否有Wafer
- /// </summary>
- /// <param name="slot"></param>
- /// <returns></returns>
- public override bool CheckWaferNextStepModuleNoWafer(int slot, bool needIgnoreRobot = true)
- {
- if (!WaferManager.Instance.CheckHasWafer(Module, slot))
- return false;
- WaferInfo wafer = WaferManager.Instance.GetWafer(Module, slot);
- if (wafer.ProcessJob == null || wafer.ProcessJob.Sequence == null)
- return false;
- var step = wafer.NextSequenceStep;
- if (step >= wafer.ProcessJob.Sequence.Steps.Count)
- return false;
- List<ModuleName> lstModuleName = wafer.ProcessJob.Sequence.Steps[wafer.NextSequenceStep].StepModules;
- if (lstModuleName.Count > 0)
- {
- if (needIgnoreRobot && lstModuleName.Any(x => x == ModuleName.EfemRobot || x == ModuleName.TMRobot))
- {
- step += 1;
- if (step >= wafer.ProcessJob.Sequence.Steps.Count)
- return false;
- lstModuleName = wafer.ProcessJob.Sequence.Steps[step].StepModules;
- }
- for (int i = 0; i < lstModuleName.Count; i++)
- {
- var moduleName = lstModuleName[i];
- if (ModuleHelper.IsPm(moduleName))
- {
- var stepParameters = wafer.ProcessJob.Sequence.Steps[step].StepParameter;
- if(stepParameters != null && stepParameters.Count > 0 && stepParameters.ContainsKey(moduleName.ToString()))
- {
- var slotList = stepParameters[moduleName.ToString()].ToString().Split(',');
- if(slotList != null)
- {
- foreach(var slotIndex in slotList)
- {
- if (WaferManager.Instance.CheckNoWafer(moduleName, Convert.ToInt32(slotIndex)))
- {
- return true;
- }
- }
- }
- }
- }
- }
- }
- return false;
- }
- }
- }
|