Pārlūkot izejas kodu

1.Venus SE DE Add PressureControl
2.adjust partialpressure/Vatperformace/GasBoxLeakCheck function for Venus SE/DE

hecl 1 gadu atpakaļ
vecāks
revīzija
945ce3c74c
27 mainītis faili ar 3477 papildinājumiem un 2960 dzēšanām
  1. 40 8
      Venus/Venus_MainPages/ViewModels/GasLeakCheckViewModel.cs
  2. 20 20
      Venus/Venus_MainPages/ViewModels/OverVenusDEViewModel.cs
  3. 4 4
      Venus/Venus_MainPages/ViewModels/OverVenusSEViewModel.cs
  4. 33 0
      Venus/Venus_MainPages/ViewModels/PartialPressureViewModel.cs
  5. 41 2
      Venus/Venus_MainPages/ViewModels/VATPerformanceViewModel.cs
  6. 42 28
      Venus/Venus_MainPages/Views/GasLeakCheckView.xaml
  7. 42 8
      Venus/Venus_MainPages/Views/PartialPressureView.xaml
  8. 7 1
      Venus/Venus_MainPages/Views/VATPerformanceView.xaml
  9. 1 1
      Venus/Venus_RT/Config/PM/VenusDE/VenusDEDeviceModel.xml
  10. 11 11
      Venus/Venus_RT/Config/PM/VenusSE/VenusSEDeviceModel.xml
  11. 0 1
      Venus/Venus_RT/Config/PM/VenusSE/VenusSEInterlock.xml
  12. 2839 2819
      Venus/Venus_RT/Config/System_VenusSE.sccfg
  13. 19 2
      Venus/Venus_RT/Devices/IODevices/IoMfc.cs
  14. 22 3
      Venus/Venus_RT/Devices/JetPMBase.cs
  15. 124 13
      Venus/Venus_RT/Devices/JetVenusDEPM.cs
  16. 49 9
      Venus/Venus_RT/Devices/JetVenusSEPM.cs
  17. 8 7
      Venus/Venus_RT/Devices/PendulumValve.cs
  18. 8 1
      Venus/Venus_RT/Modules/PMs/GasBoxLeakCheckRoutine.cs
  19. 5 1
      Venus/Venus_RT/Modules/PMs/PMHomeRoutine.cs
  20. 16 4
      Venus/Venus_RT/Modules/PMs/PMPartialPressureRoutine.cs
  21. 2 2
      Venus/Venus_RT/Modules/PMs/PMProcessRoutine.cs
  22. 9 0
      Venus/Venus_RT/Modules/PMs/PMRoutineBase.cs
  23. 16 4
      Venus/Venus_RT/Modules/PMs/PMVATPerformanceRoutine.cs
  24. 52 9
      Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPMPickRoutine.cs
  25. 4 1
      Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPMPlaceRoutine.cs
  26. 46 1
      Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPMSwapRoutine.cs
  27. 17 0
      Venus/Venus_Simulator/Instances/SimulatorSystem.cs

+ 40 - 8
Venus/Venus_MainPages/ViewModels/GasLeakCheckViewModel.cs

@@ -25,7 +25,8 @@ namespace Venus_MainPages.ViewModels
         private double m_LeakRateUpperLimit;
         private int m_BasePressure;
 
-        private bool[] m_GasIsCheck = new bool[9];
+        private bool[] m_GasIsCheck = new bool[12];
+        private int GasIndex = 9;
         public string ModuleName;
         private bool m_GasIsFlowing;
         private bool m_IsAutoMode;
@@ -49,7 +50,6 @@ namespace Venus_MainPages.ViewModels
 
         private bool m_MFC7IsEnable;
         private bool m_MFC8IsEnable;
-
         private JetChamber m_JetChamber;
 
 
@@ -567,7 +567,26 @@ namespace Venus_MainPages.ViewModels
             get { return m_MFC8IsEnable; }
             set { SetProperty(ref m_MFC8IsEnable, value); }
         }
-
+        public bool Valve9Visible
+        {
+            get { return m_Valve9Visible; }
+            set { SetProperty(ref m_Valve9Visible, value); }
+        }
+        public bool Valve10Visible
+        {
+            get { return m_Valve10Visible; }
+            set { SetProperty(ref m_Valve10Visible, value); }
+        }
+        public bool Valve11Visible
+        {
+            get { return m_Valve11Visible; }
+            set { SetProperty(ref m_Valve11Visible, value); }
+        }
+        public bool Valve12Visible
+        {
+            get { return m_Valve12Visible; }
+            set { SetProperty(ref m_Valve12Visible, value); }
+        }
         public bool PV51ValveIsOpen
         {
             get { return m_PV51ValveIsOpen; }
@@ -724,9 +743,10 @@ namespace Venus_MainPages.ViewModels
             m_CheckTime = 180;
             m_LeakRateUpperLimit = 10;
             BasePressure = 100;
-
+            GasIndex = 9;
             
 
+
             addDataKeys();
             
 
@@ -741,7 +761,8 @@ namespace Venus_MainPages.ViewModels
 
         #region 命令方法
         private void OnCheck()
-        {          
+        {
+            ChamberType = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.ChamberType").ToString());
             if (LeakCheckModeSelectedIndex == 0)
             {
                 InvokeClient.Instance.Service.DoOperation($"{ModuleName}.LeakCheck", VentTime, CheckTime, LeakRateUpperLimit);
@@ -749,7 +770,11 @@ namespace Venus_MainPages.ViewModels
             else if (LeakCheckModeSelectedIndex == 1 || LeakCheckModeSelectedIndex == 2)
             {
                 StringBuilder stringBuilder = new StringBuilder();
-                for (int i = 1; i < 9; i++)
+                if (ChamberType==JetChamber.VenusSE|| ChamberType == JetChamber.VenusDE)
+                {
+                    GasIndex = 11;
+                }
+                for (int i = 1; i < GasIndex; i++)
                 {
                     if (GasIsCheck[i] == true)
                     {
@@ -820,9 +845,10 @@ namespace Venus_MainPages.ViewModels
         }
         private void OnLoaded()
         {
+            ChamberType = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.ChamberType").ToString());
             if (m_firstLoadFlag==true)
             {
-                ChamberType = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.ChamberType").ToString());
+                
                 GasIs8 = ChamberType != JetChamber.VenusSE && ChamberType != JetChamber.VenusDE;
                 GasIs12 = ChamberType == JetChamber.VenusSE || ChamberType == JetChamber.VenusDE;
                 var AllLeakCheckDa = QueryDataClient.Instance.Service.GetPMLeakCheckResult(ModuleName);
@@ -833,7 +859,13 @@ namespace Venus_MainPages.ViewModels
                 }
                 MFC7IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas7.Enable");
                 MFC8IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas8.Enable");
-
+                if (GasIs12)
+                {
+                    Valve9Visible = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas9.Enable");
+                    Valve10Visible = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas10.Enable");
+                    Valve11Visible = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas11.Enable");
+                    Valve12Visible = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas12.Enable");
+                }
                 var m_ChamberType = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.ChamberType").ToString());
                 if (m_ChamberType == JetChamber.Kepler2200A || m_ChamberType == JetChamber.Kepler2200B)
                 {

+ 20 - 20
Venus/Venus_MainPages/ViewModels/OverVenusDEViewModel.cs

@@ -1117,9 +1117,9 @@ namespace Venus_MainPages.ViewModels
         public DelegateCommand<object> PinUpDownCommand =>
             _PinUpDownCommand ?? (_PinUpDownCommand = new DelegateCommand<object>(OnPinUpDown));
 
-        private DelegateCommand _SetSRfCommand;
-        public DelegateCommand SetSRfCommand =>
-            _SetSRfCommand ?? (_SetSRfCommand = new DelegateCommand(OnSetSRf));
+        //private DelegateCommand _SetSRfCommand;
+        //public DelegateCommand SetSRfCommand =>
+        //    _SetSRfCommand ?? (_SetSRfCommand = new DelegateCommand(OnSetSRf));
 
         private DelegateCommand _SetBRfCommand;
         public DelegateCommand SetBRfCommand =>
@@ -1194,7 +1194,7 @@ namespace Venus_MainPages.ViewModels
             CurrentModuleRecipes = GetFilesNames(Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes", ModuleName, "Process")).ToList();
 
             DispatcherTimer timer = new DispatcherTimer();
-            timer.Interval = TimeSpan.FromSeconds(0.5);
+            timer.Interval = TimeSpan.FromSeconds(0.1);
             timer.Tick += timer_Tick;
             timer.Start();
         }
@@ -1441,23 +1441,23 @@ namespace Venus_MainPages.ViewModels
             InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetLiftPin", Convert.ToBoolean(upDown));
         }
 
-        private async void OnSetSRf()
-        {
+        //private async void OnSetSRf()
+        //{
 
-            if (SRFData.IsRfOn == true)
-            {
-                InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetSRf", SRFFwdPowerSetpoint, false);
-            }
-            else
-            {
-                if (GasIsFlowing == true)
-                {
-                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.Match}.{AITRfOperation.SetMatchPosition}", SRFMatchC1, SRFMatchC2);
-                    await Task.Delay(100);
-                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetSRf", SRFFwdPowerSetpoint, true);
-                }
-            }
-        }
+        //    if (SRFData.IsRfOn == true)
+        //    {
+        //        InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetSRf", SRFFwdPowerSetpoint, false);
+        //    }
+        //    else
+        //    {
+        //        if (GasIsFlowing == true)
+        //        {
+        //            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.Match}.{AITRfOperation.SetMatchPosition}", SRFMatchC1, SRFMatchC2);
+        //            await Task.Delay(100);
+        //            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetSRf", SRFFwdPowerSetpoint, true);
+        //        }
+        //    }
+        //}
         private async void OnSetBRf()
         {
 

+ 4 - 4
Venus/Venus_MainPages/ViewModels/OverVenusSEViewModel.cs

@@ -1210,7 +1210,7 @@ namespace Venus_MainPages.ViewModels
 
             HeIsPressureMode = true;
             DispatcherTimer timer = new DispatcherTimer();
-            timer.Interval = TimeSpan.FromSeconds(0.5);
+            timer.Interval = TimeSpan.FromSeconds(0.1);
             timer.Tick += timer_Tick;
             timer.Start();
         }
@@ -1284,11 +1284,11 @@ namespace Venus_MainPages.ViewModels
 
                 if (HeIsPressureMode)
                 {
-                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetBacksideHePressure", HeGasSetpoint / 50 * 8000);
+                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetBacksideHePressure", HeGasSetpoint);
                 }
                 else
                 {
-                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetBacksideHeFlow", HeGasSetpoint / 50 * 8000);
+                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetBacksideHeFlow", HeGasSetpoint);
                 }
                 InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ControlValve", (int)ValveType.PVHe3, true);
                 InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ControlValve", (int)ValveType.HeISO, true);
@@ -1470,7 +1470,7 @@ namespace Venus_MainPages.ViewModels
                 {
                     InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.Match}.{AITRfOperation.SetMatchPosition}", SRFMatchC1, SRFMatchC2);
                     InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetSRf", SRFFwdPowerSetpoint, true);
-                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.BiasMatch}.{AITRfOperation.SetMatchProcessMode}", "Auto");
+                    InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.Match}.{AITRfOperation.SetMatchProcessMode}", "Auto");
                 }
             }
         }

+ 33 - 0
Venus/Venus_MainPages/ViewModels/PartialPressureViewModel.cs

@@ -39,6 +39,10 @@ namespace Venus_MainPages.ViewModels
         ObservableCollection<string> m_ReferenceFlow = new ObservableCollection<string>();
         private bool m_MFC7IsEnable;
         private bool m_MFC8IsEnable;
+        private bool m_MFC9IsEnable;
+        private bool m_MFC10IsEnable;
+        private bool m_MFC11IsEnable;
+        private bool m_MFC12IsEnable;
         private bool m_IsAutoMode;
         private PressureType m_PressureType;
 
@@ -90,6 +94,26 @@ namespace Venus_MainPages.ViewModels
             get { return m_MFC8IsEnable; }
             set { SetProperty(ref m_MFC8IsEnable, value); }
         }
