Browse Source

1add vpw cell strat/stop rotation
2revise chamber up/down

chenzk 3 days ago
parent
commit
285e938803

+ 1 - 0
PunkHPX8_MainPages/Views/VPWCellView.xaml

@@ -53,6 +53,7 @@
                         ChamberClose="{Binding VpwMainCommonData.ChamberClosed}"
                         ChamberOpen="{Binding VpwMainCommonData.ChamberOpened}"
                         MachineState="{Binding StateMachine}"
+                        ModuleName="{Binding Module}"
                          />
         </Grid>
         <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Grid.RowSpan="3" HorizontalAlignment="Center" Margin="-120,100,0,0">

+ 1 - 1
PunkHPX8_RT/Config/Devices/AxisProviderCfg.xml

@@ -34,7 +34,7 @@
     <Units>deg</Units>
 	<!-- 5294 X 4 counts/rev * 1/360 rev/deg = 58.822222 counts/deg -->
     <ScaleFactor>1</ScaleFactor>
-    <JogLimit>5</JogLimit>
+    <JogLimit>100000000</JogLimit>
     <!--Units>rev</Units-->
 	<!-- 5294 X 4 counts/rev = 21176 counts/rev -->
     <!--ScaleFactor>21176</ScaleFactor-->

+ 20 - 0
PunkHPX8_RT/Devices/VpwCell/VpwCellDevice.cs

@@ -251,12 +251,32 @@ namespace PunkHPX8_RT.Devices.VpwCell
             OP.Subscribe($"{Module}.AutoAction", AutoOperation);
             OP.Subscribe($"{Module}.EngineeringModeAction", EngineeringModeOperation);
             OP.Subscribe($"{Module}.ProductionModeAction", ProductionModeOperation);
+            
+            OP.Subscribe($"{Module}.StartRotation", StartRotationAction);
+            OP.Subscribe($"{Module}.StopRotation", StopRotationAction);
 
         }
         #endregion
 
         #region Action
 
+        private bool StartRotationAction(string cmd, object[] args)
+        {
+            if (args.Length < 2 && (int)args[0] < 0 && (int)args[1] < 0)
+            {
+                LOG.WriteLog(eEvent.ERR_VPW, Module, $"Start rotation paramater is wrong");
+                return false;
+            }
+            double targetPostion = (int)args[0] * 6 * (int)args[1];
+            object[] param = new object[] { "",targetPostion };
+            return _rotationAxis.JogUpPosition("", param);
+        }
+
+        private bool StopRotationAction(string cmd, object[] args)
+        {
+            return _rotationAxis.StopPositionOperation();
+        }
+
         #region Flow
         /// <summary>
         /// Flow Drip on

+ 2 - 2
PunkHPX8_RT/Devices/VpwMain/VpwMainDevice.cs

@@ -607,7 +607,7 @@ namespace PunkHPX8_RT.Devices.VpwMain
         /// <returns></returns>
         public bool ChamberUp()
         {
-            return WriteVariableValue(CHAMBER_CLOSE, false);
+            return WriteVariableValue(CHAMBER_CLOSE, true);
         }
         /// <summary>
         /// 下降
@@ -615,7 +615,7 @@ namespace PunkHPX8_RT.Devices.VpwMain
         /// <returns></returns>
         public bool ChamberDown()
         {
-            return WriteVariableValue(CHAMBER_CLOSE, true);
+            return WriteVariableValue(CHAMBER_CLOSE, false);
         }
         #endregion
 

+ 1 - 1
PunkHPX8_RT/Modules/VpwCell/VpwManualPrepareRoutine.cs

@@ -169,7 +169,7 @@ namespace PunkHPX8_RT.Modules.VpwCell
         /// <returns></returns>
         private bool CheckChamberClosed()
         {
-            return _mainDevice.CommonData.ChamberClosed && !_mainDevice.CommonData.ChamberOpened;
+            return !_mainDevice.CommonData.ChamberClosed && _mainDevice.CommonData.ChamberOpened;
         }
         /// <summary>
         /// Check LoopDO数值

+ 1 - 1
PunkHPX8_RT/Modules/VpwCell/VpwRecipeRoutine.cs

