浏览代码

1.Chamber DE process enhance
2.Code compatibility bug fix

hecl 11 月之前
父节点
当前提交
e2836bfbda

+ 4 - 2
Venus/Framework/Common/SCCore/SystemConfigManager.cs

@@ -46,7 +46,6 @@ namespace MECF.Framework.Common.SCCore
                 //_scDataErrorFile = PathManager.GetCfgDir() + $"_sc.data.err._{configType}";
             }
             _scConfigFile =  scConfigPathName;
-
             BuildItems(_scConfigFile);
 
             BackupAndRecoverDataFile();
@@ -75,7 +74,10 @@ namespace MECF.Framework.Common.SCCore
             {
                 if (_items["PMA.Chiller.EnableChiller"].Value.ToString() == "False") return true;
             }
-
+            if (key.Contains("Magnet"))
+            {
+                OP.DoOperation("System.SetMagnet", key, parameters[1]);
+            }
             if (InitializeItemValue(_items[(string)parameters[0]], (string)parameters[1]))
             {
                 GenerateDataFile();

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

@@ -1265,7 +1265,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.2);
             timer.Tick += timer_Tick;
             timer.Start();
         }

+ 1 - 1
Venus/Venus_MainPages/ViewModels/StatisticsViewModel.cs

@@ -20,7 +20,7 @@ using Venus_Core;
 namespace Venus_MainPages.ViewModels
 {
     
-    public class StatsDataListItem 
+    public class StatsDataListItem :BindableBase
     {
         public string Name { get; set; }
         public string Value { get; set; }

+ 2 - 2
Venus/Venus_MainPages/ViewModels/VceViewModel.cs

@@ -207,7 +207,7 @@ namespace Venus_MainPages.ViewModels
             InvokeClient.Instance.Service.DoOperation("VCE1.ReadMap");
             if (VCEIsInstalled == true)
             {
-                VCE1ModuleInfo = ModuleManager.ModuleInfos["VCE1"].WaferManager.Wafers;
+                VCE1ModuleInfo = ModuleManager.ModuleInfos["LP1"].WaferManager.Wafers;
             }
         }
         private void vceLoadPrepare()
@@ -297,7 +297,7 @@ namespace Venus_MainPages.ViewModels
             }
             if (VCEIsInstalled == true)
             {
-                VCE1ModuleInfo = ModuleManager.ModuleInfos["VCE1"].WaferManager.Wafers;
+                VCE1ModuleInfo = ModuleManager.ModuleInfos["LP1"].WaferManager.Wafers;
             }
 
         }

+ 1 - 1
Venus/Venus_MainPages/ViewModels/VenusSeOperationOverViewModel.cs

@@ -743,7 +743,7 @@ namespace Venus_MainPages.ViewModels
                 TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
                 RobotUpperWafer = TMModuleInfo.WaferManager.Wafers[0];
                 RobotLowerWafer = TMModuleInfo.WaferManager.Wafers[1];
