From 7d279fdc8ad8fb7666672486283d5d2457ff2e1f Mon Sep 17 00:00:00 2001
From: xcd <834800634@qq.com>
Date: 星期二, 30 六月 2020 16:25:50 +0800
Subject: [PATCH] 更新主流程中ImageSet到IImageSet

---
 src/Bro.Process/ProcessControl.cs |   31 ++++++++++++++++++-------------
 1 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/src/Bro.Process/ProcessControl.cs b/src/Bro.Process/ProcessControl.cs
index 1c146c5..aa74dc0 100644
--- a/src/Bro.Process/ProcessControl.cs
+++ b/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>
@@ -576,7 +581,7 @@
         #region 鍥惧儚澶勭悊
         protected HImage CollectHImage(CameraBase camera, IOperationConfig opConfig, out string imgSetId, [CallerMemberName]string methodCode = "")
         {
-            ImageSet set = null;
+            IImageSet set = null;
 
             if (IConfig.IsImageOffline)
             {

--
Gitblit v1.8.0