+        public bool MFC9IsEnable
+        {
+            get { return m_MFC9IsEnable; }
+            set { SetProperty(ref m_MFC9IsEnable, value); }
+        }
+        public bool MFC10IsEnable
+        {
+            get { return m_MFC10IsEnable; }
+            set { SetProperty(ref m_MFC10IsEnable, value); }
+        }
+        public bool MFC11IsEnable
+        {
+            get { return m_MFC11IsEnable; }
+            set { SetProperty(ref m_MFC11IsEnable, value); }
+        }
+        public bool MFC12IsEnable
+        {
+            get { return m_MFC12IsEnable; }
+            set { SetProperty(ref m_MFC12IsEnable, value); }
+        }
         public bool IsAutoMode
         {
             get { return m_IsAutoMode; }
@@ -227,6 +251,15 @@ namespace Venus_MainPages.ViewModels
             OnSelectGas(1);
             MFC7IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas7.Enable");
             MFC8IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas8.Enable");
+            var jetChamber = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.ChamberType").ToString());
+            if (jetChamber == JetChamber.VenusSE|| jetChamber == JetChamber.VenusDE)
+            {
+                MFC9IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas9.Enable");
+                MFC10IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas10.Enable");
+                MFC11IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas11.Enable");
+                MFC12IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas12.Enable");
+            }
+
         }
         #endregion
     }

+ 41 - 2
Venus/Venus_MainPages/ViewModels/VATPerformanceViewModel.cs

@@ -28,7 +28,12 @@ namespace Venus_MainPages.ViewModels
         VATPerformanceResult m_VATPerformanceResult;
         private bool m_MFC7IsEnable;
         private bool m_MFC8IsEnable;
+        private bool m_MFC9IsEnable;
+        private bool m_MFC10IsEnable;
+        private bool m_MFC11IsEnable;
+        private bool m_MFC12IsEnable;
         private bool m_IsAutoMode;
+        private string m_GasName;
         private PressureType m_PressureType;
 
         #endregion
@@ -74,6 +79,26 @@ namespace Venus_MainPages.ViewModels
             get { return m_MFC8IsEnable; }
             set { SetProperty(ref m_MFC8IsEnable, value); }
         }
