领胜LDS 键盘AOI检测项目
wells.liu
2020-07-11 eb4b6e7a257aaae8f65f770928a7d9b317347a39
Merge branch 'master' of http://gitblit.broconcentric.com:8088/r/M071
1个文件已修改
26 ■■■■ 已修改文件
src/Bro.Device.GTSCard/GTSCardDriver.cs 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.Device.GTSCard/GTSCardDriver.cs
@@ -269,7 +269,7 @@
            ClearStatus(1, IConfig.AxisSettings.FindAll(u => u.IsAxisEnabled).Count);
            if (res != (short)GTSRetCode.GRCRunOK)
            {
                throw new Exception("板卡载入配置文件异常,错误码:" + res);
                throw new ProcessException("板卡载入配置文件异常,错误码:" + res);
            }
        }
@@ -377,7 +377,7 @@
            var resultOK = resultCode.All(u => u == (short)GTSRetCode.GRCRunOK);
            if (!resultOK)
            {
                throw new Exception("轴" + optionPara.AxisIndex + "设置参数异常,错误码:" + string.Join(",", resultCode));
                throw new ProcessException("轴" + optionPara.AxisIndex + "设置参数异常,错误码:" + string.Join(",", resultCode));
            }
            return resultOK;
        }
@@ -461,7 +461,7 @@
            var ret = GTSCardAPI.GT_GetPrfPos((short)IConfig.CardNum, (short)axisNum, out prfpos, 1, out pclock);
            if (ret != (short)GTSRetCode.GRCRunOK)
            {
                throw new Exception("轴" + axisNum + "获取规划位置异常,错误码:" + ret);
                throw new ProcessException("轴" + axisNum + "获取规划位置异常,错误码:" + ret);
            }
            //var AxisRatio = IConfig.AxisSettings.FirstOrDefault(u => u.AxisIndex == axisNum) == null ? 1 : IConfig.AxisSettings.FirstOrDefault(u => u.AxisIndex == axisNum).AxisRatio;
            position = prfpos;
@@ -482,7 +482,7 @@
                var ret = GTSCardAPI.GT_GetPrfPos((short)IConfig.CardNum, (short)axisNum, out pPos, 1, out uint pclock);
                if (ret != (short)GTSRetCode.GRCRunOK)
                {
                    throw new Exception("轴" + axisNum + "获取目标位置异常,错误码:" + ret);
                    throw new ProcessException("轴" + axisNum + "获取目标位置异常,错误码:" + ret);
                }
                //var AxisRatio = IConfig.AxisSettings.FirstOrDefault(u => u.AxisIndex == axisNum) == null ? 1 : IConfig.AxisSettings.FirstOrDefault(u => u.AxisIndex == axisNum).AxisRatio;
                position = pPos;
@@ -502,7 +502,7 @@
            var ret = GTSCardAPI.GT_GetPrfVel((short)IConfig.CardNum, (short)axisNum, out prfVel, 1, out pclock);
            if (ret != (short)GTSRetCode.GRCRunOK)
            {
                throw new Exception("轴" + axisNum + "获取规划速度异常,错误码:" + ret);
                throw new ProcessException("轴" + axisNum + "获取规划速度异常,错误码:" + ret);
            }
            return prfVel;
        }
@@ -518,7 +518,7 @@
            var ret = GTSCardAPI.GT_GetVel((short)IConfig.CardNum, (short)axisNum, out vel);
            if (ret != (short)GTSRetCode.GRCRunOK)
            {
                throw new Exception("轴" + axisNum + "获取当前速度异常,错误码:" + ret);
                throw new ProcessException("轴" + axisNum + "获取当前速度异常,错误码:" + ret);
            }
            return vel;
        }
@@ -576,7 +576,7 @@
                if (_isResetting)
                {
                    LogAsync(DateTime.Now, "复位过程异常", "轴" + optionPara.AxisIndex + "试图在复位过程中运动");
                    throw new Exception("轴" + optionPara.AxisIndex + "试图在复位过程中运动");
                    throw new ProcessException("轴" + optionPara.AxisIndex + "试图在复位过程中运动");
                }
                int repeatTime = 30;
@@ -595,7 +595,7 @@
                if (CurrentState != EnumHelper.DeviceState.DSOpen)
                {
                    LogAsync(DateTime.Now, "非正常状态异常", "轴" + optionPara.AxisIndex + "试图在非正常状态运动");
                    throw new Exception("轴" + optionPara.AxisIndex + "试图在非正常状态运动", null);
                    throw new ProcessException("轴" + optionPara.AxisIndex + "试图在非正常状态运动", null);
                }
                LogAsync(DateTime.Now, "轴" + optionPara.AxisIndex + "开始运动", "目标坐标:" + optionPara.Destination);
@@ -657,7 +657,7 @@
                if (_isResetting)
                {
                    LogAsync(DateTime.Now, "复位过程异常", "轴" + optionPara.AxisIndex + "试图在复位过程中运动");
                    throw new Exception("轴" + optionPara.AxisIndex + "试图在复位过程中运动");
                    throw new ProcessException("轴" + optionPara.AxisIndex + "试图在复位过程中运动");
                }
                int repeatTime = 30;
                while (CurrentState != EnumHelper.DeviceState.DSOpen && repeatTime > 0)
@@ -674,7 +674,7 @@
                if (CurrentState != EnumHelper.DeviceState.DSOpen)
                {
                    LogAsync(DateTime.Now, "非正常状态异常", "轴" + optionPara.AxisIndex + "试图在非正常状态运动");
                    throw new Exception("轴" + optionPara.AxisIndex + "试图在非正常状态运动", null);
                    throw new ProcessException("轴" + optionPara.AxisIndex + "试图在非正常状态运动", null);
                }
                LogAsync(DateTime.Now, "轴" + optionPara.AxisIndex + "开始运动", "目标坐标:" + optionPara.Destination);
                short ret = 0;
@@ -738,7 +738,7 @@
                if (ret != (short)GTSRetCode.GRCRunOK)
                {
                    LogAsync(DateTime.Now, "轴" + axisNum + "运动停止异常", "错误码:" + ret);
                    throw new Exception("轴" + axisNum + "运动停止异常,错误码:" + ret);
                    throw new ProcessException("轴" + axisNum + "运动停止异常,错误码:" + ret);
                }
                else
                {
@@ -878,13 +878,13 @@
                if (repeatTime <= 0)
                {
                    MoveStop((short)movingOption.AxisIndex, 0);
                    throw new Exception($"运动轴{movingOption.AxisIndex} ,回原点超时异常");
                    throw new ProcessException($"运动轴{movingOption.AxisIndex} ,回原点超时异常");
                }
                if (isStop && capture != 1)
                {
                    ClearStatus((short)movingOption.AxisIndex, 1);
                    throw new Exception($"运动轴{movingOption.AxisIndex} ,回原点超时异常");
                    throw new ProcessException($"运动轴{movingOption.AxisIndex} ,回原点超时异常");
                }
                if (capture == 1)