-                PAWafer = ModuleManager.ModuleInfos["VPA"].WaferManager.Wafers[0];
+                PAWafer = ModuleManager.ModuleInfos["Aligner1"].WaferManager.Wafers[0];
             }
             catch
             {

+ 5 - 5
Venus/Venus_MainPages/Views/StatisticsView.xaml

@@ -22,7 +22,7 @@
             <TabItem Header="Statistic Item List ">
 
                 <DataGrid Grid.Row="1" AlternationCount="2" HorizontalAlignment="Left" CanUserAddRows="False" AutoGenerateColumns="False" RowHeaderWidth="0"               
-                  ItemsSource="{Binding StatData}" Margin="0,5,0,0" >
+                  ItemsSource="{Binding StatData, Mode=TwoWay}" Margin="0,5,0,0" >
 
                     <DataGrid.Columns>
                         <DataGridTemplateColumn Header="Name" Width="220">
@@ -63,10 +63,10 @@
                         <DataGridTemplateColumn Header="Enable Warning" Width="120">
                             <DataGridTemplateColumn.CellTemplate>
                                 <DataTemplate>
-                                    <CheckBox IsChecked="{Binding WarningEnable,Mode=TwoWay}"   VerticalAlignment="Center" HorizontalAlignment="Center" >
+                                    <CheckBox IsChecked="{Binding WarningEnable,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"   VerticalAlignment="Center" HorizontalAlignment="Center" >
                                         <i:Interaction.Triggers>
                                             <i:EventTrigger EventName="Checked">
-                                                <i:InvokeCommandAction Command="{Binding DataContext.ResetEnableValueCommnad,  ElementName=stastic}" CommandParameter="{Binding }" />
+                                                <i:InvokeCommandAction Command="{Binding DataContext.ResetEnableValueCommnad, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding }" />
                                             </i:EventTrigger>
                                             <i:EventTrigger EventName="Unchecked">
                                                 <i:InvokeCommandAction Command="{Binding DataContext.ResetEnableValueCommnad,  ElementName=stastic}" CommandParameter="{Binding }"/>
@@ -106,7 +106,7 @@
                         <DataGridTemplateColumn Header="Enable Alarm" Width="120">
                             <DataGridTemplateColumn.CellTemplate>
                                 <DataTemplate>
-                                    <CheckBox IsChecked="{Binding AlarmEnable,Mode=TwoWay}"   VerticalAlignment="Center" HorizontalAlignment="Center" >
+                                    <CheckBox IsChecked="{Binding AlarmEnable,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"   VerticalAlignment="Center" HorizontalAlignment="Center" >
                                         <i:Interaction.Triggers>
                                             <i:EventTrigger EventName="Checked">
                                                 <i:InvokeCommandAction Command="{Binding DataContext.ResetEnableAlarmCommnad,  ElementName=stastic}" CommandParameter="{Binding }" />
@@ -256,7 +256,7 @@
                         <DataGridTemplateColumn Header="Enable Alarm" Width="120">
                             <DataGridTemplateColumn.CellTemplate>
                                 <DataTemplate>
-                                    <CheckBox IsChecked="{Binding AlarmEnable,Mode=TwoWay}"   VerticalAlignment="Center" HorizontalAlignment="Center" >
+                                    <CheckBox IsChecked="{Binding AlarmEnable,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"   VerticalAlignment="Center" HorizontalAlignment="Center" >
                                         <i:Interaction.Triggers>
                                             <i:EventTrigger EventName="Checked">
                                                 <i:InvokeCommandAction Command="{Binding DataContext.ResetRFEnableAlarmCommnad,  ElementName=stastic}" CommandParameter="{Binding }" />

+ 2 - 2
Venus/Venus_MainPages/Views/VceView.xaml

@@ -129,8 +129,8 @@
                         </Border>
                         <Border BorderBrush="{DynamicResource Table_BD}"  Grid.Row="3" Background="{DynamicResource Table_BG_Content}" BorderThickness="0,0,0,1" >
                             <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
-                                <Button Content="OpenDoor"  Margin="0,10,10,10"   Width="110" Height="25" Command="{Binding OpenDoorCommand}"/>
-                                <Button Content="CloseDoor"  Margin="0,10,10,10"   Width="80" Height="25" Command="{Binding CloseDoorCommand}"/>
+                                <Button Content="OpenOutDoor"  Margin="0,10,10,10"   Width="110" Height="25" Command="{Binding OpenDoorCommand}"/>
+                                <Button Content="CloseOutDoor"  Margin="0,10,10,10"   Width="110" Height="25" Command="{Binding CloseDoorCommand}"/>
                                 <Button Content="GotoLoad"  Margin="0,10,0,10"   Width="90" Height="25" Command="{Binding GoToLoadCommand}"/>
                             </StackPanel>
                         </Border>

+ 1 - 1
Venus/Venus_RT/Config/System_VenusSE.sccfg

@@ -644,7 +644,7 @@
 			<config default="20" name="ChamberForelinePressureTimeout" nameView="Chamber Foreline Pressure Timeout" description="" max="3000" min="0" paramter="" tag="" unit="s" type="Integer" />
 		</configs>
 		<configs name="Magnet" nameView="Magnet" visible="true">
-			<config default="1" name="Magnetwareform" nameView="Magnet wareform" description="波形, 0:SIN 1:Squre 2:Single" max="2" min="0" paramter="" tag="" unit="" type="Integer" visible="true"/>
+			<config default="1" name="Magnetwaveform" nameView="Magnet waveform" description="波形, 0:SIN 1:Squre 2:Single" max="2" min="0" paramter="" tag="" unit="" type="Integer" visible="true"/>
 			<config default="25" name="MagnetFieldRatio" nameView="Magent Field Ratio" description="" max="100" min="0" paramter="" tag="" unit="%" type="Integer" visible="true"/>
 			<config default="4" name="Magnetcycleperiod" nameView="Magnet cycle period" description="serial port name of pump" max="10" min="0" paramter="" tag="" unit="s" type="Integer" visible="true"/>
 			<config default="50" name="Magnet_1A_output_full_scale" nameView="Magnet 1A output full scale" description="" max="100" min="-100" paramter="" tag="" unit="%" type="Integer" visible="true"/>

+ 29 - 12
Venus/Venus_RT/Devices/IODevices/IoMagnet.cs

@@ -3,8 +3,10 @@ using Aitex.Core.RT.DataCenter;
 using Aitex.Core.RT.Device;
 using Aitex.Core.RT.IOCore;
 using Aitex.Core.RT.Log;
+using Aitex.Core.RT.OperationCenter;
 using Aitex.Core.RT.SCCore;
 using Aitex.Core.RT.Tolerance;
+using Aitex.Core.UI.Control;
 using Aitex.Core.UI.View.Common;
 using Aitex.Core.Util;
 using CdioCs;
@@ -31,7 +33,7 @@ namespace Venus_RT.Devices.IODevices
             ON,
             ERROR
         }