+        public bool MFC9IsEnable
+        {
+            get { return m_MFC9IsEnable; }
+            set { SetProperty(ref m_MFC9IsEnable, value); }
+        }
+        public bool MFC10IsEnable
+        {
+            get { return m_MFC10IsEnable; }
+            set { SetProperty(ref m_MFC10IsEnable, value); }
+        }
+        public bool MFC11IsEnable
+        {
+            get { return m_MFC11IsEnable; }
+            set { SetProperty(ref m_MFC10IsEnable, value); }
+        }
+        public bool MFC12IsEnable
+        {
+            get { return m_MFC12IsEnable; }
+            set { SetProperty(ref m_MFC12IsEnable, value); }
+        }
         public bool IsAutoMode
         {
             get { return m_IsAutoMode; }
@@ -106,11 +131,15 @@ namespace Venus_MainPages.ViewModels
         public DelegateCommand LoadCommand =>
             _LoadCommand ?? (_LoadCommand = new DelegateCommand(OnLoad));
         #endregion
-
+        public string GasName
+        {
+            get { return m_GasName; }
+            set { SetProperty(ref m_GasName, value); }
+        }
         #region 构造函数
         public VATPerformanceViewModel()
         {
-            OnSelectGas();
+            //OnSelectGas();
             GasTime = 60;
             timer.Interval = TimeSpan.FromSeconds(2);
             timer.Tick += Timer_Tick;
@@ -122,16 +151,26 @@ namespace Venus_MainPages.ViewModels
         #region 命令方法
         private void OnLoad()
         {
+            MFC7IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas7.Enable");
+            MFC8IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas8.Enable");
             var jetChamber = (JetChamber)Enum.Parse(typeof(JetChamber), QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.ChamberType").ToString());
             if (jetChamber == JetChamber.Kepler2200A || jetChamber == JetChamber.Kepler2200B)
             {
                 PressureType = PressureType.Pa;
+            }else if(jetChamber == JetChamber.VenusSE || jetChamber == JetChamber.VenusDE)
+            {
+                MFC9IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas9.Enable");
+                MFC10IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas10.Enable");
+                MFC11IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas11.Enable");
+                MFC12IsEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas12.Enable");
             }
         }
         private void OnSelectGas()
         {
            var value=Convert.ToInt32( QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas{(GasSelectedIndex+1).ToString()}.MfcN2Scale"));
            var xishu= Convert.ToDouble(QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.MfcGas{(GasSelectedIndex + 1).ToString()}.MfcScaleFactor"));
+           string  mfcname = $"MfcGas{(GasSelectedIndex + 1).ToString()}";
+           GasName = QueryDataClient.Instance.Service.GetConfig($"{ModuleName}.{mfcname}.GasName").ToString();
            GasFlow = (int)(value * xishu) / 2;
         }
         //public enum CMPressure

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 42 - 28
Venus/Venus_MainPages/Views/GasLeakCheckView.xaml


+ 42 - 8
Venus/Venus_MainPages/Views/PartialPressureView.xaml

@@ -44,7 +44,7 @@
             </RadioButton>
            
 
-            <RadioButton Content="Gas2" Canvas.Left="20" Canvas.Top="260" FontSize="15">
+            <RadioButton Content="Gas2" Canvas.Left="20" Canvas.Top="240" FontSize="15">
                 <i:Interaction.Triggers>
                     <i:EventTrigger EventName="Checked">
                         <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
@@ -54,7 +54,7 @@
             </RadioButton>
           
 
-            <RadioButton Content="Gas3" Canvas.Left="20" Canvas.Top="320" FontSize="15">
+            <RadioButton Content="Gas3" Canvas.Left="20" Canvas.Top="280" FontSize="15">
                 <i:Interaction.Triggers>
                     <i:EventTrigger EventName="Checked">
                         <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
@@ -64,7 +64,7 @@
             </RadioButton>
           
 
-            <RadioButton Content="Gas4" Canvas.Left="20" Canvas.Top="380" FontSize="15">
+            <RadioButton Content="Gas4" Canvas.Left="20" Canvas.Top="320" FontSize="15">
                 <i:Interaction.Triggers>
                     <i:EventTrigger EventName="Checked">
                         <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
@@ -74,7 +74,7 @@
             </RadioButton>
           
 
-            <RadioButton Content="Gas5" Canvas.Left="20" Canvas.Top="440" FontSize="15">
+            <RadioButton Content="Gas5" Canvas.Left="20" Canvas.Top="360" FontSize="15">
                 <i:Interaction.Triggers>
                     <i:EventTrigger EventName="Checked">
                         <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
@@ -84,7 +84,7 @@
             </RadioButton>
            
 
-            <RadioButton Content="Gas6" Canvas.Left="20" Canvas.Top="500" FontSize="15">
+            <RadioButton Content="Gas6" Canvas.Left="20" Canvas.Top="400" FontSize="15">
                 <i:Interaction.Triggers>
                     <i:EventTrigger EventName="Checked">
                         <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
@@ -94,7 +94,7 @@
             </RadioButton>
 
 
-            <RadioButton Content="Gas7" Canvas.Left="20" Canvas.Top="560" FontSize="15" Visibility="{Binding MFC7IsEnable,Converter={StaticResource bool2VisibilityConverter}}">
+            <RadioButton Content="Gas7" Canvas.Left="20" Canvas.Top="440" FontSize="15" Visibility="{Binding MFC7IsEnable,Converter={StaticResource bool2VisibilityConverter}}">
                 <i:Interaction.Triggers>
                     <i:EventTrigger EventName="Checked">
                         <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
@@ -104,7 +104,16 @@
             </RadioButton>
 
 
-            <RadioButton Content="Gas8" Canvas.Left="20" Canvas.Top="620" FontSize="15" Visibility="{Binding MFC7IsEnable,Converter={StaticResource bool2VisibilityConverter}}">
+            <RadioButton Content="Gas8" Canvas.Left="20" Canvas.Top="480" FontSize="15" Visibility="{Binding MFC8IsEnable,Converter={StaticResource bool2VisibilityConverter}}">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
+                                   CommandParameter="8"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+            
+            <RadioButton Content="Gas9" Canvas.Left="20" Canvas.Top="520" FontSize="15" Visibility="{Binding MFC9IsEnable,Converter={StaticResource bool2VisibilityConverter}}">
                 <i:Interaction.Triggers>
                     <i:EventTrigger EventName="Checked">
                         <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
@@ -113,7 +122,32 @@
                 </i:Interaction.Triggers>
             </RadioButton>
 
-
+            <RadioButton Content="Gas10" Canvas.Left="20" Canvas.Top="560" FontSize="15" Visibility="{Binding MFC10IsEnable,Converter={StaticResource bool2VisibilityConverter}}">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
+                                   CommandParameter="8"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+            
+            <RadioButton Content="Gas11" Canvas.Left="20" Canvas.Top="600" FontSize="15" Visibility="{Binding MFC11IsEnable,Converter={StaticResource bool2VisibilityConverter}}">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
+                                   CommandParameter="8"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
+            
+            <RadioButton Content="Gas12" Canvas.Left="20" Canvas.Top="640" FontSize="15" Visibility="{Binding MFC12IsEnable,Converter={StaticResource bool2VisibilityConverter}}">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Checked">
+                        <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
+                                   CommandParameter="8"/>
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </RadioButton>
             <customControls:PathButton Content="Start" Canvas.Left="10" Canvas.Top="700"  Width="90" Height="25" Command="{Binding StartCommand}" IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}"/>
             <customControls:PathButton Content="Abort" Canvas.Left="110" Canvas.Top="700" Width="90" Height="25" Command="{Binding AbortCommand}" IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}"/>
 

+ 7 - 1
Venus/Venus_MainPages/Views/VATPerformanceView.xaml

@@ -25,6 +25,8 @@
         </Grid.ColumnDefinitions>
         <Canvas>
             <TextBlock Text="Gas Select:" FontSize="15"  Canvas.Left="40" Canvas.Top="192"/>
+            <TextBlock Text="Gas Name:" FontSize="15"  Canvas.Left="40" Canvas.Top="216" HorizontalAlignment="Center" VerticalAlignment="Top"/>
+            <TextBlock Text="{Binding GasName}" FontSize="15"  Canvas.Left="140" Canvas.Top="216" HorizontalAlignment="Center" VerticalAlignment="Top"/>
             <ComboBox Width="100" Canvas.Left="118" Canvas.Top="190" SelectedIndex="{Binding GasSelectedIndex}" Height="24">
                 <i:Interaction.Triggers>
                     <i:EventTrigger EventName="SelectionChanged">
@@ -40,6 +42,10 @@
                 <ComboBoxItem>Gas6</ComboBoxItem>
                 <ComboBoxItem Visibility="{Binding MFC7IsEnable,Converter={StaticResource bool2VisibilityConverter}}">Gas7</ComboBoxItem>
                 <ComboBoxItem Visibility="{Binding MFC8IsEnable,Converter={StaticResource bool2VisibilityConverter}}">Gas8</ComboBoxItem>
+                <ComboBoxItem Visibility="{Binding MFC9IsEnable,Converter={StaticResource bool2VisibilityConverter}}">Gas9</ComboBoxItem>
+                <ComboBoxItem Visibility="{Binding MFC10IsEnable,Converter={StaticResource bool2VisibilityConverter}}">Gas10</ComboBoxItem>
+                <ComboBoxItem Visibility="{Binding MFC11IsEnable,Converter={StaticResource bool2VisibilityConverter}}">Gas11</ComboBoxItem>
+                <ComboBoxItem Visibility="{Binding MFC12IsEnable,Converter={StaticResource bool2VisibilityConverter}}">Gas12</ComboBoxItem>
             </ComboBox>
             <TextBlock Text="Flow:" FontSize="15"  Canvas.Left="40" Canvas.Top="250"/>
             <TextBox  FontSize="15"  Canvas.Left="80" Canvas.Top="250" Width="60" Text="{Binding GasFlow,UpdateSourceTrigger=PropertyChanged}" BorderThickness="0,0,0,1" Background="Transparent" BorderBrush="Black" HorizontalContentAlignment="Center"/>
@@ -89,7 +95,7 @@
                     <RowDefinition/>
                     <RowDefinition/>
                     <RowDefinition/>
-            
+
                 </Grid.RowDefinitions>
                 <TextBlock Text="Current"      Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                 <TextBlock Text="Reference"    Grid.Column="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>

+ 1 - 1
Venus/Venus_RT/Config/PM/VenusDE/VenusDEDeviceModel.xml

@@ -201,7 +201,7 @@
 			   infoText="" warningText="N2 Pressure Alarm" alarmText="" />
 		<IoSensor id="GeneratorInterlock" display="RFG hardware interlock"  schematicId="" unit="" di="DI_RF_HV_Interlock_OK" isLowAsNormal="" textOutTrigValue="false" infoText="Generator interlock" warningText="" alarmText="" />
 		<IoSensor id="SensorSourceRFFan" display="Bias RF Water Flow Switch"  schematicId="" unit="" di="DI_BIAS_RF_Water_Flow_Switch" isLowAsNormal="" textOutTrigValue="true" infoText="Bias RF Water Flow" warningText="" alarmText="Bias RF Water Flow Error" />
-		<IoSensor id="SensorSlitDoorClosed" display="Slit Door Closed"  schematicId="" unit="" di="DI_TM_Slit_Door_Closed" isLowAsNormal="" textOutTrigValue="false" infoText="" warningText="" alarmText="" />
+		<IoSensor id="SensorLinerDoorClosed" display="Liner Door Closed"  schematicId="" unit="" di="DI_Liner_Door_Close_Position" isLowAsNormal="" textOutTrigValue="false" infoText="" warningText="" alarmText="" />
 		<IoSensor id="TurboPumpInterlock" display="Turbo Pump Interlock"  schematicId="" unit="" di="DI_Turbo_Pump_Interlock" isLowAsNormal="" textOutTrigValue="false" infoText="" warningText="" alarmText="" />
 		<IoSensor id="GasBoxDoorSW" display="Gas Box Door SW"  schematicId="" unit="" di="DI_Gas_Box_Door_Switch" isLowAsNormal="" textOutTrigValue="false" infoText="" warningText="" alarmText="" />
 		<IoSensor id="GasBoxPressureSW" display="Gas Box Pressure SW"  schematicId="" unit="" di="DI_Gas_Box_Pressure_Switch" isLowAsNormal="" textOutTrigValue="false" infoText="" warningText="" alarmText="Gas Box Pressure Alarm" />

+ 11 - 11
Venus/Venus_RT/Config/PM/VenusSE/VenusSEDeviceModel.xml

@@ -169,16 +169,16 @@
 			diPressureAlarm=""/>
   </IoMfcs>
   <IoGasSticks assembly="Venus_RT" classType="Venus_RT.Devices.IoGasStick">
-    <IoGasStick id="GasStick1" display="" mfc ="MfcGas1" downvalve="ValveMfc1" />
-    <IoGasStick id="GasStick2" display="" mfc ="MfcGas2" downvalve="ValveMfc2" />
-    <IoGasStick id="GasStick3" display="" mfc ="MfcGas3" downvalve="ValveMfc3" />
-    <IoGasStick id="GasStick4" display="" mfc ="MfcGas4" downvalve="ValveMfc4" />
-    <IoGasStick id="GasStick5" display="" mfc ="MfcGas5" downvalve="ValveMfc5" />
-    <IoGasStick id="GasStick6" display="" mfc ="MfcGas6" downvalve="ValveMfc6" />
-    <IoGasStick id="GasStick7" display="" mfc ="MfcGas7" downvalve="ValveMfc7" />
-    <IoGasStick id="GasStick8" display="" mfc ="MfcGas8" downvalve="ValveMfc8" />
-    <IoGasStick id="GasStick9" display="" mfc ="MfcGas9" downvalve="ValveMfc9" />
-    <IoGasStick id="GasStick10" display="" mfc ="MfcGas10" downvalve="ValveMfc10" />
+    <IoGasStick id="GasStick1" display="" mfc ="MfcGas1" downvalve="ValveMfc1" upvalve="ValvePV11" />
+    <IoGasStick id="GasStick2" display="" mfc ="MfcGas2" downvalve="ValveMfc2" upvalve="ValvePV21" />
+    <IoGasStick id="GasStick3" display="" mfc ="MfcGas3" downvalve="ValveMfc3" upvalve="ValvePV31"/>
+    <IoGasStick id="GasStick4" display="" mfc ="MfcGas4" downvalve="ValveMfc4" upvalve="ValvePV41"/>
+    <IoGasStick id="GasStick5" display="" mfc ="MfcGas5" downvalve="ValveMfc5" upvalve="ValvePV51"/>
+    <IoGasStick id="GasStick6" display="" mfc ="MfcGas6" downvalve="ValveMfc6" upvalve="ValvePV61"/>
+    <IoGasStick id="GasStick7" display="" mfc ="MfcGas7" downvalve="ValveMfc7" upvalve="ValvePV71"/>
+    <IoGasStick id="GasStick8" display="" mfc ="MfcGas8" downvalve="ValveMfc8" upvalve="ValvePV81"/>
+    <IoGasStick id="GasStick9" display="" mfc ="MfcGas9" downvalve="ValveMfc9" upvalve="ValvePV91"/>
+    <IoGasStick id="GasStick10" display="" mfc ="MfcGas10" downvalve="ValveMfc10" upvalve="ValvePV101"/>
     <IoGasStick id="GasStick11" display="" mfc ="MfcGas11" downvalve="ValveMfc11" />
     <IoGasStick id="GasStick12" display="" mfc ="MfcGas12" downvalve="ValveMfc12" />
     <IoGasStick id="GasStickN2" display="" mfc ="MfcN2" downvalve="ValveTurboPumpPurge" />
@@ -237,7 +237,7 @@
 						   scIsBoostPumpInstalled="EnableBoosterPump"
 						   scTvInstalled="EnableThrottleValve"
 						   boost="" tv="ThrottleValve" drypump="MainPump"
-						   pressureMeter ="PressureGauge" processMeter="ProcessGauge" forelineMeter="ForelineGauge" loadlockMeter="" escHeGauge="ESCHeGauge"/>
+						   pressureMeter ="PressureGauge" processMeter="ProcessGauge" forelineMeter="ForelineGauge" loadlockMeter="" escHeGauge="ESCHeGauge"/>   
   </IoPressureControls>
   <IoHeartbeats assembly="Venus_RT" classType=" Venus_RT.Devices.IODevices.IoHeartbeat">
     <IoHeartbeat  id="Heartbeat" display="" schematicId="" unit="" ao="AO_Heartbeat" ai="AI_Heartbeat_FB" />

+ 0 - 1
Venus/Venus_RT/Config/PM/VenusSE/VenusSEInterlock.xml

@@ -202,7 +202,6 @@
 
   <Action do="DO_N2_Valve" value="true" tip="N2 Valve" tip.zh-CN="" tip.en-US="DO-10" >
     <Limit di="DI_Lid_Closed"		value="true" tip="DI Lid Closed"            tip.zh-CN="" tip.en-US="DI-0" />
-    <Limit di="DI_TM_Slit_Door_Closed"	value="true" tip="DI Slit Door Close POS"   tip.zh-CN="" tip.en-US="DI-59" />
     <Limit di="DI_CDA_Pressure_Switch"			value="true" tip="DI CDA Pressure"          tip.zh-CN="" tip.en-US="DI-12" />
     <Limit di="DI_Gas_Box_Door_Switch"		value="true" tip="DI Gas Box Door SW"		tip.zh-CN="" tip.en-US="DI-51" />
     <Limit di="DI_Gas_Box_Pressure_Switch"	value="true" tip="DI Gas Box Pressure SW"	tip.zh-CN="" tip.en-US="DI-52" />    

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 2839 - 2819
Venus/Venus_RT/Config/System_VenusSE.sccfg


+ 19 - 2
Venus/Venus_RT/Devices/IODevices/IoMfc.cs

@@ -299,7 +299,15 @@ namespace Venus_RT.Devices.IODevices
 
                     if (_writeMode == MFCWriteMode.Flow)
                     {
-                        return flow * Scale / RtInstance.ANALOG_TRANS_RANGE;
+                        if (ModuleHelper.IsPm(Module) && (m_JetChamber == JetChamber.VenusSE || m_JetChamber == JetChamber.VenusDE))
+                        {
+                            return flow;
+                        }
+                        else
+                        {
+                            return flow * Scale / RtInstance.ANALOG_TRANS_RANGE;
+                        }
+                            
                     }
                     else
                     {
@@ -317,7 +325,16 @@ namespace Venus_RT.Devices.IODevices
                     byte[] flow;
                     if (_writeMode == MFCWriteMode.Flow)
                     {
-                        flow = BitConverter.GetBytes((float)(value * RtInstance.ANALOG_TRANS_RANGE / Scale));
+                        if (ModuleHelper.IsPm(Module) && (m_JetChamber == JetChamber.VenusSE || m_JetChamber == JetChamber.VenusDE))
+                        {
+                            flow = BitConverter.GetBytes((float)value );
+
+                        }
+                        else 
+                        {
+                            flow = BitConverter.GetBytes((float)(value * RtInstance.ANALOG_TRANS_RANGE / Scale));
+                        }
+                        
                     }
                     else
                     {

+ 22 - 3
Venus/Venus_RT/Devices/JetPMBase.cs

@@ -19,6 +19,7 @@ namespace Venus_RT.Devices
         public virtual bool IsLidLoadlockClosed { get; }
 
         public abstract bool IsSlitDoorClosed { get; }
+        public virtual bool IsLinerDoorClosed { get; }
 
         public abstract bool IsPumpRunning { get; }
         public abstract bool IsTurboPumpRunning { get; }
@@ -60,6 +61,7 @@ namespace Venus_RT.Devices
         public virtual bool SourceRFFanInterlock { get; }
         public virtual bool SourceRFMatchInterlock { get; }
         public abstract bool SlitDoorClosed { get; }
+        public virtual bool LinerDoorClosed { get; }
         //public virtual double ProcessLowPressure { get; }
         //public virtual double ProcessHighPressure { get; }
         public abstract double ProcessPressure { get; }
@@ -114,7 +116,14 @@ namespace Venus_RT.Devices
         {
             return true;
         }
-
+        public virtual bool CheckLinerDoorOpen()
+        {
+            return true;
+        }
+        public virtual bool CheckLinerDoorClose()
+        {
+            return true;
+        }
         public virtual bool CheckLiftUp()
         {
             return false;
@@ -205,6 +214,7 @@ namespace Venus_RT.Devices
             DATA.Subscribe($"{Name}.PumpIsRunning", () => IsPumpRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe($"{Name}.TurboPumpIsRunning", () => IsTurboPumpRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe($"{Name}.IsSlitDoorClosed", () => IsSlitDoorClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            DATA.Subscribe($"{Name}.IsLinerDoorClosed", () => IsLinerDoorClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe($"{Name}.IsLidClosed", () => IsLidClosed, SubscriptionAttribute.FLAG.IgnoreSaveDB);
 
             DATA.Subscribe($"{Name}.TurboPumpRotationalSpeed", () => TurboPumpSpeed);
@@ -223,7 +233,6 @@ namespace Venus_RT.Devices
             DATA.Subscribe($"{Name}.GetPVPosition", () => GetPVPosition());
 
             DATA.Subscribe($"{Name}.ESCHV.Temp", () => CoolantOutletTempFB);
-
             DATA.Subscribe($"{Name}.Chiller.Temp", () => CoolantInletTempFB);
 
             //DATA.Subscribe($"{Name}.Chiller.IsOn", () => ChillerIsRunning, SubscriptionAttribute.FLAG.IgnoreSaveDB);
@@ -287,6 +296,12 @@ namespace Venus_RT.Devices
                 return true;
             });
 
+            OP.Subscribe($"{Module}.SetLinerDoor", (cmd, args) =>
+            {
+                SetLinerDoor((bool)args[0], out _);
+                return true;
+            });
+
             OP.Subscribe($"{Module}.SetESCHVIsOn", (cmd, args) =>
             {
                 OnOffSetESCHV((bool)args[0]);
@@ -443,7 +458,11 @@ namespace Venus_RT.Devices
             reason = "";
             return false;
         }
-
+        public virtual bool SetLinerDoor(bool open, out string reason)
+        {
+            reason = "";
+            return false;
+        }
         public virtual bool RetractWafer()
         {
             return false;

+ 124 - 13
Venus/Venus_RT/Devices/JetVenusDEPM.cs

@@ -1,4 +1,5 @@
 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.Log;
@@ -27,7 +28,7 @@ namespace Venus_RT.Devices
         #region io变量定义
         private readonly IoLid _Lid;
 
-        private readonly IoCylinder _slitDoor;
+        private readonly IoCylinder _linerDoor;
         private readonly IoCylinder _LiftPin;
 
         private readonly IoValve _PVN21Valve;
@@ -94,7 +95,7 @@ namespace Venus_RT.Devices
         private readonly IoSensor _TurboPumpInterlock;
         private readonly IoSensor _GasBoxDoor;
         private readonly IoSensor _GasBoxPressure;
-
+        private readonly IoSensor _PM_LinerDoor_Closed;
         private readonly PumpBase _MainPump;
         private readonly ESC5HighVoltage _ESCHV;
         private readonly AdixenTurboPump _TurboPump;
@@ -129,7 +130,7 @@ namespace Venus_RT.Devices
             Module = moduleName;
             _Lid = DEVICE.GetDevice<IoLid>($"{Module}.{VenusDevice.Lid}");
             _LiftPin = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LiftPin}");
-            _slitDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LinerDoor}");
+            _linerDoor = DEVICE.GetDevice<IoCylinder>($"{Module}.{VenusDevice.LinerDoor}");
             _PVN21Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN21}");
             _PVN22Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVN22}");
             _PV11Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePV11}");
@@ -156,7 +157,7 @@ namespace Venus_RT.Devices
             _PVB2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVB2}");
             _PVC1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVC1}");
             _PVC2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValvePVC2}");
-
+            _PM_LinerDoor_Closed = DEVICE.GetDevice<IoSensor>($"{Module}.SensorLinerDoorClosed");
             _N2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveN2}");
             _Mfc1Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc1}");
             _Mfc2Valve = DEVICE.GetDevice<IoValve>($"{Module}.{VenusDevice.ValveMfc2}");
