Browse Source

1 add platingcell run recipe pre check
2 add system facilit/safety all on/off

chenzk 1 day ago
parent
commit
d49038500b

+ 30 - 19
PunkHPX8_MainPages/ViewModels/SystemFacilitiesViewModel.cs

@@ -235,6 +235,10 @@ namespace PunkHPX8_MainPages.ViewModels
 
         public ICommand FilterPurgeDisableCommand { get; private set; }
 
+        public ICommand AllOnCommand { get; private set; }
+
+        public ICommand AllOffCommand { get; private set; }
+
         #endregion
 
         /// <summary>
@@ -265,7 +269,10 @@ namespace PunkHPX8_MainPages.ViewModels
             SampleStationDisableCommand = new DelegateCommand<object>(SampleStationDisableAction);
             FilterPurgeEnableCommand = new DelegateCommand<object>(FilterPurgeEnableAction);
             FilterPurgeDisableCommand = new DelegateCommand<object>(FilterPurgeDisableAction);
-      
+            
+            AllOnCommand = new DelegateCommand<object>(AllOnAction);
+            AllOffCommand = new DelegateCommand<object>(AllOffAction);
+
 
         }
         /// <summary>
@@ -589,7 +596,17 @@ namespace PunkHPX8_MainPages.ViewModels
         /// <param name="param"></param>
         private void AllOnAction(object param)
         {
-
+            NitrogenOnAction(param);
+            CDAOnAction(param);
+            ExternalCDAOnAction(param);
+            DiWaterOnAction(param);
+            HouseChilledWaterOnAction(param);
+            VpwDiwEnableAction(param);
+            DiwFillEnableAction(param);
+            DiwReplenEnableAction(param);
+            SrdDiEnableAction(param);
+            SampleStationEnableAction(param);
+            FilterPurgeEnableAction(param);
         }
         /// <summary>
         /// All Off
@@ -597,23 +614,17 @@ namespace PunkHPX8_MainPages.ViewModels
         /// <param name="param"></param>
         private void AllOffAction(object param)
         {
-
-        }
-        /// <summary>
-        /// Sample Enable
-        /// </summary>
-        /// <param name="param"></param>
-        private void SampleEnableAction(object param)
-        {
-            InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.SampleEnable");
-        }
-        /// <summary>
-        /// Sample Disable
-        /// </summary>
-        /// <param name="param"></param>
-        private void SampleDisableAction(object param)
-        {
-            InvokeClient.Instance.Service.DoOperation($"System.{FACILITIES}.SampleDisable");
+            NitrogenOffAction(param);
+            CDAOffAction(param);
+            ExternalCDAOffAction(param);
+            DiWaterOffAction(param);
+            HouseChilledWaterOffAction(param);
+            VpwDiwDisableAction(param);
+            DiwFillDisableAction(param);
+            DiwReplenDisableAction(param);
+            SrdDiDisableAction(param);
+            SampleStationDisableAction(param);
+            FilterPurgeDisableAction(param);
         }
         #endregion
     }

+ 16 - 3
PunkHPX8_MainPages/Views/SystemFacilitiesView.xaml

@@ -57,6 +57,7 @@
                         <RowDefinition Height="30"></RowDefinition>
                         <RowDefinition Height="30"></RowDefinition>
                         <RowDefinition Height="30"></RowDefinition>
+                        <RowDefinition Height="30"></RowDefinition>
                         <RowDefinition/>
                     </Grid.RowDefinitions>
                     <Grid Grid.Row="1">
@@ -251,13 +252,25 @@
                             <ColumnDefinition Width="260"></ColumnDefinition>
                             <ColumnDefinition/>
                         </Grid.ColumnDefinitions>
