123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993 |
- using System;
- using System.Collections.Generic;
- using Aitex.Core.Common;
- using Aitex.Core.RT.Event;
- using Aitex.Core.Util;
- using Aitex.Sorter.Common;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.SubstrateTrackings;
- using VirgoCommon;
- using VirgoRT.Device;
- using VirgoRT.Device.YASKAWA;
- using System.Diagnostics;
- using System.Threading;
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Log;
- using VirgoRT.Devices.EFEM;
- using VirgoRT.Modules;
- namespace VirgoRT.Devices
- {
- /// <summary>
- /// Base action
- /// </summary>
- abstract class EfemActionBase : ActionBase
- {
- protected readonly EfemBase _efem;
- public EfemOperation Type { get; protected set; }
- protected EfemActionBase() : this(null) { }
- protected EfemActionBase(EfemBase efem) : base(ModuleName.EFEM)
- {
- _efem = efem;
- }
- }
- class DelayAction : ActionBase
- {
- private readonly DeviceTimer _timer = new DeviceTimer();
- private readonly ushort _delayTime;
- public bool IsDone => _timer.IsTimeout();
- public DelayAction(ushort delaytime) : base(ModuleName.System)
- {
- this._delayTime = delaytime;
- }
- public override void Execute()
- {
- _timer.Start(this._delayTime * 1000);
- }
- public override void OnPostWork(string data)
- {
- EV.PostInfoLog(ModuleName.EFEM.ToString(), $"Delay time [{_delayTime}]");
- }
- }
- }
- namespace VirgoRT.Devices.YASKAWA
- {
- class EfemAction : EfemActionBase
- {
- public EfemAction(EfemBase device, ModuleName mod) : base(device)
- { }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.MOV,
- Parameters = new List<string> { Constant.ModuleString[this.Module] }
- });
- base.Execute();
- _efem.Status = DeviceState.Busy;
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} Start");
- }
- public override void OnPostWork(string data = null)
- {
- _efem.Status = DeviceState.Idle;
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} End");
- }
- }
- /// <summary>
- ///
- /// </summary>
- class HomeAllAction : EfemAction
- {
- public HomeAllAction(EfemBase efem, ModuleName mod) : base(efem, mod)
- {
- Type = EfemOperation.Home;
- this.Module = mod;
- }
- public override void OnPostWork(string data = null)
- {
- _efem[ModuleName.LP1].OnHomed();
- _efem[ModuleName.LP2].OnHomed();
- base.OnPostWork(data);
- var tower = DEVICE.GetDevice<VirgoSignalTower>("System.SignalTower");
- if (tower != null)
- {
- tower.ResetData();
- }
-
- }
- }
- class HomeModuleAction : EfemAction
- {
- public HomeModuleAction(EfemBase efem, ModuleName mod) : base(efem, mod)
- {
- Type = EfemOperation.Home;
- this.Module = mod;
- IsBackground = ModuleHelper.IsLoadPort(mod);
- }
- public override void OnPostWork(string data = null)
- {
- if (ModuleHelper.IsLoadPort(Module))
- {
- _efem[Module].OnHomed();
- }
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} End");
- }
- }
- class LoadModuleAction : EfemAction
- {
- public LoadModuleAction(EfemBase efem, ModuleName mod) : base(efem, mod)
- {
- Type = EfemOperation.Load;
- this.Module = mod;
- IsBackground = true;
- }
- public override void OnPostWork(string data = null)
- {
- _efem[Module].OnLoaded();
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} End");
- }
-
- public override void OnError(string data = null)
- {
- _efem[Module].OnLoadFailed(data);
- base.OnError(data);
- }
- }
- class UnloadModuleAction : EfemAction
- {
- public UnloadModuleAction(EfemBase efem, ModuleName mod) : base(efem, mod)
- {
- Type = EfemOperation.Unload;
- this.Module = mod;
- IsBackground = true;
- }
- public override void OnPostWork(string data = null)
- {
- _efem.Status = DeviceState.Idle;
- _efem[Module].OnUnloaded();
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} End");
- }
- public override void OnError(string data = null)
- {
- _efem[Module].OnUnloadFailed(data);
- base.OnError(data);
- }
- }
- class ReadCarrierIdModuleAction : EfemAction
- {
- public ReadCarrierIdModuleAction(EfemBase efem, ModuleName mod) : base(efem, mod)
- {
- Type = EfemOperation.CarrierId;
- this.Module = mod;
- IsBackground = true;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.GET,
- Parameters = new List<string> { Constant.ModuleString[this.Module] }
- });
- //base.Execute();
- this.Status = ActionStatus.SendCmd;
- _efem.Status = DeviceState.Busy;
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} Start");
- }
- public override void OnPostWork(string data = null)
- {
- _efem.Status = DeviceState.Idle;
- _efem[Module].OnCarrierIDRead(data);
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} End");
- }
- public override void OnError(string data = null)
- {
- _efem[Module].OnCarrierIDReadFailed(data);
- base.OnError(data);
- }
- }
- class WriteCarrierIdModuleAction : EfemAction
- {
- private string _id;
- public WriteCarrierIdModuleAction(EfemBase efem, ModuleName mod, string id) : base(efem, mod)
- {
- Type = EfemOperation.CarrierId;
- this.Module = mod;
- IsBackground = true;
- _id = id;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.SET,
- Parameters = new List<string> { Constant.ModuleString[this.Module] , _id}
- });
- //base.Execute();
- this.Status = ActionStatus.SendCmd;
- _efem.Status = DeviceState.Busy;
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} Start");
- }
- public override void OnPostWork(string data = null)
- {
- _efem.Status = DeviceState.Idle;
- _efem[Module].OnCarrierIDWrite(_id);
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} End");
- }
- public override void OnError(string data = null)
- {
- _efem[Module].OnCarrierIDWriteFailed(_id);
- base.OnError(data);
- }
- }
- class ReadTagDataModuleAction : EfemAction
- {
- public ReadTagDataModuleAction(EfemBase efem, ModuleName mod) : base(efem, mod)
- {
- Type = EfemOperation.CarrierId;
- this.Module = mod;
- IsBackground = true;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.GET,
- Parameters = new List<string> { Constant.ModuleString[this.Module] }
- });
- //base.Execute();
- this.Status = ActionStatus.SendCmd;
- _efem.Status = DeviceState.Busy;
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} Start");
- }
- public override void OnPostWork(string data = null)
- {
- _efem.Status = DeviceState.Idle;
- _efem[Module].OnTagDataRead(data);
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} End");
- }
- public override void OnError(string data = null)
- {
- _efem[Module].OnTagDataReadFailed(data);
- base.OnError(data);
- }
- }
- class WriteTagDataModuleAction : EfemAction
- {
- private string _id;
- public WriteTagDataModuleAction(EfemBase efem, ModuleName mod, string id) : base(efem, mod)
- {
- Type = EfemOperation.CarrierId;
- this.Module = mod;
- IsBackground = true;
- _id = id;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.SET,
- Parameters = new List<string> { Constant.ModuleString[this.Module], _id }
- });
- //base.Execute();
- this.Status = ActionStatus.SendCmd;
- _efem.Status = DeviceState.Busy;
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} Start");
- }
- public override void OnPostWork(string data = null)
- {
- _efem.Status = DeviceState.Idle;
- _efem[Module].OnTagDataWrite(_id);
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} End");
- }
- public override void OnError(string data = null)
- {
- _efem[Module].OnTagDataWriteFailed(_id);
- base.OnError(data);
- }
- }
- class DockModuleAction : EfemAction
- {
- public DockModuleAction(EfemBase efem, ModuleName mod) : base(efem, mod)
- {
- Type = EfemOperation.Dock;
- this.Module = mod;
- IsBackground = true;
- }
- }
- class UndockModuleAction : EfemAction
- {
- public UndockModuleAction(EfemBase efem, ModuleName mod) : base(efem, mod)
- {
- Type = EfemOperation.Undock;
- this.Module = mod;
- IsBackground = true;
- }
- }
- class ClampModuleAction : EfemAction
- {
- private bool _isUnloadClamp;
- public ClampModuleAction(EfemBase efem, ModuleName mod, bool isUnloadClamp) : base(efem, mod)
- {
- Type = EfemOperation.Clamp;
- this.Module = mod;
- IsBackground = true;
- _isUnloadClamp = isUnloadClamp;
- }
- public override void OnPostWork(string data = null)
- {
- _efem.Status = DeviceState.Idle;
- _efem[Module].OnClamped(_isUnloadClamp);
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} End");
- }
- public override void OnError(string data = null)
- {
- _efem[Module].OnClampFailed(data);
- base.OnError(data);
- }
- }
- class UnclampModuleAction : EfemAction
- {
- public UnclampModuleAction(EfemBase efem, ModuleName mod) : base(efem, mod)
- {
- Type = EfemOperation.Unclamp;
- this.Module = mod;
- IsBackground = true;
- }
- public override void OnPostWork(string data = null)
- {
- _efem.Status = DeviceState.Idle;
- _efem[Module].OnUnclamped();
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} End");
- }
- public override void OnError(string data = null)
- {
- _efem[Module].OnUnclampFailed(data);
- base.OnError(data);
- }
- }
- class SetThicknessModuleAction : EfemAction
- {
- private string _thick;
- public SetThicknessModuleAction(EfemBase efem, ModuleName mod, string thickness) : base(efem, mod)
- {
- Type = EfemOperation.SetThickness;
- this.Module = mod;
- IsBackground = true;
- _thick = thickness;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.SET,
- Parameters = new List<string> { Constant.ModuleString[this.Module] , _thick.ToUpper()}
- });
- //base.Execute();
- this.Status = ActionStatus.SendCmd;
-
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} Start");
- }
-
- }
-
- class OrgshAction : EfemAction
- {
- public OrgshAction(EfemBase efem, ModuleName mod) : base(efem, mod)
- {
- Type = EfemOperation.Orgsh;
- this.Module = mod;
- }
- }
- class TrackAction : EfemAction
- {
- public TrackAction(EfemBase efem, ModuleName mod) : base(efem, mod)
- {
- Type = EfemOperation.StateTrack;
- this.Module = mod;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.GET,
- Parameters = new List<string> { "TRACK" }
- });
- this.Status = ActionStatus.SendCmd;
- EV.PostInfoLog(this.Module.ToString(), "Query wafer present information");
- }
- public override void OnPostWork(string data)
- {
- this.Status = ActionStatus.Completed;
- //000/111 upperArmWafer, lowerArmWafer, alignerWafer1, alignerWafer2, coolingwafer1,coolingwafer2
- if (data.Length != 6 )
- {
- LOG.Write($"EFEM Track wafer present return invalid value, {data}, should be 6 characters");
- return;
- }
- //upper arm
- if (data[0] == '1')
- {
- if (WaferManager.Instance.CheckNoWafer(ModuleName.EfemRobot, 1))
- {
- WaferManager.Instance.CreateWafer(ModuleName.EfemRobot, 1, WaferStatus.Normal);
- }
- }
- else
- {
- if (WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, 1))
- {
- EV.PostWarningLog(Module.ToString(), $" {ModuleName.EfemRobot} upper arm has wafer information, while EFEM return empty, manually delete if really no wafer");
- }
- }
- //lower arm
- if (data[1] == '1')
- {
- if (WaferManager.Instance.CheckNoWafer(ModuleName.EfemRobot, 0))
- {
- WaferManager.Instance.CreateWafer(ModuleName.EfemRobot, 0, WaferStatus.Normal);
- }
- }
- else
- {
- if (WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, 0))
- {
- EV.PostWarningLog(Module.ToString(), $" {ModuleName.EfemRobot} lower arm has wafer information, while EFEM return empty, manually delete if really no wafer");
- }
- }
- //aligner1
- if (data[2] == '1')
- {
- if (WaferManager.Instance.CheckNoWafer(ModuleName.Aligner1, 0))
- {
- WaferManager.Instance.CreateWafer(ModuleName.Aligner1, 0, WaferStatus.Normal);
- }
- }
- else
- {
- if (WaferManager.Instance.CheckHasWafer(ModuleName.Aligner1, 0))
- {
- EV.PostWarningLog(Module.ToString(), $" {ModuleName.Aligner1} has wafer information, while EFEM return empty, manually delete if really no wafer");
- }
- }
- //aligner2
- if (data[3] == '1')
- {
- if (WaferManager.Instance.CheckNoWafer(ModuleName.Aligner2, 0))
- {
- WaferManager.Instance.CreateWafer(ModuleName.Aligner2, 0, WaferStatus.Normal);
- }
- }
- else
- {
- if (WaferManager.Instance.CheckHasWafer(ModuleName.Aligner2, 0))
- {
- EV.PostWarningLog(Module.ToString(), $" {ModuleName.Aligner2} has wafer information, while EFEM return empty, manually delete if really no wafer");
- }
- }
- //cooling1
- if (data[4] == '1')
- {
- if (WaferManager.Instance.CheckNoWafer(ModuleName.Cooling1, 0))
- {
- WaferManager.Instance.CreateWafer(ModuleName.Cooling1, 0, WaferStatus.Normal);
- }
- }
- else
- {
- if (WaferManager.Instance.CheckHasWafer(ModuleName.Cooling1, 0))
- {
- EV.PostWarningLog(Module.ToString(), $" {ModuleName.Cooling1} has wafer information, while EFEM return empty, manually delete if really no wafer");
- }
- }
- //cooling2
- if (data[5] == '1')
- {
- if (WaferManager.Instance.CheckNoWafer(ModuleName.Cooling2, 0))
- {
- WaferManager.Instance.CreateWafer(ModuleName.Cooling2, 0, WaferStatus.Normal);
- }
- }
- else
- {
- if (WaferManager.Instance.CheckHasWafer(ModuleName.Cooling2, 0))
- {
- EV.PostWarningLog(Module.ToString(), $" {ModuleName.Cooling2} has wafer information, while EFEM return empty, manually delete if really no wafer");
- }
- }
- }
- }
- class ClearErrorAction : EfemAction
- {
- public ClearErrorAction(EfemBase efem) : base(efem, ModuleName.EFEM)
- {
- Type = EfemOperation.ClearError;
- IsBackground = true;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.SET,
- Parameters = new List<string> { "CLEAR" }
- });
- this.Status = ActionStatus.SendCmd;
- EV.PostInfoLog(this.Module.ToString(), "清除 EFEM 所有错误");
- }
- }
- class MapAction : EfemAction
- {
- public MapAction(EfemBase efem, ModuleName mod) : base(efem, mod)
- {
- Type = EfemOperation.Map;
- this.Module = mod;
- }
- public override void OnPostWork(string data)
- {
- _efem[Module].Status = DeviceState.Idle;
- }
- }
- class PickAction : EfemAction
- {
- private MoveParam MoveParam { get; }
- public PickAction(EfemBase efem, MoveParam mp) : base(efem, ModuleName.EFEM)
- {
- Type = EfemOperation.Pick;
- MoveParam = mp;
- }
- public override void Execute()
- {
- //MOV:LOAD/P113/ARM2;
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.MOV,
- Parameters = new List<string>
- {
- MoveParam.SrcPos.ToHWString(),
- Constant.ArmString[MoveParam.Arm],
- MoveParam.WaferSize.ToString()
- }
- });
- this.Status = ActionStatus.SendCmd;
- _efem.Status = DeviceState.Busy;
- }
- public override void OnPostWork(string data)
- {
- WaferManager.Instance.WaferMoved(MoveParam.SrcModule, MoveParam.SrcSlot, MoveParam.DestModule, MoveParam.DestSlot);
- _efem.Status = DeviceState.Idle;
- //_bladeTarget = ModuleName.EfemRobot;
- }
- }
-
- class PlaceAction : EfemAction
- {
- private MoveParam MoveParam { get; }
- public PlaceAction(EfemBase device, MoveParam mp) : base(device, ModuleName.EFEM)
- {
- Type = EfemOperation.Place;
- MoveParam = mp;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.MOV,
- Parameters = new List<string>
- {
- MoveParam.DestPos.ToHWString(),
- Constant.ArmString[MoveParam.Arm],
- MoveParam.WaferSize.ToString()
- }
- });
- this.Status = ActionStatus.SendCmd;
- _efem.Status = DeviceState.Busy;
- }
- public override void OnPostWork(string data)
- {
- WaferManager.Instance.WaferMoved(MoveParam.SrcModule, MoveParam.SrcSlot, MoveParam.DestModule, MoveParam.DestSlot);
- _efem.Status = DeviceState.Idle;
- }
- }
-
- class GotoAction : EfemAction
- {
- private MoveParam MoveParam { get; }
- public GotoAction(EfemBase device, MoveParam mp) : base(device, ModuleName.EFEM)
- {
- Type = EfemOperation.Goto;
- MoveParam = mp;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.MOV,
- Parameters = new List<string>
- {
- MoveParam.DestPos.ToHWString(),
- Constant.ArmString[MoveParam.Arm],
- MoveParam.WaferSize.ToString()
- }
- });
- this.Status = ActionStatus.SendCmd;
- _efem.Status = DeviceState.Busy;
- }
- public override void OnPostWork(string data)
- {
- _efem.Status = DeviceState.Idle;
- }
- }
- class ExtendAction : EfemAction
- {
- private ExtendParam ExtParam { get; }
- public ExtendPos TargetPosition => ExtParam.Pos;
- private JetPM _pm;
- public ExtendAction(EfemBase efem, JetPM pm, ExtendParam ep)
- : base(efem, ModuleName.EFEM)
- {
- Type = EfemOperation.Extend;
- ExtParam = ep;
- ExtParam.Arm = Hand.Blade1;
- _pm = pm;
- }
- public override void Execute()
- {
- if (_pm!=null && !_pm.CheckSlitDoorOpen())
- {
- EV.PostAlarmLog("EFEM", $"{_pm.Module} slit door should be opened");
- Singleton<RouteManager>.Instance.EFEM.PostMsg(EfemEntity.MSG.Error);
- return;
- }
- //MOV:EXTEND/LLA03/ARM2;
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.MOV,
- Parameters = new List<string>
- {
- ExtParam.Module.ToHWString(),
- //Constant.ExtendPosString[ExtParam.Pos],
- ExtParam.Pos.ToString(),
- Constant.ArmString[ExtParam.Arm]
- }
- });
- this.Status = ActionStatus.SendCmd;
- _efem.Status = DeviceState.Busy;
- }
- public override void OnPostWork(string data)
- {
- _efem.Status = DeviceState.Idle;
- switch (TargetPosition)
- {
- case ExtendPos.PB:
- WaferManager.Instance.WaferMoved(ModuleName.EfemRobot, (int)ExtParam.Arm, ExtParam.Module, 0);
- break;
- case ExtendPos.G4:
- WaferManager.Instance.WaferMoved(ExtParam.Module, 0, ModuleName.EfemRobot, (int)ExtParam.Arm);
- break;
- default:
- Debug.WriteLine($"MNPT:{TargetPosition} 不需要更新 WaferManager 信息");
- break;
- }
- }
- }
- class GripAction : EfemAction
- {
- private Hand _blade;
- private bool _isGrip;
- public GripAction(EfemBase efem, Hand blade, bool isGrip)
- : base(efem, ModuleName.EFEM)
- {
- Type = EfemOperation.Grip;
- _blade = blade;
- _isGrip = isGrip;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.SET,
- Parameters = new List<string>
- {
- _isGrip ? "ON":"OFF",
- Constant.ArmString[_blade]
- }
- });
- this.Status = ActionStatus.SendCmd;
- _efem.Status = DeviceState.Busy;
- }
- public override void OnPostWork(string data)
- {
- _efem.Status = DeviceState.Idle;
- if (_blade == Hand.Blade1)
- _efem.GripStateBlade1 = _isGrip ? "ON" : "OFF";
- if (_blade == Hand.Blade2)
- _efem.GripStateBlade2 = _isGrip ? "ON" : "OFF";
- }
- }
-
- class LiftAction : EfemAction
- {
- // MOV:LIFT/ALIGN1;
- private bool _isUp;
- public LiftAction(EfemBase device, ModuleName mod, bool isUp) : base(device, mod)
- {
- Type = EfemOperation.Lift;
- Module = mod;
- _isUp = isUp;
- IsBackground = true;
- (device as Efem).IsBufferPinUp[mod] = !isUp;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.MOV,
- Parameters = new List<string> { Constant.ModuleString[this.Module], _isUp ? "UP":"DOWN" }
- });
- this.Status = ActionStatus.SendCmd;
- _efem.Status = DeviceState.Busy;
- EV.PostInfoLog(this.Module.ToString(), $"Cmd {this.ID} {this.Type} Start");
- }
- public override void OnPostWork(string data)
- {
- _efem.Status = DeviceState.Idle;
- (_efem as Efem).IsBufferPinUp[Module] = _isUp;
- }
- }
- class AlignAction : EfemAction
- {
- private WaferSize _ws { get; }
- public AlignAction(EfemBase device, ModuleName mod, WaferSize size) : base(device, mod)
- {
- Type = EfemOperation.Align;
- this.Module = mod;
- this._ws = size;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.MOV,
- Parameters = new List<string> { Module.ToHWString(), this._ws.ToString() }
- });
- this.Status = ActionStatus.SendCmd;
- }
- public override void OnPostWork(string data) { }
- }
- class LedAction : EfemAction
- {
- private LightType Light { get; }
- private LightStatus LtStatus { get; }
- public LedAction(EfemBase device, LightType lt, LightStatus st) : base(device, ModuleName.EFEM)
- {
- Type = EfemOperation.Light;
- Light = lt;
- LtStatus = st;
- IsBackground = true;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.SET,
- Parameters = new List<string> { Constant.STOWER, Light.ToString(), LtStatus.ToString() }
- });
- _efem.Status = DeviceState.Busy;
- this.Status = ActionStatus.SendCmd;
- //EV.PostInfoLog(this.Module.ToString(), $"CMD[{this.ID}], Set {this.Light} = {LtStatus}");
- }
- public override void OnPostWork(string data)
- {
-
- }
- }
- class AbortAction: EfemAction
- {
- public AbortAction(EfemBase efem) : base(efem, ModuleName.EFEM)
- {
- Type = EfemOperation.Abort;
- }
- public override void Execute()
- {
- _efem.MsgHandler.Send(new EfemMessage
- {
- Operation = this.Type,
- Head = EfemMessage.MsgHead.MOV
- });
- }
- }
- }
|