JET-GZX 2 settimane fa
parent
commit
07bd9bc47a

+ 5 - 1
Framework/Common/DataCenter/IQueryDataService.cs

@@ -13,6 +13,7 @@ using Aitex.Sorter.Common;
 using MECF.Framework.Common.Equipment;
 using MECF.Framework.Common.IOCore;
 using MECF.Framework.Common.SubstrateTrackings;
+using Virgo_DCommon;
 
 namespace MECF.Framework.Common.DataCenter
 {
@@ -150,5 +151,8 @@ namespace MECF.Framework.Common.DataCenter
 
 		[OperationContract]
 	    DataTable QueryData(string sql);
-	}
+
+        [OperationContract]
+        List<LeakCheckResultItem> GetHistoryLeakCheck(string Module);
+    }
 }

+ 5 - 0
Framework/Common/DataCenter/QueryDataService.cs

@@ -12,6 +12,7 @@ using Aitex.Sorter.Common;
 using Aitex.Sorter.RT.Module.DBRecorder;
 using MECF.Framework.Common.DBCore;
 using MECF.Framework.Common.IOCore;
+using Virgo_DCommon;
 
 namespace MECF.Framework.Common.DataCenter
 {
@@ -174,5 +175,9 @@ namespace MECF.Framework.Common.DataCenter
         {
             return DataQuery.Query(sql);
         }
+        public List<LeakCheckResultItem> GetHistoryLeakCheck(string Module)
+        {
+            return LeakCheckResultManager.Instance.GetHistoryLeakCheck(Module);
+        }
     }
 }

+ 13 - 2
Framework/Common/DataCenter/QueryDataServiceClient.cs

@@ -8,6 +8,7 @@ using Aitex.Core.Util;
 using Aitex.Core.WCF;
 using Aitex.Sorter.Common;
 using MECF.Framework.Common.IOCore;
+using Virgo_DCommon;
 
 namespace MECF.Framework.Common.DataCenter
 {
@@ -179,6 +180,16 @@ namespace MECF.Framework.Common.DataCenter
             return result;
         }
 
-		
-	}
+        public List<LeakCheckResultItem> GetHistoryLeakCheck(string Module)
+        {
+            List<LeakCheckResultItem> result = null;
+            Invoke(svc =>
+            {
+                result = svc.GetHistoryLeakCheck(Module);
+            });
+            return result;
+        }
+
+
+    }
 }

+ 2 - 2
Framework/Common/Key/KeyManager.cs

@@ -43,8 +43,8 @@ namespace Aitex.Core.RT.Key
         {
             get
             {
-                if (_plcDateTime != null)
-                    return _plcDateTime.CurrentDateTime;
+                //if (_plcDateTime != null)
+                //    return _plcDateTime.CurrentDateTime;
                 return DateTime.Now;
             }
         }

+ 2 - 0
Virgo_DCommon/Virgo_DDevice.cs

@@ -6,6 +6,7 @@
         ValveMfc2,
         ValveMfc3,
         ValveMfc4,
+        ValveMfc5,
 
         ValveChamberPurge,
         ValveProcess,
@@ -18,6 +19,7 @@
         MfcGas2,
         MfcGas3,
         MfcGas4,
+        MfcGas5,
 
         GasStick1,
         GasStick2,

BIN
Virgo_DRT/Config/DeviceModelVirgo_D.xml


+ 2 - 2
Virgo_DRT/Config/RecipeFormat.xml

@@ -99,7 +99,7 @@
       <Pressure PressureControl.SetTVMode="TVPressureCtrl" PressureControl.SetTVPosition="0" PressureControl.SetTVPressure="50" PressureControl.SetBoostPressure="100" PressureControl.SetChamberPressure="100" />
       <Pin LiftPin.SetState="Down"/>
       <RF Rf.SetPowerOnTime ="00:00:00" Rf.SetMode ="ContinuousWaveMode" Match.SetMatchProcessMode="PresetMode" Rf.SetPower="0" Rf.SetPulsingDuty="0" Rf.SetPulsingFrequency="0" Match.SetMatchPositionC1="50" Match.SetMatchPositionC2="50" />
-      <Mfc MfcGas1 ="0" MfcGas2="0" MfcGas3="0" MfcGas4="0" MfcGas5="0" />
+      <Mfc MfcGas1 ="0" MfcGas2="0" MfcGas3="0" MfcGas4="0" />
     </Step>
   </TableRecipeData>
   <TableRecipeSchema>
@@ -158,7 +158,7 @@
                       <xs:attribute name="MfcGas2" type="xs:double" use="optional" />
                       <xs:attribute name="MfcGas3" type="xs:double" use="optional" />
                       <xs:attribute name="MfcGas4" type="xs:double" use="optional" />