+                        <Label Grid.Column="0" VerticalContentAlignment="Center">All</Label>
+                        <Grid Grid.Column="1">
+                            <Ellipse Width="16" Height="16"  Fill="{Binding AllStatus,Converter={StaticResource middleStatusColor}}" Stroke="Silver" HorizontalAlignment="Left"/>
+                            <Button Style="{StaticResource SysBtnStyle}"  Content="On" Width="50" Height="30" HorizontalAlignment="Left" Command="{Binding AllOnCommand}" Margin="25,0,0,0"></Button>
+                            <Button Style="{StaticResource SysBtnStyle}"  Content="Off" Width="50" Height="30" HorizontalAlignment="Left" Command="{Binding AllOffCommand}" Margin="80,0,0,0"></Button>
+                        </Grid>
+                    </Grid>
+                    <Grid Grid.Row="21">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="260"></ColumnDefinition>
+                            <ColumnDefinition/>
+                        </Grid.ColumnDefinitions>
                         <Label Grid.Column="0" VerticalContentAlignment="Center">N2 Blanket Pressure</Label>
                         <Grid Grid.Column="1">
                             <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="18" Width="60" Background="Black" Foreground="Lime" Text="{Binding N2BlanketPressure}" Margin="26,0,0,0"/>
                             <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="18" Width="40" Background="Black" Foreground="Lime" Text="psi" Margin="90,0,0,0"/>
                         </Grid>
                     </Grid>
-                    <Grid Grid.Row="21">
+                    <Grid Grid.Row="22">
                         <Grid.ColumnDefinitions>
                             <ColumnDefinition Width="260"></ColumnDefinition>
                             <ColumnDefinition/>
@@ -268,7 +281,7 @@
                             <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="18" Width="40" Background="Black" Foreground="Lime" Text="psi" Margin="90,0,0,0"/>
                         </Grid>
                     </Grid>
-                    <Grid Grid.Row="22">
+                    <Grid Grid.Row="23">
                         <Grid.ColumnDefinitions>
                             <ColumnDefinition Width="260"></ColumnDefinition>
                             <ColumnDefinition/>
@@ -279,7 +292,7 @@
                             <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="18" Width="40" Background="Black" Foreground="Lime" Text="psi" Margin="90,0,0,0"/>
                         </Grid>
                     </Grid>
-                    <Grid Grid.Row="23">
+                    <Grid Grid.Row="24">
                         <Grid.ColumnDefinitions>
                             <ColumnDefinition Width="260"></ColumnDefinition>
                             <ColumnDefinition/>

+ 4 - 0
PunkHPX8_RT/Devices/Facilities/SystemFacilities.cs

@@ -242,6 +242,10 @@ namespace PunkHPX8_RT.Devices.Facilities
         /// Di Fill Enable
         /// </summary>
         public bool DIFillEnable { get { return _diFillEnable; } }
+        /// <summary>
+        /// 范围数据字典
+        /// </summary>
+        public Dictionary<string, CommonLimitData> FacilitiesDataDic { get { return _facilitiesDataDic; } }
         #endregion
 
         /// <summary>

+ 48 - 6
PunkHPX8_RT/Devices/Safety/SafetyAllOnRoutine.cs

@@ -31,10 +31,10 @@ namespace PunkHPX8_RT.Devices.Safety
             WaitSwitchOnPlatingCell3Rotation,
             PlatingCell4RotationSwitchOn,
             WaitSwitchOnPlatingCell4Rotation,
-            PlatingCell12LiftSwitchOn,
-            WaitSwitchOnPlatingCell12Lift,
-            PlatingCell34LiftSwitchOn,
-            WaitSwitchOnPlatingCell34Lift,
+            PlatingCell12VerticalSwitchOn,
+            WaitSwitchOnPlatingCell12Vertical,
+            PlatingCell34VerticalSwitchOn,
+            WaitSwitchOnPlatingCell34Vertical,
             SwitchOnSRD1,
             WaitSwitchOnSRD1,
             SwitchOnSRD2,
@@ -49,8 +49,8 @@ namespace PunkHPX8_RT.Devices.Safety
         private JetAxisBase _platingCell2Rotation;
         private JetAxisBase _platingCell3Rotation;
         private JetAxisBase _platingCell4Rotation;