@@ -366,7 +367,7 @@ namespace Venus_RT.Devices
 
             }
         }
-
+        public override bool IsLinerDoorClosed => !_linerDoor.ONFeedback && _linerDoor.OFFFeedback;
         public override bool IsPumpRunning => _MainPump.IsRunning;
 
         public override bool IsTurboPumpRunning => _TurboPump.IsRunning;
@@ -433,6 +434,7 @@ namespace Venus_RT.Devices
         public override bool TurboPumpInterlock => _TurboPumpInterlock.Value;
 
         public override bool SourceRFFanInterlock => _Source_RF_Fan.Value;
+        public override bool LinerDoorClosed => _PM_LinerDoor_Closed.Value;
 
         public override bool SlitDoorClosed
         {
@@ -619,7 +621,17 @@ namespace Venus_RT.Devices
             //检查是否是ATM模式
             return _ATM_sw.Value && ChamberPressure > 700000;
         }
-
+        public override void RTCloseEvent()
+        {
+            if (_GeneratorBias.IsPowerOn)
+            {
+                GeneratorBiasPowerOn(false);
+            }
+            if (PendulumValveIsOpen())
+            {
+                TurnPendulumValve(false);
+            }
+        }
         public override bool CheckChillerStatus()
         {
             return _Chiller != null /*&& _Chiller.IsRunning*/ && !_Chiller.IsError;
@@ -664,6 +676,11 @@ namespace Venus_RT.Devices
                 return false;
             }
 