@@ -94,7 +94,7 @@ namespace PunkHPX8_RT.Modules.VpwCell
         /// <returns></returns>
         private bool CheckChamberClosed()
         {
-            bool result= _mainDevice.CommonData.ChamberClosed && !_mainDevice.CommonData.ChamberOpened;
+            bool result= !_mainDevice.CommonData.ChamberClosed && _mainDevice.CommonData.ChamberOpened;
             if (!result)
             {
                 NotifyError(eEvent.ERR_VPW, $"Chamber Closed is {_mainDevice.CommonData.ChamberClosed} and opened is {_mainDevice.CommonData.ChamberOpened}",0);

+ 2 - 2
PunkHPX8_RT/Modules/VpwCell/VpwVacuumPrewetRoutine.cs

@@ -252,7 +252,7 @@ namespace PunkHPX8_RT.Modules.VpwCell
         /// <returns></returns>
         private bool CheckChamberOpened()
         {
-            return _mainDevice.CommonData.ChamberOpened && !_mainDevice.CommonData.ChamberClosed;
+            return !_mainDevice.CommonData.ChamberOpened && _mainDevice.CommonData.ChamberClosed;
         }
         /// <summary>
         /// Chamber up
@@ -273,7 +273,7 @@ namespace PunkHPX8_RT.Modules.VpwCell
         /// <returns></returns>
         private bool CheckChamberClosed()
         {
-            return !_mainDevice.CommonData.ChamberOpened && _mainDevice.CommonData.ChamberClosed;
+            return _mainDevice.CommonData.ChamberOpened && !_mainDevice.CommonData.ChamberClosed;
         }
         /// <summary>
         /// 检验真空

+ 2 - 2
PunkHPX8_RT/Modules/VpwMain/VPWHomeRoutine.cs

@@ -159,7 +159,7 @@ namespace PunkHPX8_RT.Modules.VpwMain
                 .DelayIf(HomeStep.DegasDelay,_checkFlowOk,_degasEnableDelayTime)
                 .RunIf(HomeStep.OpenDegas,_checkFlowOk,OpenDegasPump,_delay_1ms)
                 .RunIf(HomeStep.ChamberDown,_checkFlowOk, () => { return _mainDevice.ChamberDown(); }, 
-                    () => { return !_mainDevice.CommonData.ChamberClosed && _mainDevice.CommonData.ChamberOpened; })
+                    () => { return _mainDevice.CommonData.ChamberClosed && !_mainDevice.CommonData.ChamberOpened; })
                 .Run(HomeStep.LastCheckStatus,LastCheckResult,_delay_1ms)
                 .End(HomeStep.End,NullFun, _delay_1ms);
             return Runner.Status;
@@ -170,7 +170,7 @@ namespace PunkHPX8_RT.Modules.VpwMain
         /// <returns></returns>
         private bool CheckChamberClosed()
         {
-            return _mainDevice.CommonData.ChamberClosed && !_mainDevice.CommonData.ChamberOpened;
+            return !_mainDevice.CommonData.ChamberClosed && _mainDevice.CommonData.ChamberOpened;
         }
         /// <summary>
         /// 打开所有cell valve

+ 2 - 2
PunkHPX8_RT/Modules/VpwMain/VpwPurgeRoutine.cs

@@ -150,7 +150,7 @@ namespace PunkHPX8_RT.Modules.VpwMain
                 .WaitWithStopCondition(PurgeStep.CheckLastHomeRotation, CheckAllRotationHomeStatus, CheckAllRotationHomeStopStatus)
                 .Run(PurgeStep.CheckFlowOk, CheckFlowOk, _delay_1ms)
                 .RunIf(PurgeStep.ChamberDown, _checkFlowOk, () => { return _mainDevice.ChamberDown(); },
-                    () => { return !_mainDevice.CommonData.ChamberClosed && _mainDevice.CommonData.ChamberOpened; })
+                    () => { return _mainDevice.CommonData.ChamberClosed && !_mainDevice.CommonData.ChamberOpened; })
                 .Run(PurgeStep.LastCheckStatus, LastCheckResult, _delay_1ms)
                 .End(PurgeStep.End, NullFun, _delay_1ms);
             return Runner.Status;