-        public IoMagnet(string module, XmlElement node, string ioModule = "") 
+        public IoMagnet(string module, XmlElement node, string ioModule = "")
         {
             base.Module = module;
             Name = "AIoMagnet";
@@ -47,18 +49,18 @@ namespace Venus_RT.Devices.IODevices
             _aiMagnet2U = ParseAiNode("aiMagnet2U", node, ioModule);
             _aiMagnet2W = ParseAiNode("aiMagnet2W", node, ioModule);
             _diMagnetOn = ParseDiNode("diPowerOn", node, ioModule);
-            _aoMagnetintensity= ParseAoNode("aoSetPoint", node, ioModule);
+            _aoMagnetintensity = ParseAoNode("aoSetPoint", node, ioModule);
             _aoMagnetWaveForm = ParseAoNode("aoWaveSsquare", node, ioModule);
             _aoMagnetFieldRadio = ParseAoNode("aoMagnetFieldRadio", node, ioModule);
             _aoMagnetCycle = ParseAoNode("aoCycletime", node, ioModule);
             _aoMinMagnet = ParseAoNode("aoCurrentLimit", node, ioModule);
-            _ao1Aoutput= ParseAoNode("ao1Aoutput", node, ioModule);
+            _ao1Aoutput = ParseAoNode("ao1Aoutput", node, ioModule);
             _ao1Boutput = ParseAoNode("ao1Boutput", node, ioModule);
             _ao2Aoutput = ParseAoNode("ao2Aoutput", node, ioModule);
             _ao2Boutput = ParseAoNode("ao2Boutput", node, ioModule);
         }
         public MagnetStatus Status { get; set; }
-        private readonly AIAccessor _aiMagnet1U;    
+        private readonly AIAccessor _aiMagnet1U;
         private readonly AIAccessor _aiMagnet1V;
         private readonly AIAccessor _aiMagnet1W;
         private readonly AIAccessor _aiMagnet2U;
@@ -79,8 +81,8 @@ namespace Venus_RT.Devices.IODevices
         public bool Initialize()
         {
             DATA.Subscribe($"{Module}.AIoMagnet.DeviceData", () => DeviceData, SubscriptionAttribute.FLAG.IgnoreSaveDB);
-            
-            _SetRealFloat(_aoMagnetWaveForm, Convert.ToSingle(SC.GetConfigItem($"{Module}.Magnet.Magnetwareform").Value));          
+            OP.Subscribe("System.SetMagnet", Setmagnet);
+            _SetRealFloat(_aoMagnetWaveForm, Convert.ToSingle(SC.GetConfigItem($"{Module}.Magnet.Magnetwaveform").Value));
             _SetRealFloat(_aoMagnetCycle, Convert.ToSingle(SC.GetConfigItem($"{Module}.Magnet.Magnetcycleperiod").Value));
             _SetRealFloat(_aoMinMagnet, Convert.ToSingle(SC.GetConfigItem($"{Module}.Magnet.Min_Magnet_Coil_Current").Value));
             _SetRealFloat(_aoMagnetFieldRadio, Convert.ToSingle(SC.GetConfigItem($"{Module}.Magnet.MagnetFieldRatio").Value));
@@ -90,7 +92,22 @@ namespace Venus_RT.Devices.IODevices
             _SetRealFloat(_ao2Boutput, Convert.ToSingle(SC.GetConfigItem($"{Module}.Magnet.Magnet_2B_output_full_scale").Value));
             return true;
         }