+            if (!LinerDoorClosed)
+            {
+                LOG.Write(evt, Module, $"Cannot Power ON {device} as Liner Door is open.");
+                return false;
+            }
             if ((device == VenusDevice.ESCHV || device == VenusDevice.BiasRf) && WaferManager.Instance.CheckNoWafer(Module, 0))
             {
                 LOG.Write(evt, Module, $"Cannot Power ON {device} as {Module} has no wafer");
@@ -673,6 +690,49 @@ namespace Venus_RT.Devices
             return true;
         }
 
+
+        public override bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
+        {
+            if (_BiasMatch == null) return false;
+            if (matchWorkMode == MatchWorkMode.Auto)
+            {
+                return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
+            }
+            else if (matchWorkMode == MatchWorkMode.Manual)
+            {
+                return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
+            }
+            return false;
+        }
+        public override bool StartControlPressure(int pressureSetpoint, int flowSetpoint)
+        {
+            OpenValve(ValveType.TurboPumpPumping, true);
+            if (_TurboPumpPumpingValve.Status)
+            {
+                OpenValve(ValveType.Purge, true);
+                OpenValve(ValveType.GasFinal, false);
+                OpenValve(ValveType.N2, true);
+                OpenValve(ValveType.PVN22, true);
+                //FlowGas(12, flowSetpoint);
+                TurnPendulumValve(true);
+                SetPVPressure(pressureSetpoint);
+                return true;
+            }
+            else
+            {
+                LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"cannot control pressure,cause Turbo Pump Pumping Valve is Close");
+                return true;
+            }
+        }
+        public async override Task<bool> AbortControlPressure()
+        {
+            OpenValve(ValveType.PVN22, false);
+            OpenValve(ValveType.N2, false);
+            await Task.Delay(2000);
+            OpenValve(ValveType.GasFinal, false);
+            OpenValve(ValveType.Purge, false);
+            return true;
+        }
         public override void CheckIdleInterlock()
         {
             if (ForelinePressure > _foreline_interlock_pressure)
@@ -697,12 +757,20 @@ namespace Venus_RT.Devices
         {
             return _LiftPin.State == CylinderState.Open;
         }
+        public override  bool CheckLinerDoorOpen()
+        {
+            return _linerDoor.State == CylinderState.Open;
+        }
 
+        public override  bool CheckLinerDoorClose()
+        {
+            return _linerDoor.State == CylinderState.Close;
+        }
         public override bool CheckSlitDoorClose()
-        => IsSlitDoorClosed;
+        => IsSlitDoorClosed && IsLinerDoorClosed;
 
         public override bool CheckSlitDoorOpen()
-        => !IsSlitDoorClosed;
+        => !IsSlitDoorClosed && !IsLinerDoorClosed;
 
         public override void CloseValves(int? delayTime = null)
         {
@@ -867,7 +935,17 @@ namespace Venus_RT.Devices
             {
                 SetSlitDoor(false, out _);
             }
-            
+
+            if (_linerDoor.State == CylinderState.Open)
+            {
+                SetLinerDoor(true, out _);
+            }
+            else
+            {
+                SetLinerDoor(false, out _);
+            }
+
+            SetLinerDoor(false, out _);
             //SetSlitDoor(false, out _);
             OpenValve(ValveType.PVN22, false);
         }
@@ -1000,6 +1078,35 @@ namespace Venus_RT.Devices
             OP.DoOperation($"{ModuleName.SETM}.SetSlitDoor",Module,open);
             return true;
         }
+        public override bool SetLinerDoor(bool open, out string reason)
+        {
+            if (open)
+            {
+                if (RouteManager.IsATMMode)
+                {
+                    if (!IsATM)
+                    {
+                        reason = $"{Module} is not ATM, can not open slit door";
+                        LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
+                        return false;
+                    }
+                }
+                //else
+                //{
+
+                //    double maxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
+                //    if (Math.Abs(TMPressure - ChamberPressure) > maxPressureDifference)
+                //    {
+                //        reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{ChamberPressure}";
+                //        LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
+                //        return false;
+                //    }
+                //}
+
+            }
+
+            return _linerDoor.SetCylinder(open, out reason);
+        }
 
         public override bool SetWallTCTemperature(float value)
         => _WallTC.RampTemp(value);
@@ -1052,7 +1159,7 @@ namespace Venus_RT.Devices
 
             }
             //
-            if (!_slitDoor.SetCylinder(true, out reason))
+            if (!SetLinerDoor(true, out reason))
             {
                 LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Open failed:{reason}");
                 return false;
@@ -1081,11 +1188,11 @@ namespace Venus_RT.Devices
         }
         public override bool PreparePlaceIsOK()
         {
-            return CheckSlitDoorOpen() && LiftPinIsDown;
+            return CheckSlitDoorOpen() && LiftPinIsDown && CheckLinerDoorOpen();
         }
         public override bool PreparePickIsOK()
         {
-            return CheckSlitDoorOpen() && LiftPinIsUp;
+            return CheckSlitDoorOpen() && LiftPinIsUp && CheckLinerDoorOpen();
         }
         public override bool EndPlace()
         {
@@ -1100,7 +1207,11 @@ namespace Venus_RT.Devices
                 LOG.Write(eEvent.ERR_PM, Module, $"Set Slit Door Close failed:{reason}");
                 return false;
             }
-
+            if (!SetLinerDoor(false, out reason))
+            {
+                LOG.Write(eEvent.ERR_PM, Module, $"Set Liner Door Close failed:{reason}");
+                return false;
+            }
             return true;
         }
 

+ 49 - 9
Venus/Venus_RT/Devices/JetVenusSEPM.cs

@@ -744,7 +744,7 @@ namespace Venus_RT.Devices
             _PV32Valve.TurnValve(false, out _);
             _PV41Valve.TurnValve(false, out _);
             _PV42Valve.TurnValve(false, out _);
-
+                       
             _PVHe1Valve.TurnValve(false, out _);
             _PVHe2Valve.TurnValve(false, out _);
             _GasFinalValve.TurnValve(false, out _);
@@ -791,6 +791,7 @@ namespace Venus_RT.Devices
             _PVB2Valve.TurnValve(false, out _);
             _PVC1Valve.TurnValve(false, out _);
             _PVC2Valve.TurnValve(false, out _);
+            _PVN22Valve.TurnValve(false, out _);
 
             foreach (var stick in _gasLines)
             {
@@ -818,7 +819,21 @@ namespace Venus_RT.Devices
             _gasLineN2.Flow(val);
             return true;
         }