-                      <xs:attribute name="MfcGas5" type="xs:double" use="optional" />
+                      <!--<xs:attribute name="MfcGas5" type="xs:double" use="optional" />-->
                     </xs:complexType>
                   </xs:element>
                 </xs:sequence>

+ 12 - 1
Virgo_DRT/Config/System.sccfg

@@ -36,7 +36,7 @@
     <config default="1" name="TimeLimitOfCloseGasValve" description="" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
     <config default="1" name="OpenCloseSlitValveTimeout" description="" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
     <config default="180" name="VentTime" description="" max="600" min="0" paramter="" tag="" unit="second" type="Integer" />
-    <config default="3" name="GasCount" description="Gas stick count" max="5" min="0" paramter="" tag="" unit="" type="Integer" />
+    <config default="3" name="GasCount" description="Gas stick count" max="4" min="0" paramter="" tag="" unit="" type="Integer" />
     <config default="100" name="GasFlowPressureAlarmRange" description="" max="760000" min="0" paramter="" tag="" unit="sccm" type="Double" />
     <config default="60" name="GasFlowPressureAlarmTime" description="" max="3600" min="0" paramter="" tag="" unit="second" type="Double" />
     <config default="true" name="EnableThrottleValve" description="" max="10" min="0" paramter="" tag="" unit="" type="Bool" />
@@ -127,6 +127,17 @@
       <config default="100" name="DefaultSetPoint" description="default setpoint" max="1000" min="0" tag="" unit="sccm" type="Integer" />
       <config default="1" name="FlowRegulationFactor" description="flow regulation factor" max="10" min="0" tag="" unit="sccm" type="Integer" />
     </configs>
+	  <!--<configs name="MfcGas5">
+		  <config default="true" name="MfcEnableAlarm" description="Mfc Enable Alarm" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
+		  <config default="10" name="MfcAlarmRange" description="Mfc Alarm Range" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
+		  <config default="10" name="MfcAlarmTime" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+		  <config default="Gas4" name="GasName" description="Name of NO.5 gas stick" tag="" unit="" type="String" />
+		  <config default="true" name="Enable" description="Enable gas 5 or not" tag="" unit="" type="Bool" />
+		  <config default="100" name="MfcN2Scale" description="Max scale by N2 tuning" max="10000" min="0" tag="" unit="sccm" type="Integer" />
+		  <config default="1" name="MfcScaleFactor" description="Scale factor" max="10" min="0" tag="" unit="sccm" type="Double" />
+		  <config default="100" name="DefaultSetPoint" description="default setpoint" max="1000" min="0" tag="" unit="sccm" type="Integer" />
+		  <config default="1" name="FlowRegulationFactor" description="flow regulation factor" max="10" min="0" tag="" unit="sccm" type="Integer" />
+	  </configs>-->
     <configs name="Pump">
       <config default="30" name="LeakRate" description="Leak Rate" max="756000" min="0" paramter="" tag="" unit="mTorrPerMin" type="Double" />
       <config default="180" name="LeakCheckPumpingTime" description="Leak Check Pumping Time" max="3000" min="0" paramter="" tag="" unit="" type="Integer" />

+ 27 - 3
Virgo_DRT/Devices/JetPM.cs

@@ -29,7 +29,8 @@ namespace Virgo_DRT.Devices
         Mfc1,
         Mfc2,
         Mfc3,
-        Mfc4
+        Mfc4,
+        Mfc5
     }
 
     class JetPM : PM
@@ -57,6 +58,8 @@ namespace Virgo_DRT.Devices
         private readonly IoValve _Mfc2Valve;
         private readonly IoValve _Mfc3Valve;
         private readonly IoValve _Mfc4Valve;
+        private readonly IoValve _Mfc5Valve;
+        private readonly IoValve _WaterValve;
         //private readonly IoValve           _N2SupplyValve;
         //private readonly IoCylinder          _slitDoor;
         private readonly IoCylinder _LiftPin;
@@ -179,6 +182,12 @@ namespace Virgo_DRT.Devices
         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 HasPumpError => _MainPump.IsError || !_MainPump.IsRunning;
 
         public bool IsCDA_OK => _CDAPressure.Value;
@@ -253,7 +262,13 @@ namespace Virgo_DRT.Devices
             _ProcessValve           = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveProcess}");
             _FastVentValve          = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveFastVent}");
             _PurgeValve             = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveChamberPurge}");
