123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261 |
- using System;
- using System.Xml;
- using Aitex.Core.Common;
- using Aitex.Core.RT.DataCenter;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.OperationCenter;
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using Aitex.Sorter.Common;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.Event;
- using MECF.Framework.Common.SubstrateTrackings;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Efems.Rorzes;
- namespace JetEfemLib
- {
- public class FutureEfemBase : RorzeEfem
- {
- public AlarmEventItem VacuumSourcePressureAlarm { get; set; }
- public AlarmEventItem CompressedAirPressureAlarm { get; set; }
- public AlarmEventItem FlowGaugeWarning { get; set; }
- public AlarmEventItem WaterLeakWarning { get; set; }
- public AlarmEventItem DrivePowerAlarm { get; set; }
- public AlarmEventItem DifferentialPressureSensorSetting1Alarm { get; set; }
- public AlarmEventItem DifferentialPressureSensorSetting2Alarm { get; set; }
- public AlarmEventItem IonizerAlarm { get; set; }
- public AlarmEventItem FfuAlarm { get; set; }
- public AlarmEventItem AirErrorForRobot { get; set; }
- //public AlarmEventItem AirErrorForChamber { get; set; }
- public AlarmEventItem IsMaintain { get; set; }
- public AlarmEventItem DoorOpen { get; set; }
- public AlarmEventItem EmoAlarm { get; set; }
- protected bool _stateVacuumSourcePressureAlarm;
- protected bool _stateCompressedAirPressureAlarm;
- protected bool _stateFlowGaugeWarning;
- protected bool _stateWaterLeakWarning;
- protected bool _stateDrivePowerAlarm;
- protected bool _stateDifferentialPressureSensorSetting1Alarm;
- protected bool _stateDifferentialPressureSensorSetting2Alarm;
- protected bool _stateIonizerAlarm;
- protected bool _stateFfuAlarm;
- protected bool _stateAirErrorForRobot;
- protected bool _stateIsMaintain;
- protected bool _stateDoorOpen;
- protected bool _stateEmoAlarm;
- public FutureEfemBase(string module, XmlElement node, string ioModule = "") : base("System", "EFEM", "")
- {
- }
- public FutureEfemBase(string system, string efemName) : base(system, efemName, "")
- {
- }
- public FutureEfemBase() : base("System", "EFEM", "")
- {
- }
- public override bool Initialize()
- {
- VacuumSourcePressureAlarm = SubscribeAlarm($"{Module}.{Name}.VacuumSourcePressureAlarm", "EFEM Vacuum Source Pressure Alarm", () => !_stateFfuAlarm, EventLevel.Alarm);
- CompressedAirPressureAlarm = SubscribeAlarm($"{Module}.{Name}.CompressedAirPressureAlarm", "EFEM Compressed Air Pressure Alarm", () => !_stateFfuAlarm, EventLevel.Alarm);
- FlowGaugeWarning = SubscribeAlarm($"{Module}.{Name}.FlowGaugeWarning", "EFEM Flow Gauge Warning", () => !_stateFfuAlarm, EventLevel.Alarm);
- WaterLeakWarning = SubscribeAlarm($"{Module}.{Name}.WaterLeakWarning", "EFEM Water Leak Warning", () => !_stateFfuAlarm, EventLevel.Alarm);
- DrivePowerAlarm = SubscribeAlarm($"{Module}.{Name}.DrivePowerAlarm", "EFEM Drive Power Alarm", () => !_stateFfuAlarm, EventLevel.Alarm);
- DifferentialPressureSensorSetting1Alarm = SubscribeAlarm($"{Module}.{Name}.DifferentialPressureSensorSetting1Alarm", "EFEM Differential Pressure Sensor Setting1 Alarm", () => !_stateFfuAlarm, EventLevel.Alarm);
- DifferentialPressureSensorSetting2Alarm = SubscribeAlarm($"{Module}.{Name}.DifferentialPressureSensorSetting2Alarm", "EFEM Differential Pressure Sensor Setting2 Alarm", () => !_stateFfuAlarm, EventLevel.Alarm);
- FfuAlarm = SubscribeAlarm($"{Module}.{Name}.FFUAlarm", "EFEM FFU Error", () => !_stateFfuAlarm, EventLevel.Warning);
- IonizerAlarm = SubscribeAlarm($"{Module}.{Name}.IonizerAlarm", "EFEM Ionizer Error", () => !_stateIonizerAlarm, EventLevel.Warning);
- AirErrorForRobot = SubscribeAlarm($"{Module}.{Name}.AirErrorForRobot", "EFEM Robot Air Error", () => !_stateAirErrorForRobot, EventLevel.Warning);
- //AirErrorForChamber = SubscribeAlarm($"{Module}.{Name}.AirErrorForChamber", "EFEM Chamber Air Error", () => !_stateAirErrorForChamber, EventLevel.Warning);
- IsMaintain = SubscribeAlarm($"{Module}.{Name}.IsMaintain", "EFEM in Maintenance Mode, switch to online and turn key to auto", () => !_stateIsMaintain, EventLevel.Alarm);
- DoorOpen = SubscribeAlarm($"{Module}.{Name}.DoorOpen", "EFEM door open", () => !_stateDoorOpen, EventLevel.Warning);
- EmoAlarm = SubscribeAlarm($"{Module}.{Name}.EmoAlarm", "EFEM EMO error", () => !_stateEmoAlarm, EventLevel.Alarm);
- //EfemVacuumSourcePressureAlarm = SubscribeAlarm($"{Module}.{Name}.EfemVacuumSourcePressureAlarm", "Efem Vacuum Source Pressure Alarm", () => !_stateEfemVacuumSourcePressureAlarm, EventLevel.Alarm);
- //EfemCompressedAirPressureAlarm = SubscribeAlarm($"{Module}.{Name}.EfemCompressedAirPressureAlarm", "Efem Compressed Air Pressure Alarm", () => !_stateEfemCompressedAirPressureAlarm, EventLevel.Alarm);
- DATA.Subscribe($"{Module}.{Name}.VacuumSourcePressureAlarm", () => _stateVacuumSourcePressureAlarm);
- DATA.Subscribe($"{Module}.{Name}.CompressedAirPressureAlarm", () => _stateCompressedAirPressureAlarm);
- DATA.Subscribe($"{Module}.{Name}.FlowGaugeWarning", () => _stateFlowGaugeWarning);
- DATA.Subscribe($"{Module}.{Name}.WaterLeakWarning", () => _stateWaterLeakWarning);
- DATA.Subscribe($"{Module}.{Name}.DrivePowerAlarm", () => _stateDrivePowerAlarm);
- DATA.Subscribe($"{Module}.{Name}.DifferentialPressureSensorSetting1Alarm", () => _stateDifferentialPressureSensorSetting1Alarm);
- DATA.Subscribe($"{Module}.{Name}.DifferentialPressureSensorSetting2Alarm", () => _stateDifferentialPressureSensorSetting2Alarm);
- DATA.Subscribe($"{Module}.{Name}.FFUAlarm", () => _stateFfuAlarm);
- DATA.Subscribe($"{Module}.{Name}.IonizerAlarm", () => _stateIonizerAlarm);
- DATA.Subscribe($"{Module}.{Name}.AirErrorForRobot", () => _stateAirErrorForRobot);
- //DATA.Subscribe($"{Module}.{Name}.AirErrorForChamber", () => _stateAirErrorForChamber);
- DATA.Subscribe($"{Module}.{Name}.IsMaintain", () => _stateIsMaintain);
- DATA.Subscribe($"{Module}.{Name}.DoorOpen", () => _stateDoorOpen);
- DATA.Subscribe($"{Module}.{Name}.EmoAlarm", () => _stateEmoAlarm);
- OP.Subscribe("System.SetWaferSize", (string cmd, object[] args) =>
- {
- string module = (string)args[0];
- int slot = (int)args[1];
- string size = (string)args[2];
- switch (size)
- {
- case "4":
- WaferManager.Instance.UpdateWaferSize(ModuleHelper.Converter(module), slot, WaferSize.WS4);
- break;
- case "6":
- WaferManager.Instance.UpdateWaferSize(ModuleHelper.Converter(module), slot, WaferSize.WS6);
- break;
- case "8":
- WaferManager.Instance.UpdateWaferSize(ModuleHelper.Converter(module), slot, WaferSize.WS8);
- break;
- case "12":
- WaferManager.Instance.UpdateWaferSize(ModuleHelper.Converter(module), slot, WaferSize.WS12);
- break;
- default:
- EV.PostWarningLog("System", $"wafer size {size} not valid");
- break;
- }
- return true;
- });
- return base.Initialize();
- }
- public override void NoteStateEvent(ModuleName module, string data1, string data2)
- {
- base.NoteStateEvent(module, data1, data2);
- }
- public override void NoteWaferTrack(string waferInfo)
- {
- if (waferInfo[0] == '1' && !WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, 1))
- {
- WaferManager.Instance.CreateWafer(ModuleName.EfemRobot, 1, WaferStatus.Normal);
- }
- else if (waferInfo[0] == '0' && !WaferManager.Instance.CheckNoWafer(ModuleName.EfemRobot, 1))
- {
- WaferManager.Instance.DeleteWafer(ModuleName.EfemRobot, 1);
- }
- if (waferInfo[1] == '1' && !WaferManager.Instance.CheckHasWafer(ModuleName.EfemRobot, 0))
- {
- WaferManager.Instance.CreateWafer(ModuleName.EfemRobot, 0, WaferStatus.Normal);
- }
- else if (waferInfo[1] == '0' && !WaferManager.Instance.CheckNoWafer(ModuleName.EfemRobot, 0))
- {
- WaferManager.Instance.DeleteWafer(ModuleName.EfemRobot, 0);
- }
- if (waferInfo[2] == '1' && !WaferManager.Instance.CheckHasWafer(ModuleName.Aligner, 0))
- {
- WaferManager.Instance.CreateWafer(ModuleName.Aligner, 0, WaferStatus.Normal);
- }
- else if (waferInfo[2] == '0' && !WaferManager.Instance.CheckNoWafer(ModuleName.Aligner, 0))
- {
- WaferManager.Instance.DeleteWafer(ModuleName.Aligner, 0);
- }
- }
- public override void Monitor()
- {
- base.Monitor();
- }
- public override void Reset()
- {
- FfuAlarm.Reset();
- IonizerAlarm.Reset();
- AirErrorForRobot.Reset();
- //AirErrorForChamber.Reset();
- IsMaintain.Reset();
- DoorOpen.Reset();
- EmoAlarm.Reset();
- base.Reset();
- }
- public void ResetData()
- {
- Reset();
- }
- public bool MapCarrier(string lp, int thicknessIndex, out string slotMap, out string reason)
- {
- slotMap = string.Empty;
- if (!Connection.IsConnected)
- {
- reason = "not connected";
- return false;
- }
- return Connection.Execute(new RorzeEfemHandlerWafsh(this, ModuleHelper.Converter(lp), true, thicknessIndex), out reason);
- }
- public override bool GetWafer(ModuleName chamber, int slot, Hand hand, out string reason)
- {
- if (Connection == null || !Connection.IsConnected || !IsInitialized)
- {
- reason = "not connected";
- return false;
- }
- WaferSize ws = WaferManager.Instance.GetWaferSize(chamber, slot);
- int smallSize = SC.GetValue<int>("System.SmallWafer");
- int midSize = SC.GetValue<int>("System.MidWafer");
- int bigSize = SC.GetValue<int>("System.BigWafer");
- if (ws == (WaferSize)smallSize)
- {
- ws = WaferSize.WS3;
- }
- else if (ws == (WaferSize)midSize)
- {
- ws = WaferSize.WS4;
- }
- else if (ws == (WaferSize)bigSize)
- {
- ws = WaferSize.WS6;
- }
- return Connection.Execute(new RorzeEfemHandlerLoad(this, chamber, slot, hand, ws), out reason);
- }
- public override bool PutWafer(ModuleName chamber, int slot, Hand hand, out string reason)
- {
- if (Connection == null || !Connection.IsConnected || !IsInitialized)
- {
- reason = "not connected";
- return false;
- }
- WaferSize ws = WaferManager.Instance.GetWaferSize(ModuleName.EfemRobot, (int)hand);
- int smallSize = SC.GetValue<int>("System.SmallWafer");
- int midSize = SC.GetValue<int>("System.MidWafer");
- int bigSize = SC.GetValue<int>("System.BigWafer");
- if (ws == (WaferSize)smallSize)
- {
- ws = WaferSize.WS3;
- }
- else if (ws == (WaferSize)midSize)
- {
- ws = WaferSize.WS4;
- }
- else if (ws == (WaferSize)bigSize)
- {
- ws = WaferSize.WS6;
- }
- return Connection.Execute(new RorzeEfemHandlerUnload(this, chamber, slot, hand, ws), out reason);
- }
- }
- }
|