Browse Source

revise vpw cell auto drain valve on

chenzk 4 days ago
parent
commit
f30ae293e8

+ 33 - 19
PunkHPX8_RT/Devices/VpwCell/VpwCellDevice.cs

@@ -19,6 +19,7 @@ using PunkHPX8_RT.Devices.AXIS;
 using PunkHPX8_RT.Devices.Resistivity;
 using PunkHPX8_RT.Devices.VpwMain;
 using PunkHPX8_RT.Modules;
+using PunkHPX8_RT.Modules.Reservoir;
 using PunkHPX8_RT.Modules.VpwMain;
 using System;
 using System.Collections.Generic;
@@ -80,19 +81,23 @@ namespace PunkHPX8_RT.Devices.VpwCell
         /// <summary>
         /// cell flow 初始设定值
         /// </summary>
-        private double _cellFLowSetValue;
+        private double _cellFlowSetValue;
         /// <summary>
-        /// cell流量满足初始设定值自动打开排水阀的时间
+        /// total flow 初始设定值
+        /// </summary>
+        private double _totalFlowSetValue;
+        /// <summary>
+        /// total流量满足初始设定值自动打开排水阀的时间
         /// </summary>
         private int _dripValveOpenIdlePeriod;
         /// <summary>
-        /// 检测到cell flow 满足设定条件的时间
+        /// 检测到total flow 满足设定条件的时间
         /// </summary>
-        private DateTime _cellFlowOkDetectTime;
+        private DateTime _totalFlowOkDetectTime;
         /// <summary>
-        /// 检测到cell flow 是否正常
+        /// 检测到total flow 是否正常
         /// </summary>
-        private bool _cellFlowOK;
+        private bool _totalFlowOK;
         #endregion
 
         #region 属性
@@ -644,35 +649,44 @@ namespace PunkHPX8_RT.Devices.VpwCell
             {
                 _rotationAxis.OnTimer();
             }
-            
-            //cell flow满足条件过一段时间自动打开排水阀
-            CellFlowMonitor();
-            
+
+
+            //cell flow满足条件过一段时间自动打开排水阀 (非run recipe期间)
+            VpwCellEntity vpwcellEntity = Singleton<RouteManager>.Instance.GetModule<VpwCellEntity>(Module);
+            if(vpwcellEntity != null && !vpwcellEntity.IsInReceiping)
+            {
+                CellFlowMonitor();
+            } 
             return true;
         }
 
         //cell flow满足条件过一段时间自动打开排水阀
         private void CellFlowMonitor()
         {
-            _cellFLowSetValue = SC.GetValue<double>("VPWMain.Plumbing.CellFlowStartLowLimit");
+            _cellFlowSetValue = SC.GetValue<double>("VPWMain.Plumbing.CellFlowStartLowLimit");
+            _totalFlowSetValue = SC.GetValue<double>("VPWMain.Plumbing.TotalFlowStartLowLimit");
             _dripValveOpenIdlePeriod = SC.GetValue<int>($"{Module}.DripValveOpenIdlePeriod");
-            if (_commonData.DiwFlow > _cellFLowSetValue)
+            if (MainCommonData.DiwTotalFlow > _totalFlowSetValue)
             {
-                if (!_cellFlowOK)
+                if (!_totalFlowOK)
                 {
-                    _cellFlowOK = true;
-                    _cellFlowOkDetectTime = DateTime.Now;
+                    _totalFlowOK = true;
+                    _totalFlowOkDetectTime = DateTime.Now;
                 }
-                if ((DateTime.Now - _cellFlowOkDetectTime).TotalSeconds > _dripValveOpenIdlePeriod * 60 && !_commonData.DrainValve)
+                if ((DateTime.Now - _totalFlowOkDetectTime).TotalSeconds > _dripValveOpenIdlePeriod * 60 && !_commonData.DrainValve)
                 {
-                    LOG.WriteLog(eEvent.WARN_VPW, Module, $"cell flow is lower than start limit more than {_dripValveOpenIdlePeriod} min,Drin valve on!");
+                    LOG.WriteLog(eEvent.INFO_VPW, Module, $"total flow is large than start limit more than {_dripValveOpenIdlePeriod} min,Drin valve on!");
                     DrainValveOn();
-                    _cellFlowOkDetectTime = DateTime.Now;
+                    _totalFlowOkDetectTime = DateTime.Now;
+                    if(_commonData.DiwFlow < _cellFlowSetValue)
+                    {
+                        LOG.WriteLog(eEvent.WARN_VPW, Module, $"Drin valve open failed!");
+                    }
                 }
             }
             else
             {
-                _cellFlowOK = false;
+                _totalFlowOK = false;
             }
         }
 

+ 9 - 0
PunkHPX8_RT/Modules/VpwCell/VpwCellEntity.cs

@@ -172,6 +172,15 @@ namespace PunkHPX8_RT.Modules.VpwMain
         /// recipe时长
         /// </summary>
         public int RecipeTime { get { return _recipeTime; } }
+        /// <summary>
+        /// 是否在做recipe
+        /// </summary>
+        public bool IsInReceiping
+        {
+            get { return fsm.State == (int)VPWCellState.RunReciping ||
+                        fsm.State == (int)VPWCellState.ManualReciping ||
+                         fsm.State == (int)VPWCellState.CycleManualProcessing;}
+        }
         #endregion
 
         /// <summary>