-            //_slitDoor               = DEVICE.GetDevice<IoCylinder>($"{Module}.{Virgo_DDevice.SlitDoor}");
+            _PurgeValve             = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveChamberPurge}");
+            _Mfc1Valve              = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveMfc1}");
+            _Mfc2Valve              = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveMfc2}");
+            _Mfc3Valve              = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveMfc3}");
+            _Mfc4Valve              = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveMfc4}");
+            //_Mfc5Valve              = DEVICE.GetDevice<IoValve>($"{Module}.{Virgo_DDevice.ValveMfc5}");
+            //_slitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{Virgo_DDevice.SlitDoor}");
             _LiftPin                = DEVICE.GetDevice<IoCylinder>($"{Module}.{Virgo_DDevice.LiftPin}");
             _PinInch3               = DEVICE.GetDevice<IoCylinder>($"{Module}.{Virgo_DDevice.Inch3Pin}");
             _PinInch4               = DEVICE.GetDevice<IoCylinder>($"{Module}.{Virgo_DDevice.Inch4Pin}");
@@ -423,8 +438,11 @@ namespace Virgo_DRT.Devices
                 case ValveType.Mfc4:
                     _Mfc4Valve.TurnValve(on, out _);
                     break;
+                //case ValveType.Mfc5:
+                //    _Mfc5Valve.TurnValve(on, out _);
+                //    break;
                 default:
-                throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
+                    throw new ArgumentOutOfRangeException($"Argument error {vlvType}-{on}");
             }
         }
 
@@ -454,6 +472,12 @@ namespace Virgo_DRT.Devices
             _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 _);
+
             foreach (var stick in _gasLines)
             {
                 stick.Stop();

+ 11 - 1
Virgo_DRT/Modules/PMs/PMEntity.cs

@@ -37,6 +37,7 @@ namespace Virgo_DRT.Module
             TransferHandoff,
             StartTransfer,
             LeakCheck,
+            DeleteLeakCheck,
             MoveLiftPin,
             MoveGuidePin,
 
@@ -256,6 +257,8 @@ namespace Virgo_DRT.Module
             //_chamber = new JetPM(ModuleHelper.Converter(Name));
             _chamber = DEVICE.GetDevice<JetPM>(Module.ToString());
 
+            LeakCheckResultManager.Instance.Initialize(Module.ToString());
+
             fsm = new StateMachine<PMEntity>(Module.ToString(), (int)PMState.Init, 50);
 
             _ventRoutine        = new VentRoutine(_chamber);
@@ -338,6 +341,7 @@ namespace Virgo_DRT.Module
 
             //Leak check sequence
             Transition(PMState.Idle, MSG.LeakCheck,                   FnStartLeakCheck, PMState.LeakCheck);
+            Transition(PMState.Idle, MSG.DeleteLeakCheck,             FnDeleteLeakCheck, PMState.Idle);
             Transition(PMState.LeakCheck, FSM_MSG.TIMER,              FnLeakCheckTimeout, PMState.Idle);
             Transition(PMState.LeakCheck, MSG.Abort,                  FnAbortLeakCheck, PMState.Idle);
 
@@ -429,7 +433,8 @@ namespace Virgo_DRT.Module
             OP.Subscribe($"{Module}.{RtOperation.StartPump}",       (cmd, args) => CheckToPostMessage((int)MSG.LaunchPump));
             OP.Subscribe($"{Module}.{RtOperation.Vent}",            (cmd, args) => CheckToPostMessage((int)MSG.Vent));
             OP.Subscribe($"{Module}.{RtOperation.Purge}",           (cmd, args) => CheckToPostMessage((int)MSG.CyclePurge));
-            OP.Subscribe($"{Module}.{RtOperation.LeakCheck}",       (cmd, args) => CheckToPostMessage((int)MSG.LeakCheck));
+            OP.Subscribe($"{Module}.{RtOperation.LeakCheck}",       (cmd, args) => CheckToPostMessage((int)MSG.LeakCheck, args));
+            OP.Subscribe($"{Module}.{RtOperation.DeleteLeakCheck}", (cmd, args) => CheckToPostMessage((int)MSG.DeleteLeakCheck, args));
             OP.Subscribe($"{Module}.{RtOperation.LockLid}",         (cmd, args) => CheckToPostMessage((int)MSG.LockLid, true));
             OP.Subscribe($"{Module}.{RtOperation.UnlockLid}",       (cmd, args) => CheckToPostMessage((int)MSG.LockLid, false));
             OP.Subscribe($"{Module}.{RtOperation.RunRecipe}",       (cmd, args) => CheckToPostMessage((int)MSG.RunRecipe, (string)args[0]));
@@ -610,6 +615,11 @@ namespace Virgo_DRT.Module
             Result res = _leakCheckRoutine.Monitor();
             return res == Result.DONE || res == Result.FAIL;
         }