-
+        private bool Setmagnet(string cmd, object[] parameters)
+        {
+            if (parameters[0].ToString().Contains("Magnetwaveform"))
+            {
+                Setpoint(_aoMagnetWaveForm, Convert.ToSingle(parameters[1]));
+            }
+            else if (parameters[0].ToString().Contains("MagnetFieldRatio"))
+            {
+                _SetRealFloat(_aoMagnetFieldRadio, Convert.ToSingle(parameters[1]));
+            }
+            else if (parameters[0].ToString().Contains("Magnetcycleperiod"))
+            {
+                _SetRealFloat(_aoMagnetCycle, Convert.ToSingle(parameters[1]));
+            }
+            return true;
+        }
         public AITMagnetData DeviceData
         {
             get
@@ -104,14 +121,14 @@ namespace Venus_RT.Devices.IODevices
                     Magnet2VFeedBack = Magent2V,
                     Magnet2WFeedBack = Magent2W,
                     IsMagnetOn = MagnetOn,
-                    MagnetIntensity= MagnetPowerIntensity
+                    MagnetIntensity = MagnetPowerIntensity
 
                 };
 
                 return deviceData;
             }
         }
-        public void Setpoint(AOAccessor ao,float config)
+        public void Setpoint(AOAccessor ao, float config)
         {
             if (_GetRealFloat(ao) != config)
             {
@@ -125,10 +142,10 @@ namespace Venus_RT.Devices.IODevices
             Setpoint(_ao1Boutput, Convert.ToSingle(SC.GetConfigItem($"{Module}.Magnet.Magnet_1B_output_full_scale").Value));
             Setpoint(_ao2Aoutput, Convert.ToSingle(SC.GetConfigItem($"{Module}.Magnet.Magnet_2A_output_full_scale").Value));
             Setpoint(_ao2Boutput, Convert.ToSingle(SC.GetConfigItem($"{Module}.Magnet.Magnet_2B_output_full_scale").Value));
-            Setpoint(_aoMagnetCycle, Convert.ToSingle(SC.GetConfigItem($"{Module}.Magnet.Magnetcycleperiod").Value));
+            //Setpoint(_aoMagnetCycle, Convert.ToSingle(SC.GetConfigItem($"{Module}.Magnet.Magnetcycleperiod").Value));
             //Setpoint(_aoMagnetWaveForm, Convert.ToSingle(SC.GetConfigItem($"{Module}.Magnet.Magnetwareform").Value));
         }
-       
+
         public float Magent1V
         {
             get
@@ -181,7 +198,7 @@ namespace Venus_RT.Devices.IODevices
         public bool SetMagnetPower(float val)
         {
             _SetRealFloat(_aoMagnetintensity, val);
-            return true;  
+            return true;
         }
         public bool SetFieldRatio(float val)
         {

+ 1 - 0
Venus/Venus_RT/Devices/JetVenusDEPM.cs

@@ -1432,6 +1432,7 @@ namespace Venus_RT.Devices
             GeneratorBiasPowerOn(false);
             OpenValve(ValveType.TurboPumpPumping, true);
             OpenValve(ValveType.TurboPumpPurge, true);
+            _Magnet.SetMagnetPower(0);
             if (IsTurboPumpAtSpeed)
             {
                 OpenValve(ValveType.TurboPumpPumping, true);

+ 1 - 0
Venus/Venus_RT/Devices/JetVenusSEPM.cs

@@ -20,6 +20,7 @@ using Venus_Core;
 using Venus_RT.Devices.IODevices;
 using Venus_RT.Modules;
 using IoMfc = Venus_RT.Devices.IODevices.IoMfc;
+using Aitex.Core.RT.DataCenter;
 
 namespace Venus_RT.Devices
 {

+ 6 - 18
Venus/Venus_RT/Devices/TM/HongHuTM.cs

@@ -150,7 +150,7 @@ namespace Venus_RT.Devices
             get
             {
                 if (_allInstalledModules.Contains("PMA"))
-                    return (_PMASlitDoor.State == CylinderState.Open) && IsPressureReady(ModuleName.PMA);
+                    return (_PMASlitDoor.State == CylinderState.Open);
                 else
                     return false;
             }
@@ -160,7 +160,7 @@ namespace Venus_RT.Devices
             get
             {
                 if (_allInstalledModules.Contains("PMB"))
-                    return (_PMBSlitDoor.State == CylinderState.Open)&&IsPressureReady(ModuleName.PMB);
+                    return (_PMBSlitDoor.State == CylinderState.Open);
                 else
                     return false;
             }
@@ -170,7 +170,7 @@ namespace Venus_RT.Devices
             get
             {
                 if (_allInstalledModules.Contains("PMC"))
-                    return (_PMCSlitDoor.State == CylinderState.Open) && IsPressureReady(ModuleName.PMC);
+                    return (_PMCSlitDoor.State == CylinderState.Open);
                 else
                     return false;
             }
@@ -320,18 +320,6 @@ namespace Venus_RT.Devices
                 _PressureControl.SetMode(false);
             }
         }
-        private bool IsPressureReady(ModuleName _targetModule)
-        {
-            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)))
-            {
-                return true;
-            }
-            else return false;
-        }
         public override bool TurnSlitDoor(ModuleName mod, bool bOn)
         {
             double MaxPressureDifference = SC.GetValue<double>("System.PMTMMaxPressureDifference");
@@ -353,19 +341,19 @@ namespace Venus_RT.Devices
                 case ModuleName.PMA:
                     if (bOn && Singleton<RouteManager>.Instance.PMA.IsAtm && IsTMATM)
                         return _PMASlitDoor.SetCylinder(bOn, out _);
-                    if (bOn && !CanOpenSlitDoor(mod, MaxPressureDifference)&& !IsPressureReady(mod))
+                    if (bOn && !CanOpenSlitDoor(mod, MaxPressureDifference))
                         return false;
                     return _PMASlitDoor.SetCylinder(bOn, out _);
                 case ModuleName.PMB:
                     if (bOn && Singleton<RouteManager>.Instance.PMB.IsAtm && IsTMATM)
                         return _PMBSlitDoor.SetCylinder(bOn, out _);
-                    if (bOn && !CanOpenSlitDoor(mod, MaxPressureDifference)&& !IsPressureReady(mod))
+                    if (bOn && !CanOpenSlitDoor(mod, MaxPressureDifference) )
                         return false;
                     return _PMBSlitDoor.SetCylinder(bOn, out _);
                 case ModuleName.PMC:
                     if (bOn && Singleton<RouteManager>.Instance.PMC.IsAtm && IsTMATM)
                         return _PMCSlitDoor.SetCylinder(bOn, out _);
-                    if (bOn && !CanOpenSlitDoor(mod, MaxPressureDifference) && !IsPressureReady(mod))
+                    if (bOn && !CanOpenSlitDoor(mod, MaxPressureDifference))
                         return false;
                     return _PMCSlitDoor.SetCylinder(bOn, out _);
             }