-        private JetAxisBase _platingCell12Lift;
-        private JetAxisBase _platingCell34Lift;
+        private JetAxisBase _platingCell1_2Vertical;
+        private JetAxisBase _platingCell3_4Vertical;
         private JetAxisBase _srd1Rotation;
         private JetAxisBase _srd2Rotation;
         #endregion
@@ -78,9 +78,43 @@ namespace PunkHPX8_RT.Devices.Safety
             Runner.RunIf(SafetyAllOnStep.VpwCell1SwitchOn,ModuleHelper.IsInstalled(ModuleName.VPW1),()=>SwitchOnAxis(_vpwCell1Rotation),_delay_1ms)
                 .WaitWithStopConditionIf(SafetyAllOnStep.WaitSwitchOnVpwCell1, ModuleHelper.IsInstalled(ModuleName.VPW1),
                     ()=>CheckSwitchOn(_vpwCell1Rotation),()=>CheckSwitchOnStopStatus(_vpwCell1Rotation))
+                
                 .RunIf(SafetyAllOnStep.VpwCell2SwitchOn, ModuleHelper.IsInstalled(ModuleName.VPW2), () => SwitchOnAxis(_vpwCell2Rotation), _delay_1ms)
                 .WaitWithStopConditionIf(SafetyAllOnStep.WaitSwitchOnVpwCell2, ModuleHelper.IsInstalled(ModuleName.VPW2),
                     () => CheckSwitchOn(_vpwCell2Rotation), () => CheckSwitchOnStopStatus(_vpwCell2Rotation))