+        private bool FnDeleteLeakCheck(object[] param)
+        {
+            _leakCheckRoutine.DeleteLeadCheck(param);
+            return true;
+        }
 
         private bool FnAbortLeakCheck(object[] param)
         {

+ 192 - 25
Virgo_DRT/Modules/PMs/PMLeakCheckRoutine.cs

@@ -1,7 +1,12 @@
 using System;
+using System.Reflection;
 using Aitex.Core.RT.Log;
 using Aitex.Core.RT.Routine;
 using Aitex.Core.RT.SCCore;
+using Virgo_DCommon;
+using Virgo_DRT.Devices;
+using Virgo_DRT.Modules.PMs;
+using Virgo_DCommon;
 using Virgo_DRT.Devices;
 
 namespace Virgo_DRT.Modules.PMs
@@ -19,13 +24,20 @@ namespace Virgo_DRT.Modules.PMs
             OpenPumpingValve,
 
             OpenGasFinalValve,
+            CloseGasFinalValve,
 
             OpenMfc1Valve,
             OpenMfc2Valve,
             OpenMfc3Valve,
             OpenMfc4Valve,
-            OpenMfc5Valve,
-
+            //OpenMfc5Valve,
+            CloseMfc1Valve,
+            CloseMfc2Valve,
+            CloseMfc3Valve,
+            CloseMfc4Valve,
+            //CloseMfc5Valve,
+            StartFlow,
+            StopFlow,
             RecordStartPressure,
 
             RecordEndPressure,
@@ -51,13 +63,13 @@ namespace Virgo_DRT.Modules.PMs
         // Fields
         private double _beginPressure = 0;
         private double _endPressure = 0;
-        private double _lowerLimitPressure;
-        private double _upperLimitPressure;
-        private int _leakCheckTimeLimit;
-        private int _leakCheckPumpTimeLimit;
         private double _leakRate;
         public double LeakRate { get; private set; }
-
+        private int _leakCheckPumpDownTime;
+        private int _leakCheckWaitTime;
+        private LeakCheckMode _mode;
+        private bool[] _enableGasLine = new bool[5];
+        private double[] _mfcFlow = new double[5];
         private readonly PumpDownRoutine _pumpdownRoutine;
 
         // Properties
@@ -84,16 +96,41 @@ namespace Virgo_DRT.Modules.PMs
                 CheckSlitDoor() == Result.RUN &&
                 CheckDryPump() == Result.RUN)
             {
+                _enableGasLine = new bool[5] { false, false, false, false, false };
+                _mfcFlow = new double[5] { 0.0, 0.0, 0.0, 0.0, 0.0 };
+
                 Reset();
 
                 delayTimer.Start(0);
 
-                //_lowerLimitPressure = SC.GetValue<double>($"{ Module}.Pump.PumpLowerLimitPressure");
-                //_upperLimitPressure = SC.GetValue<double>($"{ Module}.Pump.PumpUpperLimitPressure");
-                _leakCheckPumpTimeLimit = SC.GetValue<int>($"{Module}.Pump.LeakCheckPumpingTime");
-                _leakCheckTimeLimit = SC.GetValue<int>($"{Module}.Pump.LeakCheckWaitTime");
-                _leakRate = SC.GetValue<double>($"{Module}.Pump.LeakRate");
-                //_intLeakMode = SC.GetValue<int>($"{Module}.Pump.LeakCheckMode");
+                try
+                {
+                    if (objs.Length == 0)
+                    {
+                        _leakCheckPumpDownTime = SC.GetValue<int>($"{Module}.Pump.LeakCheckPumpingTime");
+                        _leakCheckWaitTime = SC.GetValue<int>($"{Module}.Pump.LeakCheckWaitTime");
+                        _leakRate = SC.GetValue<double>($"{Module}.Pump.LeakRate");
+                        _mode = LeakCheckMode.ChamberOnly;
+                    }
+                    else
+                    {
+                        _leakCheckPumpDownTime = Convert.ToInt32(objs[0].ToString());
+                        _leakCheckWaitTime = Convert.ToInt32(objs[1].ToString());
+                        _mode = (LeakCheckMode)Enum.Parse(typeof(LeakCheckMode), objs[2].ToString());
+                        _leakRate = Convert.ToInt32(objs[3].ToString());
+                        for (int i = 0; i < 5; i++)
+                            _enableGasLine[i] = Convert.ToBoolean(objs[4 + i].ToString());
+                    }
+                    for (int i = 0; i < 5; i++)
+                    {
+                        if (_enableGasLine[i]) _mfcFlow[i] = SC.GetValue<int>($"{Module}.MfcGas{i + 1}.MfcN2Scale");
+                    }
+                }
+                catch (Exception ex)
+                {
+                    LOG.Write(ex);
+                    return Result.FAIL;
+                }
 
                 return Result.RUN;
             }