+ 1 - 1
Venus/Venus_RT/Modules/PMs/PMGasVerificationRoutine.cs

@@ -254,7 +254,7 @@ namespace Venus_RT.Modules.PMs
             //{
             //    _beginPressure = _chamber.ChamberPressure;
             //}
-
+            _chamber.OpenValve(ValveType.GasFinal, true);
             OpenPVNVlv(_mfcIndex, true);
             if (!_chamber.FlowGas(_mfcIndex, _paramMode == VerifyMode.TenPoint ? _paramFlowSet[Runner.LoopCounter] : _mfcFlow))
             {

+ 1 - 1
Venus/Venus_RT/Modules/RouteManager.cs

@@ -477,7 +477,7 @@ namespace Venus_RT.Modules
                 return ModuleHelper.IsInstalled((ModuleName)args[0]);
             });
             OP.Subscribe("System.SETMCycle", (cmd, args) => CheckToPostMessage((int)MSG.SETMCycle, args));
-            OP.Subscribe("System.CreateSEJob", (cmd, args) => CheckToPostMessage((int)MSG.CreateJob, args));
+            OP.Subscribe("System.CreateSEJob", (cmd, args) => CheckToPostMessage((int)MSG.CreateSEJob, args));
             OP.Subscribe("System.StartSEJob", (cmd, args) => CheckToPostMessage((int)MSG.StartJob, args));
             OP.Subscribe("System.ReturnAllSEWafer", (cmd, args) => CheckToPostMessage((int)MSG.ReturnAllWafer, args));
             OP.Subscribe("System.SEAbort", (cmd, args) => CheckToPostMessage((int)MSG.ABORT, args));

+ 21 - 2
Venus/Venus_RT/Modules/TM/VenusEntity/SEMFPMPickRoutine.cs

