领胜LDS 键盘AOI检测项目
wells.liu
2020-06-29 c339e592f9232e460602093cb3248adf2484eebb
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,22 +413,27 @@
                {
                    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>
        /// 获取预先载入的Halcon算法
        /// </summary>