+                
+                .RunIf(SafetyAllOnStep.PlatingCell12VerticalSwitchOn, ModuleHelper.IsInstalled(ModuleName.PlatingCell1), () => SwitchOnAxis(_platingCell1_2Vertical), _delay_1ms)
+                .WaitWithStopConditionIf(SafetyAllOnStep.WaitSwitchOnPlatingCell12Vertical, ModuleHelper.IsInstalled(ModuleName.PlatingCell1),
+                    () => CheckSwitchOn(_platingCell1_2Vertical), () => CheckSwitchOnStopStatus(_platingCell1_2Vertical))
+
+                .RunIf(SafetyAllOnStep.PlatingCell34VerticalSwitchOn, ModuleHelper.IsInstalled(ModuleName.PlatingCell3), () => SwitchOnAxis(_platingCell3_4Vertical), _delay_1ms)
+                .WaitWithStopConditionIf(SafetyAllOnStep.WaitSwitchOnPlatingCell34Vertical, ModuleHelper.IsInstalled(ModuleName.PlatingCell3),
+                    () => CheckSwitchOn(_platingCell3_4Vertical), () => CheckSwitchOnStopStatus(_platingCell3_4Vertical))
+
+                .RunIf(SafetyAllOnStep.PlatingCell1RotationSwitchOn, ModuleHelper.IsInstalled(ModuleName.PlatingCell1), () => SwitchOnAxis(_platingCell1Rotation), _delay_1ms)
+                .WaitWithStopConditionIf(SafetyAllOnStep.WaitSwitchOnPlatingCell1Rotation, ModuleHelper.IsInstalled(ModuleName.PlatingCell1),
+                    () => CheckSwitchOn(_platingCell1Rotation), () => CheckSwitchOnStopStatus(_platingCell1Rotation))
+                       
+                .RunIf(SafetyAllOnStep.PlatingCell2RotationSwitchOn, ModuleHelper.IsInstalled(ModuleName.PlatingCell2), () => SwitchOnAxis(_platingCell2Rotation), _delay_1ms)
+                .WaitWithStopConditionIf(SafetyAllOnStep.WaitSwitchOnPlatingCell2Rotation, ModuleHelper.IsInstalled(ModuleName.PlatingCell2),
+                    () => CheckSwitchOn(_platingCell2Rotation), () => CheckSwitchOnStopStatus(_platingCell2Rotation))
+
+                .RunIf(SafetyAllOnStep.PlatingCell3RotationSwitchOn, ModuleHelper.IsInstalled(ModuleName.PlatingCell3), () => SwitchOnAxis(_platingCell3Rotation), _delay_1ms)
+                .WaitWithStopConditionIf(SafetyAllOnStep.WaitSwitchOnPlatingCell3Rotation, ModuleHelper.IsInstalled(ModuleName.PlatingCell3),
+                    () => CheckSwitchOn(_platingCell3Rotation), () => CheckSwitchOnStopStatus(_platingCell3Rotation))
+
+                .RunIf(SafetyAllOnStep.PlatingCell4RotationSwitchOn, ModuleHelper.IsInstalled(ModuleName.PlatingCell4), () => SwitchOnAxis(_platingCell4Rotation), _delay_1ms)
+                .WaitWithStopConditionIf(SafetyAllOnStep.WaitSwitchOnPlatingCell4Rotation, ModuleHelper.IsInstalled(ModuleName.PlatingCell4),
+                    () => CheckSwitchOn(_platingCell4Rotation), () => CheckSwitchOnStopStatus(_platingCell4Rotation))
+
+                .RunIf(SafetyAllOnStep.SwitchOnSRD1, ModuleHelper.IsInstalled(ModuleName.SRD1), () => SwitchOnAxis(_srd1Rotation), _delay_1ms)
+                .WaitWithStopConditionIf(SafetyAllOnStep.WaitSwitchOnSRD1, ModuleHelper.IsInstalled(ModuleName.SRD1),
+                    () => CheckSwitchOn(_srd1Rotation), () => CheckSwitchOnStopStatus(_srd1Rotation))
+
+                .RunIf(SafetyAllOnStep.SwitchOnSRD2, ModuleHelper.IsInstalled(ModuleName.SRD2), () => SwitchOnAxis(_srd2Rotation), _delay_1ms)
+                .WaitWithStopConditionIf(SafetyAllOnStep.WaitSwitchOnSRD2, ModuleHelper.IsInstalled(ModuleName.SRD2),
+                    () => CheckSwitchOn(_srd2Rotation), () => CheckSwitchOnStopStatus(_srd2Rotation))
+
                 .End(SafetyAllOnStep.End, NullFun, _delay_1ms);
 
             return Runner.Status;
@@ -123,6 +157,14 @@ namespace PunkHPX8_RT.Devices.Safety
             _device = DEVICE.GetDevice<SafetyDevice>(Module);
             _vpwCell1Rotation = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.VPW1}.Rotation");
             _vpwCell2Rotation = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.VPW2}.Rotation");
+            _platingCell1Rotation = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.PlatingCell1}.Rotation");
+            _platingCell2Rotation = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.PlatingCell2}.Rotation");
+            _platingCell3Rotation = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.PlatingCell3}.Rotation");
+            _platingCell4Rotation = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.PlatingCell4}.Rotation");
+            _platingCell1_2Vertical = DEVICE.GetDevice<JetAxisBase>($"PlatingCell1_2.Vertical");
+            _platingCell3_4Vertical = DEVICE.GetDevice<JetAxisBase>($"PlatingCell3_4.Vertical");
+            _srd1Rotation = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.SRD1}.Rotation");
+            _srd2Rotation = DEVICE.GetDevice<JetAxisBase>($"{ModuleName.SRD2}.Rotation");
             return Runner.Start(Module, $"Safety All On");
         }
     }

+ 80 - 4
PunkHPX8_RT/Modules/PlatingCell/PlatingCellRunRecipeRoutine.cs

@@ -5,10 +5,13 @@ using Aitex.Core.Util;
 using MECF.Framework.Common.Beckhoff.AxisProvider;
 using MECF.Framework.Common.RecipeCenter;
 using MECF.Framework.Common.Routine;