@@ -113,7 +113,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
 
         public RState Monitor()
         {
-            Runner.Wait(PickStep.WaitPMReady, () => _pmModule.IsIdle, _delay_60s)
+                  Runner.Wait(PickStep.WaitPMReady,   PMPrepare, _delay_60s)
                         .Run(PickStep.OpenMFSlitDoor, OpenSlitDoor, CheckSlitDoorOpen)
                         .Run(PickStep.PMPrepare, ModulePrepare, IsModulePrepareReady, _delay_60s)
                         .Delay(PickStep.PickDelay, _pickdelay)
@@ -131,7 +131,26 @@ namespace Venus_RT.Modules.TM.VenusEntity
 
             return Runner.Status;
         }
-
+        private bool PMPrepare()
+        {
+            return IsPressureReady(_targetModule) && _pmModule.IsIdle;
+        }
+        private bool IsPressureReady(ModuleName _targetModule)
+        {
+            if (Singleton<RouteManager>.Instance.GetPM(_targetModule).IsOnline)
+            {
+                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)))
+                {
+                    return true;
+                }
+                else return false;
+            }
+            else return true;
+        }
         private bool OpenSlitDoor()
         {
             return _tm.TurnSlitDoor(_targetModule,true);

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

@@ -1,4 +1,5 @@
-using Aitex.Core.RT.Log;
+using Aitex.Core.RT.DataCenter;
+using Aitex.Core.RT.Log;
 using Aitex.Core.RT.Routine;
 using Aitex.Core.RT.SCCore;
 using Aitex.Core.Util;
@@ -56,7 +57,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
         private DateTime _starttime;
         private bool _queryAwc;
 
-        public SEMFPMPlaceRoutine(TMBase honghutm, ITransferRobot robot,ModuleName module) : base(module)
+        public SEMFPMPlaceRoutine(TMBase honghutm, ITransferRobot robot, ModuleName module) : base(module)
         {
             _TM = honghutm;
             _robot = robot;
@@ -114,7 +115,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
 
         public RState Monitor()
         {
-            Runner.Wait(PlaceStep.WaitPMReady, () => _pmModule.IsIdle, _delay_60s)
+            Runner.Wait(PlaceStep.WaitPMReady, PMPrepare, _delay_60s)
                 .Run(PlaceStep.OpenMFSlitDoor, OpenSlitDoor, CheckSlitDoorOpen)
                 .Run(PlaceStep.PMPrepare, ModulePrepare, IsModulePrepareReady, _delay_60s)
                 .Delay(PlaceStep.PlaceDelay, _placeDelayTime)
@@ -131,7 +132,25 @@ namespace Venus_RT.Modules.TM.VenusEntity
 
             return Runner.Status;
         }
-
+        private bool PMPrepare()
+        {
+            return IsPressureReady(_targetModule) && _pmModule.IsIdle;
+        }
+        private bool IsPressureReady(ModuleName _targetModule)
+        {
+            if (Singleton<RouteManager>.Instance.GetPM(_targetModule).IsOnline)
+            {
+                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)))
+                {
+                    return true;
+                }
+                else return false;
+            }else return true;
+        }
         private bool OpenSlitDoor()
         {
             return _TM.TurnSlitDoor(_targetModule, true);

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

@@ -130,7 +130,7 @@ namespace Venus_RT.Modules.TM.VenusEntity
 
         public RState Monitor()
         {
-            Runner.Wait(SwapStep.WaitPMReady,       () => _pmModule.IsIdle,     _delay_60s)
+            Runner.Wait(SwapStep.WaitPMReady,       PMPrepare,                         _delay_60s)
                 .Run(SwapStep.OpenMFSlitDoor,       OpenSlitDoor,               CheckSlitDoorOpen)
                 .Run(SwapStep.PickPrepare,          PickPrepare,                IsModuleReadyForPick)
                 .Delay(SwapStep.PickDelay, _placeDelayTime)
@@ -153,6 +153,27 @@ namespace Venus_RT.Modules.TM.VenusEntity
             return Runner.Status;
         }
 
+        private bool PMPrepare()
+        {
+
+            return IsPressureReady(_targetModule)&& _pmModule.IsIdle;
+        }
+        private bool IsPressureReady(ModuleName _targetModule)
+        {
+            if (Singleton<RouteManager>.Instance.GetPM(_targetModule).IsOnline)
+            {
+                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)))
+                {
+                    return true;
+                }
+                else return false;
+            }
+            else return true;
+        }
         private bool OpenSlitDoor()
         {
             return _TM.TurnSlitDoor(_targetModule, true);