Browse Source

revise auto open vpw drip valve bug when recipe done

chenzk 12 hours ago
parent
commit
53f8d577aa
1 changed files with 16 additions and 15 deletions
  1. 16 15
      PunkHPX8_RT/Devices/VpwCell/VpwCellDevice.cs

+ 16 - 15
PunkHPX8_RT/Devices/VpwCell/VpwCellDevice.cs

@@ -95,9 +95,9 @@ namespace PunkHPX8_RT.Devices.VpwCell
         /// </summary>
         private DateTime _totalFlowOkDetectTime;
         /// <summary>
-        /// 检测到total flow 是否正常
+        /// 是否在检测totalflow的周期中
         /// </summary>
-        private bool _totalFlowOK;
+        private bool _isIntotalFlowCheck=false;
         #endregion
 
         #region 属性
@@ -611,10 +611,10 @@ namespace PunkHPX8_RT.Devices.VpwCell
         /// <returns></returns>
         public bool RotationProfilePosition(double position)
         {
-            VpwMainDevice vpwCellDevice = DEVICE.GetDevice<VpwMainDevice>(ModuleName.VPWMain1.ToString());
-            if (vpwCellDevice != null)
+            VpwMainDevice vpwMainDevice = DEVICE.GetDevice<VpwMainDevice>(ModuleName.VPWMain1.ToString());
+            if (vpwMainDevice != null)
             {
-                if (vpwCellDevice.CommonData.ChamberOpened && !vpwCellDevice.CommonData.ChamberClosed)
+                if (vpwMainDevice.CommonData.ChamberOpened && !vpwMainDevice.CommonData.ChamberClosed)
                 {
                     LOG.WriteLog(eEvent.ERR_AXIS, $"{Module}.{Name}", "chamber is not closed, Cannot execute Rotation Profile Position");
                     return false;
@@ -653,10 +653,14 @@ namespace PunkHPX8_RT.Devices.VpwCell
 
             //cell flow满足条件过一段时间自动打开排水阀 (非run recipe期间)
             VpwCellEntity vpwcellEntity = Singleton<RouteManager>.Instance.GetModule<VpwCellEntity>(Module);
-            if(vpwcellEntity != null && !vpwcellEntity.IsInReceiping)
+            if(vpwcellEntity != null && vpwcellEntity.IsIdle)
             {
                 CellFlowMonitor();
-            } 
+            }
+            else
+            {
+                _isIntotalFlowCheck = false;
+            }
             return true;
         }
 
@@ -668,26 +672,23 @@ namespace PunkHPX8_RT.Devices.VpwCell
             _dripValveOpenIdlePeriod = SC.GetValue<int>($"{Module}.DripValveOpenIdlePeriod");
             if (MainCommonData.DiwTotalFlow > _totalFlowSetValue)
             {
-                if (!_totalFlowOK)
+                if (!_isIntotalFlowCheck)
                 {
-                    _totalFlowOK = true;
                     _totalFlowOkDetectTime = DateTime.Now;
+                    _isIntotalFlowCheck = true;
                 }
-                if (_totalFlowOK == true && (_totalFlowOkDetectTime - DateTime.Now).TotalSeconds > (_dripValveOpenIdlePeriod * 60) && !_commonData.FlowDrip)
+                else if((DateTime.Now - _totalFlowOkDetectTime).TotalSeconds > (_dripValveOpenIdlePeriod * 60) && !_commonData.FlowDrip)
                 {
+                    _isIntotalFlowCheck = false;//重置监控周期
                     LOG.WriteLog(eEvent.INFO_VPW, Module, $"total flow is large than start limit more than {_dripValveOpenIdlePeriod} min,Drip valve on!");
                     FlowDripOn();
-                    _totalFlowOkDetectTime = DateTime.Now;
                     if(_commonData.DiwFlow <= 0)
                     {
                         LOG.WriteLog(eEvent.WARN_VPW, Module, $"Drip valve open failed!");
                     }
                 }
             }
-            else
-            {
-                _totalFlowOK = false;
-            }
+            
         }
 
         /// <summary>