123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- using System;
- using System.Linq;
- using Aitex.Core.Common;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.Util;
- using Aitex.Sorter.Common;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.Schedulers;
- using MECF.Framework.Common.SubstrateTrackings;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Aligners;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Efems.Rorzes;
- using MECF.Framework.RT.EquipmentLibrary.LogicUnits;
- namespace JetEfemLib.Aligners
- {
- public class FutureBuffer : BaseDevice, IDevice, IEfemBufferCallback
- {
- private RorzeEfem _efem;
- private string _efemName;
- public FutureBuffer(string module, string name, string efemName) : base(module, name, module, module)
- {
- base.Module = module;
- base.Name = name;
- base.Display = name;
- base.DeviceID = "";
- _efemName = efemName;
- //IsMapWaferByLoadPort = false;
- }
- public bool IsBusy
- {
- get
- {
- return _efem.CheckIsBusy(ModuleHelper.Converter(Module));
- }
- }
- public bool Home(out string reason)
- {
- reason = string.Empty;
- if (!_efem.HomeWaferAligner(ModuleHelper.Converter(Module), out reason))
- {
-
- return false;
- }
- return true;
- }
-
- public bool Initialize()
- {
- if (_efem == null && !string.IsNullOrEmpty(_efemName))
- {
- _efem = DEVICE.GetDevice<RorzeEfem>(_efemName);
- _efem.SetBufferCallback(ModuleHelper.Converter(Module), this);
- }
- //base.Initialize();
- return true;
- }
- public bool PrepareTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
- {
- throw new System.NotImplementedException();
- }
- public bool TransferHandoff(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
- {
- throw new System.NotImplementedException();
- }
- public bool PostTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
- {
- throw new System.NotImplementedException();
- }
- public bool CheckReadyForTransfer(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType,
- out string reason)
- {
- reason = string.Empty;
- if (transferType == EnumTransferType.Pick)
- {
- return WaferManager.Instance.CheckHasWafer(Module, targetSlot);
- }
- if (transferType == EnumTransferType.Place)
- {
- return WaferManager.Instance.CheckNoWafer(Module, targetSlot);
- }
- return false;
- }
- public bool NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
- {
- reason = string.Empty;
- return true;
- }
- public bool NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType, out string reason)
- {
- reason = string.Empty;
- return true;
- }
- public void NoteTransferStart(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
- {
- }
- public void NoteTransferStop(ModuleName robot, Hand blade, int targetSlot, EnumTransferType transferType)
- {
- }
- public void NoteComplete()
- {
- }
- public void NoteCancel(string error)
- {
- }
- public virtual void NoteSlotMap(string slotMap)
- {
- slotMap = slotMap.Replace('3', '2');
- slotMap = slotMap.Replace('4', 'W');
- slotMap = slotMap.Replace('7', 'W');
- slotMap = slotMap.Replace('8', 'W');
- slotMap = slotMap.Replace('2', 'W');
- var _module = ModuleHelper.Converter(Module);
- for (int i = 0; i < slotMap.Length; i++)
- {
- // No wafer: "0", Wafer: "1", Crossed:"2", Undefined: "?", Overlapping wafers: "W"
- WaferInfo wafer = null;
- switch (slotMap[i])
- {
- case '0':
- WaferManager.Instance.DeleteWafer(_module, i);
- CarrierManager.Instance.UnregisterCarrierWafer(Name, i);
- break;
- case '1':
- if (!WaferManager.Instance.GetWafer(_module, i).IsEmpty)
- break;
- wafer = WaferManager.Instance.CreateWafer(_module, i, WaferStatus.Normal);
- WaferManager.Instance.UpdateWaferSize(_module, i, GetCurrentWaferSize());
- CarrierManager.Instance.RegisterCarrierWafer(Name, i, wafer);
- break;
- case '2':
- wafer = WaferManager.Instance.CreateWafer(_module, i, WaferStatus.Crossed);
- WaferManager.Instance.UpdateWaferSize(_module, i, GetCurrentWaferSize());
- CarrierManager.Instance.RegisterCarrierWafer(Name, i, wafer);
- //NotifyWaferError(Name, i, WaferStatus.Crossed);
- break;
- case 'W':
- wafer = WaferManager.Instance.CreateWafer(_module, i, WaferStatus.Double);
- WaferManager.Instance.UpdateWaferSize(_module, i, GetCurrentWaferSize());
- CarrierManager.Instance.RegisterCarrierWafer(Name, i, wafer);
- //NotifyWaferError(Name, i, WaferStatus.Double);
- break;
- case '?':
- wafer = WaferManager.Instance.CreateWafer(_module, i, WaferStatus.Unknown);
- WaferManager.Instance.UpdateWaferSize(_module, i, GetCurrentWaferSize());
- CarrierManager.Instance.RegisterCarrierWafer(Name, i, wafer);
- //NotifyWaferError(Name, i, WaferStatus.Unknown);
- break;
- }
- }
- string waferMap = "";
- foreach (var wafer in WaferManager.Instance.GetWafers(ModuleHelper.Converter(Module)))
- {
- waferMap += wafer.IsEmpty ? "0" : "1";
- }
- if (slotMap != waferMap)
- {
- EV.PostAlarmLog("EFEM", $"Map result : {slotMap} is not match {waferMap}");
- }
- else
- {
- EV.PostInfoLog("EFEM", $"Map result : {slotMap} is match {waferMap}");
- }
- }
- private WaferSize GetCurrentWaferSize()
- {
- if (SC.GetStringValue("EFEM.EfemRobot.DefaultMapWaferSize").Trim() == "8")
- return WaferSize.WS8;
- return WaferSize.WS12;
- }
- public void Monitor()
- {
- }
- public void Terminate()
- {
- }
- public void Reset()
- {
- }
- }
- }
|