领胜LDS 键盘AOI检测项目
wells.liu
2020-07-02 f391747ad784f65c4f5c8f6640e094d01f3fdb79
src/Bro.Device.GTSCard/GTSCardDriver.cs
@@ -18,7 +18,7 @@
namespace Bro.Device.GTSCard
{
    [Device("GTSCard", "固高板卡", EnumHelper.DeviceAttributeType.Device)]
    public class GTSCardDriver : DeviceBase, IMonitor, IMotion
    public class GTSCardDriver : MotionCardBase
    {
        // 异常事件
        public Action<Exception> OnExceptionRaised;
@@ -42,7 +42,7 @@
            _isResetting = isReset;
        }
        public List<AxisInfo> GetCurrentAxisInfo(params string[] axisName)
        public override List<AxisInfo> GetCurrentAxisInfo(params string[] axisName)
        {
            throw new NotImplementedException();
        }
@@ -74,6 +74,11 @@
            AllMoveStop();
            AllAxisOff();
        }
        public override ResponseMessage Run(IOperationConfig config)
        {
            throw new NotImplementedException();
        }
        #endregion
        #region GTSCard
@@ -93,6 +98,7 @@
                throw new Exception("板卡载入配置文件异常,错误码:" + res);
            }
        }
        public bool AllAxisOn()
        {
@@ -153,7 +159,7 @@
        /// </summary>
        /// <param name="item">运动对象</param>
        /// <returns>运动控制+停止判断</returns>
        public ResponseMessage MoveToPoint(IOperationConfig opConfig)
        public override ResponseMessage MoveToPoint(IOperationConfig opConfig)
        {
            bool resultOK = false;
            var gtsOperationConfig = opConfig as GTSCardOperationConfig;
@@ -680,8 +686,6 @@
        #endregion
        #region IMonitor
        public event Action<DateTime, string, IDevice, IMonitorSet> OnMonitorInvoke;
        public event Action<DateTime, IDevice, IWarningSet> OnMonitorAlarm;
        public List<IOItem> MonitorValues { get; set; } = new List<IOItem>();
@@ -718,7 +722,7 @@
            return result;
        }
        public async void Monitor()
        public async override void Monitor()
        {
            await Task.Run(() =>
            {
@@ -805,7 +809,7 @@
                    warningSet.TriggerTime = DateTime.Now;
                    warningSet.WarningDescription = $"警报:{warningSet.Name}-触发索引:{warningSet.TriggerIndex}-{warningSet.WarningIOModel.GetEnumDescription()}:{warningSet.WarningCode}";
                    SaveAlarmCSVAsync(DateTime.Now, this.Name, warningSet);
                    OnMonitorAlarm?.BeginInvoke(DateTime.Now, this, warningSet, null, null);
                    ExcuteMonitorAlarm(DateTime.Now, this, warningSet);
                }
            });
            #endregion
@@ -836,14 +840,14 @@
                        //    return tempNew[index].Value;
                        //}).ToList();
                        OnMonitorInvoke?.BeginInvoke(DateTime.Now, monitorSet.InvokeDevice, this, monitorSet, OnMethodInvoked, monitorSet);
                        ExcuteMonitorInvok(DateTime.Now, monitorSet.InvokeDevice, this, monitorSet);
                    }
                }
            });
            #endregion
        }
        public void ResetAlarm()
        public override void ResetAlarm()
        {
            int axis_sts;
            uint clk;