| | |
| | | #endregion |
| | | |
| | | #region Halcon算子设置 |
| | | private void InitialHalconTool() |
| | | protected virtual void InitialHalconTool() |
| | | { |
| | | foreach (HDevEngineTool tool in _halconToolDict.Values) |
| | | { |
| | |
| | | { |
| | | 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> |