@@ -107,24 +144,77 @@ namespace Virgo_DRT.Modules.PMs
             {
                 ExecuteRoutine((int)LeakCheckStep.PumpDown, _pumpdownRoutine);
 
-                TimeDelay((int)LeakCheckStep.PumpDownDelay, _leakCheckPumpTimeLimit);
+                if (_mode == LeakCheckMode.ChamberOnly)
+                {
+                    ;
+                }
+                else if (_mode == LeakCheckMode.ChamberAndGasLine)
+                {
+                    OpenValve((int)LeakCheckStep.OpenGasFinalValve, ValveType.PROCESS, true);
+                    if (_enableGasLine[0]) OpenValve((int)LeakCheckStep.OpenMfc1Valve, ValveType.Mfc1, true);
+                    if (_enableGasLine[1]) OpenValve((int)LeakCheckStep.OpenMfc2Valve, ValveType.Mfc2, true);
+                    if (_enableGasLine[2]) OpenValve((int)LeakCheckStep.OpenMfc3Valve, ValveType.Mfc3, true);
+                    if (_enableGasLine[3]) OpenValve((int)LeakCheckStep.OpenMfc4Valve, ValveType.Mfc4, true);
+                    //if (_enableGasLine[4]) OpenValve((int)LeakCheckStep.OpenMfc5Valve, ValveType.Mfc5, true);
+                }
+                else if (_mode == LeakCheckMode.ChamberAndGasLineAndFAC)
+                {
+                    OpenValve((int)LeakCheckStep.OpenGasFinalValve, ValveType.PROCESS, true);
+                    if (_enableGasLine[0]) OpenValve((int)LeakCheckStep.OpenMfc1Valve, ValveType.Mfc1, true);
+                    if (_enableGasLine[1]) OpenValve((int)LeakCheckStep.OpenMfc2Valve, ValveType.Mfc2, true);
+                    if (_enableGasLine[2]) OpenValve((int)LeakCheckStep.OpenMfc3Valve, ValveType.Mfc3, true);
+                    if (_enableGasLine[3]) OpenValve((int)LeakCheckStep.OpenMfc4Valve, ValveType.Mfc4, true);
+                    //if (_enableGasLine[4]) OpenValve((int)LeakCheckStep.OpenMfc5Valve, ValveType.Mfc5, true);
+
+                    StartFlowMFC((int)LeakCheckStep.StartFlow, _mfcFlow);
+                }
+
+                TimeDelay((int)LeakCheckStep.PumpDownDelay, _leakCheckPumpDownTime);
 
                 OpenValve((int)LeakCheckStep.ClosePumpValve, ValveType.FAST_PUMP, false);
 
+
                 //记录腔体Start pressure P1
                 RecordBeginPressure((int)LeakCheckStep.RecordStartPressure);
 
                 //pump down delay
-                TimeDelay((int)LeakCheckStep.EndPressureDelay, _leakCheckTimeLimit);
+                TimeDelay((int)LeakCheckStep.EndPressureDelay, _leakCheckWaitTime);
 
                 //记录腔体End pressure P2
                 RecordEndPressure((int)LeakCheckStep.RecordEndPressure);
 
-                CalcLeakCheck((int)LeakCheckStep.CalcLeakCheck, _leakRate, _leakCheckTimeLimit, 0);
+                CalcLeakCheck((int)LeakCheckStep.CalcLeakCheck, _leakRate, _leakCheckWaitTime, 0);
+
+                if (_mode == LeakCheckMode.ChamberOnly)
+                {
+                    ;
+                }
+                else if (_mode == LeakCheckMode.ChamberAndGasLine)
+                {
+                    OpenValve((int)LeakCheckStep.CloseGasFinalValve, ValveType.PROCESS, false);
+                    if (_enableGasLine[0]) OpenValve((int)LeakCheckStep.CloseMfc1Valve, ValveType.Mfc1, false);
+                    if (_enableGasLine[1]) OpenValve((int)LeakCheckStep.CloseMfc2Valve, ValveType.Mfc2, false);
+                    if (_enableGasLine[2]) OpenValve((int)LeakCheckStep.CloseMfc3Valve, ValveType.Mfc3, false);
+                    if (_enableGasLine[3]) OpenValve((int)LeakCheckStep.CloseMfc4Valve, ValveType.Mfc4, false);
+                    //if (_enableGasLine[4]) OpenValve((int)LeakCheckStep.CloseMfc5Valve, ValveType.Mfc5, false);
+                }
+                else if (_mode == LeakCheckMode.ChamberAndGasLineAndFAC)
+                {
+                    OpenValve((int)LeakCheckStep.CloseGasFinalValve, ValveType.PROCESS, false);
+                    if (_enableGasLine[0]) OpenValve((int)LeakCheckStep.CloseMfc1Valve, ValveType.Mfc1, false);
+                    if (_enableGasLine[1]) OpenValve((int)LeakCheckStep.CloseMfc2Valve, ValveType.Mfc2, false);
+                    if (_enableGasLine[2]) OpenValve((int)LeakCheckStep.CloseMfc3Valve, ValveType.Mfc3, false);
+                    if (_enableGasLine[3]) OpenValve((int)LeakCheckStep.CloseMfc4Valve, ValveType.Mfc4, false);
+                    //if (_enableGasLine[4]) OpenValve((int)LeakCheckStep.CloseMfc5Valve, ValveType.Mfc5, false);
+
+                    StopFlowMFC((int)LeakCheckStep.StopFlow);
+                }
+
 
                 End((int)LeakCheckStep.End);
 
                 //ExecuteRoutine((int)LeakCheckStep.EndLeakCheck, _pumpDownRoutine);
+
             }
             catch (RoutineBreakException)
             {
@@ -168,10 +258,10 @@ namespace Virgo_DRT.Modules.PMs
             {
                 if (_chamber.ChamberPressure < target)
                 {
-                    Notify($"腔体压力 [{_chamber.ChamberPressure}] mt, 低于 [{target}] mt");
+                    Notify($"Chamber pressure [{_chamber.ChamberPressure}] mt, less than [{target}] mt");
                     return true;
                 }
-                Stop($"腔体压力 [{_chamber.ChamberPressure}], 高于 [{target}]");
+                Stop($"Chamber pressure [{_chamber.ChamberPressure}], greater than [{target}]");
                 return false;
             }
 
@@ -200,7 +290,7 @@ namespace Virgo_DRT.Modules.PMs
             bool Func()
             {
                 _beginPressure = _chamber.ChamberPressure;
-                Notify($"腔体压力初始值 {_beginPressure} mt");
+                Notify($"Record PM begin pressure {_beginPressure} mt");
                 return true;
             }
 
@@ -231,7 +321,7 @@ namespace Virgo_DRT.Modules.PMs
             bool Func()
             {
                 _endPressure = _chamber.ChamberPressure;
-                Notify($"腔体压力结束值 {_endPressure} mt");
+                Notify($"Record PM end pressure {_endPressure} mt");
                 return true;
             }
 
@@ -267,13 +357,14 @@ namespace Virgo_DRT.Modules.PMs
             bool? Check1()
             {
                 LeakRate = (_endPressure - _beginPressure) / (timeRate / 60.0);
-
                 if (LeakRate < target)
                 {
-                    Notify($"腔体漏率 [{LeakRate}] mt/min, 低于 [{target}] mt/min");
+                    Notify($"PM leak rate [{LeakRate}] mt/min, less than [{target}] mt/min");
+                    LeakCheckResultManager.Instance.AddLeakCheck(Module, DateTime.Now, ElapseTime, (int)_beginPressure, (int)_endPressure, LeakRate, LeakCheckStatus.Succeed.ToString(), _mode.ToString());
                     return true;
                 }
-                Stop($"腔体漏率 [{LeakRate}] mt/min, 高于 [{target}] mt/min");
+                Stop($"PM leak rate [{LeakRate}] mt/min, greater than [{target}] mt/min");
+                LeakCheckResultManager.Instance.AddLeakCheck(Module, DateTime.Now, ElapseTime, (int)_beginPressure, (int)_endPressure, LeakRate, LeakCheckStatus.Failed.ToString(), _mode.ToString());
                 return false;
             }
 
@@ -294,10 +385,86 @@ namespace Virgo_DRT.Modules.PMs
             }
         }
 