+using MECF.Framework.Common.ToolLayout;
 using MECF.Framework.Common.Utilities;
 using PunkHPX8_Core;
 using PunkHPX8_RT.Devices.AXIS;
+using PunkHPX8_RT.Devices.Facilities;
 using PunkHPX8_RT.Devices.PlatingCell;
+using PunkHPX8_RT.Modules.Reservoir;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -56,9 +59,14 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// 当前完成的Cycle次数
         /// </summary>
         private int _currentCycle;
-
-
-
+        /// <summary>
+        /// platingcell entity
+        /// </summary>
+        private PlatingCellEntity _platingCellEntity;
+        /// <summary>
+        /// 对应reservoir entity
+        /// </summary>
+        private ReservoirEntity _reservoirEntity;
 
         private PlatingCellInterRinseRoutine _interRinseRoutine;
         private PlatingCellVerticalEntity _verticalEntity;
@@ -144,9 +152,14 @@ namespace PunkHPX8_RT.Modules.PlatingCell
                 NotifyError(eEvent.ERR_PLATINGCELL, $"{Module}.Rotation Provider is not exist", 0);
                 return RState.Failed;
             }
-           
+            //获取vertical entity
             string vertical = ModuleMatcherManager.Instance.GetPlatingVerticalByCell(Module);
             _verticalEntity = Singleton<RouteManager>.Instance.GetModule<PlatingCellVerticalEntity>(vertical);
+            //获取platingcell eneity
+            _platingCellEntity = Singleton<RouteManager>.Instance.GetModule<PlatingCellEntity>(Module);
+            //获取对应reservoir eneity
+            string reservoir = ReservoirItemManager.Instance.GetReservoirByPlatingCell(Module);
+            _reservoirEntity = Singleton<RouteManager>.Instance.GetModule<ReservoirEntity>(reservoir);
             if (!CheckPreCondition())
             {
                 return RState.Failed;
@@ -175,6 +188,30 @@ namespace PunkHPX8_RT.Modules.PlatingCell
             }
             CheckAxisHome();
             CheckFacility();
+            CheckModuleAndReservoir();
+            return true;
+        }
+        private bool CheckModuleAndReservoir()
+        {
+            if (!_platingCellEntity.IsIdle)
+            {
+                LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, $"{Module} is not initialized");
+                return false;
+            }
+            if (!_reservoirEntity.IsIdle)
+            {
+                LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, $"Releated reseroivr is not initialized");
+                return false;
+            }
+            if (!_reservoirEntity.TemperatureReached)
+            {
+                LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, $"Releated reseroivr temperature is not reached");
+                return false;
+            }
+            if ("Manual".Equals(_reservoirEntity.PersistentValue.OperatingMode))
+            {
+                // 要增加又wafer的判定,待修正
+            }
             return true;
         }
         /// <summary>
@@ -206,6 +243,45 @@ namespace PunkHPX8_RT.Modules.PlatingCell
         /// <returns></returns>
         private bool CheckFacility()
         {
+            SystemFacilities systemFacilities = DEVICE.GetDevice<SystemFacilities>("System.Facilities");
+            if (systemFacilities == null) 
+            {
+                LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility is null");
+                return false;
+            }
+            if (!systemFacilities.CDAEnable)
+            {
+                LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility CDA is off");
+                return false;
+            }
+            if (!systemFacilities.N2Enable)
+            {
+                LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility N2 is off");
+                return false;
+            }
+            if (!systemFacilities.DIFillEnable)
+            {
+                LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility DIW is off");
+                return false;
+            }
+            if (systemFacilities.FacilitiesDataDic["CDA1Pressure"].IsError || systemFacilities.FacilitiesDataDic["CDA2Pressure"].IsError)
+            {
+                LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility CDA Data is in errro range");
+                return false;
+            }
+            if (systemFacilities.FacilitiesDataDic["Nitrogen1APressure"].IsError  || 
+                systemFacilities.FacilitiesDataDic["Nitrogen1BPressure"].IsError ||
+                systemFacilities.FacilitiesDataDic["Nitrogen2APressure"].IsError ||
+                systemFacilities.FacilitiesDataDic["Nitrogen2BPressure"].IsError)
+            {
+                LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility N2 Data is in errro range");
+                return false;
+            }
+            if (systemFacilities.FacilitiesDataDic["DiWaterPressure"].IsError)
+            {
+                LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, "Facility Diw Pressure value is in errro range");
+                return false;
+            }
             return true;
         }
     }

