| 
					
				 | 
			
			
				@@ -25,6 +25,7 @@ namespace FurnaceRT.Equipments.PMs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public partial class PMModule
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private string _currentLeakCheckFileName = "";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private Dictionary<int, LeakCheckTableParameter> _leakCheckDic;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private int _currentRetryCount = 0;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -38,7 +39,7 @@ namespace FurnaceRT.Equipments.PMs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private bool _isLeakCheckFinished = false;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private Stopwatch _leakCheckDelayTimer = new Stopwatch();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private Stopwatch _leakCheckTimer = new Stopwatch();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        private string _leakCheckStatus = "None";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private int _leakCheckStatus = (int)LeakCheckStatusEnum.None;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private LeakCheckTableParameter _leakCheckTableParameter = null;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private void InitLeakCheckData()
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         {
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -60,7 +61,7 @@ namespace FurnaceRT.Equipments.PMs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             DATA.Subscribe($"{Module}.LeakCheckLeakLimit", () => _leakCheckTableParameter != null ? _leakCheckTableParameter.LeakLimit : 0.0f);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             DATA.Subscribe($"{Module}.LeakCheckDelayMonitorPressure", () => _leakCheckTableParameter != null && _leakCheckDelayTimer.IsRunning && !_leakCheckTimer.IsRunning ? (float)_leakCheckDelayMonitorPressure : 0.0f);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             DATA.Subscribe($"{Module}.LeakCheckDelayStartPressure", () => _leakCheckTableParameter != null && _leakCheckDelayTimer.IsRunning ? (float)_leakCheckDelayStartPressure : 0.0f);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            DATA.Subscribe($"{Module}.LeakCheckMonitorPressure", () => _leakCheckTableParameter != null && _leakCheckTimer.IsRunning && !_leakCheckDelayTimer.IsRunning  ? (float)_leakCheckMonitorPressure : 0.0f);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            DATA.Subscribe($"{Module}.LeakCheckMonitorPressure", () => _leakCheckTableParameter != null && _leakCheckTimer.IsRunning && !_leakCheckDelayTimer.IsRunning ? (float)_leakCheckMonitorPressure : 0.0f);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             DATA.Subscribe($"{Module}.LeakCheckStartPressure", () => _leakCheckTableParameter != null && !_leakCheckDelayTimer.IsRunning && _leakCheckTimer.IsRunning ? (float)_leakCheckStartPressure : 0.0f);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             DATA.Subscribe($"{Module}.LeakCheckActualLeak", () => (float)_leakCheckActualLeak);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             DATA.Subscribe($"{Module}.LeakCheckRetryCurrentCount", () => _currentRetryCount);
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -74,7 +75,6 @@ namespace FurnaceRT.Equipments.PMs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _basePressure = -1;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _isLeakCheckFinished = false;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _leakCheckActualLeak = 0;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            _leakCheckDelayStartPressure = 0;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _leakCheckDelayMonitorPressure = 0;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _leakCheckStartPressure = 0;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -86,7 +86,7 @@ namespace FurnaceRT.Equipments.PMs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!ret)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            _leakCheckStatus = "BasePressureCheck";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _leakCheckStatus = (int)LeakCheckStatusEnum.BasePressureCheck;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _currentLeakCheckIndex = index;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _basePressure = _leakCheckTableParameter.PressureSensor.Value;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -120,7 +120,7 @@ namespace FurnaceRT.Equipments.PMs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public void InitLeakCheck(string fileName)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            _leakCheckStatus = "None";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _leakCheckStatus = (int)LeakCheckStatusEnum.None;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _currentRetryCount = 0;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (string.IsNullOrEmpty(fileName))
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             {
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -246,27 +246,24 @@ namespace FurnaceRT.Equipments.PMs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public bool CheckLeakCheckFinish()
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (_leakCheckStatus == "None")//没在leakCheck状态
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (_leakCheckDic == null || _currentLeakCheckIndex < 0)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return true;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (_isLeakCheckFinished)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                StopLeakCheckTimer();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 _currentRetryCount = 0;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return true;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (_leakCheckDic == null || _currentLeakCheckIndex < 0)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                return true;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             var ret = _leakCheckDic.TryGetValue(_currentLeakCheckIndex, out var leakCheckParameter);
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!ret)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return true;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if (_isLeakCheckFinished)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (_leakCheckDelayTimer.IsRunning)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    _leakCheckDelayTimer.Stop();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (_leakCheckTimer.IsRunning)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    _leakCheckTimer.Stop();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!_leakCheckDelayTimer.IsRunning && !_leakCheckTimer.IsRunning)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             {
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -276,7 +273,7 @@ namespace FurnaceRT.Equipments.PMs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (_leakCheckDelayTimer.IsRunning && _leakCheckDelayTimer.ElapsedMilliseconds >= leakCheckParameter.DelayTime * 1000)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                _leakCheckStatus = "LeakCheck";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                _leakCheckStatus = (int)LeakCheckStatusEnum.LeakCheck;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (!_leakCheckTimer.IsRunning)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     _leakCheckDelayMonitorPressure = leakCheckParameter.PressureSensor.Value;
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -291,8 +288,8 @@ namespace FurnaceRT.Equipments.PMs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (!_leakCheckTimer.IsRunning)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     _leakCheckDelayMonitorPressure = leakCheckParameter.PressureSensor.Value;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    _leakCheckStatus = "LeakCheckDelay";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-           
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    _leakCheckStatus = (int)LeakCheckStatusEnum.LeakCheckDelay;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -335,7 +332,7 @@ namespace FurnaceRT.Equipments.PMs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     _isLeakCheckFinished = true;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    _leakCheckStatus = "None";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    _leakCheckStatus = (int)LeakCheckStatusEnum.None;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     _leakCheckTimer.Stop();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     _leakCheckDelayTimer.Stop();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     LOG.Write($"Leak check completed, leak rate={_leakCheckActualLeak}, delay time={leakCheckParameter.DelayTime}, check time={leakCheckParameter.CheckTime}, leak limit={leakCheckParameter.LeakLimit}, retry info={_currentRetryCount}/{leakCheckParameter.RetryLimit}");
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -346,8 +343,13 @@ namespace FurnaceRT.Equipments.PMs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public void AbortLeakCheck()
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            _leakCheckStatus = "None";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _leakCheckStatus = (int)LeakCheckStatusEnum.None;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _currentRetryCount = 0;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            StopLeakCheckTimer();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        public void StopLeakCheckTimer()
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (_leakCheckDelayTimer.IsRunning)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 _leakCheckDelayTimer.Stop();
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -357,7 +359,7 @@ namespace FurnaceRT.Equipments.PMs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private void ProcessLeakCheckErrorCommand(string command)
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         {
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             _isLeakCheckFinished = true;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            _leakCheckStatus = "None";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            _leakCheckStatus = (int)LeakCheckStatusEnum.None;
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             var recipe = "";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             var recipeType = "";
 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             var recipeTable = "";
 
			 |