+        public void StopFlowMFC(int id)
+        {
+            bool Func()
+            {
+                _chamber.StopAllGases();
+                return true;
+            }
+
+            bool? Check1()
+            {
+                return true;
+            }
+
+            Tuple<bool, Result> ret = ExecuteAndWait(id, Func, Check1, 1 * 1000);
+
+            if (ret.Item1)
+            {
+                if (ret.Item2 == Result.FAIL)
+                {
+                    throw new RoutineFaildException();
+                }
+
+                if (ret.Item2 == Result.TIMEOUT)
+                {
+                    throw new RoutineFaildException();
+                }
+                throw new RoutineBreakException();
+            }
+        }
+
+        public void StartFlowMFC(int id, double[] mfcValues)
+        {
+            bool Func()
+            {
+                for (int index = 0; index < mfcValues.Length; index++)
+                {
+                    _chamber.FlowGas(index, mfcValues[index]);
+                }
+                return true;
+            }
+
+            bool? Check1()
+            {
+                return true;
+            }
+
+            Tuple<bool, Result> ret = ExecuteAndWait(id, Func, Check1, 1 * 1000);
+
+            if (ret.Item1)
+            {
+                if (ret.Item2 == Result.FAIL)
+                {
+                    throw new RoutineFaildException();
+                }
+
+                if (ret.Item2 == Result.TIMEOUT)
+                {
+                    throw new RoutineFaildException();
+                }
+                throw new RoutineBreakException();
+            }
+        }
+
+        public void DeleteLeadCheck(object[] args)
+        {
+            LeakCheckResultManager.Instance.Delete(Module, args[0].ToString());
+        }
+
         public override void Abort()
         {
-            ExecuteRoutine((int)LeakCheckStep.AbortLeakCheck, _pumpdownRoutine);
-            return;
+            try
+            {
+                _chamber.CloseValves();
+                LeakCheckResultManager.Instance.AddLeakCheck(Module, DateTime.Now, ElapseTime, (int)_beginPressure, (int)_chamber.ChamberPressure, 0, LeakCheckStatus.Aborted.ToString(), _mode.ToString());
+            }
+            catch (Exception ex)
+            {
+                LOG.Write(ex);
+            }
+
         }
     }
 }