+ 39 - 34
PunkHPX8_RT/Modules/Reservoir/ReservoirEntity.cs

@@ -45,7 +45,44 @@ namespace PunkHPX8_RT.Modules.Reservoir
         /// 当前recipe
         /// </summary>
         private ResRecipe _currentRecipe;
+        /// <summary>
+        /// dmPlatingCell device
+        /// </summary>
+        private DMPlatingCellDevice _dmPlatingCellDevice;
+        /// <summary>
+        /// hsPlatingCell device
+        /// </summary>
+        private HSPlatingCellDevice _hsPlatingCellDevice;
+        /// <summary>
+        /// diPlatingCell device
+        /// </summary>
+        private DIPlatingCellDevice _diPlatingCellDevice;
+        /// <summary>
+        /// 温度控制设备
+        /// </summary>
+        private TemperatureController _temperatureController;
+        /// <summary>
+        /// Reservoir项
+        /// </summary>
+        private ReservoirItem _reservoirItem;
+        /// <summary>
+        /// 电源
+        /// </summary>
+        private CellPowerSupplier _powerSupplier;
+        /// <summary>
+        /// DM init routine
+        /// </summary>
+        private DMReservoirInitializeRoutine _dmInitializeRoutine;
+        /// <summary>
+        /// HS init routine
+        /// </summary>
+        private HSReservoirInitializeRoutine _hsInitializeRoutine;
+        /// <summary>
+        /// DI init routine
+        /// </summary>
+        private DIReservoirInitializeRoutine _diInitializeRoutine;
         #endregion
+
         #region 属性
         /// <summary>
         /// 模块名称
@@ -132,41 +169,9 @@ namespace PunkHPX8_RT.Modules.Reservoir
         /// </summary>
         public ReservoirUsage ReservoirUsage { get { return ReservoirUsageManager.Instance.GetReservoirUsage(Module.ToString()); } }
         /// <summary>
-        /// dmPlatingCell device
-        /// </summary>
-        private DMPlatingCellDevice _dmPlatingCellDevice;
-        /// <summary>
-        /// hsPlatingCell device
-        /// </summary>
-        private HSPlatingCellDevice _hsPlatingCellDevice;
-        /// <summary>
-        /// diPlatingCell device
-        /// </summary>
-        private DIPlatingCellDevice _diPlatingCellDevice;
-        /// <summary>
-        /// 温度控制设备
-        /// </summary>
-        private TemperatureController _temperatureController;
-        /// <summary>
-        /// Reservoir项
+        /// 是否达到所需温度
         /// </summary>
-        private ReservoirItem _reservoirItem;
-        /// <summary>
-        /// 电源
-        /// </summary>
-        private CellPowerSupplier _powerSupplier;
-        /// <summary>
-        /// DM init routine
-        /// </summary>
-        private DMReservoirInitializeRoutine _dmInitializeRoutine;
-        /// <summary>
-        /// HS init routine
-        /// </summary>
-        private HSReservoirInitializeRoutine _hsInitializeRoutine;
-        /// <summary>
-        /// DI init routine
-        /// </summary>
-        private DIReservoirInitializeRoutine _diInitializeRoutine;
+        public bool TemperatureReached { get { return _temperatureController != null ? _temperatureController.TemperatureData.TemperatureReached : false; } }
         #endregion