|
|
@@ -0,0 +1,36 @@
|
|
|
+using Aitex.Core.Util;
|
|
|
+using PunkHPX8_RT.Devices.Reservoir;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+
|
|
|
+namespace PunkHPX8_RT.Devices.PlatingCell
|
|
|
+{
|
|
|
+ public class PlatingCellOverflowLevelCurve : Singleton<PlatingCellOverflowLevelCurve>
|
|
|
+ {
|
|
|
+ /// <summary>
|
|
|
+ /// 计算Level
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="current"></param>
|
|
|
+ /// <param name="levelCurve"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public double CalculateLevelByCurrent(double current, string levelCurve)
|
|
|
+ {
|
|
|
+ string[] strAry = levelCurve.Split(',', ',');
|
|
|
+ if (strAry.Length >= 3)
|
|
|
+ {
|
|
|
+ double.TryParse(strAry[strAry.Length - 1], out double c);
|
|
|
+ double.TryParse(strAry[strAry.Length - 2], out double b);
|
|
|
+ double.TryParse(strAry[strAry.Length - 3], out double a);
|
|
|
+
|
|
|
+ return a * (current - b) + c;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|