-
+        public override void RTCloseEvent()
+        {
+            if (_Generator.IsPowerOn)
+            {
+                GeneratorPowerOn(false);
+            }
+            if (_GeneratorBias.IsPowerOn)
+            {
+                GeneratorBiasPowerOn(false);
+            }
+            if (PendulumValveIsOpen())
+            {
+                TurnPendulumValve(false);
+            }
+        }
         public override bool GeneratorBiasPowerOn(bool on)
         {
             if (_GeneratorBias == null) return false;
@@ -839,7 +854,32 @@ namespace Venus_RT.Devices
             _GeneratorBias.SetMatchingAutoMode(val, out reason);
             return true;
         }
+        public override bool SetMatchWorkMode(MatchWorkMode matchWorkMode)
+        {
+            if (_Match == null) return false;
+            if (matchWorkMode == MatchWorkMode.Auto)
+            {
+                return _Match.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
+            }
+            else
+            {
+                return _Match.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
+            }
+        }
 
+        public override bool SetBiasMatchWorkMode(MatchWorkMode matchWorkMode)
+        {
+            if (_BiasMatch == null) return false;
+            if (matchWorkMode == MatchWorkMode.Auto)
+            {
+                return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Auto, out _);
+            }
+            else if (matchWorkMode == MatchWorkMode.Manual)
+            {
+                return _BiasMatch.SetMatchMode(EnumRfMatchTuneMode.Manual, out _);
+            }
+            return false;
+        }
         public override bool GeneratorBiasSetpower(float val)
         {
             if (_GeneratorBias == null) return false;
@@ -926,11 +966,11 @@ namespace Venus_RT.Devices
         }
 
         public async override Task<bool> AbortControlPressure()
-        {
-            OpenValve(ValveType.N2, false);
+        {           
             OpenValve(ValveType.PVN22, false);
-            await Task.Delay(500);
-            //OpenValve(ValveType.GasFinal, false);
+            OpenValve(ValveType.N2, false);
+            await Task.Delay(2000);
+            OpenValve(ValveType.GasFinal, false);
             OpenValve(ValveType.PV14, false);
             return true;
         }
@@ -1167,8 +1207,8 @@ namespace Venus_RT.Devices
             CheckPermanentInterlock();
 
             //2024-02-20 17:11:16 朱永吉确认所有气不流后关闭rf 任意一管打开都不关闭
-            if (_isAllGasOff)
-                GasRFInterlock();
+            if (_isAllGasOff) { }
+                //GasRFInterlock();
 
 
         }
