using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; using Aitex.Core.Common; using Aitex.Core.Common.DeviceData; using Aitex.Core.RT.DataCenter; using Aitex.Core.RT.Device; using Aitex.Core.RT.Device.Unit; using Aitex.Core.RT.Event; using Aitex.Core.RT.OperationCenter; using Aitex.Core.RT.SCCore; using Aitex.Core.Util; using Aitex.Sorter.Common; using JetVirgoPM.PMs; using JetVirgoPM.PMs.Routines; using MECF.Framework.Common.Device.Bases; using MECF.Framework.Common.Equipment; using MECF.Framework.Common.Schedulers; using MECF.Framework.Common.SubstrateTrackings; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.PMs; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Pumps.EdwardsPump; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Pumps.SkyPump; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.JEL; using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.Rorze; using MECF.Framework.RT.EquipmentLibrary.Unit; using MECF.Framework.RT.ModuleLibrary.SystemModules; namespace JetVirgoPM.Devices { enum ValveType { PROCESS, N2, FAST_PUMP, SOFT_PUMP, FAST_VENT, PURGE, Mfc1, Mfc2, Mfc3, Mfc4, Mfc5, Mfc6, } class JetDualPM : DualPM { // ----------------------------Fields-------------------------- // private readonly IoLid _Lid; //private readonly IoCylinder _LidLocker; private readonly IoMessage _Messager; private readonly IoSensor _ATM_sw; private readonly IoSensor _VAC_sw; //private readonly IoSensor _WLK_sw; //private readonly IoSensor _CDAPressure; private readonly IoSensor _CoolantInletTC1; private readonly IoSensor _CoolantInletTC2; private readonly IoSensor _CoolantOutletTC1; private readonly IoSensor _CoolantOutletTC2; //private readonly IoSensor _ArmNotExtend; private readonly IoSensor _N2Pressure_sw; private readonly IoSensor _LEOT1; private readonly IoSensor _LEOT2; private readonly IoSensor _GBInterlock; private readonly IoSensor _TMRobotNotExtendToPM1; private readonly IoSensor _TMRobotNotExtendToPM2; //private readonly IoSensor _TMInSafety; private readonly IoSensor _CHBOTSW; private readonly IoSensor _SourceFan; private readonly IoSensor _GeneratorInterlock; //private readonly IoSensor _RFG_Interlock; private readonly IoPressureControl _pressureController; private readonly IoHeater _ChamberHeater1; private readonly IoHeater _HeaterChamber; private readonly IoHeater _ForelineHeater; private readonly IoHeater _LEHeater1; private readonly IoHeater _LEHeater2; private readonly IoValve _SoftPumpValve; private readonly IoValve _FastPumpValve; private readonly IoValve _ProcessValve; private readonly IoValve _N2Valve; private readonly IoValve _PurgeValve; private readonly IoValve _FastVentValve; private readonly IoValve _Mfc1Valve; private readonly IoValve _Mfc2Valve; private readonly IoValve _Mfc3Valve; private readonly IoValve _Mfc4Valve; private readonly IoValve _Mfc5Valve; private readonly IoValve _Mfc6Valve; //private readonly IoValve _N2SupplyValve; //private readonly IoCylinder _slitDoor1; //private readonly IoCylinder _slitDoor2; private readonly IoCylinder _LiftPin1; private readonly IoCylinder _LiftPin2; private readonly IoCylinder _GuidePin1; // 3' private readonly IoCylinder _GuidePin2; // 4' private readonly IoLiftPin _ioLiftPin1; private readonly IoLiftPin _ioLiftPin2; private readonly RfPowerBase _Generator1; private readonly RfPowerBase _Generator2; private readonly RfPowerBase _GeneratorBias1; private readonly RfPowerBase _GeneratorBias2; private readonly RfMatchBase _Match1; private readonly RfMatchBase _Match2; private readonly RfMatchBase _BiasMatch1; private readonly RfMatchBase _BiasMatch2; private readonly PumpBase _MainPump; private readonly ChillerBase _Chiller1; private readonly ChillerBase _Chiller2; private readonly IoGasStick[] _gasLines; private readonly R_TRIG _trigBasePressure = new R_TRIG(); private readonly R_TRIG _trigBaseTemperature1 = new R_TRIG(); private readonly R_TRIG _trigBaseTemperature2 = new R_TRIG(); private double BasePressure; private double BaseTemperature; private bool EnableBiasRF1 = false; private bool EnableBiasRF2 = false; private int _bigWafer = 0; private int _midWafer = 0; private int _smallWafer = 0; private int gasCount = 0; private bool _IsPlus; public bool _Chamber1Disabled; public bool _Chamber2Disabled; private bool _guidePinInstalled; public bool GuidePinInstalled { get { return _guidePinInstalled; } } public bool IsPlus => _IsPlus; public bool AlarmPro = false; // --------------------------Properties------------------------ // public new ModuleName Module { get; } // 门的状态 public bool IsSlitDoor1Closed => !(bool)DATA.Poll($"TM.Left{Module}SlitDoorOpen"); public bool IsSlitDoor2Closed => !(bool)DATA.Poll($"TM.Right{Module}SlitDoorOpen"); public bool IsTMRobotNotExtendToPM1 => _TMRobotNotExtendToPM1.Value; public bool IsTMRobotNotExtendToPM2 => _TMRobotNotExtendToPM2.Value; // 盖子的状态 public bool IsLidClosed => _Lid.OFFFeedback; // 盖子的锁 //public bool IsLidLocked => !_LidLocker.ONSetPoint && _LidLocker.OFFSetPoint; public MovementPosition LiftPinPosition { get { MovementPosition pos = MovementPosition.Unknown; if (_LiftPin1.ONFeedback && !_LiftPin1.OFFFeedback) { pos = MovementPosition.Up; } else if (!_LiftPin1.ONFeedback && _LiftPin1.OFFFeedback) { pos = MovementPosition.Down; } return pos; } } public MovementPosition GuidePin1Position { get { if (_smallWafer == 0) return MovementPosition.Down; MovementPosition res = MovementPosition.Unknown; if (_GuidePin1.ONFeedback && !_GuidePin1.OFFFeedback) { res = MovementPosition.Up; } else if (_GuidePin1.OFFFeedback && !_GuidePin1.ONFeedback) { res = MovementPosition.Down; } return res; } } public MovementPosition GuidePin2Position { get { if (_midWafer == 0) return MovementPosition.Down; MovementPosition res = MovementPosition.Unknown; if (_GuidePin2.ONFeedback && !_GuidePin2.OFFFeedback) { res = MovementPosition.Up; } else if (_GuidePin2.OFFFeedback && !_GuidePin2.ONFeedback) { res = MovementPosition.Down; } return res; } } public bool Chamber1Disable { get { return SC.GetValue($"System.SetUp.{Module}Chamber1Disabled.IsInstalled"); } } public bool Chamber2Disable { get { return SC.GetValue($"System.SetUp.{Module}Chamber2Disabled.IsInstalled"); } } public override bool IsError { get { bool IsGeneratorBias1Error = SC.GetValue($"{Module}.BiasRf1.EnableBiasRF") && _GeneratorBias1.IsError; bool IsGeneratorBias2Error = SC.GetValue($"{Module}.BiasRf2.EnableBiasRF") && _GeneratorBias2.IsError; return _MainPump.IsError || _Generator1.IsError || _Generator2.IsError || IsGeneratorBias1Error || IsGeneratorBias2Error; } } public override bool IsIdle { get; } // 腔体压力 public bool IsPressureToleranceEnabled { get => _pressureController.EnableTolerance; set => _pressureController.EnableTolerance = value; } public override double ChamberPressure => _pressureController.ProcessGauge.Value; public override double ChamberPressurePressure => _pressureController.PressureGauge.Value; public double ForelinePressure => _pressureController.ForelineGauge.Value; public PressureCtrlMode PressureMode => _pressureController.ThrottleValve.PressureMode; public double TargetPressure => _pressureController.TargetPressure; // 压力信号 public bool IsATM => _ATM_sw.Value; public bool IsVAC => _VAC_sw.Value; //public bool IsWLK => _WLK_sw.Value; public bool IsGeneratorInterlockOk => _GeneratorInterlock.Value; // 温度 public float ChamberTempSP1 => _ChamberHeater1.ControlTcSetPoint; public float ChamberTempFB1 => _ChamberHeater1.ControlTcFeedback; public float CoolantInletTempFB1 => _ChamberHeater1.CoolantInletTcFeedback; public float CoolantOutletTempFB1 => _ChamberHeater1.CoolantOutletTcFeedback; public float ChamberTempSP2 => _HeaterChamber.ControlTcSetPoint; public float ChamberTempFB2 => _HeaterChamber.ControlTcFeedback; public float CoolantInletTempFB2 => _HeaterChamber.CoolantInletTcFeedback; public float CoolantOutletTempFB2 => _HeaterChamber.CoolantOutletTcFeedback; // LE温度 public float LETempSP1 => _LEHeater1.ControlTcSetPoint; public float LETempFB1 => _LEHeater1.ControlTcFeedback; public string LETempFB1Name => _LEHeater1.Name; public float LECoolantInletTempFB1 => _LEHeater1.CoolantInletTcFeedback; public float LECoolantOutletTempFB1 => _LEHeater1.CoolantOutletTcFeedback; public float LETempSP2 => _LEHeater2.ControlTcSetPoint; public float LETempFB2 => _LEHeater2.ControlTcFeedback; public string LETempFB2Name => _LEHeater2.Name; public float LECoolantInletTempFB2 => _LEHeater2.CoolantInletTcFeedback; public float LECoolantOutletTempFB2 => _LEHeater2.CoolantOutletTcFeedback; public bool LETemp1ON => _LEHeater1.IsPowerOnFeedback; public bool LETemp2ON => _LEHeater2.IsPowerOnFeedback; // Pump 状态 public bool IsPumpRunning => _MainPump.IsRunning; public bool IsFastPumpOpened => _FastPumpValve.Status; public bool IsSoftPumpOpened => _SoftPumpValve.Status; public bool IsMfc1ValveOpened => _Mfc1Valve.Status; public bool IsMfc2ValveOpened => _Mfc2Valve.Status; public bool IsMfc3ValveOpened => _Mfc3Valve.Status; public bool IsMfc4ValveOpened => _Mfc4Valve.Status; public bool IsMfc5ValveOpened => _Mfc5Valve.Status; public bool IsMfc6ValveOpened => _Mfc6Valve.Status; public bool HasPumpError => _MainPump.IsError || !_MainPump.IsRunning; //public bool IsCDA_OK => _CDAPressure.Value; public bool IsCoolantInletTC_OK1 => _CoolantInletTC1.Value; public bool IsCoolantInletTC_OK2 => _CoolantInletTC2.Value; public bool IsCoolantOutletTC_OK1 => _CoolantOutletTC1.Value; public bool IsCoolantOutletTC_OK2 => _CoolantOutletTC2.Value; // interlock public bool NotHasInterlock => AlarmPro ? _GBInterlock.Value : _GBInterlock.Value && _GeneratorInterlock.Value; public bool NotHasInterlockWithOutGeneratorInterlock => _GBInterlock.Value; // 蝶阀位置 public float TVPosition => _pressureController.ThrottleValve.PositionFeedback; // 腔体压力.end // 射频1 public float Generator1ForwardPower => _Generator1.ForwardPower; public bool IsGenerator1ON => _Generator1.IsPowerOn; public float Generator1Setpoint => _Generator1.PowerSetPoint; // 射频 2 public float Generator2ForwardPower => _Generator2.ForwardPower; public bool IsGenerator2ON => _Generator2.IsPowerOn; public float Generator2Setpoint => _Generator2.PowerSetPoint; // Bias射频1 public float ForwardPowerBias1 => _GeneratorBias1.ForwardPower; public bool IsGeneratorONBias1 => _GeneratorBias1.IsPowerOn; public float GeneratorSetpointBias1 => _GeneratorBias1.PowerSetPoint; public float CTune1 => _GeneratorBias1.CTune; public float CLoad1 => _GeneratorBias1.CLoad; public int VPP1 => _GeneratorBias1.VPP; // Bias射频2 public float ForwardPowerBias2 => _GeneratorBias2.ForwardPower; public bool IsGeneratorONBias2 => _GeneratorBias2.IsPowerOn; public float GeneratorSetpointBias2 => _GeneratorBias2.PowerSetPoint; public float CTune2 => _GeneratorBias2.CTune; public float CLoad2 => _GeneratorBias2.CLoad; public int VPP2 => _GeneratorBias2.VPP; // 流气 public double TotalGasSetpoint { get { double sum = 0; foreach (var gas in _gasLines) { sum += gas.FlowSP; } return sum; } } public bool HasGasOutOfRange { get { foreach (var gas in _gasLines) { if (!gas.IsOutOfRange) return false; } return true; } } // --------------------------Constructor----------------------- // public JetDualPM(ModuleName mod) : base(mod.ToString()) { Module = mod; AlarmPro = SC.GetValue($"System.SetUp.AlarmPro.IsInstalled"); _Chamber1Disabled = SC.GetValue($"System.SetUp.{Module}Chamber1Disabled.IsInstalled"); _Chamber2Disabled = SC.GetValue($"System.SetUp.{Module}Chamber2Disabled.IsInstalled"); _guidePinInstalled = SC.GetValueOrDefault($"{Module}.GuidePin.IsInstalled"); BasePressure = SC.GetValue($"{mod}.ChamberBasePressureThreshold"); BaseTemperature = SC.GetValue($"{mod}.ChamberBaseTemperatureThreshold"); _smallWafer = SC.GetValue($"System.SmallWafer"); _midWafer = SC.GetValue($"System.MidWafer"); _bigWafer = SC.GetValue($"System.BigWafer"); EnableBiasRF1 = SC.GetValue($"{Module}.BiasRf1.EnableBiasRF"); EnableBiasRF2 = SC.GetValue($"{Module}.BiasRf2.EnableBiasRF"); for (int i = 1; i <= 6; i++) { if (SC.GetValue($"{Module}.MfcGas{i}.Enable")) gasCount++; } //_gasLines = new IoGasStick[gasCount]; _gasLines = new IoGasStick[6]; //for (int index = 0; index < gasCount; index++) //{ // _gasLines[index] = DEVICE.GetDevice($"{Module}.GasStick{index + 1}"); //} for (int index = 0; index < 6; index++) { _gasLines[index] = DEVICE.GetDevice($"{Module}.GasStick{index + 1}"); } //_LidLocker = DEVICE.GetDevice($"{Module}.{VirgoDevice.LidLocker}"); //_CDAPressure = DEVICE.GetDevice($"{Module}.SensorCDAPressureOk"); //_ArmNotExtend = DEVICE.GetDevice($"{Module}.SensorArmNotExtend"); //_RFG_Interlock = DEVICE.GetDevice($"{Module}.GeneratorInterlock"); #region CHECKDED _Lid = DEVICE.GetDevice($"{Module}.{VirgoDevice.Lid}"); _ATM_sw = DEVICE.GetDevice($"{Module}.SensorATMSwitch"); _VAC_sw = DEVICE.GetDevice($"{Module}.SensorVacSwitch"); _CoolantInletTC1 = DEVICE.GetDevice($"{Module}.SensorCoolantInletTCOK1"); _CoolantInletTC2 = DEVICE.GetDevice($"{Module}.SensorCoolantInletTCOK2"); _CoolantOutletTC1 = DEVICE.GetDevice($"{Module}.SensorCoolantOutletTCOK1"); _CoolantOutletTC2 = DEVICE.GetDevice($"{Module}.SensorCoolantOutletTCOK2"); //_WLK_sw = DEVICE.GetDevice($"{Module}.SensorWaterLeakOk"); _N2Pressure_sw = DEVICE.GetDevice($"{Module}.N2PressureOk"); _LEOT1 = DEVICE.GetDevice($"{Module}.LE_OT1"); _LEOT2 = DEVICE.GetDevice($"{Module}.LE_OT2"); _GBInterlock = DEVICE.GetDevice($"{Module}.GB_Interlock"); _TMRobotNotExtendToPM1 = DEVICE.GetDevice($"{Module}.SensorTMRobotNotExtendToPM1"); _TMRobotNotExtendToPM2 = DEVICE.GetDevice($"{Module}.SensorTMRobotNotExtendToPM2"); //_TMInSafety = DEVICE.GetDevice($"{Module}.SensorTMInSafety"); _CHBOTSW = DEVICE.GetDevice($"{Module}.SensorCHBOTSW"); _SourceFan = DEVICE.GetDevice($"{Module}.SourceFan"); _GeneratorInterlock = DEVICE.GetDevice($"{Module}.GeneratorInterlock"); _pressureController = DEVICE.GetDevice($"{Module}.{VirgoDevice.PressureControl}"); _ChamberHeater1 = DEVICE.GetDevice($"{Module}.HeaterChamber1"); _HeaterChamber = DEVICE.GetDevice($"{Module}.HeaterChamber"); _ForelineHeater = DEVICE.GetDevice($"{Module}.ForelineHeater"); _LEHeater1 = DEVICE.GetDevice($"{Module}.LEHeater1"); _LEHeater2 = DEVICE.GetDevice($"{Module}.LEHeater2"); _SoftPumpValve = DEVICE.GetDevice($"{Module}.{VirgoDevice.ValveSoftPumping}"); _FastPumpValve = DEVICE.GetDevice($"{Module}.{VirgoDevice.ValveFastPumping}"); _ProcessValve = DEVICE.GetDevice($"{Module}.{VirgoDevice.ValveProcess}"); _N2Valve = DEVICE.GetDevice($"{Module}.{VirgoDevice.ValveN2}"); _FastVentValve = DEVICE.GetDevice($"{Module}.{VirgoDevice.ValveFastVent}"); _PurgeValve = DEVICE.GetDevice($"{Module}.{VirgoDevice.ValveChamberPurge}"); _Mfc1Valve = DEVICE.GetDevice($"{Module}.{VirgoDevice.ValveMfc1}"); _Mfc2Valve = DEVICE.GetDevice($"{Module}.{VirgoDevice.ValveMfc2}"); _Mfc3Valve = DEVICE.GetDevice($"{Module}.{VirgoDevice.ValveMfc3}"); _Mfc4Valve = DEVICE.GetDevice($"{Module}.{VirgoDevice.ValveMfc4}"); _Mfc5Valve = DEVICE.GetDevice($"{Module}.{VirgoDevice.ValveMfc5}"); _Mfc6Valve = DEVICE.GetDevice($"{Module}.{VirgoDevice.ValveMfc6}"); //_slitDoor1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.SlitDoor1}"); //_slitDoor2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.SlitDoor2}"); _GuidePin1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.GuidePin1}"); _GuidePin2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.GuidePin2}"); _IsPlus = SC.GetValue($"{Module}.IsPlus"); if (_IsPlus) { _ioLiftPin1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.LiftPin1}"); _ioLiftPin2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.LiftPin2}"); } else { _LiftPin1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.LiftPin1}"); _LiftPin2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.LiftPin2}"); } _Messager = DEVICE.GetDevice($"{Module}.Messager"); _Generator1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Rf1}"); _Generator2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Rf2}"); _GeneratorBias1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.BiasRf1}"); _GeneratorBias2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.BiasRf2}"); _MainPump = DEVICE.GetDevice($"{Module}.{VirgoDevice.MainPump}"); _Chiller1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Chiller1}"); _Chiller2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Chiller2}"); #endregion // RS223 AdTec Generator if (SC.GetValue($"{mod}.Rf1.CommunicationType") == (int)CommunicationType.RS232 && SC.GetValue($"{mod}.Rf1.MFG") == (int)GeneratorMFG.AdTec) { _Generator1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Rf1}"); } // RS223 AdTec Generator if (SC.GetValue($"{mod}.Rf2.CommunicationType") == (int)CommunicationType.RS232 && SC.GetValue($"{mod}.Rf2.MFG") == (int)GeneratorMFG.AdTec) { _Generator2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Rf2}"); } // RS223 AdTec Generator Bias 1 if (SC.GetValue($"{mod}.BiasRf1.EnableBiasRF") && SC.GetValue($"{mod}.BiasRf1.CommunicationType") == (int)CommunicationType.RS232 && SC.GetValue($"{mod}.BiasRf1.MFG") == (int)GeneratorMFG.AdTec) { _GeneratorBias1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.BiasRf1}"); } // RS223 AdTec Generator Bias 2 if (SC.GetValue($"{mod}.BiasRf2.EnableBiasRF") && SC.GetValue($"{mod}.BiasRf2.CommunicationType") == (int)CommunicationType.RS232 && SC.GetValue($"{mod}.BiasRf2.MFG") == (int)GeneratorMFG.AdTec) { _GeneratorBias2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.BiasRf2}"); } // Ethernet Comet Generator Bias 1 if (SC.GetValue($"{mod}.BiasRf1.EnableBiasRF") && SC.GetValue($"{mod}.BiasRf1.CommunicationType") == (int)CommunicationType.Ethernet && SC.GetValue($"{mod}.BiasRf1.MFG") == (int)GeneratorMFG.Comet) { _GeneratorBias1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.BiasRf1}"); } // Ethernet Comet Generator Bias 2 if (SC.GetValue($"{mod}.BiasRf2.EnableBiasRF") && SC.GetValue($"{mod}.BiasRf2.CommunicationType") == (int)CommunicationType.Ethernet && SC.GetValue($"{mod}.BiasRf2.MFG") == (int)GeneratorMFG.Comet) { _GeneratorBias2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.BiasRf2}"); } //========================================================================================= //srf1 match revtec if (SC.GetValue($"{mod}.match1.EnableMatch") && SC.GetValue($"{mod}.match1.CommunicationType") == (int)CommunicationType.Ethernet && SC.GetValue($"{mod}.match1.MFG") == (int)MatchMFG.RevTec) { _Match1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Match1}"); } //srf2 match revtec if (SC.GetValue($"{mod}.match2.EnableMatch") && SC.GetValue($"{mod}.match2.CommunicationType") == (int)CommunicationType.Ethernet && SC.GetValue($"{mod}.match2.MFG") == (int)MatchMFG.RevTec) { _Match2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Match2}"); } //brf1 match revtec if (SC.GetValue($"{mod}.BiasRf1Match.EnableMatch") && SC.GetValue($"{mod}.BiasRf1Match.CommunicationType") == (int)CommunicationType.Ethernet && SC.GetValue($"{mod}.BiasRf1Match.MFG") == (int)MatchMFG.RevTec) { _BiasMatch1 = DEVICE.GetDevice($"{Module}.BiasRf1Match"); } //brf2 match revtec if (SC.GetValue($"{mod}.BiasRf2Match.EnableMatch") && SC.GetValue($"{mod}.BiasRf2Match.CommunicationType") == (int)CommunicationType.Ethernet && SC.GetValue($"{mod}.BiasRf2Match.MFG") == (int)MatchMFG.RevTec) { _BiasMatch2 = DEVICE.GetDevice($"{Module}.BiasRf2Match"); } //========================================================================================= // RS232 AdTec match if (SC.GetValue($"{mod}.match1.CommunicationType") == (int)CommunicationType.RS232 && SC.GetValue($"{mod}.match1.MFG") == (int)MatchMFG.AdTec) { _Match1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Match1}"); } // RS232 AdTec match if (SC.GetValue($"{mod}.match1.CommunicationType") == (int)CommunicationType.RS232 && SC.GetValue($"{mod}.match1.MFG") == (int)MatchMFG.AdTec) { _Match2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Match2}"); } // RS232 Dry pump, SKY if (SC.GetValue($"{mod}.DryPump.CommunicationType") == (int)CommunicationType.RS232) { if (SC.GetValue($"{mod}.DryPump.MFG") == (int)DryPumpMFG.SKY) { _MainPump = DEVICE.GetDevice($"{Module}.{VirgoDevice.MainPump}"); } else if (SC.GetValue($"{mod}.DryPump.MFG") == (int)DryPumpMFG.Edwards) { _MainPump = DEVICE.GetDevice($"{Module}.{VirgoDevice.MainPump}"); } } if (SC.GetValue($"{mod}.Chiller1.EnableChiller") && SC.GetValue($"{mod}.Chiller1.CommunicationType") == (int)CommunicationType.RS232) { if (SC.GetValue($"{mod}.Chiller1.MFG") == (int)ChillerMFG.SMC) { _Chiller1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Chiller1}"); } else if (SC.GetValue($"{mod}.Chiller1.MFG") == (int)ChillerMFG.AIRSYS) { _Chiller1 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Chiller1}"); } } if (SC.GetValue($"{mod}.Chiller2.EnableChiller") && SC.GetValue($"{mod}.Chiller2.CommunicationType") == (int)CommunicationType.RS232) { if (SC.GetValue($"System.SetUp.ChillerSetupOp.IsInstalled") == (int)ChillerSetupOp.ShareSingleChiller) { _Chiller2 = _Chiller1; } else { if (SC.GetValue($"{mod}.Chiller2.MFG") == (int)ChillerMFG.SMC) { _Chiller2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Chiller2}"); } else if (SC.GetValue($"{mod}.Chiller1.MFG") == (int)ChillerMFG.AIRSYS) { _Chiller2 = DEVICE.GetDevice($"{Module}.{VirgoDevice.Chiller2}"); } } } System.Diagnostics.Debug.Assert(null != _Generator1); System.Diagnostics.Debug.Assert(null != _Generator2); System.Diagnostics.Debug.Assert(null != _MainPump); if (SC.GetValue($"{Module}.BiasRf1.EnableBiasRF")) { System.Diagnostics.Debug.Assert(null != _GeneratorBias1); } if (SC.GetValue($"{Module}.BiasRf2.EnableBiasRF")) { System.Diagnostics.Debug.Assert(null != _GeneratorBias2); } //WaferManager.Instance.SubscribeLocation(Module, 2); } public override bool Initialize() { DATA.Subscribe($"{Name}.IsAtm", () => { return CheckAtm(); }); DATA.Subscribe($"{Name}.IsVacuum", () => { return CheckVacuum(); }); DATA.Subscribe($"{Name}.IsCDAOK", () => { return CheckCDAOK(); }); DATA.Subscribe($"{Name}.IsCoolantInletTCOK1", () => { return CheckCoolantInletTCOK1(); }); DATA.Subscribe($"{Name}.IsCoolantOutletTCOK1", () => { return CheckCoolantOutletTCOK1(); }); DATA.Subscribe($"{Name}.IsCoolantInletTCOK2", () => { return CheckCoolantInletTCOK2(); }); DATA.Subscribe($"{Name}.IsCoolantOutletTCOK2", () => { return CheckCoolantOutletTCOK2(); }); DATA.Subscribe($"{Name}.IsTMRbotNotExtendToPM1", () => { return CheckTMRobotCanExtendToPM1(); }); DATA.Subscribe($"{Name}.IsTMRbotNotExtendToPM2", () => { return CheckTMRobotCanExtendToPM2(); }); //DATA.Subscribe($"{Name}.IsWaterLeak", () => { return CheckWaterLeak(); }); DATA.Subscribe($"{Name}.ChamberPressure", () => ChamberPressure); DATA.Subscribe($"{Name}.IoTemperatureCtrl.TemperatureControl.Chamber1Temperature", () => ChamberTempFB1); DATA.Subscribe($"{Name}.IoTemperatureCtrl.TemperatureControl.Chamber2Temperature", () => ChamberTempFB2); IsInstalled = SC.GetValue($"System.SetUp.{Name}.IsInstalled"); return true; } // -----------------------------Method------------------------- // public override void Home() { // 与yp讨论过,PM 初始化不需要 if (!_Chamber1Disabled) { SetLiftPin1(MovementPosition.Down, out _); //if (IsSlitDoor1Closed) //{ // SetSlitDoor1(false, out _); //} //else if (!IsSlitDoor1Closed) //{ // SetSlitDoor1(false, out _); //} //else if (_slitDoor1.State == CylinderState.Error) //{ // SetSlitDoor1(true, out _); //} if (SC.GetValue($"{Module}.BiasRf1.EnableBiasRF")) { _Messager.SetMessager(1); //Virgo B } else { _Messager.SetMessager(0); //Virgo A } } if (!_Chamber2Disabled) { SetLiftPin2(MovementPosition.Down, out _); //SetSlitDoor(false, out _); //SetGuidePin1(MovementPosition.Down); //SetGuidePin2(MovementPosition.Down); //if (IsSlitDoor2Closed) //{ // SetSlitDoor2(false, out _); //} //else if (!IsSlitDoor2Closed) //{ // SetSlitDoor2(false, out _); //} //else if (_slitDoor2.State == CylinderState.Error) //{ // SetSlitDoor2(true, out _); //} if (SC.GetValue($"{Module}.BiasRf2.EnableBiasRF")) { _Messager.SetMessager(1); //Virgo B } else { _Messager.SetMessager(0); //Virgo A } } } public bool SetSlitDoor1(bool open, out string reason) { reason = string.Empty; // [XIAHUAN]: 只在关门的时候检查arm not extend if (!open && !(IsTMRobotNotExtendToPM1/* || DEVICE.GetDevice($"TMRobot").LastRecordStation != $"{Module}1"*/)) { reason = "TMRobot Not Extend To PM1 信号不满足"; EV.PostAlarmLog(Module.ToString(), reason); return false; } OP.DoOperation($"TM.SetSlitDoor", Module, open); return true; } public bool SetSlitDoor2(bool open, out string reason) { reason = string.Empty; // [XIAHUAN]: 只在关门的时候检查arm not extend if (!open && !(IsTMRobotNotExtendToPM2 /*|| DEVICE.GetDevice($"TMRobot").LastRecordStation != $"{Module}2"*/)) { reason = "TMRobot Not Extend To PM2 信号不满足"; EV.PostAlarmLog(Module.ToString(), reason); return false; } OP.DoOperation($"TM.SetSlitDoor", Module, open); return true; } //public override bool CheckWaterLeak() //{ // return _WLK_sw.Value; //} //public override bool CheckCDAOK() //{ // return _CDAPressure.Value; //} public override bool CheckCoolantInletTCOK1() { return _CoolantInletTC1.Value; } public override bool CheckCoolantInletTCOK2() { return _CoolantInletTC2.Value; } public override bool CheckCoolantOutletTCOK1() { return _CoolantOutletTC1.Value; } public override bool CheckCoolantOutletTCOK2() { return _CoolantOutletTC2.Value; } public override bool CheckTMRobotCanExtendToPM1() { return _TMRobotNotExtendToPM1.Value; } public override bool CheckTMRobotCanExtendToPM2() { return _TMRobotNotExtendToPM2.Value; } public override bool CheckAtm() { //2024-03-14 15:26:34 TPS dkj lx 删除 //return _ATM_sw.Value && ChamberPressurePressure > 700000; return _ATM_sw.Value; } public override bool CheckVacuum() { //2024-03-14 15:26:34 TPS dkj lx修改小于5000 //return _VAC_sw.Value && ChamberPressure < 100; return _VAC_sw.Value && ChamberPressure < 5000; } public bool CheckSlitDoor1Open() { return !IsSlitDoor1Closed; } public bool CheckSlitDoor1Close() { return IsSlitDoor1Closed; } public bool CheckSlitDoor2Open() { return !IsSlitDoor2Closed; } public bool CheckSlitDoor2Close() { return IsSlitDoor2Closed; } public bool CheckLift1Up() { if (_IsPlus) return _ioLiftPin1.PinPosition == PositionType.Position4; else return _LiftPin1.State == CylinderState.Open; } public bool CheckLift1Down() { if (_IsPlus) return _ioLiftPin1.PinPosition == PositionType.Position1; else return _LiftPin1.State == CylinderState.Close; } public bool CheckLift2Up() { if (_IsPlus) return _ioLiftPin2.PinPosition == PositionType.Position4; else return _LiftPin2.State == CylinderState.Open; } public bool CheckLift2Down() { if (_IsPlus) return _ioLiftPin2.PinPosition == PositionType.Position1; else return _LiftPin2.State == CylinderState.Close; } public void SetGas2(double sp) { OP.DoOperation($"{Module}.MfcGas2",out string reason,0,sp); } public void StartPump(bool on) { //_pressureController.StartPump(on); _MainPump?.SetPumpOnOff(on); } public void OpenValve(ValveType vlvType, bool on) { switch (vlvType) { case ValveType.PROCESS: _ProcessValve.TurnValve(on, out _); break; case ValveType.N2: _N2Valve.TurnValve(on, out _); break; case ValveType.FAST_PUMP: _FastPumpValve.TurnValve(on, out _); if (on) _SoftPumpValve.TurnValve(false, out _); break; case ValveType.SOFT_PUMP: _SoftPumpValve.TurnValve(on, out _); if(on) _FastPumpValve.TurnValve(false, out _); break; case ValveType.FAST_VENT: _FastVentValve.TurnValve(on, out _); break; case ValveType.PURGE: _PurgeValve.TurnValve(on, out _); break; case ValveType.Mfc1: _Mfc1Valve.TurnValve(on, out _); break; case ValveType.Mfc2: _Mfc2Valve.TurnValve(on, out _); break; case ValveType.Mfc3: _Mfc3Valve.TurnValve(on, out _); break; case ValveType.Mfc4: _Mfc4Valve.TurnValve(on, out _); break; case ValveType.Mfc5: _Mfc5Valve.TurnValve(on, out _); break; case ValveType.Mfc6: _Mfc6Valve.TurnValve(on, out _); break; default: throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}"); } } public bool CheckValveSwitchStatus(ValveType vlvType, bool on) { switch (vlvType) { case ValveType.PROCESS: return _ProcessValve.Status == on; case ValveType.N2: return _N2Valve.Status == on; case ValveType.FAST_PUMP: return _FastPumpValve.Status == on; case ValveType.SOFT_PUMP: return _SoftPumpValve.Status == on; case ValveType.FAST_VENT: return _FastVentValve.Status == on; case ValveType.PURGE: return _PurgeValve.Status == on; case ValveType.Mfc1: return _Mfc1Valve.Status == on; case ValveType.Mfc2: return _Mfc2Valve.Status == on; case ValveType.Mfc3: return _Mfc3Valve.Status == on; case ValveType.Mfc4: return _Mfc4Valve.Status == on; case ValveType.Mfc5: return _Mfc5Valve.Status == on; case ValveType.Mfc6: return _Mfc6Valve.Status == on; default: throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}"); } } public void CheckPressureStability() { IsPressureToleranceEnabled = true; } public void CheckPressureDisable() { IsPressureToleranceEnabled = false; } public override void Monitor() { foreach (var gas in _gasLines) { gas.Monitor(); } _trigBasePressure.CLK = ChamberPressurePressure >= BasePressure; if (SC.GetValue($"{Module}.Chiller1.EnableChiller")) { _trigBaseTemperature1.CLK = CoolantOutletTempFB1 >= BaseTemperature; } else { _trigBaseTemperature1.CLK = LETempFB1 >= BaseTemperature; } if (SC.GetValue($"{Module}.Chiller2.EnableChiller")) { _trigBaseTemperature2.CLK = CoolantOutletTempFB2 >= BaseTemperature; } else { _trigBaseTemperature2.CLK = LETempFB2 >= BaseTemperature; } if (_trigBasePressure.Q) EV.PostMessage(Module.ToString(), EventEnum.DefaultAlarm, $"{Module} pressure out of tolerance"); if (_trigBaseTemperature1.Q) EV.PostMessage(Module.ToString(), EventEnum.DefaultAlarm, $"{Module} 1 temperature out of tolerance"); if (_trigBaseTemperature2.Q) EV.PostMessage(Module.ToString(), EventEnum.DefaultAlarm, $"{Module} 2 temperature out of tolerance"); } public void CloseValves() { _N2Valve.TurnValve(false, out _); _SoftPumpValve.TurnValve(false, out _); _FastPumpValve.TurnValve(false, out _); _ProcessValve.TurnValve(false, out _); _PurgeValve.TurnValve(false, out _); _FastVentValve.TurnValve(false, out _); _PurgeValve.TurnValve(false, out _); _Mfc1Valve.TurnValve(false, out _); _Mfc2Valve.TurnValve(false, out _); _Mfc3Valve.TurnValve(false, out _); _Mfc4Valve.TurnValve(false, out _); _Mfc5Valve.TurnValve(false, out _); _Mfc6Valve.TurnValve(false, out _); foreach (var stick in _gasLines) { stick.Stop(); } } public bool FlowGas(int gasNum, double val) { if (_gasLines.Length <= gasNum) return false; _gasLines[gasNum].Flow(val); return true; } public void StopAllGases() { foreach (var line in _gasLines) { line.Stop(); } } public bool ResetPin() { if (_IsPlus) { _ioLiftPin1.Reset(); _ioLiftPin2.Reset(); } return true; } public bool CancelPin() { if (_IsPlus) { _ioLiftPin1.Cancelset(); _ioLiftPin2.Cancelset(); } return true; } public bool SearchPinOrigin() { if(_IsPlus) return _ioLiftPin1.GoPosition(PositionType.Origin) && _ioLiftPin2.GoPosition(PositionType.Origin); return true; } public bool HasPinOrigin() { if (_IsPlus) return _ioLiftPin1.HasOrigin && _ioLiftPin2.HasOrigin; return true; } public bool SetLiftPin1(MovementPosition dirt, out string reason) { reason = string.Empty; switch (dirt) { case MovementPosition.Down: if (_IsPlus) return _ioLiftPin1.GoPosition(PositionType.Position1); else return _LiftPin1.SetCylinder(false, out reason); case MovementPosition.Up: if (_IsPlus) return _ioLiftPin1.GoPosition(PositionType.Position4); else return _LiftPin1.SetCylinder(true, out reason); case MovementPosition.Left: case MovementPosition.Right: case MovementPosition.Middle: throw new ArgumentException("Movement argument error"); } return true; } public bool SetLiftPin2(MovementPosition dirt, out string reason) { reason = string.Empty; switch (dirt) { case MovementPosition.Down: if (_IsPlus) return _ioLiftPin2.GoPosition(PositionType.Position1); else return _LiftPin2.SetCylinder(false, out reason); case MovementPosition.Up: if (_IsPlus) return _ioLiftPin2.GoPosition(PositionType.Position4); else return _LiftPin2.SetCylinder(true, out reason); case MovementPosition.Left: case MovementPosition.Right: case MovementPosition.Middle: throw new ArgumentException("Movement argument error"); } return true; } public void SetGuidePin(WaferSize ws, MovementPosition dirt) { //if (ws == WaferSize.WS3) // SetGuidePinSmall(dirt); //else if (ws == WaferSize.WS4) // SetGuidePinMedium(dirt); } public void PrepareGuidePinForPlace(WaferSize ws) { //if (ws == WaferSize.WS3) //{ // SetGuidePinSmall(MovementPosition.Up); // SetGuidePinMedium(MovementPosition.Down); //} //else if (ws == WaferSize.WS4) //{ // SetGuidePinSmall(MovementPosition.Down); // SetGuidePinMedium(MovementPosition.Up); //} //else if (ws == WaferSize.WS6) //{ // SetGuidePinSmall(MovementPosition.Down); // SetGuidePinMedium(MovementPosition.Down); //} } public void PrepareGuidePinForPlaceLeft(WaferSize ws) { //if (ws == WaferSize.WS3) //{ // SetGuidePinSmall(MovementPosition.Up); // SetGuidePinMedium(MovementPosition.Down); //} //else if (ws == WaferSize.WS4) //{ // SetGuidePinSmall(MovementPosition.Down); // SetGuidePinMedium(MovementPosition.Up); //} //else if (ws == WaferSize.WS6) //{ // SetGuidePinSmall(MovementPosition.Down); // SetGuidePinMedium(MovementPosition.Down); //} string reason = string.Empty; if (ws == WaferSize.WS4) { _GuidePin1.SetCylinder(true, out reason); } else { _GuidePin1.SetCylinder(false, out reason); } } public void PrepareGuidePinForPlaceRight(WaferSize ws) { //if (ws == WaferSize.WS3) //{ // SetGuidePinSmall(MovementPosition.Up); // SetGuidePinMedium(MovementPosition.Down); //} //else if (ws == WaferSize.WS4) //{ // SetGuidePinSmall(MovementPosition.Down); // SetGuidePinMedium(MovementPosition.Up); //} //else if (ws == WaferSize.WS6) //{ // SetGuidePinSmall(MovementPosition.Down); // SetGuidePinMedium(MovementPosition.Down); //} string reason = string.Empty; if (ws == WaferSize.WS4) { _GuidePin2.SetCylinder(true, out reason); } else { _GuidePin2.SetCylinder(false, out reason); } } public bool CheckGuidePinIsReadyForTransfer(EnumDualPM pos, WaferSize ws) { if (!GuidePinInstalled) { return true; } if (pos == EnumDualPM.Left) { return CheckGuidePinIsReadyForTransferLeft(ws); } else if (pos == EnumDualPM.Right) { return CheckGuidePinIsReadyForTransferRight(ws); } return false; } public bool CheckGuidePinIsReadyForTransferLeft(WaferSize ws) { if (ws == WaferSize.WS4) { return GuidePin1Position == MovementPosition.Up; } else if (ws == WaferSize.WS6 || ws == WaferSize.WS8 || ws == WaferSize.WS12) { return GuidePin1Position == MovementPosition.Down; } else return false; } public bool CheckGuidePinIsReadyForTransferRight(WaferSize ws) { if (ws == WaferSize.WS4) { return GuidePin2Position == MovementPosition.Up; } else if (ws == WaferSize.WS6 || ws == WaferSize.WS8 || ws == WaferSize.WS12) { return GuidePin2Position == MovementPosition.Down; } else return false; } private void SetGuidePin1(MovementPosition dirt) { EV.PostInfoLog(Module.ToString(), $"set small pin {dirt}, smallWafer={_smallWafer}"); switch (dirt) { case MovementPosition.Down: if (_smallWafer != 0) _GuidePin1?.SetCylinder(false, out _); break; case MovementPosition.Up: if (_smallWafer != 0) _GuidePin1?.SetCylinder(true, out _); break; default: throw new ArgumentException("Movement argument error"); } } private void SetGuidePin2(MovementPosition dirt) { EV.PostInfoLog(Module.ToString(), $"set medium pin {dirt}, midWafer={_midWafer}"); switch (dirt) { case MovementPosition.Down: if (_midWafer != 0) _GuidePin2?.SetCylinder(false, out _); break; case MovementPosition.Up: if (_midWafer != 0) _GuidePin2?.SetCylinder(true, out _); break; default: throw new ArgumentException("Movement argument error"); } } public void SetGenerator1CommunicationMode(int mode) { _Generator1?.SetCommunicationMode(mode); } public void SetGenerator2CommunicationMode(int mode) { _Generator2?.SetCommunicationMode(mode); } public bool Generator1PowerOn(bool on) { if (_Generator1 == null) return false; if (on && !NotHasInterlock) { EV.PostAlarmLog(Module.ToString(), "射频电源 Interlock条件不满足"); return false; } return _Generator1.SetPowerOnOff(on, out _); } public bool Generator2PowerOn(bool on) { if (_Generator2 == null) return false; if (on && !NotHasInterlock) { EV.PostAlarmLog(Module.ToString(), "射频电源 Interlock条件不满足"); return false; } return _Generator2.SetPowerOnOff(on, out _); } public bool Generator1Setpower(float val) { if (_Generator1 == null) return false; if (Math.Abs(val) > 0.01) _Generator1.SetPower((ushort)val); return true; } public bool Generator2Setpower(float val) { if (_Generator2 == null) return false; if (Math.Abs(val) > 0.01) _Generator2.SetPower((ushort)val); return true; } public bool GeneratorBias1PowerOn(bool on) { if (_GeneratorBias1 == null) return false; if (on && !NotHasInterlock) { EV.PostAlarmLog(Module.ToString(), "Bias射频电源 Interlock条件不满足"); return false; } return _GeneratorBias1.SetPowerOnOff(on, out _); } public bool GeneratorBias2PowerOn(bool on) { if (_GeneratorBias2 == null) return false; if (on && !NotHasInterlock) { EV.PostAlarmLog(Module.ToString(), "Bias射频电源 Interlock条件不满足"); return false; } return _GeneratorBias2.SetPowerOnOff(on, out _); } public bool GeneratorBias1Setpower(float val) { if (_GeneratorBias1 == null) return false; if (Math.Abs(val) > 0.01) _GeneratorBias1.SetPower((ushort)val); return true; } public bool GeneratorBias2Setpower(float val) { if (_GeneratorBias2 == null) return false; if (Math.Abs(val) > 0.01) _GeneratorBias2.SetPower((ushort)val); return true; } public bool GeneratorBias1SetMatchMode(bool val) { if (_BiasMatch1 != null) { _BiasMatch1.SetMatchMode(true ? EnumRfMatchTuneMode.Auto.ToString() : EnumRfMatchTuneMode.Manual.ToString(), out _); return true; } if (_GeneratorBias1 == null) return false; string reason = string.Empty; _GeneratorBias1.SetMatchingAutoMode(val, out reason); return true; } public bool GeneratorBias2SetMatchMode(bool val) { if (_BiasMatch2 != null) { _BiasMatch2.SetMatchMode(true ? EnumRfMatchTuneMode.Auto.ToString(): EnumRfMatchTuneMode.Manual.ToString(), out _); return true; } if (_GeneratorBias2 == null) return false; string reason = string.Empty; _GeneratorBias2.SetMatchingAutoMode(val, out reason); return true; } public bool SetMatch1Position(float c1, float c2) { if (_Match1 == null) return false; string reason = string.Empty; _Match1.SetMatchPosition(c1, c2, out reason); return true; } public bool SetMatch2Position(float c1, float c2) { if (_Match2 == null) return false; string reason = string.Empty; _Match2.SetMatchPosition(c1, c2, out reason); return true; } public bool SetBias1MatchPosition(float c1, float c2) { if (_BiasMatch1 != null) { _BiasMatch1.SetMatchPosition(c1,c2,out _); return true; } if (_GeneratorBias1 == null) return false; string reason = string.Empty; _GeneratorBias1.SetMatchPosition(c1, c2, out reason); return true; } public bool SetBias2MatchPosition(float c1, float c2) { if (_BiasMatch2 != null) { _BiasMatch2.SetMatchPosition(c1, c2, out _); return true; } if (_GeneratorBias2 == null) return false; string reason = string.Empty; _GeneratorBias2.SetMatchPosition(c1, c2, out reason); return true; } public void FullOpenTV() { _pressureController.FullOpenThrottleValve(); } public void PressureControl(int pressure) { _pressureController.setTVPressure(pressure); //_pressureController._setChamberPressure(); } public void HeatChamber1(double val) { _ChamberHeater1?.RampTemp((float)val); _ChamberHeater1?.TurnOnOff(true); } public void HeatChamber2(double val) { _HeaterChamber?.RampTemp((float)val); _HeaterChamber?.TurnOnOff(true); } public void HeatChiller1(double value, double offset) { _Chiller1?.SetChillerTemp((float)value, (float)offset); _Chiller1?.SetChillerOnOff(true); } public void HeatChiller2(double value, double offset) { _Chiller2?.SetChillerTemp((float)value, (float)offset); _Chiller2?.SetChillerOnOff(true); } public void HeatForeline(double val) { _ForelineHeater?.RampTemp((float)val); } public void HeatLE1(double val) { _LEHeater1?.RampTemp((float)val); _LEHeater1?.TurnOnOff(true); } public void HeatLE2(double val) { _LEHeater2?.RampTemp((float)val); _LEHeater2?.TurnOnOff(true); } public override bool CheckEnableTransfer(EnumTransferType type, EnumDualPM pos) { if (type == EnumTransferType.Pick) { if (pos == EnumDualPM.Left) { if (_IsPlus) return !IsSlitDoor1Closed && _ioLiftPin1.PinPosition == PositionType.Position4; else return !IsSlitDoor1Closed && _LiftPin1.State == CylinderState.Open; } else if (pos == EnumDualPM.Right) { if (_IsPlus) return !IsSlitDoor2Closed && _ioLiftPin2.PinPosition == PositionType.Position4; else return !IsSlitDoor2Closed && _LiftPin2.State == CylinderState.Open; } } if (type == EnumTransferType.Place) { if (pos == EnumDualPM.Left) { if (_IsPlus) return !IsSlitDoor1Closed && _ioLiftPin1.PinPosition == PositionType.Position1; else return !IsSlitDoor1Closed && _LiftPin1.State == CylinderState.Close; } else if (pos == EnumDualPM.Right) { if (_IsPlus) return !IsSlitDoor2Closed && _ioLiftPin2.PinPosition == PositionType.Position1; else return !IsSlitDoor2Closed && _LiftPin2.State == CylinderState.Close; } } return false; } public bool CheckEnableTransfer(EnumTransferType type, EnumDualPM pos, WaferSize waferSize) { if (type == EnumTransferType.Pick) { if (_IsPlus) return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (!IsSlitDoor1Closed && _ioLiftPin1.PinPosition == PositionType.Position4 && CheckGuidePinIsReadyForTransfer(pos, waferSize))) && ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (!IsSlitDoor2Closed && _ioLiftPin2.PinPosition == PositionType.Position4 && CheckGuidePinIsReadyForTransfer(pos, waferSize))); else return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (!IsSlitDoor1Closed && _LiftPin1.State == CylinderState.Open && CheckGuidePinIsReadyForTransfer(pos, waferSize))) && ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (!IsSlitDoor2Closed && _LiftPin2.State == CylinderState.Open && CheckGuidePinIsReadyForTransfer(pos, waferSize))); } if (type == EnumTransferType.Place) { if (_IsPlus) return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (!IsSlitDoor1Closed && _ioLiftPin1.PinPosition == PositionType.Position1 && CheckGuidePinIsReadyForTransfer(pos, waferSize))) && ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (!IsSlitDoor2Closed && _ioLiftPin2.PinPosition == PositionType.Position1 && CheckGuidePinIsReadyForTransfer(pos, waferSize))); else return ((pos != EnumDualPM.Left && pos != EnumDualPM.Both) || (!IsSlitDoor1Closed && _LiftPin1.State == CylinderState.Close && CheckGuidePinIsReadyForTransfer(pos, waferSize))) && ((pos != EnumDualPM.Right && pos != EnumDualPM.Both) || (!IsSlitDoor2Closed && _LiftPin2.State == CylinderState.Close && CheckGuidePinIsReadyForTransfer(pos, waferSize))); } return false; } public override void TransferHandoff(EnumTransferType type, EnumDualPM pos) { switch (type) { case EnumTransferType.Pick: if (pos == EnumDualPM.Left) { SetLiftPin1(MovementPosition.Up, out _); } else if (pos == EnumDualPM.Right) { SetLiftPin2(MovementPosition.Up, out _); } break; case EnumTransferType.Place: SetLiftPin1(MovementPosition.Down, out _); break; case EnumTransferType.Extend: break; case EnumTransferType.Retract: break; default: break; } } public override void Reset() { _trigBasePressure.RST = true; _trigBaseTemperature1.RST = true; } } /// /// PM Action /// abstract class PmActionBase : ActionBase { protected internal JetDualPM _chamber; protected PmActionBase(ModuleName mod, JetDualPM dualPm) : base(mod) { _chamber = dualPm; } } class PinAction : PmActionBase { public MovementPosition Pos { get; } public bool IsWaferTransfered { get; } public PMModule PmModule { get; set; } private Hand _blade; public PinAction(ModuleName mod, JetDualPM dualPm, MovementPosition pos, bool isTransferWafer, Hand blade) : base(mod, dualPm) { this.Pos = pos; IsWaferTransfered = isTransferWafer; _blade = blade; } public override void Execute() { if (Module == ModuleName.PMA) PmModule = (PMModule)EquipmentManager.Modules[ModuleName.PMA]; else if (Module == ModuleName.PMB) PmModule = (PMModule)EquipmentManager.Modules[ModuleName.PMB]; else if (Module == ModuleName.PMC) PmModule = (PMModule)EquipmentManager.Modules[ModuleName.PMC]; if (PmModule != null) { PmModule.PostMsg(PMModule.MSG.MoveLiftPin1, Pos, ID); } } public override void OnPostWork(string data = null) { if (IsWaferTransfered) { if (Pos == MovementPosition.Up) { WaferManager.Instance.WaferMoved(ModuleName.EfemRobot, _blade == Hand.Blade1 ? 0 : 1, Module, 0); } else { WaferManager.Instance.WaferMoved(Module, 0, ModuleName.EfemRobot, _blade == Hand.Blade1 ? 0 : 1); } } } } abstract class ActionBase { private static ushort _id = 100; //---------------------------------Properties------------------------------------ // public ushort ID { get; } public ModuleName Module { get; protected set; } public virtual ActionStatus Status { get; set; } public virtual bool IsReady { get; set; } public bool IsBackground { get; set; } //--------------------------------Constructor------------------------------------ // protected ActionBase(ModuleName mod) { this.ID = _id++; this.Module = mod; this.Status = ActionStatus.Pending; } public virtual void Execute() { this.Status = ActionStatus.SendCmd; } protected virtual void OnPreWork() { } public virtual void OnPostWork(string data = null) { } } }