领胜LDS 键盘AOI检测项目
wells.liu
2020-07-01 e9f47e76b9932949c9df829e98b09938eb93e870
src/Bro.Process/ProcessControl.cs
@@ -398,7 +398,7 @@
        #endregion
        #region Halcon算子设置
        private void InitialHalconTool()
        protected virtual void InitialHalconTool()
        {
            foreach (HDevEngineTool tool in _halconToolDict.Values)
            {
@@ -413,20 +413,25 @@
                {
                    toolPath.GetHalconToolPathList().ForEach(path =>
                    {
                        if (!string.IsNullOrWhiteSpace(path))
                        {
                            string directoryPath = Path.GetDirectoryName(path);
                            string fileName = Path.GetFileNameWithoutExtension(path);
                            HDevEngineTool tool = new HDevEngineTool(directoryPath);
                            tool.LoadProcedure(fileName);
                            //使用“|”作为间隔符
                            _halconToolDict[monitorSet.Id + "|" + path] = tool;
                        }
                        LoadHalconTool(path, monitorSet.Id);
                    });
                }
            });
        }
        protected void LoadHalconTool(string algorithemPath, string prefix)
        {
            if (!string.IsNullOrWhiteSpace(algorithemPath))
            {
                string directoryPath = Path.GetDirectoryName(algorithemPath);
                string fileName = Path.GetFileNameWithoutExtension(algorithemPath);
                HDevEngineTool tool = new HDevEngineTool(directoryPath);
                tool.LoadProcedure(fileName);
                //使用“|”作为间隔符
                _halconToolDict[prefix + "|" + algorithemPath] = tool;
            }
        }
        /// <summary>
@@ -479,7 +484,7 @@
        #endregion
        #region IMonitor监听
        protected virtual void OnMonitorInvoke(DateTime dt, string deviceId, IDevice sourceDevice, MonitorSet monitorSet)
        protected virtual void OnMonitorInvoke(DateTime dt, string deviceId, IDevice sourceDevice, IMonitorSet monitorSet)
        {
            string methodCode = monitorSet.MethodCode;
@@ -637,9 +642,9 @@
        #endregion
        #region 报警和DownTime
        ObservableCollection<WarningSet> _warningRemains = new ObservableCollection<WarningSet>();
        ObservableCollection<IWarningSet> _warningRemains = new ObservableCollection<IWarningSet>();
        protected virtual void OnMonitorAlarm(DateTime dt, IDevice device, WarningSet warning)
        protected virtual void OnMonitorAlarm(DateTime dt, IDevice device, IWarningSet warning)
        {
            if (warning.CurrentStatus)
            {