+ 1 - 1
Virgo_DSimulator/Instances/SimulatorSystem.cs

@@ -66,7 +66,7 @@ namespace Virgo_DSimulator.Instances
             IO.DI[$"{mod}.DI_MFC2_Pressure"].Value                = true;
             IO.DI[$"{mod}.DI_MFC3_Pressure"].Value                = true;
             IO.DI[$"{mod}.DI_MFC4_Pressure"].Value                = true;
-            IO.DI[$"{mod}.DI_MFC5_Pressure"].Value                = true;
+            //IO.DI[$"{mod}.DI_MFC5_Pressure"].Value                = true;
             IO.DI[$"{mod}.DI_N2_Pressure"].Value                = true;
             //IO.DI[$"{mod}.DI_EFEM_Side_Panel_Closed"].Value       = true;
             IO.DI[$"{mod}.DI_Generator_Hardware_Interlock"].Value = true;

+ 1 - 0
Virgo_DUI/Config/Menu.xml

@@ -6,6 +6,7 @@
     <!--<menuItem id="OperationPMA" resKey="Operation" System="PMA"  viewmodel="Virgo_DUI.Client.Models.PMs.PmOperationViewModel,Virgo_DUI" />-->
     <menuItem id="IOPMA" resKey="IO" System="PMA"  viewmodel="Virgo_DUI.Client.Models.PMs.PmIoViewModel,Virgo_DUI" />
     <menuItem id="RecipePMA" resKey="Recipe" System="PMA"  viewmodel="Virgo_DUI.Client.Models.PMs.RecipeEditorViewModel,Virgo_DUI" />
+	<menuItem id="LeakCheckPMA" resKey="LeakCheck" System="PMA"  viewmodel="Virgo_DUI.Client.Models.PMs.LeakCheckViewModel,Virgo_DUI" />
   </menuItem>
   <!--<menuItem id="Operation" resKey="Operation">
     <menuItem id="Overview" resKey="Overview" viewmodel="Virgo_DUI.Client.Models.Operate.OverViewModel,Virgo_DUI" ></menuItem>

BIN
Virgo_DUI/Config/SystemConfig.default.xml


+ 5 - 5
Virgo_DUI/Models/PMs/PmOverviewView.xaml

@@ -1005,13 +1005,13 @@
                     </DataGridTemplateColumn>
 
                     <!--参数 Setpoint & Feedback-->
-                    <DataGridTemplateColumn Header="Parameter" Width="230" CellTemplateSelector="{StaticResource SPSelector}">
+                    <DataGridTemplateColumn Header="Parameter" Width="248" CellTemplateSelector="{StaticResource SPSelector}">
                         <DataGridTemplateColumn.HeaderTemplate>
                             <DataTemplate>
                                 <Grid>
                                     <Grid.ColumnDefinitions>