@@ -1178,7 +1218,7 @@ namespace Venus_RT.Devices
 
         private void GasRFInterlock()
         {
-            if(_Generator.IsPowerOn)
+            if (_Generator.IsPowerOn)
             {
                 LOG.Write(eEvent.WARN_DEVICE_INFO, Module, $"ALL Gas are not flowing. Source RF will Power Off");
                 GeneratorPowerOn(false);

+ 8 - 7
Venus/Venus_RT/Devices/PendulumValve.cs

@@ -170,7 +170,7 @@ namespace Venus_RT.Devices
         public bool IsOpen { get; private set; }
 
         private readonly string EOF = "\r\n";
-        private readonly int _readInterval = 1000;
+        private readonly int _readInterval = 100;
         private readonly int _position_unit = 100;
         private readonly float _pressure_ful_range = 500;
         private readonly int _foreLinePressureLimit = 750;
@@ -306,20 +306,21 @@ namespace Venus_RT.Devices
                 {
                     case "P":
                         {
-                            int pressure;
-                            if (int.TryParse(data[1], out pressure))
+                            Double pressure;
+                            if (Double.TryParse(data[1], out pressure))
                             {
                                 if ((m_JetChamber == JetChamber.Kepler2200A || m_JetChamber == JetChamber.Kepler2200B))
                                 {
-                                    Pressure =Convert.ToSingle( ConvertPressureUnit.ConvertPaTomtorr( pressure * _pressure_ful_range / 1000000));
+                                    Pressure = Convert.ToSingle(ConvertPressureUnit.ConvertPaTomtorr(pressure * _pressure_ful_range / 1000000));
+                                    //Pressure = pressure * _pressure_ful_range / 1000000;
                                 }
-								else if(m_JetChamber == JetChamber.VenusSE || m_JetChamber == JetChamber.VenusDE)
+                                else if (m_JetChamber == JetChamber.VenusSE || m_JetChamber == JetChamber.VenusDE)
                                 {
-                                    Pressure = pressure / 100 ;
+                                    Pressure = Convert.ToSingle(pressure) / 100;
                                 }
                                 else
                                 {
-                                    Pressure = pressure * _pressure_ful_range / 1000000;
+                                    Pressure = Convert.ToSingle(pressure) * _pressure_ful_range / 1000000;
                                 }
                             }
                                 

+ 8 - 1
Venus/Venus_RT/Modules/PMs/GasBoxLeakCheckRoutine.cs

@@ -77,8 +77,11 @@ namespace Venus_RT.Modules.PMs
                 if (_chamber.ChamberType == JetChamber.Kepler2200A || _chamber.ChamberType == JetChamber.Kepler2200B)
                 {
                     allGas = 6;
+                }else if (_chamber.ChamberType == JetChamber.VenusSE || _chamber.ChamberType == JetChamber.VenusDE)
+                {
+                    allGas = 10;
                 }
-                foreach(string num in lineNums)
+                    foreach (string num in lineNums)
                 {
                     if(int.TryParse(num, out nNum))
                     {
@@ -214,6 +217,10 @@ namespace Venus_RT.Modules.PMs
             _chamber.OpenValve(ValveType.PV21, false);
             _chamber.OpenValve(ValveType.PV31, false);
             _chamber.OpenValve(ValveType.PV41, false);
+            if(_chamber.ChamberType==JetChamber.VenusSE|| _chamber.ChamberType == JetChamber.VenusDE)
+            {
+                _chamber.OpenValve(ValveType.PVN22, false);
+            }
             pMLeakCheckResult.LeakCheckTime = (int)_routineTimer.ElapsedMilliseconds / 1000;
             //SerializeHelper.Instance.WriteToJsonFile<PMLeakCheckResult>(pMLeakCheckResult, $"LeakCheck/PM/{DateTime.Now.ToString("yyyyMMddHHmm")}.json");
 

+ 5 - 1
Venus/Venus_RT/Modules/PMs/PMHomeRoutine.cs

@@ -54,10 +54,14 @@ namespace Venus_RT.Modules.PMs
                 return _chamber.IsSlitDoorClosed && _chamber.PVN22ValveIsOpen;
 
             }
-            else if(_chamber.ChamberType == JetChamber.VenusSE || _chamber.ChamberType == JetChamber.VenusDE) 
+            else if(_chamber.ChamberType == JetChamber.VenusSE ) 
             {
                 return _chamber.IsSlitDoorClosed && _chamber.LiftPinPosition == Venus_Core.MovementPosition.Down;
             }
+            else if ( _chamber.ChamberType == JetChamber.VenusDE)
+            {
+                return _chamber.IsSlitDoorClosed && _chamber.LiftPinPosition == Venus_Core.MovementPosition.Down;//&& _chamber.IsLinerDoorClosed
+            }
             return false;
         }
     }

+ 16 - 4
Venus/Venus_RT/Modules/PMs/PMPartialPressureRoutine.cs

@@ -82,13 +82,25 @@ namespace Venus_RT.Modules.PMs
 
         private bool SetGasPoint()
         {
-            if (gasIndex <= 4)
+            if (_chamber.ChamberType == JetChamber.VenusDE || _chamber.ChamberType == JetChamber.VenusSE)
             {
+                valveTypes = new ValveType[12] { ValveType.PV11, ValveType.PV21, ValveType.PV31, ValveType.PV41, ValveType.PV51, ValveType.PV61, ValveType.PV71, ValveType.PV81, ValveType.PV91, ValveType.PVA1, ValveType.PVB1, ValveType.PVC1, }; 
                 _chamber.OpenValve(valveTypes[gasIndex - 1], true);
+                _chamber.OpenValve(ValveType.GasFinal, true);
+                _chamber.FlowGas(gasIndex - 1, GasMaxScale * 0.1 * counter);
+                return true;
             }
-            _chamber.OpenValve(ValveType.GasFinal, true);
-            _chamber.FlowGas(gasIndex - 1, GasMaxScale * 0.1 * counter);
-            return true;
+            else
+            {
+                if (gasIndex <= 4)
+                {
+                    _chamber.OpenValve(valveTypes[gasIndex - 1], true);
+                }
+                _chamber.OpenValve(ValveType.GasFinal, true);
+                _chamber.FlowGas(gasIndex - 1, GasMaxScale * 0.1 * counter);
+                return true;
+            }
+
         }
 
         private bool ReadChamberPressure()

+ 2 - 2
Venus/Venus_RT/Modules/PMs/PMProcessRoutine.cs

@@ -547,7 +547,7 @@ namespace Venus_RT.Modules.PMs
             _chamber.OpenValve(ValveType.TurboPumpPurge, true);
             _chamber.OpenValve(ValveType.Guage, true);
             _chamber.SetPVPostion(1000);
-            if (_jetChamber == JetChamber.Venus && _chamber.IsHVOn == true)
+            if ((_jetChamber == JetChamber.Venus || _chamber.ChamberType == JetChamber.VenusSE )&& _chamber.IsHVOn == true)
             {
                 _chamber.OnOffSetESCHV(false);
             }
@@ -590,7 +590,7 @@ namespace Venus_RT.Modules.PMs
             CloseAllValves();
             _chamber.OpenValve(ValveType.TurboPumpPumping, true);
             _chamber.OpenValve(ValveType.TurboPumpPurge, true);
-            if (_chamber.ChamberType == JetChamber.Venus)
+            if (_chamber.ChamberType == JetChamber.Venus|| _chamber.ChamberType == JetChamber.VenusSE)
             {
                 await Task.Delay(3000);
                 _chamber.OnOffSetESCHV(false);

+ 9 - 0
Venus/Venus_RT/Modules/PMs/PMRoutineBase.cs

@@ -45,7 +45,16 @@ namespace Venus_RT.Modules.PMs
                 Stop("传送门必须关");
                 return false;
             }
+            if (_chamber.ChamberType== JetChamber.VenusDE)
+            {
+                if (!_chamber.IsLinerDoorClosed)
+                {
+                    Stop("Liner door 必须关");
+                    return false;
+                }
+            }
             return true;
+
         }
 
         protected bool CheckDryPump()

+ 16 - 4
Venus/Venus_RT/Modules/PMs/PMVATPerformanceRoutine.cs

@@ -24,7 +24,7 @@ namespace Venus_RT.Modules.PMs
         public int counter;
         int gasTime;
         int gasSetPoint;
-        ValveType[] valveTypes = new ValveType[4] { ValveType.PV11, ValveType.PV21, ValveType.PV31, ValveType.PV41 };
+        ValveType[] valveTypes = new ValveType[4] { ValveType.PV11, ValveType.PV21, ValveType.PV31, ValveType.PV41 };//ValveType.PV11, ValveType.PV21, ValveType.PV31, ValveType.PV41,ValveType.PV51,ValveType.PV61,ValveType.PV71,ValveType.PV81, ValveType.PV91, ValveType.PVA1, ValveType.PVB1, ValveType.PVC1,
         List<int> Positions = new List<int>() {50,100,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850,900,950,1000};
         public VATPerformanceResult m_VATPerformanceResult;
         private CMPressure currentCMPressure = CMPressure.CM1;
@@ -91,12 +91,24 @@ namespace Venus_RT.Modules.PMs
             { 
             return false;
             }
-            if (gasIndex <= 4)
+            if (_chamber.ChamberType==JetChamber.VenusDE|| _chamber.ChamberType == JetChamber.VenusSE) 
             {
+                valveTypes = new ValveType[12] { ValveType.PV11, ValveType.PV21, ValveType.PV31, ValveType.PV41, ValveType.PV51, ValveType.PV61, ValveType.PV71, ValveType.PV81, ValveType.PV91, ValveType.PVA1, ValveType.PVB1, ValveType.PVC1, };
                 _chamber.OpenValve(valveTypes[gasIndex - 1], true);
+
+                _chamber.OpenValve(ValveType.GasFinal, true);
+                _chamber.FlowGas(gasIndex - 1, gasSetPoint);
             }
-            _chamber.OpenValve(ValveType.GasFinal, true);
-            _chamber.FlowGas(gasIndex - 1, gasSetPoint);
+            else
+            {
+                if (gasIndex <= 4)
+                {
+                    _chamber.OpenValve(valveTypes[gasIndex - 1], true);
+                }
+                _chamber.OpenValve(ValveType.GasFinal, true);
+                _chamber.FlowGas(gasIndex - 1, gasSetPoint);
+            }
+
             return true;
         }
 

+ 52 - 9
Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPMPickRoutine.cs

@@ -1,4 +1,6 @@
-using Aitex.Core.RT.Log;
+using Aitex.Core.RT.DataCenter;
+using Aitex.Core.RT.Device;
+using Aitex.Core.RT.Log;
 using Aitex.Core.RT.Routine;
 using Aitex.Core.RT.SCCore;
 using Aitex.Core.Util;
@@ -13,8 +15,11 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Interop;
 using Venus_Core;
 using Venus_RT.Devices;
+using Venus_RT.Devices.IODevices;
 using Venus_RT.Modules.PMs;
 
 namespace Venus_RT.Modules.TM.VenusEntity
@@ -24,6 +29,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
         private enum PickStep
         {
             WaitPMReady,
+            WaitforControlPressure,
             PMPrepare,
             ArmExtend,
             QueryAWC,
@@ -40,19 +46,21 @@ namespace Venus_RT.Modules.TM.VenusEntity
         private readonly ITransferRobot _robot;
         private int _picktimeout = 60 * 1000;//1 min
         private int _pickdelay = 0;
-
         private ModuleName _targetModule;
         private Hand _hand;
         private int _targetSlot;
         private PMEntity _pmModule;
-        private int _ExtendTimeout = 120 *1000;
+        private int _ExtendTimeout = 120 * 1000;
         private int _RetractTimeout = 120 * 1000;
-        //private JetChamber _chamber;
-
+        private JetPMBase _chamber;
+        private bool NeedControlPressure;
+        private int _controlPressureSetPoint = 90;
+        private int _controlFlowSetPoint = 10;
+        string _chambertype;
         //private DateTime _starttime;
         private bool _queryAwc;
 
-        public SEMFPMPickRoutine(HongHuTM honghutm,ITransferRobot robot) : base(ModuleName.TMRobot)
+        public SEMFPMPickRoutine(HongHuTM honghutm, ITransferRobot robot) : base(ModuleName.TMRobot)
         {
             _tm = honghutm;
             _robot = robot;
@@ -94,14 +102,21 @@ namespace Venus_RT.Modules.TM.VenusEntity
                 LOG.Write(eEvent.ERR_TM, Module, $"Cannot pick as {_targetModule} Slot {_targetSlot + 1} has no wafer");
                 return RState.Failed;
             }
-            
+
             var wafer = WaferManager.Instance.GetWafer(_targetModule, _targetSlot);
             LOG.Write(eEvent.INFO_TM_ROBOT, ModuleName.TMRobot, $"{wafer.WaferOrigin} will be move from {_targetModule} {_targetSlot + 1} to TM Robot {_hand}");
 
             _ExtendTimeout = SC.GetValue<int>("SETM.ExtendTimeout") * 1000;
             _RetractTimeout = SC.GetValue<int>("SETM.RetractTimeout") * 1000;
             _pickdelay = SC.GetValue<int>($"{_targetModule}.PickDelayTime");
-
+            if (Singleton<RouteManager>.Instance.GetPM(_targetModule).IsOnline)
+            {
+                NeedControlPressure = true;
+            }
+            else
+            {
+                NeedControlPressure = false;
+            }
             Reset();
             return Runner.Start(Module, $"Pick from {_targetModule}");
         }
@@ -109,6 +124,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
         public RState Monitor()
         {
             Runner.Wait(PickStep.WaitPMReady, () => _pmModule.IsIdle, _delay_60s)
+                        .RunIf(PickStep.WaitforControlPressure, NeedControlPressure, StartControlPressure, IsPressureReady, _delay_60s)
                         .Run(PickStep.PMPrepare, ModulePrepare, IsModulePrepareReady)
                         .Run(PickStep.ArmExtend, ArmExtend, WaitRobotExtendDone, _ExtendTimeout)
                         .Run(PickStep.QueryAWC, QueryAWC, WaitRobotQueryDone, _delay_1s)
@@ -119,7 +135,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
                         .Run(PickStep.NotifyDone, NotifyPMDone, _delay_50ms)
                         .Delay(PickStep.PickDelay, _delay_50ms)
                         .Run(PickStep.CloseSlitDoor, PMDoorClose, WaitPMDoorClose)
-                        .End(PickStep.EndDelay,NullFun, _delay_50ms);
+                        .End(PickStep.EndDelay, NullFun, _delay_50ms);
 
 
             return Runner.Status;
@@ -164,10 +180,35 @@ namespace Venus_RT.Modules.TM.VenusEntity
             else
             {
                 Runner.Stop($"TM Robot Pick Extend failed, {_robot.Status}");
+                Singleton<RouteManager>.Instance.GetPM(_targetModule).PostMsg(PMEntity.MSG.Error);
                 return true;
             }
         }
+        private bool IsPressureReady()
+        {
+            double ControlPressure = SC.GetValue<int>($"{_targetModule}.ControlPressureSetPoint");
+            //double PMPressure = Singleton<RouteManager>.Instance.GetPM(_targetModule).ChamberPressure;
+            double PMPressure = (double)DATA.Poll($"{_targetModule}.ChamberPressure");
+            double range = SC.GetValue<int>($"{_targetModule}.ControlPressureOffset");
+            if ((PMPressure >= (ControlPressure - range)) && (PMPressure <= (ControlPressure + range)))
+            {
 
+                //LOG.Write(eEvent.WARN_DEFAULT_WARN, _targetModule, "current pmpressure"+PMPressure);
+                //LOG.Write(eEvent.WARN_DEFAULT_WARN, _targetModule, "DATA current pmpressure"+DATA.Poll($"{_targetModule}.ChamberPressure"));
+                //string reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{PMPressure}";
+                //LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
+                return true;
+            }
+            else return false;
+        }
+        private bool StartControlPressure()
+        {
+            _chamber = DEVICE.GetDevice<JetPMBase>(_targetModule.ToString());
+            _controlPressureSetPoint = SC.GetValue<int>($"{_targetModule}.ControlPressureSetPoint");
+            _controlFlowSetPoint = SC.GetValue<int>($"{_targetModule}.ControlPressureN2FlowSetPoint");
+            _chamber.StartControlPressure(_controlPressureSetPoint, _controlFlowSetPoint);
+            return true;
+        }
         private bool QueryAWC()
         {
             if (!_queryAwc)
@@ -192,6 +233,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
             else
             {
                 Runner.Stop($"TM Robot Query Awc failed, {_robot.Status}");
+                Singleton<RouteManager>.Instance.GetPM(_targetModule).PostMsg(PMEntity.MSG.Error);
                 return true;
             }
         }
@@ -229,6 +271,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
             else
             {
                 Runner.Stop($"TM Robot Pick Retract failed, {_robot.Status}");
+                Singleton<RouteManager>.Instance.GetPM(_targetModule).PostMsg(PMEntity.MSG.Error);
                 return true;
             }
         }

