Selaa lähdekoodia

Merge branch 'master' of http://git.jetplasma-oa.com/JetPlasma/PunkHPX8

chenkui 1 päivä sitten
vanhempi
commit
dd0e2ee582

+ 1 - 0
PunkHPX8_RT/Config/System.sccfg

@@ -361,6 +361,7 @@
 		<config default="1000" name="ReclaimJerk" nameView="ReclaimJerk" description="Reclaim Jerk" max="10000" min="0" paramter="" tag="" unit="mm/s^3" type="Integer"></config>
 		<config default="false" name="PostProcessCurrentEnable" nameView="PostProcessCurrentEnable" description="Post Process Current Enable" max="" min="" paramter="" tag="" unit="" type="Bool"/>
 		<config default="0.1" name="PostProcessCurrentSetPoint" nameView="PostProcessCurrentSetPoint" description="Post Process Current SetPoint" max="10" min="0" paramter="" tag="A" unit="" type="Double"></config>
+	    <config default="12.76,4,0" name="OverFlowLevelCurve" nameView="OverFlowLevelCurve" description="OverFlow Level Curve " max="" min="" paramter="" tag="" unit="" type="String" />
 		<configs name="CSR" nameView="CSR">
 			<config default="true" name="CSREnable" nameView="CSREnable" description="CSR Enabled" max="" min="" paramter="" tag="" unit="" type="Bool"/>
 			<config default="80" name="RinseSpeed" nameView="RinseSpeed" description="Rinse Speed" max="1000" min="0" paramter="" tag="" unit="rpm" type="Integer"></config>

+ 6 - 8
PunkHPX8_RT/Devices/AXIS/JetAxisBase.cs

@@ -481,25 +481,23 @@ namespace PunkHPX8_RT.Devices.AXIS
         public bool CheckMotoPositionInPosition(string position,double offset)
         {
             double checkPosition = 0;
+            bool isInStation = false;
             foreach (Station item in _stationAxis.Stations)
             {
                 if (item.Name == position)
                 {
+                    isInStation = true;
                     checkPosition = double.Parse(item.Position);
                     break;
                 }
             }
-            checkPosition = checkPosition + offset;
-            
-            if(MotionData.MotorPosition <= checkPosition + _stationAxis.ToleranceDefault &&
-                MotionData.MotorPosition >= checkPosition - _stationAxis.ToleranceDefault)
-            {
-                return true;
-            }
-            else
+            if (!isInStation)
             {
+                LOG.WriteLog(eEvent.INFO_AXIS, $"{Module}.{Name}", $"position:{position} is not in Station list");
                 return false;
             }
+            checkPosition = checkPosition + offset;
+            return Math.Abs(MotionData.MotorPosition - checkPosition) <= _stationAxis.ToleranceDefault;
         }
         /// <summary>
         /// 计算所处当前工位

+ 3 - 1
PunkHPX8_RT/Devices/PlatingCell/PlatingCellDevice.cs

@@ -383,7 +383,9 @@ namespace PunkHPX8_RT.Devices.PlatingCell
                 property.SetValue(_platingCellData, value);
                 if (variable == OVERFLOW_LEVEL)
                 {
-                    double waterLevel = CurrentToWaterLevel(Convert.ToDouble(value));
+                    string LevelCurve = SC.GetStringValue($"PlatingCell.OverFlowLevelCurve");
+                    double waterLevel = PlatingCellOverflowLevelCurve.Instance.CalculateLevelByCurrent(Convert.ToDouble(value), LevelCurve);
+                    //double waterLevel = CurrentToWaterLevel(Convert.ToDouble(value));
                     _platingCellData.OverFlowLevel = waterLevel;
                     if (_platingCellData.OverFlowLevel >= _overflowLevelHigh)
                     {

+ 36 - 0
PunkHPX8_RT/Devices/PlatingCell/PlatingCellOverflowLevelCurve.cs

@@ -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;
+            }
+        }
+    }
+}

+ 1 - 1
PunkHPX8_RT/Modules/PlatingCell/PlatingCellRunRecipeRoutine.cs

@@ -398,7 +398,7 @@ namespace PunkHPX8_RT.Modules.PlatingCell
             {
                 _isZeroCurrent = true;
             }
-            if(_maxCurrent < _recipe.EntryCurrent)//最大电流要考虑entry current
+            if(_maxCurrent < _recipe.EntryCurrent)//记录最大电流要考虑entry current
             {
                 _maxCurrent = _recipe.EntryCurrent;
             }