-                                        <ColumnDefinition Width="115"></ColumnDefinition>
-                                        <ColumnDefinition Width="115"></ColumnDefinition>
+                                        <ColumnDefinition Width="124"></ColumnDefinition>
+                                        <ColumnDefinition Width="124"></ColumnDefinition>
                                     </Grid.ColumnDefinitions>
                                     <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,0"  Grid.Row="0" Padding="0">
                                         <TextBlock Text="反馈值" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" />
@@ -1235,13 +1235,13 @@
                         </i:Interaction.Triggers>
                     </Button>
 
-                    <Button Content="检测漏率" Width="80" Height="25" Margin="0 0 0 10" IsEnabled="{Binding Path=IsManualMode}">
+                    <!--<Button Content="检测漏率" Width="80" Height="25" Margin="0 0 0 10" IsEnabled="{Binding Path=IsManualMode}">
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Click">
                                 <cal:ActionMessage MethodName="LeakCheck"/>
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
-                    </Button>
+                    </Button>-->
                 </StackPanel>
             </Border>
             <Border Grid.Row="5" BorderBrush="{DynamicResource Table_BD}" CornerRadius="0,0,5,5" Background="{DynamicResource Table_BG_Content}" BorderThickness="1,0,1,1" Padding="5,1">

+ 25 - 0
Virgo_DUI/Models/PMs/PmOverviewViewModel.cs

@@ -240,6 +240,13 @@ namespace Virgo_DUI.Client.Models.PMs
             set;
         }
 
+        //[Subscription(Virgo_DDevice.ValveMfc5)]
+        //public AITValveData GP5Valve
+        //{
+        //    get;
+        //    set;
+        //}
+
         [Subscription(Virgo_DDevice.ValveChamberPurge)]
         public AITValveData ChamberPurgeValve
         {
@@ -364,6 +371,24 @@ namespace Virgo_DUI.Client.Models.PMs
                 }
             }
         }
+        //private AITMfcData _mfc5;
+
+        //[Subscription(Virgo_DDevice.MfcGas5)]
+        //public AITMfcData GP5Mfc
+        //{
+        //    get
+        //    {
+        //        return _mfc5;
+        //    }
+        //    set
+        //    {
+        //        _mfc5 = value;
+        //        if (IsAutoMode && ((int)QueryDataClient.Instance.Service.GetConfig($"{SystemName}.GasCount") >= 5))
+        //        {
+        //            PMParameters.Find(x => x.Name == $"{SystemName}.IoMfc.MfcGas5.FeedBack").Setpoint = _mfc5.SetPoint.ToString("F1");
+        //        }
+        //    }
+        //}
         [Subscription("HeaterChamber.DeviceData")]
         public AITHeaterData HeaterChamber { get; set; }
 

+ 1 - 1
Virgo_DUI/Models/Utility/SystemConfig/SystemConfigViewModel.cs

@@ -34,7 +34,7 @@ namespace Virgo_DUI.Client.Models.Utility.SystemConfig
             this.DisplayName = "System Config";
             TreeViewSelectedItemChangedCmd = new BaseCommand<ConfigNode>(TreeViewSelectedItemChanged);
         }
-
+         
         protected override void OnInitialize()
         {
             base.OnInitialize();

+ 1 - 1
Virgo_DUI/Themes/StringResources.en-US.xaml

@@ -312,7 +312,7 @@ xmlns:system="clr-namespace:System;assembly=mscorlib">
     <system:String x:Key="GlobalLableConfigGas2">Gas 2</system:String>
     <system:String x:Key="GlobalLableConfigGas3">Gas 3</system:String>
     <system:String x:Key="GlobalLableConfigGas4">Gas 4</system:String>
-    <system:String x:Key="GlobalLableConfigGas5">Gas 5</system:String>
+    <!-- <system:String x:Key="GlobalLableConfigGas5">Gas 5</system:String>-->
     <system:String x:Key="GlobalLableConfigN2">N2</system:String>
     <system:String x:Key="GlobalLableConfigCda">CDA</system:String>
 

+ 8 - 0
Virgo_DUI/Virgo_DUI.csproj

@@ -322,6 +322,10 @@
     <Compile Include="Models\Platform\UnitModel.cs" />
     <Compile Include="Models\PMs\GaslineItem.cs" />
     <Compile Include="Models\PMs\IUiRecipeManager.cs" />
+    <Compile Include="Models\PMs\LeakCheckView.xaml.cs">
+      <DependentUpon>LeakCheckView.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Models\PMs\LeakCheckViewModel.cs" />
     <Compile Include="Models\PMs\PmIoView.xaml.cs">
       <DependentUpon>PmIoView.xaml</DependentUpon>
     </Compile>
@@ -612,6 +616,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Models\PMs\LeakCheckView.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Models\PMs\PmIoView.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>