@@ -161,7 +161,7 @@ namespace PunkHPX8_RT.Modules.VpwMain
         /// <returns></returns>
         private bool CheckChamberClosed()
         {
-            return _mainDevice.CommonData.ChamberClosed && !_mainDevice.CommonData.ChamberOpened;
+            return !_mainDevice.CommonData.ChamberClosed && _mainDevice.CommonData.ChamberOpened;
         }
         private bool SetRotationSpeed()
         {

+ 2 - 2
PunkHPX8_RT/Modules/VpwMain/VpwSimpleHomeRoutine.cs

@@ -133,7 +133,7 @@ namespace PunkHPX8_RT.Modules.VpwCelMain
         /// <returns></returns>
         private bool CheckChamberClosed()
         {
-            return _mainDevice.CommonData.ChamberClosed && !_mainDevice.CommonData.ChamberOpened;
+            return !_mainDevice.CommonData.ChamberClosed && _mainDevice.CommonData.ChamberOpened;
         }
         /// <summary>
         /// 检验Chamber打开
@@ -141,7 +141,7 @@ namespace PunkHPX8_RT.Modules.VpwCelMain
         /// <returns></returns>
         private bool CheckChamberOpened()
         {
-            return !_mainDevice.CommonData.ChamberClosed && _mainDevice.CommonData.ChamberOpened;
+            return _mainDevice.CommonData.ChamberClosed && !_mainDevice.CommonData.ChamberOpened;
         }
         /// <summary>
         /// 启动

+ 10 - 10
PunkHPX8_Themes/UserControls/VPWCellStatusControl.xaml.cs

@@ -128,15 +128,15 @@ namespace PunkHPX8_Themes.UserControls
         }
 
         public static readonly DependencyProperty InputRotationSpeedProperty = DependencyProperty.Register(
-            "InputRotationSpeed", typeof(double), typeof(VPWCellStatusControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
+            "InputRotationSpeed", typeof(int), typeof(VPWCellStatusControl), new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender));
         /// <summary>
         /// InputRotationSpeed
         /// </summary>
-        public double InputRotationSpeed
+        public int InputRotationSpeed
         {
             get
             {
-                return (double)this.GetValue(InputRotationSpeedProperty);
+                return (int)this.GetValue(InputRotationSpeedProperty);
             }
             set
             {
@@ -145,15 +145,15 @@ namespace PunkHPX8_Themes.UserControls
         }
 
         public static readonly DependencyProperty InputRotationTimeProperty = DependencyProperty.Register(
-           "InputRotationTime", typeof(double), typeof(VPWCellStatusControl), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsRender));
+           "InputRotationTime", typeof(int), typeof(VPWCellStatusControl), new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsRender));
         /// <summary>
         /// InputRotationTime
         /// </summary>
-        public double InputRotationTime
+        public int InputRotationTime
         {
             get
             {
-                return (double)this.GetValue(InputRotationTimeProperty);
+                return (int)this.GetValue(InputRotationTimeProperty);
             }
             set
             {
@@ -180,22 +180,22 @@ namespace PunkHPX8_Themes.UserControls
 
         private void ChamberOpen_Click(object sender, RoutedEventArgs e)
         {
-            InvokeClient.Instance.Service.DoOperation($"VPWMain1.ChamberUp");
+            InvokeClient.Instance.Service.DoOperation($"VPWMain1.ChamberDown");
         }
 
         private void ChamberClose_Click(object sender, RoutedEventArgs e)
         {
-            InvokeClient.Instance.Service.DoOperation($"VPWMain1.ChamberDown");
+            InvokeClient.Instance.Service.DoOperation($"VPWMain1.ChamberUp");
         }
 
         private void RotationStart_Click(object sender, RoutedEventArgs e)
         {
-
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.StartRotation", InputRotationSpeed, InputRotationTime);
         }
 
         private void RotationStop_Click(object sender, RoutedEventArgs e)
         {
-
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.StopRotation");
         }
     }
 }

+ 2 - 2
PunkHPX8_Themes/UserControls/VPWMainStateControl.xaml.cs

@@ -176,12 +176,12 @@ namespace PunkHPX8_Themes.UserControls
 
         private void ChamberOpen_Click(object sender, RoutedEventArgs e)
         {
-            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ChamberUp");
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ChamberDown");
         }
 
         private void ChamberClose_Click(object sender, RoutedEventArgs e)
         {
-            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ChamberDown");
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName}.ChamberUp");
         }
     }
 }