首次上传
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
using Aitex.Core.RT.Fsm;
|
||||
using Aitex.Core.Util;
|
||||
using SicRT.Scheduler;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.SubstrateTrackings;
|
||||
using SicRT.Equipments;
|
||||
using SicRT.Equipments.Systems;
|
||||
using Aitex.Core.RT.Device;
|
||||
using SicModules.Aligners;
|
||||
|
||||
namespace SicRT.Modules.Schedulers
|
||||
{
|
||||
public class SchedulerAligner : SchedulerModule
|
||||
{
|
||||
public override bool IsAvailable
|
||||
{
|
||||
get { return _aliger.IsIdle && _aliger.IsOnline && CheckTaskDone(); }
|
||||
|
||||
}
|
||||
public override bool IsOnline
|
||||
{
|
||||
get { return _aliger.IsOnline; }
|
||||
|
||||
}
|
||||
public override bool IsError
|
||||
{
|
||||
get { return _aliger.IsError; }
|
||||
|
||||
}
|
||||
|
||||
private AlignerModuleBase _aliger = null;
|
||||
|
||||
private int _entityTaskToken = (int)FSM_MSG.NONE;
|
||||
|
||||
public SchedulerAligner(ModuleName module) : base(module.ToString())
|
||||
{
|
||||
_module = module.ToString();
|
||||
_aliger = Singleton<EquipmentManager>.Instance.Modules[module] as AlignerModule;
|
||||
}
|
||||
|
||||
public bool Monitor()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool Aligning()
|
||||
{
|
||||
_task = TaskType.Align;
|
||||
_entityTaskToken = _aliger.InvokeAligner();
|
||||
LogTaskStart(_task, $"{Module} Aligning");
|
||||
|
||||
return _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public bool CheckTaskDone()
|
||||
{
|
||||
var taskSucceed = false;
|
||||
switch (_task)
|
||||
{
|
||||
case TaskType.None:
|
||||
taskSucceed = true;
|
||||
break;
|
||||
case TaskType.Align:
|
||||
taskSucceed = _aliger.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
}
|
||||
|
||||
return SuperCheckTaskDone(taskSucceed, _aliger.IsIdle | _aliger.IsError);
|
||||
}
|
||||
|
||||
public override bool IsReadyForPick(ModuleName robot, int slot)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool IsReadyForPlace(ModuleName robot, int slot)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
using Aitex.Core.RT.Fsm;
|
||||
using Aitex.Core.Util;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using SicRT.Equipments.Systems;
|
||||
using Aitex.Core.RT.Device;
|
||||
using Aitex.Core.RT.Device.Devices;
|
||||
using SicModules.Buffers;
|
||||
|
||||
namespace SicRT.Modules.Schedulers
|
||||
{
|
||||
public class SchedulerBuffer : SchedulerModule
|
||||
{
|
||||
public override bool IsAvailable
|
||||
{
|
||||
get { return _buffer.IsIdle && _buffer.IsOnline && CheckTaskDone(); }
|
||||
|
||||
}
|
||||
public override bool IsOnline
|
||||
{
|
||||
get { return _buffer.IsOnline; }
|
||||
|
||||
}
|
||||
public override bool IsError
|
||||
{
|
||||
get { return _buffer.IsError; }
|
||||
|
||||
}
|
||||
|
||||
private BufferModuleBase _buffer = null;
|
||||
|
||||
private int _entityTaskToken = (int)FSM_MSG.NONE;
|
||||
|
||||
public SchedulerBuffer(ModuleName module) : base(module.ToString())
|
||||
{
|
||||
_module = module.ToString();
|
||||
_buffer = Singleton<EquipmentManager>.Instance.Modules[module] as BufferModuleBase;
|
||||
}
|
||||
|
||||
internal float GetTemperature()
|
||||
{
|
||||
var deviceBufferTemp = DEVICE.GetDevice<IoTempMeter>($"Buffer.BufferTemp");
|
||||
return deviceBufferTemp.FeedBack;
|
||||
}
|
||||
|
||||
public override bool Cooling(bool coolingTypeIsTime,int coolingValue)
|
||||
{
|
||||
_task = TaskType.Cooling;
|
||||
|
||||
_entityTaskToken = _buffer.InvokeCooling(coolingTypeIsTime, coolingValue);
|
||||
|
||||
if (coolingTypeIsTime)
|
||||
{
|
||||
LogTaskStart(_task, $"{Module} cooling {coolingValue} seconds");
|
||||
}
|
||||
else
|
||||
{
|
||||
LogTaskStart(_task, $"{Module} cooling wait temprature below {coolingValue}℃");
|
||||
}
|
||||
|
||||
return _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public bool PreHeat(int preTemp)
|
||||
{
|
||||
_task = TaskType.WarmUp;
|
||||
LogTaskStart(_task, $"{Module} warm up to {preTemp} ℃");
|
||||
_entityTaskToken = _buffer.InvokeWarmUp(preTemp);
|
||||
return _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public bool CheckTaskDone()
|
||||
{
|
||||
var taskSucceed = false;
|
||||
switch (_task)
|
||||
{
|
||||
case TaskType.None:
|
||||
taskSucceed = true;
|
||||
break;
|
||||
case TaskType.Cooling:
|
||||
taskSucceed = _buffer.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
case TaskType.WarmUp:
|
||||
taskSucceed = _buffer.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
}
|
||||
|
||||
return SuperCheckTaskDone(taskSucceed, _buffer.IsIdle | _buffer.IsError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using Aitex.Core.RT.Fsm;
|
||||
using Aitex.Core.Util;
|
||||
using SicRT.Scheduler;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.SubstrateTrackings;
|
||||
using SicModules.Cassettes;
|
||||
using SicRT.Equipments;
|
||||
using SicRT.Equipments.Systems;
|
||||
|
||||
namespace SicRT.Modules.Schedulers
|
||||
{
|
||||
public class SchedulerCassette : SchedulerModule
|
||||
{
|
||||
public override bool IsAvailable
|
||||
{
|
||||
get { return _cass.IsOnline; }
|
||||
|
||||
}
|
||||
public override bool IsOnline
|
||||
{
|
||||
get { return _cass.IsOnline; }
|
||||
|
||||
}
|
||||
public override bool IsError
|
||||
{
|
||||
get { return _cass.IsError; }
|
||||
|
||||
}
|
||||
|
||||
private CassetteModule _cass = null;
|
||||
|
||||
private int _entityTaskToken = (int)FSM_MSG.NONE;
|
||||
|
||||
public SchedulerCassette(ModuleName module) : base(module.ToString())
|
||||
{
|
||||
_module = module.ToString();
|
||||
_cass = Singleton<EquipmentManager>.Instance.Modules[module] as CassetteModule;
|
||||
}
|
||||
|
||||
public bool Monitor()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool IsReadyForPlace(ModuleName robot, int slot)
|
||||
{
|
||||
return WaferManager.Instance.CheckNoWafer(_cass.Module, slot) && WaferManager.Instance.CheckNoTray(ModuleHelper.Converter(_cass.Module), slot);
|
||||
}
|
||||
|
||||
public override bool IsReadyForPick(ModuleName robot, int slot)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public bool CheckTaskDone()
|
||||
{
|
||||
var taskSucceed = false;
|
||||
switch (_task)
|
||||
{
|
||||
case TaskType.None:
|
||||
taskSucceed = true;
|
||||
break;
|
||||
}
|
||||
|
||||
return SuperCheckTaskDone(taskSucceed, _cass.IsIdle | _cass.IsError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Aitex.Core.Common;
|
||||
using MECF.Framework.Common.DBCore;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.Jobs;
|
||||
using MECF.Framework.Common.SubstrateTrackings;
|
||||
|
||||
namespace SicRT.Equipments.Schedulers
|
||||
{
|
||||
|
||||
class SchedulerDBCallback
|
||||
{
|
||||
public void LotCreated(ControlJobInfo cj)
|
||||
{
|
||||
ModuleName module = ModuleHelper.Converter(cj.Module);
|
||||
Guid carrierGuid = CarrierManager.Instance.GetCarrier(cj.Module).InnerId;
|
||||
|
||||
LotDataRecorder.StartLot(cj.LotInnerId.ToString(), carrierGuid.ToString(), "", cj.LotName, cj.Module, cj.Module, cj.LotWafers.Count);
|
||||
|
||||
foreach (var waferInfo in cj.LotWafers)
|
||||
{
|
||||
LotDataRecorder.InsertLotWafer(cj.LotInnerId.ToString(), waferInfo.WaferInnerID.ToString());
|
||||
|
||||
WaferDataRecorder.SetWaferSequence(waferInfo.WaferInnerID.ToString(), waferInfo.ProcessJobID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void LotFinished(ControlJobInfo cj)
|
||||
{
|
||||
|
||||
int unprocessed = 0;
|
||||
int aborted = 0;
|
||||
foreach (var waferInfo in cj.LotWafers)
|
||||
{
|
||||
if (waferInfo.ProcessState == WaferProcessStatus.Failed)
|
||||
{
|
||||
aborted++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (waferInfo.ProcessState != WaferProcessStatus.Completed)
|
||||
{
|
||||
unprocessed++;
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
LotDataRecorder.EndLot(cj.LotInnerId.ToString(), aborted, unprocessed);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,377 @@
|
||||
using System.Linq;
|
||||
using Aitex.Core.RT.Device;
|
||||
using Aitex.Core.RT.Fsm;
|
||||
using Aitex.Core.Util;
|
||||
using Aitex.Sorter.Common;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.Schedulers;
|
||||
using MECF.Framework.Common.SubstrateTrackings;
|
||||
using SicRT.Equipments.Systems;
|
||||
using SicRT.Modules.Schedulers;
|
||||
using Aitex.Core.RT.Device.Devices;
|
||||
using Aitex.Core.RT.Event;
|
||||
using SicModules.LLs;
|
||||
|
||||
namespace SicRT.Scheduler
|
||||
{
|
||||
public class SchedulerLoadLock : SchedulerModule
|
||||
{
|
||||
#region Variables
|
||||
|
||||
/// <summary>
|
||||
/// 最后一次传盘动作是Pick还是Place。
|
||||
/// </summary>
|
||||
private TaskType _lastTransferAction;
|
||||
|
||||
/// <summary>
|
||||
/// 最后一次传盘的槽位。
|
||||
/// </summary>
|
||||
private int _lastTransferSlot;
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
public override bool IsAvailable
|
||||
{
|
||||
get
|
||||
{
|
||||
return _ll.IsIdle && _ll.IsOnline && CheckTaskDone() && _ll.CheckSlitValveClosed();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsOnline
|
||||
{
|
||||
get
|
||||
{
|
||||
return _ll.IsOnline;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsError
|
||||
{
|
||||
get
|
||||
{
|
||||
return _ll.IsError;
|
||||
}
|
||||
}
|
||||
|
||||
private LoadLockModuleBase _ll = null;
|
||||
|
||||
private ModuleName _taskRobot;
|
||||
private int _taskSlot;
|
||||
private int _entityTaskToken = (int)FSM_MSG.NONE;
|
||||
private bool _separated = false;
|
||||
private bool _purged = false;
|
||||
public bool IsInPumping { get => _task == TaskType.Pump || _task == TaskType.Purge || _task == TaskType.PrepareTransfer ; }
|
||||
|
||||
public SchedulerLoadLock(ModuleName module) : base(module.ToString())
|
||||
{
|
||||
_module = module.ToString();
|
||||
_ll = Singleton<EquipmentManager>.Instance.Modules[module] as LoadLockModuleBase;
|
||||
}
|
||||
|
||||
public override bool PrepareTransfer(ModuleName robot, EnumTransferType type, int slot)
|
||||
{
|
||||
_task = TaskType.PrepareTransfer;
|
||||
_taskRobot = robot;
|
||||
_taskSlot = slot;
|
||||
|
||||
LogTaskStart(_task, $"{robot} {type} slot {slot + 1}");
|
||||
return _ll.PrepareTransfer(robot, Hand.Blade1, slot, type, out _);
|
||||
}
|
||||
|
||||
internal bool CheckAtAtm()
|
||||
{
|
||||
SicLoadLock deviceLL = DEVICE.GetDevice<SicLoadLock>($"{_module}.{_module}");
|
||||
|
||||
return deviceLL.CheckAtm();
|
||||
}
|
||||
internal bool CheckAtVacuum()
|
||||
{
|
||||
SicLoadLock deviceLL = DEVICE.GetDevice<SicLoadLock>($"{_module}.{_module}");
|
||||
|
||||
return deviceLL.CheckVacuum();
|
||||
}
|
||||
internal void SetJobStatue()
|
||||
{
|
||||
SicLoadLock deviceLL = DEVICE.GetDevice<SicLoadLock>($"{_module}.{_module}");
|
||||
deviceLL.SetJobDoneStatus();
|
||||
}
|
||||
|
||||
public override bool IsReadyForPick(ModuleName robot, int slot)
|
||||
{
|
||||
if (robot == ModuleName.TMRobot)
|
||||
{
|
||||
return _ll.CheckReadyForTransfer(robot, Hand.Blade1, slot, EnumTransferType.Pick, out _);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool IsReadyForPlace(ModuleName robot, int slot)
|
||||
{
|
||||
if (robot == ModuleName.TMRobot)
|
||||
{
|
||||
return _ll.CheckReadyForTransfer(robot, Hand.Blade1, slot, EnumTransferType.Place, out _);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool IsReadyForTransfer(ModuleName robot, int slot)
|
||||
{
|
||||
if (robot == ModuleName.WaferRobot)
|
||||
{
|
||||
return _ll.CheckReadyForTransfer(robot, Hand.Blade1, slot, EnumTransferType.Place, out _);
|
||||
}
|
||||
else if (robot == ModuleName.TMRobot || robot == ModuleName.TrayRobot)
|
||||
{
|
||||
return _ll.CheckReadyForTransfer(robot, Hand.Blade1, slot, EnumTransferType.Place, out _)
|
||||
&& WaferManager.Instance.CheckNoTray(ModuleHelper.Converter(_module), slot);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public bool Vent()
|
||||
{
|
||||
_task = TaskType.Vent;
|
||||
|
||||
_entityTaskToken = _ll.InvokeVent();
|
||||
|
||||
LogTaskStart(_task, $"{Module} vent to ATM");
|
||||
|
||||
return _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public bool Pump()
|
||||
{
|
||||
_entityTaskToken = _ll.InvokePump();
|
||||
if (_entityTaskToken != (int)FSM_MSG.NONE)
|
||||
{
|
||||
_task = TaskType.Pump;
|
||||
LogTaskStart(_task, $"{Module} pump to Vaccum");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public bool Purge(params object[] objs)
|
||||
{
|
||||
_entityTaskToken = _ll.InvokePurge(objs);
|
||||
if (_entityTaskToken != (int)FSM_MSG.NONE)
|
||||
{
|
||||
_task = TaskType.Purge;
|
||||
LogTaskStart(_task, $"{Module} purge for new job");
|
||||
_purged = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool GroupWaferTray()
|
||||
{
|
||||
_entityTaskToken = _ll.InvokeGroupWaferTray();
|
||||
if (_entityTaskToken != (int)FSM_MSG.NONE)
|
||||
{
|
||||
_task = TaskType.Group;
|
||||
LogTaskStart(_task, $"{Module} start group wafer and tray");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool SeparateWaferTray()
|
||||
{
|
||||
_entityTaskToken = _ll.InvokeSeparateWaferTray();
|
||||
if (_entityTaskToken != (int)FSM_MSG.NONE)
|
||||
{
|
||||
_task = TaskType.Separate;
|
||||
LogTaskStart(_task, $"{Module} start separate wafer and tray");
|
||||
}
|
||||
_separated = _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
return _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
|
||||
public int? GetWaferPurgeCount(int slot)
|
||||
{
|
||||
if (!WaferManager.Instance.CheckHasWafer(Module, slot))
|
||||
return null;
|
||||
|
||||
var wafer = WaferManager.Instance.GetWafer(Module, slot);
|
||||
|
||||
if (wafer.ProcessJob == null || wafer.ProcessJob.Sequence == null)
|
||||
return null;
|
||||
|
||||
if (wafer.NextSequenceStep >= wafer.ProcessJob.Sequence.Steps.Count)
|
||||
return null;
|
||||
|
||||
if (!wafer.ProcessJob.Sequence.Steps[wafer.NextSequenceStep].StepModules.Any(m => m == ModuleName.LoadLock || m == ModuleName.Load))
|
||||
return null;
|
||||
|
||||
if (!wafer.ProcessJob.Sequence.Steps[wafer.NextSequenceStep].StepParameter.ContainsKey("PurgeCount"))
|
||||
return null;
|
||||
|
||||
if (int.TryParse(wafer.ProcessJob.Sequence.Steps[wafer.NextSequenceStep].StepParameter["PurgeCount"].ToString(), out int purgeCount))
|
||||
{
|
||||
return purgeCount;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public int? GetWaferPumpDelayTime(int slot)
|
||||
{
|
||||
if (!WaferManager.Instance.CheckHasWafer(Module, slot))
|
||||
return null;
|
||||
|
||||
var wi = WaferManager.Instance.GetWafer(Module, slot);
|
||||
|
||||
if (wi.ProcessJob?.Sequence == null)
|
||||
return null;
|
||||
|
||||
if (wi.NextSequenceStep >= wi.ProcessJob.Sequence.Steps.Count)
|
||||
return null;
|
||||
|
||||
if (!wi.ProcessJob.Sequence.Steps[wi.NextSequenceStep].StepModules.Any(m => m == ModuleName.LoadLock || m == ModuleName.Load))
|
||||
return null;
|
||||
|
||||
if (!wi.ProcessJob.Sequence.Steps[wi.NextSequenceStep].StepParameter.ContainsKey("PumpDelayTime"))
|
||||
return null;
|
||||
|
||||
if (int.TryParse(wi.ProcessJob.Sequence.Steps[wi.NextSequenceStep].StepParameter["PumpDelayTime"].ToString(), out int pumpDelayTime))
|
||||
{
|
||||
return pumpDelayTime;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public override bool CheckWaferNextStepIsThis(ModuleName module, int slot)
|
||||
{
|
||||
if (!WaferManager.Instance.CheckHasWafer(module, slot))
|
||||
return false;
|
||||
|
||||
var wi = WaferManager.Instance.GetWafer(module, slot);
|
||||
|
||||
if (wi.ProcessJob?.Sequence == null)
|
||||
return false;
|
||||
|
||||
if (wi.NextSequenceStep >= wi.ProcessJob.Sequence.Steps.Count)
|
||||
return false;
|
||||
|
||||
if (!wi.ProcessJob.Sequence.Steps[wi.NextSequenceStep].StepModules.Any(m => m == ModuleName.LoadLock || m == ModuleName.Load))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckWaferTrayGrouped()
|
||||
{
|
||||
return !_ll.CheckWaferClamped() && WaferManager.Instance.CheckHasWafer(Module, 0);
|
||||
}
|
||||
|
||||
public override bool CheckWaferTraySeparated()
|
||||
{
|
||||
return _separated;
|
||||
}
|
||||
|
||||
public override bool CheckSlitValveClosed()
|
||||
{
|
||||
return _ll.CheckSlitValveClosed();
|
||||
}
|
||||
|
||||
public override bool CheckTrayPlaced()
|
||||
{
|
||||
return _ll.CheckTrayPlaced();
|
||||
}
|
||||
|
||||
public bool WaitTransfer(ModuleName robot, bool isPick, int slot)
|
||||
{
|
||||
_lastTransferAction = isPick ? TaskType.Pick : TaskType.Place;
|
||||
_lastTransferSlot = slot;
|
||||
return base.WaitTransfer(robot);
|
||||
}
|
||||
|
||||
|
||||
/*public override bool StopWaitTransfer(ModuleName robot)
|
||||
{
|
||||
|
||||
var ret = base.StopWaitTransfer(robot);
|
||||
if (ret)
|
||||
{
|
||||
// 传盘结束后,如果上个动作是Place,Wafer回到Cassette,则响蜂鸣器进行提示。
|
||||
if (_lastTransferAction == TaskType.Place
|
||||
&& WaferManager.Instance.CheckHasWafer(ModuleName.LoadLock.ToString(), 0))
|
||||
{
|
||||
EV.PostMessage(Module.ToString(), EventEnum.PJ_DONE, "LoadLock", "0");
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}*/
|
||||
|
||||
public override void ResetTask()
|
||||
{
|
||||
base.ResetTask();
|
||||
_lastTransferAction = TaskType.None;
|
||||
_lastTransferSlot = -1;
|
||||
}
|
||||
|
||||
public bool CheckTaskDone()
|
||||
{
|
||||
var taskSucceed = false;
|
||||
switch (_task)
|
||||
{
|
||||
case TaskType.None:
|
||||
taskSucceed = true;
|
||||
break;
|
||||
case TaskType.PrepareTransfer:
|
||||
taskSucceed = _ll.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
case TaskType.Cooling:
|
||||
taskSucceed = _ll.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
case TaskType.Vent:
|
||||
taskSucceed = _ll.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
case TaskType.Pump:
|
||||
taskSucceed = _ll.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
case TaskType.Purge:
|
||||
taskSucceed = _ll.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
case TaskType.Group:
|
||||
taskSucceed = _ll.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
case TaskType.Separate:
|
||||
taskSucceed = _ll.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return SuperCheckTaskDone(taskSucceed, _ll.IsIdle | _ll.IsError);
|
||||
}
|
||||
|
||||
internal float GetTemperature()
|
||||
{
|
||||
IoTempMeter deviceLoadTemp = DEVICE.GetDevice<IoTempMeter>($"Buffer.BufferTemp");
|
||||
return deviceLoadTemp.FeedBack;
|
||||
}
|
||||
|
||||
public bool CheckPurged()
|
||||
{
|
||||
return _purged;
|
||||
}
|
||||
|
||||
public void ResetPurged()
|
||||
{
|
||||
_purged = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,614 @@
|
||||
using System.Collections.Generic;
|
||||
using Aitex.Core.Common;
|
||||
using Aitex.Core.RT.Event;
|
||||
using Aitex.Core.Util;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.Schedulers;
|
||||
using MECF.Framework.Common.SubstrateTrackings;
|
||||
|
||||
namespace SicRT.Modules.Schedulers
|
||||
{
|
||||
public class SchedulerModule
|
||||
{
|
||||
protected enum TaskType
|
||||
{
|
||||
None,
|
||||
|
||||
PrepareTransfer,
|
||||
|
||||
Pick,
|
||||
|
||||
Place,
|
||||
|
||||
PickAndPlace,
|
||||
|
||||
Preprocess,
|
||||
Process,
|
||||
PostProcess,
|
||||
|
||||
OpenCover,
|
||||
CloseCover,
|
||||
|
||||
Load,
|
||||
Unload,
|
||||
|
||||
Align,
|
||||
|
||||
TransferTarget,
|
||||
|
||||
Cooling,
|
||||
WarmUp,
|
||||
|
||||
Vent,
|
||||
Pump,
|
||||
Purge,
|
||||
Group,
|
||||
Separate,
|
||||
Map
|
||||
}
|
||||
|
||||
#region Variables
|
||||
|
||||
private readonly R_TRIG[] firstDetectWaferArriveTrigs = new R_TRIG[25];
|
||||
private readonly R_TRIG[] firstDetectWaferLeaveTrigs = new R_TRIG[25];
|
||||
private readonly R_TRIG[] firstDetectTrayArriveTrigs = new R_TRIG[25];
|
||||
private readonly R_TRIG[] firstDetectTrayLeaveTrigs = new R_TRIG[25];
|
||||
|
||||
protected string _module;
|
||||
protected TaskType _task = TaskType.None;
|
||||
protected ModuleName _inProcessRobot;
|
||||
|
||||
/// <summary>
|
||||
/// 检测调度器TransferTarget任务是否超时。
|
||||
/// </summary>
|
||||
private readonly DeviceTimer _timTransferTargetStatusTimeout = new();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public SchedulerModule(string module)
|
||||
{
|
||||
_module = module;
|
||||
for (var i = 0; i < firstDetectWaferArriveTrigs.Length; i++)
|
||||
{
|
||||
firstDetectWaferArriveTrigs[i] = new R_TRIG();
|
||||
}
|
||||
for (var i = 0; i < firstDetectWaferLeaveTrigs.Length; i++)
|
||||
{
|
||||
firstDetectWaferLeaveTrigs[i] = new R_TRIG();
|
||||
}
|
||||
for (var i = 0; i < firstDetectTrayArriveTrigs.Length; i++)
|
||||
{
|
||||
firstDetectTrayArriveTrigs[i] = new R_TRIG();
|
||||
}
|
||||
for (var i = 0; i < firstDetectTrayLeaveTrigs.Length; i++)
|
||||
{
|
||||
firstDetectTrayLeaveTrigs[i] = new R_TRIG();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public ModuleName Module
|
||||
{
|
||||
get { return ModuleHelper.Converter(_module); }
|
||||
}
|
||||
public virtual bool IsAvailable { get; }
|
||||
|
||||
public virtual bool IsOnline { get; }
|
||||
|
||||
public virtual bool IsError { get; }
|
||||
|
||||
public virtual bool IsReady { get; }
|
||||
|
||||
public virtual bool IsService { get; }
|
||||
|
||||
public virtual string State { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// 检查调度器是否空闲。
|
||||
/// </summary>
|
||||
/// <Remarks>
|
||||
/// 调度器空闲的条件除调度器无任务执行,还需要判断Module的状态是否为Idle或Error。
|
||||
/// 因为如果调度器执行过程中,Module发生错误,也应该将调度器标记为空闲,否则调度器可能卡死而导致Auto流程无法继续。
|
||||
/// 以下为调度器和Module可能出现冲突的状态,和判决方法:
|
||||
/// <para>1. 如果调度器无任务,但Module还未Idle,则说明上个Routine还未执行完毕,则认为Task还未完成。</para>
|
||||
/// <para>2. 如果调度器有任务,但Module已经Idle或Error,则说明Routine已执行完毕,但可能出错,则认为Task完成。</para>
|
||||
/// </Remarks>
|
||||
/// <param name="isTaskDone">调度器执行的任务是否结束。</param>
|
||||
/// <param name="fsmStopped">调度器关联的Module的状态机是否Idle或Alarm</param>
|
||||
/// <returns></returns>
|
||||
protected bool SuperCheckTaskDone(bool isTaskDone, bool fsmStopped)
|
||||
{
|
||||
// Transfer状态需特殊对待。该状态在调度器的CheckTaskDone()中未处理,因为机械手的异常可能导致被操作的调度器卡死在Transfer任务中。
|
||||
// 因此需要建立超时机制,如果调度器停留在Transfer状态时间过长,则可能是机械手发生异常,需要自动退出Transfer任务。
|
||||
if (_task == TaskType.TransferTarget)
|
||||
{
|
||||
if (_timTransferTargetStatusTimeout.IsTimeout())
|
||||
{
|
||||
// 强制结束TransferTarget任务
|
||||
_task = TaskType.None;
|
||||
_timTransferTargetStatusTimeout.Stop();
|
||||
isTaskDone = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 调度器仍然在Transfer任务中
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
isTaskDone &= fsmStopped;
|
||||
|
||||
if (isTaskDone)
|
||||
{
|
||||
if (_task != TaskType.None)
|
||||
{
|
||||
LogTaskDone(_task, "");
|
||||
_task = TaskType.None;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (fsmStopped)
|
||||
{
|
||||
LogTaskDone(_task, "Task Failed");
|
||||
_task = TaskType.None;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
protected void LogTaskStart(TaskType cmd, string message)
|
||||
{
|
||||
EV.PostInfoLog("Scheduler", $"Task start:{_module},{cmd} {message}");
|
||||
|
||||
}
|
||||
protected void LogTaskDone(TaskType cmd, string message)
|
||||
{
|
||||
EV.PostInfoLog("Scheduler", $"Task done:{_module},{cmd} {message}");
|
||||
}
|
||||
public virtual void ResetTask()
|
||||
{
|
||||
_task = TaskType.None;
|
||||
_timTransferTargetStatusTimeout.Stop();
|
||||
}
|
||||
|
||||
public bool WaitTransfer(ModuleName robot)
|
||||
{
|
||||
_task = TaskType.TransferTarget;
|
||||
_inProcessRobot = robot;
|
||||
_timTransferTargetStatusTimeout.Start(30000);
|
||||
LogTaskStart(_task, $"Note {robot} in transfer");
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool IsWaitTransfer(ModuleName robot)
|
||||
{
|
||||
return _task == TaskType.TransferTarget && _inProcessRobot == robot;
|
||||
}
|
||||
|
||||
public virtual bool StopWaitTransfer(ModuleName robot)
|
||||
{
|
||||
LogTaskDone(_task, $"Note {robot} transfer complete");
|
||||
_timTransferTargetStatusTimeout.Stop();
|
||||
_inProcessRobot = ModuleName.System;
|
||||
|
||||
_task = TaskType.None;
|
||||
return true;
|
||||
}
|
||||
|
||||
public WaferInfoRt GetWaferInfo(int slot)
|
||||
{
|
||||
return WaferManager.Instance.GetWafer(ModuleHelper.Converter(_module), slot);
|
||||
}
|
||||
|
||||
public bool CheckWaferStatus(int slot, WaferStatus waferStatus)
|
||||
{
|
||||
return WaferManager.Instance.CheckWafer(ModuleHelper.Converter(_module), slot, waferStatus);
|
||||
}
|
||||
|
||||
public bool HasWafer(int slot)
|
||||
{
|
||||
return WaferManager.Instance.CheckHasWafer(ModuleHelper.Converter(_module), slot);
|
||||
}
|
||||
|
||||
public bool NoWafer(int slot)
|
||||
{
|
||||
return WaferManager.Instance.CheckNoWafer(ModuleHelper.Converter(_module), slot);
|
||||
}
|
||||
|
||||
public bool HasTray(int slot)
|
||||
{
|
||||
return WaferManager.Instance.CheckHasTray(ModuleHelper.Converter(_module), slot);
|
||||
}
|
||||
|
||||
public bool NoTray(int slot)
|
||||
{
|
||||
return WaferManager.Instance.CheckNoTray(ModuleHelper.Converter(_module), slot);
|
||||
}
|
||||
|
||||
public bool FirstDetectWaferArrive(int slot)
|
||||
{
|
||||
firstDetectWaferArriveTrigs[slot].CLK = HasWafer(slot);
|
||||
return firstDetectWaferArriveTrigs[slot].Q;
|
||||
}
|
||||
|
||||
public bool FirstDetectWaferLeave(int slot)
|
||||
{
|
||||
firstDetectWaferLeaveTrigs[slot].CLK = NoWafer(slot);
|
||||
return firstDetectWaferLeaveTrigs[slot].Q;
|
||||
}
|
||||
|
||||
public bool FirstDetectTrayArrive(int slot)
|
||||
{
|
||||
firstDetectTrayArriveTrigs[slot].CLK = HasTray(slot);
|
||||
return firstDetectTrayArriveTrigs[slot].Q;
|
||||
}
|
||||
|
||||
public bool FirstDetectTrayLeave(int slot)
|
||||
{
|
||||
firstDetectTrayLeaveTrigs[slot].CLK = NoTray(slot);
|
||||
return firstDetectTrayLeaveTrigs[slot].Q;
|
||||
}
|
||||
|
||||
public bool HasTrayAndExceedProcessCount(int slot)
|
||||
{
|
||||
var wi = WaferManager.Instance.GetWafer(ModuleHelper.Converter(_module), slot);
|
||||
return wi.TrayStatus == TrayStatus.Normal && wi.TrayProcessCount <=0;
|
||||
}
|
||||
|
||||
public bool HasTrayAndNotExceedProcessCount(int slot)
|
||||
{
|
||||
var wi = WaferManager.Instance.GetWafer(ModuleHelper.Converter(_module), slot);
|
||||
return wi.TrayStatus == TrayStatus.Normal && wi.TrayProcessCount >0;
|
||||
}
|
||||
|
||||
public virtual bool CheckWaferNextStepIsThis(ModuleName module, int slot)
|
||||
{
|
||||
if (!WaferManager.Instance.CheckHasWafer(module, slot))
|
||||
return false;
|
||||
|
||||
var 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
|
||||
/// </summary>
|
||||
/// <param name="slot"></param>
|
||||
/// <returns></returns>
|
||||
public virtual bool CheckWaferNextStepModuleNoWafer(int slot)
|
||||
{
|
||||
if (!WaferManager.Instance.CheckHasWafer(Module, slot))
|
||||
return false;
|
||||
|
||||
var 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;
|
||||
|
||||
List<ModuleName> lstModuleName = wafer.ProcessJob.Sequence.Steps[wafer.NextSequenceStep].StepModules;
|
||||
if (lstModuleName.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < lstModuleName.Count; i++)
|
||||
{
|
||||
if (WaferManager.Instance.CheckNoWafer(lstModuleName[i], 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool CheckWaferNextStepBufferNoTray(int slot)
|
||||
{
|
||||
if (!WaferManager.Instance.CheckHasWafer(Module, slot))
|
||||
return false;
|
||||
|
||||
var 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;
|
||||
|
||||
List<ModuleName> lstModuleName = wafer.ProcessJob.Sequence.Steps[wafer.NextSequenceStep].StepModules;
|
||||
if (lstModuleName.Count > 0)
|
||||
{
|
||||
for (int j = 0; j < lstModuleName.Count; j++)
|
||||
{
|
||||
if (CheckWaferNeedProcess(slot, ModuleName.PM1))
|
||||
{
|
||||
if (WaferManager.Instance.CheckNoTray(ModuleName.Buffer, 2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (CheckWaferNeedProcess(slot, ModuleName.PM2))
|
||||
{
|
||||
if (WaferManager.Instance.CheckNoTray(ModuleName.Buffer, 1))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool CheckWaferNextStepModuleNoTray(int slot)
|
||||
{
|
||||
if (!WaferManager.Instance.CheckHasWafer(Module, slot))
|
||||
return false;
|
||||
|
||||
var 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;
|
||||
|
||||
List<ModuleName> lstModuleName = wafer.ProcessJob.Sequence.Steps[wafer.NextSequenceStep].StepModules;
|
||||
if (lstModuleName.Count > 0)
|
||||
{
|
||||
for (int j = 0; j < lstModuleName.Count; j++)
|
||||
{
|
||||
if (lstModuleName[j] == ModuleName.Buffer)
|
||||
{
|
||||
if (CheckWaferNeedProcess(slot, ModuleName.PM1))
|
||||
{
|
||||
if (WaferManager.Instance.CheckNoTray(ModuleName.Buffer, 2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (CheckWaferNeedProcess(slot, ModuleName.PM2))
|
||||
{
|
||||
if (WaferManager.Instance.CheckNoTray(ModuleName.Buffer, 1))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (WaferManager.Instance.CheckNoTray(lstModuleName[j], 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 判断Wafer的步骤是否都完成了
|
||||
/// </summary>
|
||||
/// <param name="waferModule"></param>
|
||||
/// <param name="waferSlot"></param>
|
||||
/// <returns></returns>
|
||||
public virtual bool CheckWaferSequenceStepDone(int slot)
|
||||
{
|
||||
var wafer = WaferManager.Instance.GetWafer(Module, slot);
|
||||
|
||||
if (wafer.IsWaferEmpty)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (wafer.ProcessJob == null || wafer.ProcessJob.Sequence == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (wafer.NextSequenceStep >= wafer.ProcessJob.Sequence.Steps.Count && wafer.ProcessJob.Sequence.Steps.Count > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool CheckWaferNeedProcess(int waferSlot, ModuleName processIn = ModuleName.System)
|
||||
{
|
||||
var wafer = WaferManager.Instance.GetWafer(Module, waferSlot);
|
||||
|
||||
if (wafer.IsWaferEmpty)
|
||||
return false;
|
||||
|
||||
if (wafer.WaferStatus == WaferStatus.Dummy && wafer.ProcessState == WaferProcessStatus.Wait)
|
||||
{
|
||||
if (ModuleHelper.IsPm(processIn))
|
||||
{
|
||||
return (CheckNeedRunClean(out bool withWafer, out _) && withWafer);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (wafer.ProcessJob == null || wafer.ProcessJob.Sequence == null || wafer.ProcessJob.Sequence.Steps == null)
|
||||
return false;
|
||||
|
||||
if (wafer.NextSequenceStep >= wafer.ProcessJob.Sequence.Steps.Count || wafer.ProcessJob.Sequence.Steps[wafer.NextSequenceStep].StepModules == null)
|
||||
return false;
|
||||
|
||||
if (processIn != ModuleName.System)
|
||||
{
|
||||
for (int i = wafer.NextSequenceStep; i < wafer.ProcessJob.Sequence.Steps.Count; i++)
|
||||
{
|
||||
foreach (var stepModule in wafer.ProcessJob.Sequence.Steps[i].StepModules)
|
||||
{
|
||||
if (ModuleHelper.IsPm(stepModule)&& stepModule==processIn)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool hasPm = false;
|
||||
for (int i = wafer.NextSequenceStep; i < wafer.ProcessJob.Sequence.Steps.Count; i++)
|
||||
{
|
||||
foreach (var stepModule in wafer.ProcessJob.Sequence.Steps[i].StepModules)
|
||||
{
|
||||
if (ModuleHelper.IsPm(stepModule))
|
||||
{
|
||||
hasPm = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasPm)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!hasPm)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool CheckNeedRunClean(out bool withWafer, out string recipeName)
|
||||
{
|
||||
recipeName = string.Empty;
|
||||
withWafer = false;
|
||||
|
||||
//SequenceInfo seq = GetCurrentSequenceInfo();
|
||||
//int waferProcessed = StatsDataManager.Instance.GetValue($"{Module}.WaferProcessedSincePreviousClean");
|
||||
|
||||
//if (seq == null)
|
||||
// return false;
|
||||
|
||||
|
||||
//foreach (var stepInfo in seq.Steps)
|
||||
//{
|
||||
// if (!stepInfo.StepModules.Contains(Module))
|
||||
// continue;
|
||||
|
||||
// if (stepInfo.StepParameter.ContainsKey("CleanIntervalWaferless")
|
||||
// && int.TryParse((string)stepInfo.StepParameter["CleanIntervalWaferless"], out int interval)
|
||||
// && stepInfo.StepParameter.ContainsKey("CleanRecipeWaferless")
|
||||
// && !string.IsNullOrEmpty((string)stepInfo.StepParameter["CleanRecipeWaferless"]))
|
||||
// {
|
||||
// if (interval > 0 && waferProcessed >= interval)
|
||||
// {
|
||||
// recipeName = (string)stepInfo.StepParameter["CleanRecipeWaferless"];
|
||||
// withWafer = false;
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (stepInfo.StepParameter.ContainsKey("CleanIntervalWafer")
|
||||
// && int.TryParse((string)stepInfo.StepParameter["CleanIntervalWafer"], out interval)
|
||||
// && stepInfo.StepParameter.ContainsKey("CleanRecipeWafer")
|
||||
// && !string.IsNullOrEmpty((string)stepInfo.StepParameter["CleanRecipeWafer"]))
|
||||
// {
|
||||
// if (interval > 0 && waferProcessed >= interval)
|
||||
// {
|
||||
// recipeName = (string)stepInfo.StepParameter["CleanRecipeWafer"];
|
||||
// withWafer = true;
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool IsReadyForPick(ModuleName robot, int slot)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool IsReadyForPlace(ModuleName robot, int slot)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool IsReadyForTransfer(ModuleName robot, int slot)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public virtual bool PrepareTransfer(ModuleName robot, EnumTransferType type, int slot)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool PostTransfer(ModuleName robot, EnumTransferType type, int slot)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool Process(string recipeName, bool isCleanRecipe, bool withDummyWafer)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool Cooling(bool coolingType, int coolingTime)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool Aligning()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool WarmUp(int warmUpTime)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public virtual bool CheckWaferTraySeparated()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool CheckWaferTrayGrouped()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool CheckSlitValveClosed() //检查闸板阀是否关闭
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual bool CheckTrayPlaced()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
using SicRT.Scheduler;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SicRT.Modules.Schedulers
|
||||
{
|
||||
public class SchedulerModuleFactory
|
||||
{
|
||||
protected SchedulerTMRobot _tmRobot = new();
|
||||
protected SchedulerWaferRobot _waferRobot = new();
|
||||
protected SchedulerTrayRobot _trayRobot = new();
|
||||
|
||||
protected SchedulerBuffer _buffer = new(ModuleName.Buffer);
|
||||
protected SchedulerLoadLock _load = new(ModuleName.LoadLock);
|
||||
protected SchedulerUnLoad _unload = new(ModuleName.UnLoad);
|
||||
protected SchedulerAligner _aligner = new(ModuleName.Aligner);
|
||||
protected SchedulerPM _pm1 = new(ModuleName.PM1);
|
||||
protected SchedulerPM _pm2 = new(ModuleName.PM2);
|
||||
|
||||
protected SchedulerCassette _cassetteAL = new(ModuleName.CassAL);
|
||||
protected SchedulerCassette _cassetteAR = new(ModuleName.CassAR);
|
||||
protected SchedulerCassette _cassetteBL = new(ModuleName.CassBL);
|
||||
|
||||
protected List<SchedulerPM> _lstPms = new();
|
||||
protected List<SchedulerCassette> _lstWaferCassettes = new();
|
||||
|
||||
protected SchedulerModuleFactory()
|
||||
{
|
||||
_lstPms.AddRange(new[] { _pm1,_pm2 });
|
||||
|
||||
_lstWaferCassettes.AddRange(new[] { _cassetteAL, _cassetteAR});
|
||||
}
|
||||
|
||||
protected SchedulerModule GetModule(string name)
|
||||
{
|
||||
switch (ModuleHelper.Converter(name))
|
||||
{
|
||||
case ModuleName.Buffer:
|
||||
return _buffer;
|
||||
case ModuleName.TMRobot:
|
||||
return _tmRobot;
|
||||
case ModuleName.WaferRobot:
|
||||
return _waferRobot;
|
||||
case ModuleName.TrayRobot:
|
||||
return _trayRobot;
|
||||
case ModuleName.PM1:
|
||||
return _pm1;
|
||||
case ModuleName.PM2:
|
||||
return _pm2;
|
||||
case ModuleName.CassAL:
|
||||
return _cassetteAL;
|
||||
case ModuleName.CassAR:
|
||||
return _cassetteAR;
|
||||
case ModuleName.CassBL:
|
||||
return _cassetteBL;
|
||||
case ModuleName.LoadLock:
|
||||
case ModuleName.Load:
|
||||
return _load;
|
||||
case ModuleName.UnLoad:
|
||||
return _unload;
|
||||
case ModuleName.Aligner:
|
||||
return _aligner;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected SchedulerModule GetModule(ModuleName name)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case ModuleName.Buffer:
|
||||
return _buffer;
|
||||
case ModuleName.TMRobot:
|
||||
return _tmRobot;
|
||||
case ModuleName.WaferRobot:
|
||||
return _waferRobot;
|
||||
case ModuleName.TrayRobot:
|
||||
return _trayRobot;
|
||||
case ModuleName.PM1:
|
||||
return _pm1;
|
||||
case ModuleName.PM2:
|
||||
return _pm2;
|
||||
case ModuleName.CassAL:
|
||||
return _cassetteAL;
|
||||
case ModuleName.CassAR:
|
||||
return _cassetteAR;
|
||||
case ModuleName.CassBL:
|
||||
return _cassetteBL;
|
||||
case ModuleName.LoadLock:
|
||||
case ModuleName.Load:
|
||||
return _load;
|
||||
case ModuleName.UnLoad:
|
||||
return _unload;
|
||||
case ModuleName.Aligner:
|
||||
return _aligner;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_tmRobot.ResetTask();
|
||||
foreach (var pm in _lstPms)
|
||||
{
|
||||
pm.ResetTask();
|
||||
}
|
||||
|
||||
_buffer.ResetTask();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
using Aitex.Core.Common;
|
||||
using Aitex.Core.RT.Fsm;
|
||||
using Aitex.Core.RT.SCCore;
|
||||
using Aitex.Core.Util;
|
||||
using SicRT.Modules;
|
||||
using SicRT.Modules.Schedulers;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.Schedulers;
|
||||
using MECF.Framework.Common.SubstrateTrackings;
|
||||
using SicRT.Equipments;
|
||||
using SicRT.Equipments.Systems;
|
||||
using Aitex.Core.RT.Device;
|
||||
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs;
|
||||
using Aitex.Core.RT.Device.Devices;
|
||||
using Aitex.Core.RT.DataCenter;
|
||||
|
||||
namespace SicRT.Scheduler
|
||||
{
|
||||
public class SchedulerPM : SchedulerModule
|
||||
{
|
||||
public override bool IsAvailable
|
||||
{
|
||||
get
|
||||
{
|
||||
if (SC.GetValue<bool>("System.IsATMMode"))
|
||||
{
|
||||
return _pm.IsIdle && _pm.IsOnline && CheckTaskDone();
|
||||
}
|
||||
else
|
||||
{
|
||||
return _pm.IsProcessIdle && _pm.IsOnline && CheckTaskDone();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsOnline
|
||||
{
|
||||
get { return _pm.IsOnline; }
|
||||
}
|
||||
public override bool IsError
|
||||
{
|
||||
get { return _pm.IsError; }
|
||||
}
|
||||
|
||||
public bool IsLineHeaterEnable
|
||||
{
|
||||
get { return (bool)DATA.Poll($"{_pm.Name}.OmronTemp.Enable"); }
|
||||
}
|
||||
|
||||
public override bool IsService
|
||||
{
|
||||
get { return _pm.IsService; }
|
||||
}
|
||||
|
||||
public override string State
|
||||
{
|
||||
get { return _pm.StringFsmStatus; }
|
||||
}
|
||||
|
||||
|
||||
private PMModuleBase _pm = null;
|
||||
|
||||
private ModuleName _taskRobot;
|
||||
private EnumTransferType _taskTransferType;
|
||||
private int _taskSlot;
|
||||
private int _entityTaskToken = (int)FSM_MSG.NONE;
|
||||
|
||||
private DeviceTimer _timer = new DeviceTimer();
|
||||
|
||||
public SchedulerPM(ModuleName chamber) : base(chamber.ToString())
|
||||
{
|
||||
_pm = Singleton<EquipmentManager>.Instance.Modules[chamber] as PMModuleBase;
|
||||
System.Diagnostics.Trace.Assert(_pm != null);
|
||||
}
|
||||
|
||||
public override bool IsReadyForPick(ModuleName robot, int slot)
|
||||
{
|
||||
return _pm.IsPrepareTransferReady(robot, EnumTransferType.Pick, slot);
|
||||
}
|
||||
|
||||
public override bool IsReadyForPlace(ModuleName robot, int slot)
|
||||
{
|
||||
return _pm.IsPrepareTransferReady(robot, EnumTransferType.Place, slot);
|
||||
}
|
||||
|
||||
public override bool PrepareTransfer(ModuleName robot, EnumTransferType type, int slot)
|
||||
{
|
||||
_task = TaskType.PrepareTransfer;
|
||||
_taskRobot = robot;
|
||||
_taskSlot = slot;
|
||||
_taskTransferType = type;
|
||||
_entityTaskToken = _pm.InvokePrepareTransfer(robot, type, slot);
|
||||
|
||||
LogTaskStart(_task, $"{robot} {type} slot {slot + 1}");
|
||||
return _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public override bool Process(string recipeName, bool isCleanRecipe, bool withWafer)
|
||||
{
|
||||
_task = TaskType.Process;
|
||||
|
||||
if (SC.GetValue<bool>("System.IsATMMode"))
|
||||
{
|
||||
_timer.Start(5000);
|
||||
|
||||
_entityTaskToken = (int)FSM_MSG.TIMER;
|
||||
|
||||
WaferManager.Instance.GetWafer(Module, 0).ProcessState = WaferProcessStatus.InProcess;
|
||||
}
|
||||
else
|
||||
{
|
||||
_entityTaskToken = _pm.InvokeProcess(recipeName, isCleanRecipe, withWafer);
|
||||
}
|
||||
|
||||
LogTaskStart(_task, $"recipe: {recipeName}, clean: {isCleanRecipe}, with wafer: {withWafer}");
|
||||
|
||||
|
||||
return _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public bool CheckTaskDone()
|
||||
{
|
||||
bool ret = false;
|
||||
switch (_task)
|
||||
{
|
||||
case TaskType.None:
|
||||
ret = true;
|
||||
break;
|
||||
case TaskType.PrepareTransfer:
|
||||
ret = _pm.CheckAcked(_entityTaskToken) && _pm.IsPrepareTransferReady(_taskRobot, _taskTransferType, _taskSlot);
|
||||
break;
|
||||
case TaskType.Process:
|
||||
|
||||
if (SC.GetValue<bool>("System.IsATMMode"))
|
||||
{
|
||||
ret = _timer.IsTimeout();
|
||||
|
||||
if (ret)
|
||||
WaferManager.Instance.GetWafer(Module, 0).ProcessState = WaferProcessStatus.Completed;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = _pm.CheckAcked(_entityTaskToken) && _pm.IsProcessed();
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret && _task != TaskType.None)
|
||||
{
|
||||
LogTaskDone(_task, "");
|
||||
_task = TaskType.None;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool Monitor()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//TMRobot从Buffer放到PM时检查
|
||||
public bool CheckBufferToPMTemp()
|
||||
{
|
||||
bool psuEnable = SC.GetValue<bool>($"PM.{Module}.PreTransferPSUEnable");
|
||||
bool scrEnable = SC.GetValue<bool>($"PM.{Module}.PreTransferSCREnable");
|
||||
|
||||
if(!psuEnable)
|
||||
{
|
||||
_pm.ClosePSUEnable(out _);
|
||||
}
|
||||
|
||||
if(!scrEnable)
|
||||
{
|
||||
_pm.CloseSCREnable(out _);
|
||||
}
|
||||
|
||||
//IoInterLock pmIoInterLock = DEVICE.GetDevice<IoInterLock>($"{_module}.PMInterLock");
|
||||
//if (pmIoInterLock != null)
|
||||
//{
|
||||
// return pmIoInterLock.DiHeaterTempBelow900CSW && _pm.CheckPlacetoPMTemp();
|
||||
//}
|
||||
|
||||
//return false;
|
||||
|
||||
return _pm.CheckPlacetoPMTemp();
|
||||
}
|
||||
|
||||
//TMRobot从PM取Tray时检查
|
||||
public bool CheckPMToTMRobotTemp()
|
||||
{
|
||||
bool psuEnable = SC.GetValue<bool>($"PM.{Module}.PreTransferPSUEnable");
|
||||
bool scrEnable = SC.GetValue<bool>($"PM.{Module}.PreTransferSCREnable");
|
||||
|
||||
if (!psuEnable)
|
||||
{
|
||||
_pm.ClosePSUEnable(out _);
|
||||
}
|
||||
|
||||
if (!scrEnable)
|
||||
{
|
||||
_pm.CloseSCREnable(out _);
|
||||
}
|
||||
|
||||
//IoInterLock pmIoInterLock = DEVICE.GetDevice<IoInterLock>($"{_module}.PMInterLock");
|
||||
//if (pmIoInterLock != null)
|
||||
//{
|
||||
// return pmIoInterLock.DiHeaterTempBelow900CSW;
|
||||
//}
|
||||
|
||||
//return false;
|
||||
|
||||
return _pm.CheckPickFromPMTemp();
|
||||
}
|
||||
|
||||
public bool CheckTempBelow900()
|
||||
{
|
||||
IoInterLock pmIoInterLock = DEVICE.GetDevice<IoInterLock>($"{_module}.PMInterLock");
|
||||
if (pmIoInterLock != null)
|
||||
{
|
||||
return pmIoInterLock.DiHeaterTempBelow900CSW;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
using Aitex.Core.Util;
|
||||
using Aitex.Sorter.Common;
|
||||
using SicRT.Modules.Schedulers;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.SubstrateTrackings;
|
||||
using SicModules.TMs;
|
||||
using SicRT.Equipments.Systems;
|
||||
|
||||
namespace SicRT.Scheduler
|
||||
{
|
||||
public class SchedulerTMRobot : SchedulerModule
|
||||
{
|
||||
public override bool IsAvailable => _tmRobot.IsIdle && _tmRobot.IsOnline && CheckTaskDone();
|
||||
|
||||
public override bool IsOnline => _tmRobot.IsOnline;
|
||||
|
||||
public override bool IsError => _tmRobot.IsError;
|
||||
|
||||
private TMModuleBase _tmRobot = null;
|
||||
|
||||
private Hand _taskHand;
|
||||
|
||||
private ModuleName _target;
|
||||
|
||||
public bool IsInPumping => ((_task == TaskType.Pick || _task == TaskType.Place) &&
|
||||
(_target == ModuleName.UnLoad || _target == ModuleName.LoadLock ||
|
||||
_target == ModuleName.Load));
|
||||
|
||||
public SchedulerTMRobot() : base(ModuleName.TMRobot.ToString())
|
||||
{
|
||||
_tmRobot = Singleton<EquipmentManager>.Instance.Modules[ModuleName.TM] as TMModuleBase;
|
||||
}
|
||||
|
||||
|
||||
public bool IsReadyForPick(Hand blade)
|
||||
{
|
||||
return WaferManager.Instance.CheckNoWafer(ModuleName.TMRobot, (int)blade);
|
||||
}
|
||||
|
||||
public bool IsReadyForPlace(Hand blade)
|
||||
{
|
||||
return WaferManager.Instance.CheckHasWafer(ModuleName.TMRobot, (int)blade);
|
||||
}
|
||||
|
||||
|
||||
public bool Pick(ModuleName target, int slot, Hand hand)
|
||||
{
|
||||
if (_tmRobot.Pick(target, hand, slot, out string reason))
|
||||
{
|
||||
_task = TaskType.Pick;
|
||||
_taskHand = hand;
|
||||
_target = target;
|
||||
LogTaskStart(_task, $"{target}.{slot + 1}=>{Module}.{hand}");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Place(ModuleName target, int slot, Hand hand)
|
||||
{
|
||||
if (_tmRobot.Place(target, hand, slot, out string reason))
|
||||
{
|
||||
_task = TaskType.Place;
|
||||
_taskHand = hand;
|
||||
_target = target;
|
||||
LogTaskStart(_task, $"{Module}.{hand}=>{target}.{slot + 1}");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Goto(ModuleName chamber, int slot, Hand hand)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Monitor()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CheckTaskDone()
|
||||
{
|
||||
var taskSucceed = false;
|
||||
switch (_task)
|
||||
{
|
||||
case TaskType.None:
|
||||
taskSucceed = true;
|
||||
break;
|
||||
case TaskType.Pick:
|
||||
taskSucceed = WaferManager.Instance.CheckHasTray(ModuleName.TMRobot, (int)_taskHand);
|
||||
break;
|
||||
case TaskType.Place:
|
||||
taskSucceed = WaferManager.Instance.CheckNoTray(ModuleName.TMRobot, (int)_taskHand);
|
||||
break;
|
||||
}
|
||||
|
||||
return SuperCheckTaskDone(taskSucceed, _tmRobot.IsIdle | _tmRobot.IsError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using Aitex.Core.Util;
|
||||
using Aitex.Sorter.Common;
|
||||
using SicRT.Modules.Schedulers;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.SubstrateTrackings;
|
||||
using SicModules.EFEMs;
|
||||
using SicRT.Equipments.Systems;
|
||||
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot.HineAutomation;
|
||||
|
||||
namespace SicRT.Scheduler
|
||||
{
|
||||
public class SchedulerTrayRobot : SchedulerModule
|
||||
{
|
||||
public override bool IsAvailable
|
||||
{
|
||||
get { return _efem.IsIdle && _efem.IsOnline && _efem.TrayRobotModule.IsIdle && _efem.TrayRobotModule.IsOnline && CheckTaskDone(); }
|
||||
}
|
||||
|
||||
public override bool IsOnline
|
||||
{
|
||||
get { return _efem.IsOnline && _efem.TrayRobotModule.IsOnline; }
|
||||
|
||||
}
|
||||
public override bool IsError
|
||||
{
|
||||
get { return _efem.IsError || _efem.TrayRobotModule.IsError; }
|
||||
|
||||
}
|
||||
|
||||
private EFEMModule _efem = null;
|
||||
|
||||
private Hand _taskHand;
|
||||
public SchedulerTrayRobot() : base(ModuleName.TrayRobot.ToString())
|
||||
{
|
||||
_efem = Singleton<EquipmentManager>.Instance.Modules[ModuleName.EFEM] as EFEMModule;
|
||||
}
|
||||
|
||||
|
||||
public bool IsReadyForPick(Hand blade)
|
||||
{
|
||||
return WaferManager.Instance.CheckNoWafer(ModuleName.TrayRobot, (int)blade);
|
||||
}
|
||||
|
||||
public bool IsReadyForPlace(Hand blade)
|
||||
{
|
||||
return WaferManager.Instance.CheckHasWafer(ModuleName.TrayRobot, (int)blade);
|
||||
}
|
||||
|
||||
|
||||
public bool Pick(ModuleName target, int slot, Hand hand)
|
||||
{
|
||||
if (_efem.PickTray(target, hand, slot))
|
||||
{
|
||||
_task = TaskType.Pick;
|
||||
_taskHand = hand;
|
||||
LogTaskStart(_task, $"{target}.{slot + 1}=>{Module}.{hand}");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Place(ModuleName target, int slot, Hand hand)
|
||||
{
|
||||
if (_efem.PlaceTray(target, hand, slot))
|
||||
{
|
||||
_task = TaskType.Place;
|
||||
_taskHand = hand;
|
||||
LogTaskStart(_task, $"{Module}.{hand}=>{target}.{slot + 1}");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Goto(ModuleName chamber, int slot, Hand hand)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Monitor()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CheckTaskDone()
|
||||
{
|
||||
var taskSucceed = false;
|
||||
switch (_task)
|
||||
{
|
||||
case TaskType.None:
|
||||
taskSucceed = true;
|
||||
break;
|
||||
case TaskType.Pick:
|
||||
taskSucceed = WaferManager.Instance.CheckHasTray(ModuleName.TrayRobot, (int)_taskHand);
|
||||
break;
|
||||
case TaskType.Place:
|
||||
taskSucceed = WaferManager.Instance.CheckNoTray(ModuleName.TrayRobot, (int)_taskHand);
|
||||
break;
|
||||
}
|
||||
return SuperCheckTaskDone(taskSucceed, _efem.TrayRobotModule.IsIdle | _efem.TrayRobotModule.IsError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,311 @@
|
||||
using System.Linq;
|
||||
using Aitex.Core.Common;
|
||||
using Aitex.Core.RT.Device;
|
||||
using Aitex.Core.RT.Fsm;
|
||||
using Aitex.Core.Util;
|
||||
using Aitex.Sorter.Common;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.Schedulers;
|
||||
using MECF.Framework.Common.SubstrateTrackings;
|
||||
using SicModules.LLs;
|
||||
using SicModules.UnLoads;
|
||||
using SicRT.Equipments.Systems;
|
||||
using SicRT.Modules.Schedulers;
|
||||
|
||||
namespace SicRT.Scheduler
|
||||
{
|
||||
public class SchedulerUnLoad : SchedulerModule
|
||||
{
|
||||
public override bool IsAvailable
|
||||
{
|
||||
get
|
||||
{
|
||||
return _unL.IsIdle && _unL.IsOnline && CheckTaskDone() && _unL.CheckSlitValveClosed();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsOnline
|
||||
{
|
||||
get
|
||||
{
|
||||
return _unL.IsOnline;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsError
|
||||
{
|
||||
get
|
||||
{
|
||||
return _unL.IsError;
|
||||
}
|
||||
}
|
||||
|
||||
private UnLoadModuleBase _unL = null;
|
||||
|
||||
private ModuleName _taskRobot;
|
||||
private int _taskSlot;
|
||||
private int _entityTaskToken = (int)FSM_MSG.NONE;
|
||||
private bool _separated = false;
|
||||
private bool _purged = false;
|
||||
private bool _coolingCompleted = false;
|
||||
private DeviceTimer _timerCooling = new DeviceTimer();
|
||||
|
||||
public bool IsInPumping { get => _task == TaskType.Pump || _task == TaskType.Purge || _task == TaskType.PrepareTransfer; }
|
||||
|
||||
public SchedulerUnLoad(ModuleName module) : base(module.ToString())
|
||||
{
|
||||
_module = module.ToString();
|
||||
_unL = Singleton<EquipmentManager>.Instance.Modules[module] as UnLoadModuleBase;
|
||||
}
|
||||
|
||||
public override bool PrepareTransfer(ModuleName robot, EnumTransferType type, int slot)
|
||||
{
|
||||
_task = TaskType.PrepareTransfer;
|
||||
_taskRobot = robot;
|
||||
_taskSlot = slot;
|
||||
|
||||
LogTaskStart(_task, $"{robot} {type} slot {slot + 1}");
|
||||
|
||||
return _unL.PrepareTransfer(robot, Hand.Blade1, slot, type, out _);
|
||||
}
|
||||
|
||||
internal bool CheckAtAtm()
|
||||
{
|
||||
SicLoadLock deviceLL = DEVICE.GetDevice<SicLoadLock>($"{_module}.{_module}");
|
||||
|
||||
return deviceLL.CheckAtm();
|
||||
}
|
||||
internal bool CheckAtVacuum()
|
||||
{
|
||||
SicLoadLock deviceLL = DEVICE.GetDevice<SicLoadLock>($"{_module}.{_module}");
|
||||
|
||||
return deviceLL.CheckVacuum();
|
||||
}
|
||||
internal void SetJobStatue()
|
||||
{
|
||||
SicLoadLock deviceLL = DEVICE.GetDevice<SicLoadLock>($"{_module}.{_module}");
|
||||
//deviceLL.SetJobDoneStatus();
|
||||
}
|
||||
|
||||
public override bool IsReadyForPick(ModuleName robot, int slot)
|
||||
{
|
||||
if (robot == ModuleName.WaferRobot)
|
||||
{
|
||||
return _unL.CheckReadyForTransfer(robot, Hand.Blade1, slot, EnumTransferType.Pick, out _)
|
||||
&& WaferManager.Instance.CheckHasWafer(ModuleHelper.Converter(_module), slot);
|
||||
}
|
||||
else if (robot == ModuleName.TMRobot)
|
||||
{
|
||||
return _unL.CheckReadyForTransfer(robot, Hand.Blade1, slot, EnumTransferType.Pick, out _)
|
||||
&& WaferManager.Instance.CheckHasTray(ModuleHelper.Converter(_module), slot);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool IsReadyForPlace(ModuleName robot, int slot)
|
||||
{
|
||||
return _unL.CheckReadyForTransfer(robot, Hand.Blade1, slot, EnumTransferType.Place, out _)
|
||||
&& WaferManager.Instance.CheckNoWafer(ModuleHelper.Converter(_module), slot)
|
||||
&& WaferManager.Instance.CheckNoTray(ModuleHelper.Converter(_module), slot);
|
||||
}
|
||||
|
||||
|
||||
public bool Vent()
|
||||
{
|
||||
_task = TaskType.Vent;
|
||||
|
||||
_entityTaskToken = _unL.InvokeVent();
|
||||
|
||||
LogTaskStart(_task, $"{Module} vent to ATM");
|
||||
|
||||
return _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public bool Pump()
|
||||
{
|
||||
_entityTaskToken = _unL.InvokePump();
|
||||
if (_entityTaskToken != (int)FSM_MSG.NONE)
|
||||
{
|
||||
_task = TaskType.Pump;
|
||||
LogTaskStart(_task, $"{Module} pump to Vaccum");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public override bool Cooling(bool coolingType, int coolingTime)
|
||||
{
|
||||
_entityTaskToken = _unL.InvokeCooling(coolingTime);
|
||||
if (_entityTaskToken != (int)FSM_MSG.NONE)
|
||||
{
|
||||
_task = TaskType.Cooling;
|
||||
LogTaskStart(_task, $"{Module} cooling {coolingTime} seconds");
|
||||
}
|
||||
_coolingCompleted = _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
|
||||
return _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public bool Purge(params object[] objs)
|
||||
{
|
||||
_entityTaskToken = _unL.InvokePurge(objs);
|
||||
if (_entityTaskToken != (int)FSM_MSG.NONE)
|
||||
{
|
||||
_task = TaskType.Purge;
|
||||
LogTaskStart(_task, $"{Module} purge for new job");
|
||||
_purged = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool Monitor()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool GroupWaferTray()
|
||||
{
|
||||
_entityTaskToken = _unL.InvokeGroupWaferTray();
|
||||
if (_entityTaskToken != (int)FSM_MSG.NONE)
|
||||
{
|
||||
|
||||
_task = TaskType.Group;
|
||||
LogTaskStart(_task, $"{Module} start group wafer and tray");
|
||||
}
|
||||
return _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public bool SeparateWaferTray()
|
||||
{
|
||||
_entityTaskToken = _unL.InvokeSeparateWaferTray();
|
||||
if (_entityTaskToken != (int)FSM_MSG.NONE)
|
||||
{
|
||||
_task = TaskType.Separate;
|
||||
LogTaskStart(_task, $"{Module} start separate wafer and tray");
|
||||
}
|
||||
_separated = _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
return _entityTaskToken != (int)FSM_MSG.NONE;
|
||||
}
|
||||
|
||||
public void ResetPurgedAndSeparatedStatus()
|
||||
{
|
||||
_coolingCompleted = false;
|
||||
_separated = false;
|
||||
_purged = false;
|
||||
}
|
||||
|
||||
public bool CheckCoolingCompleted()
|
||||
{
|
||||
return _coolingCompleted;
|
||||
}
|
||||
|
||||
public override bool CheckWaferTraySeparated()
|
||||
{
|
||||
return _separated;
|
||||
}
|
||||
|
||||
public bool CheckPurged()
|
||||
{
|
||||
return _purged;
|
||||
}
|
||||
|
||||
public override bool CheckSlitValveClosed()
|
||||
{
|
||||
return _unL.CheckSlitValveClosed();
|
||||
}
|
||||
|
||||
public int? GetWaferPurgeCount(int slot)
|
||||
{
|
||||
if (!WaferManager.Instance.CheckHasWafer(Module, slot))
|
||||
return null;
|
||||
|
||||
var wi = WaferManager.Instance.GetWafer(Module, slot);
|
||||
|
||||
if (wi.ProcessJob?.Sequence == null)
|
||||
return null;
|
||||
|
||||
if (wi.NextSequenceStep >= wi.ProcessJob.Sequence.Steps.Count)
|
||||
return null;
|
||||
|
||||
if (!wi.ProcessJob.Sequence.Steps[wi.NextSequenceStep].StepModules.Contains(Module))
|
||||
return null;
|
||||
|
||||
if (!wi.ProcessJob.Sequence.Steps[wi.NextSequenceStep].StepParameter.ContainsKey("PurgeCount"))
|
||||
return null;
|
||||
|
||||
if (int.TryParse(wi.ProcessJob.Sequence.Steps[wi.NextSequenceStep].StepParameter["PurgeCount"].ToString(), out int purgeCount))
|
||||
{
|
||||
return purgeCount;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public int? GetWaferPumpDelayTime(int slot)
|
||||
{
|
||||
if (!WaferManager.Instance.CheckHasWafer(Module, slot))
|
||||
return null;
|
||||
|
||||
var wi = WaferManager.Instance.GetWafer(Module, slot);
|
||||
|
||||
if (wi.ProcessJob?.Sequence == null)
|
||||
return null;
|
||||
|
||||
if (wi.NextSequenceStep >= wi.ProcessJob.Sequence.Steps.Count)
|
||||
return null;
|
||||
|
||||
if (!wi.ProcessJob.Sequence.Steps[wi.NextSequenceStep].StepModules.Contains(Module))
|
||||
return null;
|
||||
|
||||
if (!wi.ProcessJob.Sequence.Steps[wi.NextSequenceStep].StepParameter.ContainsKey("PumpDelayTime"))
|
||||
return null;
|
||||
|
||||
if (int.TryParse(wi.ProcessJob.Sequence.Steps[wi.NextSequenceStep].StepParameter["PumpDelayTime"].ToString(), out int pumpDelayTime))
|
||||
{
|
||||
return pumpDelayTime;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool CheckTaskDone()
|
||||
{
|
||||
var taskSucceed = false;
|
||||
switch (_task)
|
||||
{
|
||||
case TaskType.None:
|
||||
taskSucceed = true;
|
||||
break;
|
||||
case TaskType.PrepareTransfer:
|
||||
taskSucceed = _unL.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
case TaskType.Cooling:
|
||||
taskSucceed = _unL.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
case TaskType.Vent:
|
||||
taskSucceed = _unL.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
case TaskType.Pump:
|
||||
taskSucceed = _unL.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
case TaskType.Group:
|
||||
taskSucceed = _unL.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
case TaskType.Purge:
|
||||
taskSucceed = _unL.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
case TaskType.Separate:
|
||||
taskSucceed = _unL.CheckAcked(_entityTaskToken);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return SuperCheckTaskDone(taskSucceed, _unL.IsIdle | _unL.IsError);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using Aitex.Core.Util;
|
||||
using Aitex.Sorter.Common;
|
||||
using SicRT.Modules.Schedulers;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.SubstrateTrackings;
|
||||
using SicModules.EFEMs;
|
||||
using SicRT.Equipments.Systems;
|
||||
using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.EFEM;
|
||||
|
||||
namespace SicRT.Scheduler
|
||||
{
|
||||
public class SchedulerWaferRobot : SchedulerModule
|
||||
{
|
||||
public override bool IsAvailable
|
||||
{
|
||||
get { return _efem.IsIdle && _efem.IsOnline && _efem.WaferRobotModule.IsIdle && _efem.WaferRobotModule.IsOnline && CheckTaskDone(); }
|
||||
}
|
||||
|
||||
public override bool IsOnline
|
||||
{
|
||||
get { return _efem.IsOnline && _efem.WaferRobotModule.IsOnline; }
|
||||
|
||||
}
|
||||
public override bool IsError
|
||||
{
|
||||
get { return _efem.IsError || _efem.WaferRobotModule.IsError; }
|
||||
|
||||
}
|
||||
|
||||
private EFEMModule _efem = null;
|
||||
|
||||
private Hand _taskHand;
|
||||
|
||||
private Hand _taskSwapPickHand;
|
||||
private Hand _taskSwapPlaceHand;
|
||||
|
||||
public SchedulerWaferRobot() : base(ModuleName.WaferRobot.ToString())
|
||||
{
|
||||
_efem = Singleton<EquipmentManager>.Instance.Modules[ModuleName.EFEM] as EFEMModule;
|
||||
}
|
||||
|
||||
|
||||
public bool IsReadyForPick(Hand blade)
|
||||
{
|
||||
return WaferManager.Instance.CheckNoWafer(ModuleName.WaferRobot, (int)blade);
|
||||
}
|
||||
|
||||
public bool IsReadyForPlace(Hand blade)
|
||||
{
|
||||
return WaferManager.Instance.CheckHasWafer(ModuleName.WaferRobot, (int)blade);
|
||||
}
|
||||
|
||||
|
||||
public bool Pick(ModuleName target, int slot, Hand hand)
|
||||
{
|
||||
if (_efem.PickWafer(target, hand, slot))
|
||||
{
|
||||
_task = TaskType.Pick;
|
||||
_taskHand = hand;
|
||||
LogTaskStart(_task, $"{target}.WaferRobot.{slot + 1}=>{Module}.{hand}");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Place(ModuleName target, int slot, Hand hand)
|
||||
{
|
||||
if (_efem.PlaceWafer(target, hand, slot))
|
||||
{
|
||||
_task = TaskType.Place;
|
||||
_taskHand = hand;
|
||||
LogTaskStart(_task, $"{Module}.WaferRobot.{hand}=>{target}.{slot + 1}");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Map(ModuleName target)
|
||||
{
|
||||
if (_efem.MapWafer(target))
|
||||
{
|
||||
_task = TaskType.Map;
|
||||
LogTaskStart(_task, $"{Module}.WaferRobot Map");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Goto(ModuleName chamber, int slot, Hand hand)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Monitor()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CheckTaskDone()
|
||||
{
|
||||
var taskSucceed = false;
|
||||
switch (_task)
|
||||
{
|
||||
case TaskType.None:
|
||||
taskSucceed = true;
|
||||
break;
|
||||
case TaskType.Pick:
|
||||
taskSucceed = WaferManager.Instance.CheckHasWafer(ModuleName.WaferRobot, (int)_taskHand);
|
||||
break;
|
||||
case TaskType.Place:
|
||||
taskSucceed = WaferManager.Instance.CheckNoWafer(ModuleName.WaferRobot, (int)_taskHand);
|
||||
break;
|
||||
}
|
||||
|
||||
return SuperCheckTaskDone(taskSucceed, _efem.WaferRobotModule.IsIdle | _efem.WaferRobotModule.IsError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user