+ 4 - 1
Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPMPlaceRoutine.cs

@@ -52,7 +52,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
         private DateTime _starttime;
         private bool _queryAwc;
 
-        public SEMFPMPlaceRoutine(HongHuTM honghutm,ITransferRobot robot) : base(ModuleName.TMRobot)
+        public SEMFPMPlaceRoutine(HongHuTM honghutm, ITransferRobot robot) : base(ModuleName.TMRobot)
         {
             _TM = honghutm;
             _robot = robot;
@@ -171,6 +171,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
             else
             {
                 Runner.Stop($"TM Robot Place Extend failed, {_robot.Status}");
+                Singleton<RouteManager>.Instance.GetPM(_targetModule).PostMsg(PMEntity.MSG.Error);
                 return true;
             }
         }
@@ -211,6 +212,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
             else
             {
                 Runner.Stop($"TM Robot Query Awc failed, {_robot.Status}");
+                Singleton<RouteManager>.Instance.GetPM(_targetModule).PostMsg(PMEntity.MSG.Error);
                 return true;
             }
         }
@@ -240,6 +242,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
             else
             {
                 Runner.Stop($"TM Robot Place Retract failed, {_robot.Status}");
+                Singleton<RouteManager>.Instance.GetPM(_targetModule).PostMsg(PMEntity.MSG.Error);
                 return true;
             }
         }

+ 46 - 1
Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPMSwapRoutine.cs

@@ -1,4 +1,5 @@
 using Aitex.Core.Common.DeviceData;
+using Aitex.Core.RT.DataCenter;
 using Aitex.Core.RT.Device;
 using Aitex.Core.RT.Log;
 using Aitex.Core.RT.Routine;
@@ -13,6 +14,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows.Documents;
 using Venus_Core;
 using Venus_RT.Devices;
 using Venus_RT.Modules.PMs;
@@ -24,6 +26,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
         private enum SwapStep
         {
             WaitPMReady,
+            WaitforControlPressure,
             PreRotation,
             PickPrepare,
             PickExtend,
@@ -51,6 +54,10 @@ namespace Venus_RT.Modules.TM.VenusEntity
         private int _targetSlot;
         private Hand _pickHand;
         private Hand _placeHand;
+        private JetPMBase _chamber;
+        private bool NeedControlPressure;
+        private int _controlPressureSetPoint = 90;
+        private int _controlFlowSetPoint = 90;
 
         public SEMFPMSwapRoutine(HongHuTM tm, ITransferRobot robot) : base(ModuleName.TMRobot)
         {
@@ -71,6 +78,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
             _targetSlot = swapItem.Peek().SourceSlot;
             _pickHand = swapItem.Peek().RobotHand;
             _placeHand = _pickHand == Hand.Blade2 ? Hand.Blade1 : Hand.Blade2;
+
             if (ModuleHelper.IsPm(_targetModule) && ModuleHelper.IsInstalled(_targetModule))
             {
                 _pmModule = Singleton<RouteManager>.Instance.GetPM(_targetModule);
@@ -103,7 +111,14 @@ namespace Venus_RT.Modules.TM.VenusEntity
             _swapingTimeout = SC.GetValue<int>($"SETM.SwapTimeout") * 1000;
             _pickDelayTime = SC.GetValue<int>($"{_targetModule}.PickDelayTime");
             _placeDelayTime = SC.GetValue<int>($"{_targetModule}.PlaceDelayTime");
-
+            if (Singleton<RouteManager>.Instance.GetPM(_targetModule).IsOnline)
+            {
+                NeedControlPressure = true;
+            }
+            else
+            {
+                NeedControlPressure = false;
+            }
             return Runner.Start(Module, $"Swap with {_targetModule}");
 
         }
@@ -111,6 +126,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
         public RState Monitor()
         {
             Runner.Wait(SwapStep.WaitPMReady, () => _pmModule.IsIdle, _delay_60s)
+                 .RunIf(SwapStep.WaitforControlPressure, NeedControlPressure, StartControlPressure, IsPressureReady, _delay_60s)
                 //.RunIf(SwapStep.PreRotation, _JetTM.PreRotateModules.ContainsKey(_targetModule), RotateArm, WaitRotateDone)
                 .Run(SwapStep.PickPrepare, PickPrepare, IsModuleReadyForPick)
                 .Run(SwapStep.PickExtend, PickExtend, WaitRobotExtendDone)
@@ -131,6 +147,33 @@ namespace Venus_RT.Modules.TM.VenusEntity
             return Runner.Status;
         }
 
+        private bool StartControlPressure()
+        {
+            _chamber = DEVICE.GetDevice<JetPMBase>(_targetModule.ToString());
+            _controlPressureSetPoint = SC.GetValue<int>($"{_targetModule}.ControlPressureSetPoint");
+            _controlFlowSetPoint = SC.GetValue<int>($"{_targetModule}.ControlPressureN2FlowSetPoint");
+            _chamber.StartControlPressure(_controlPressureSetPoint, _controlFlowSetPoint);
+            return true;
+        }
+
+        private bool IsPressureReady()
+        {
+            double ControlPressure = SC.GetValue<int>($"{_targetModule}.ControlPressureSetPoint");
+            //double PMPressure = Singleton<RouteManager>.Instance.GetPM(_targetModule).ChamberPressure;
+            double PMPressure = (double)DATA.Poll($"{_targetModule}.ChamberPressure");
+            double range = SC.GetValue<int>($"{_targetModule}.ControlPressureOffset");
+            if ((PMPressure >= (ControlPressure - range)) && (PMPressure <= (ControlPressure + range)))
+            {
+
+                //LOG.Write(eEvent.WARN_DEFAULT_WARN, _targetModule, "current pmpressure" + PMPressure);
+                //LOG.Write(eEvent.WARN_DEFAULT_WARN, _targetModule, "DATA current pmpressure" + DATA.Poll($"{_targetModule}.ChamberPressure"));
+                //string reason = $"{Module} and TM pressure difference exceeds the max limit {maxPressureDifference}, TMPressure:{TMPressure}, {Module}Pressure:{PMPressure}";
+                //LOG.Write(eEvent.ERR_DEVICE_INFO, Module, reason);
+                return true;
+            }
+            else return false;
+        }
+
         private bool PickPrepare()
         {
             _pmModule.PostMsg(PMEntity.MSG.PreparePick);
@@ -185,6 +228,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
             else
             {
                 Runner.Stop($"TM Robot Place Extend failed, {_robot.Status}");
+                Singleton<RouteManager>.Instance.GetPM(_targetModule).PostMsg(PMEntity.MSG.Error);
                 return true;
             }
         }
@@ -241,6 +285,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
             else
             {
                 Runner.Stop($"TM Robot Swap Retract failed, {_robot.Status}");
+                Singleton<RouteManager>.Instance.GetPM(_targetModule).PostMsg(PMEntity.MSG.Error);
                 return true;
             }
         }

+ 17 - 0
Venus/Venus_Simulator/Instances/SimulatorSystem.cs

@@ -763,6 +763,7 @@ namespace Venus_Simulator.Instances
                             //MonitorVenuDESlitDoor(item.Key);
                             MonitorDEPressure(item.Key);
                             ChangeTime(item.Key);
+                            MonitorLinerDoor(item.Key);
                             this.SimulateDEHe(item.Key);
                             break;
                     }
@@ -818,6 +819,22 @@ namespace Venus_Simulator.Instances
                 IO.DI[$"{mod}.DI_Slit_Door_Close_POS"].Value = true;
             }
         }
+        void MonitorLinerDoor(ModuleName mod)
+        {
+            // slit door open
+            if (IO.DO[$"{mod}.DO_PM_Liner_Door_Open"].Value)
+            {
+                IO.DI[$"{mod}.DI_Liner_Door_Open_Position"].Value = true;
+                IO.DI[$"{mod}.DI_Liner_Door_Close_Position"].Value = false;
+            }
+
+            // slit door close
+            if (IO.DO[$"{mod}.DO_PM_Liner_Door_Close"].Value)
+            {
+                IO.DI[$"{mod}.DI_Liner_Door_Open_Position"].Value = false;
+                IO.DI[$"{mod}.DI_Liner_Door_Close_Position"].Value = true;
+            }
+        }
         void MonitorSlitDoorInTM(ModuleName mod)
         {
             // slit door open