From 2ad4cf6d588bd9bc446e8bde2a916c17aec3dad6 Mon Sep 17 00:00:00 2001
From: Gokiburi <Gokiburi@DESKTOP-9ITC11L>
Date: 星期二, 17 六月 2025 11:49:48 +0800
Subject: [PATCH] 增加离线测试功能

---
 libs/halcon12/halcondotnet.dll                      |    0 
 /dev/null                                           |  120 ------------------------
 libs/halcon12/hdevenginedotnet.dll                  |    0 
 src/Bro.M141.Process/Properties/launchSettings.json |    7 +
 src/Bro.M141_AOI1.Process/AOI1Process.cs            |    2 
 src/Bro.M135.Common/Bro.M135.Common.csproj          |    7 -
 src/Bro.M141.Process/M141Config.cs                  |   32 ++++++
 src/Bro.M141.Process/M141Models.cs                  |    3 
 src/Bro.M135.Common/Properties/launchSettings.json  |    7 +
 src/Bro.M141.Process/M141Process_ImageCheck.cs      |  110 ++++++++++++++++++++++
 10 files changed, 161 insertions(+), 127 deletions(-)

diff --git a/libs/halcon12/halcondotnet.dll b/libs/halcon12/halcondotnet.dll
index 52831e9..6b217c0 100644
--- a/libs/halcon12/halcondotnet.dll
+++ b/libs/halcon12/halcondotnet.dll
Binary files differ
diff --git a/libs/halcon12/hdevenginedotnet.dll b/libs/halcon12/hdevenginedotnet.dll
index e6c23df..9252032 100644
--- a/libs/halcon12/hdevenginedotnet.dll
+++ b/libs/halcon12/hdevenginedotnet.dll
Binary files differ
diff --git a/src/Bro.M135.Common/Bro.M135.Common.csproj b/src/Bro.M135.Common/Bro.M135.Common.csproj
index 67153ca..5fd9006 100644
--- a/src/Bro.M135.Common/Bro.M135.Common.csproj
+++ b/src/Bro.M135.Common/Bro.M135.Common.csproj
@@ -22,6 +22,7 @@
   </ItemGroup>
 
   <ItemGroup>
+    <PackageReference Include="Microsoft.Windows.CppWinRT" Version="2.0.250303.1" />
     <PackageReference Include="System.Drawing.Common" Version="6.0.0" />
     <PackageReference Include="System.Security.Cryptography.Pkcs" Version="6.0.3" />
     <PackageReference Include="System.Security.Cryptography.Xml" Version="6.0.1" />
@@ -55,12 +56,6 @@
     <Reference Include="SunnyUI.Common">
       <HintPath>..\..\libs\Nuget\SunnyUI.Common.dll</HintPath>
     </Reference>
-  </ItemGroup>
-
-  <ItemGroup>
-    <Compile Update="FrmProductList.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
   </ItemGroup>
 
 </Project>
diff --git a/src/Bro.M135.Common/FrmProductList.Designer.cs b/src/Bro.M135.Common/FrmProductList.Designer.cs
deleted file mode 100644
index de39347..0000000
--- a/src/Bro.M135.Common/FrmProductList.Designer.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-锘縩amespace Bro.M135.Common
-{
-    partial class FrmProductList
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            this.components = new System.ComponentModel.Container();
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(800, 450);
-            this.Text = "FrmProductList";
-        }
-
-        #endregion
-    }
-}
\ No newline at end of file
diff --git a/src/Bro.M135.Common/FrmProductList.cs b/src/Bro.M135.Common/FrmProductList.cs
deleted file mode 100644
index 13fc454..0000000
--- a/src/Bro.M135.Common/FrmProductList.cs
+++ /dev/null
@@ -1,194 +0,0 @@
-锘縰sing Bro.Common.Helper;
-using Bro.Common.Interface;
-using Bro.Common.Model;
-using Bro.UI.Model.Winform;
-using Sunny.UI;
-using System.ComponentModel;
-using System.Data;
-
-namespace Bro.M135.Common
-{
-    //[MenuNode("ProductList", "浜у搧鍒楄〃", 2, EnumHelper.TopMenu.SystemInfo, MenuNodeType.Form)]
-    public partial class FrmProductList : MenuFormBase
-    {
-        DataGridView dgvProducts = new DataGridView();
-        bool _isFirstLoaded = true;
-        object _loadLock = new object();
-
-
-        //BindingList<dynamic> BindDatas = new BindingList<dynamic>();
-
-        BindingList<Dictionary<string, object>> BindDatas = new BindingList<Dictionary<string, object>>();
-
-        public FrmProductList()
-        {
-            InitializeComponent();
-
-            dgvProducts.AutoGenerateColumns = false;
-            dgvProducts.ReadOnly = true;
-            dgvProducts.AllowUserToAddRows = false;
-            dgvProducts.AllowUserToDeleteRows = false;
-            dgvProducts.Dock = DockStyle.Fill;
-            dgvProducts.RowsAdded += DgvProducts_RowsAdded;
-            this.Controls.Add(dgvProducts);
-
-            var head = new Dictionary<string, string>() { { "PID", "PID" }, { "鏉$爜", "SN" }, { "妫�娴嬬粨鏋�", "Result" } };
-            head.ForEach(u =>
-            {
-                DataGridViewColumn col = new DataGridViewTextBoxColumn();
-                col.HeaderText = u.Key;
-                col.DataPropertyName = u.Value;
-                col.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
-
-                dgvProducts.Columns.Add(col);
-            });
-
-            dgvProducts.DataSource = BindDatas;
-        }
-
-        private void DgvProducts_RowsAdded(object? sender, DataGridViewRowsAddedEventArgs e)
-        {
-            int rowIndex = e.RowIndex;
-            if (rowIndex < 0)
-                return;
-
-            try
-            {
-                if (dgvProducts.Rows[rowIndex].DataBoundItem is Dictionary<string, object> model)
-                {
-                    for (int i = 0; i < dgvProducts.Columns.Count; i++)
-                    {
-                        string propName = dgvProducts.Columns[i].DataPropertyName;
-                        var cell = dgvProducts.Rows[rowIndex].Cells[i];
-                        cell.Value = model[propName];
-
-                        if (i == 2)
-                        {
-                            if (cell.Value.ToString().ToUpper().StartsWith("OK"))
-                            {
-                                cell.Style.BackColor = Color.Lime;
-                            }
-                            else
-                            {
-                                cell.Style.BackColor = Color.Red;
-                            }
-                        }
-                        else if (i > 2 && i < dgvProducts.Columns.Count - 1)
-                        {
-                            var measureResult = model[$"{propName}_MeasureResult"] as bool?;
-                            if (measureResult == null)
-                            {
-                                cell.Style.BackColor = Color.Orange;
-                            }
-                            else if (measureResult.Value == false)
-                            {
-                                cell.Style.BackColor = Color.Red;
-                            }
-                        }
-                        else if (i == dgvProducts.Columns.Count - 1)
-                        {
-                            if (!string.IsNullOrWhiteSpace(cell.Value.ToString()))
-                            {
-                                cell.Style.BackColor = Color.Red;
-                            }
-                        }
-                    }
-                }
-            }
-            catch (Exception ex)
-            {
-                CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Error, $"鐣岄潰娣诲姞鏂颁骇鍝佹暟鎹椂寮傚父锛寋ex.GetExceptionMessage()}");
-            }
-        }
-
-        public override void OnProcessUpdated()
-        {
-            base.OnProcessUpdated();
-
-            if (Process is IUpdateProductData upd)
-            {
-                upd.OnUpdateProductData -= Upd_OnUpdateProductData;
-                upd.OnUpdateProductData += Upd_OnUpdateProductData;
-            }
-        }
-
-        private async void Upd_OnUpdateProductData(ProductModel p)
-        {
-            await Task.Run(() =>
-            {
-                this.Invoke(() =>
-                {
-                    var specList = p.Details.SelectMany(u => u.SpecList ?? new List<ISpec>()).ToList();
-                    specList.AddRange(p.Details.SelectMany(u => u.ResultList.SelectMany(s => s.Specs.Select(m => (Spec)m))));
-                    specList.Sort((a, b) => string.Compare(a.Code, b.Code));
-
-                    if (_isFirstLoaded)
-                    {
-                        lock (_loadLock)
-                        {
-                            if (_isFirstLoaded)
-                            {
-                                _isFirstLoaded = false;
-
-                                specList.ForEach(s =>
-                                {
-                                    DataGridViewColumn col = new DataGridViewTextBoxColumn();
-                                    col.HeaderText = s.Code;
-                                    col.DataPropertyName = s.Code;
-                                    col.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
-                                    col.DefaultCellStyle.Format = "f4";
-
-                                    dgvProducts.Columns.Add(col);
-                                });
-
-                                DataGridViewColumn col = new DataGridViewTextBoxColumn();
-                                col.HeaderText = "缂洪櫡姹囨��";
-                                col.DataPropertyName = "Defects";
-                                col.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;
-
-                                dgvProducts.Columns.Add(col);
-                            }
-                        }
-                    }
-
-                    Dictionary<string, object> model = new Dictionary<string, object>();
-                    model["PID"] = p.PID;
-                    model["SN"] = p.SN;
-                    model["Result"] = p.Result;
-                    specList.ForEach(s =>
-                    {
-                        model[s.Code] = s.GetMeasureValueStr();
-                        model[$"{s.Code}_MeasureResult"] = s.MeasureResult;
-                    });
-
-                    var defects = p.Details.SelectMany(u => u.ResultList.GetDefectDescList()).ToList();
-                    defects.AddRange(p.Details.SelectMany(u => u.DefectList));
-                    defects.AddRange(p.Details.SelectMany(u => u.SpecList.Where(s => s.MeasureResult != true).Select(s => s.Code)));
-                    model["Defects"] = $"{string.Join(",", defects)}";
-
-                    BindDatas.Insert(0, model);
-
-                    while (BindDatas.Count > 100)
-                    {
-                        BindDatas.RemoveAt(BindDatas.Count - 1);
-                    }
-
-                    //dgvProducts.DataSource = null;
-                    //dgvProducts.DataSource = BindDatas;
-
-                    dgvProducts.Invalidate();
-                });
-            });
-        }
-
-        public override void OnCustomizedDispose()
-        {
-            base.OnCustomizedDispose();
-
-            if (Process is IUpdateProductData upd)
-            {
-                upd.OnUpdateProductData -= Upd_OnUpdateProductData;
-            }
-        }
-    }
-}
diff --git a/src/Bro.M135.Common/FrmProductList.resx b/src/Bro.M135.Common/FrmProductList.resx
deleted file mode 100644
index 1af7de1..0000000
--- a/src/Bro.M135.Common/FrmProductList.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-锘�<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>
\ No newline at end of file
diff --git a/src/Bro.M135.Common/Properties/launchSettings.json b/src/Bro.M135.Common/Properties/launchSettings.json
new file mode 100644
index 0000000..b97af8e
--- /dev/null
+++ b/src/Bro.M135.Common/Properties/launchSettings.json
@@ -0,0 +1,7 @@
+{
+  "profiles": {
+    "Bro.M135.Common": {
+      "commandName": "Project"
+    }
+  }
+}
\ No newline at end of file
diff --git a/src/Bro.M141.Process/M141Config.cs b/src/Bro.M141.Process/M141Config.cs
index 5602e23..3eb2a41 100644
--- a/src/Bro.M141.Process/M141Config.cs
+++ b/src/Bro.M141.Process/M141Config.cs
@@ -13,6 +13,7 @@
 using System.Drawing.Printing;
 using System.Reflection;
 using System.Windows.Forms.Design;
+using static Bro.Common.Helper.EnumHelper;
 
 namespace Bro.M141.Process
 {
@@ -24,6 +25,12 @@
         [TypeConverter(typeof(CollectionCountConvert))]
         [Editor(typeof(ComplexCollectionEditor<Printer>), typeof(UITypeEditor))]
         public List<Printer> Printers { get; set; } = new List<Printer>();
+
+
+      
+     
+
+
 
 
         [Category("浜у搧鏄剧ず鐣岄潰閰嶇疆")]
@@ -364,6 +371,11 @@
         [Description("搴斿鍗曟妫�娴嬮」闇�瑕佸娆℃媿鐓ф椂锛岃褰曞浘鐗囩殑绱㈠紩鍙凤紝浠�0寮�濮�")]
         public int ImageIndex { get; set; } = 0;
 
+        [Category("鍚敤閰嶇疆")]
+        [DisplayName("鍥哄畾妫�娴嬮」")]
+        [Description("true锛氳妫�娴嬮」鏄浐瀹氭娴嬮」鐩紝蹇呴』鎵ц false锛氳妫�娴嬫槸鍙彉妫�娴嬮」鐩紝娴佺▼涓喅瀹氭槸鍚︽娴嬶紝榛樿涓嶆娴�")]
+        public bool IsFixed { get; set; } = true;
+
         [Category("鍙栧儚璁剧疆")]
         [DisplayName("鐩告満閫夋嫨")]
         [Description("閫夋嫨璇ユ娴嬮」瀵瑰簲鐨勭浉鏈�")]
@@ -422,7 +434,10 @@
         [DisplayName("OK鍥剧墖淇濆瓨寮�鍏�")]
         public bool OKImageSwitch { get; set; } = false;
 
-
+        [Category("鍥剧墖淇濆瓨璁剧疆")]
+        [Description("璇ョ珯妫�娴嬪浘鐗囦繚瀛樻椂锛屼繚瀛樼殑鍥剧墖椤哄簭鍚庣紑")]
+        [DisplayName("鍥剧墖淇濆瓨椤哄簭鍚庣紑")]
+        public string ImageSaveSeq { get; set; } = "1";
 
         public string GetDisplayText()
         {
@@ -907,6 +922,21 @@
     }
 
 
+    [Device("OfflineDemo", "绂荤嚎娴嬭瘯", DeviceAttributeType.OperationConfig)]
+    public class OfflineDemoOperationConfig : OperationConfigBase
+    {
+        [Category("鍥剧墖鐩綍")]
+        [Description("鍥剧墖鐩綍")]
+        [DisplayName("鍥剧墖鐩綍")]
+        [Editor(typeof(FoldDialogEditor), typeof(UITypeEditor))]
+        public string ImageFolder { get; set; }
+
+        [Category("鍚姩閰嶇疆")]
+        [Description("true锛氬惎鍔ㄧ绾挎祴璇� false锛氬仠姝㈢绾挎祴璇�")]
+        [DisplayName("娴嬭瘯寮�鍏�")]
+        public bool IsStart { get; set; } = true;
+    }
+
     public class RealTimeAdjustDataDetail : IComplexDisplay
     {
         [Category("鐐逛綅璁剧疆")]
diff --git a/src/Bro.M141.Process/M141Models.cs b/src/Bro.M141.Process/M141Models.cs
index 43b83bf..930c91b 100644
--- a/src/Bro.M141.Process/M141Models.cs
+++ b/src/Bro.M141.Process/M141Models.cs
@@ -203,6 +203,9 @@
         [Description("璇ユ娴嬮」鎵�娑夊強鐨勬墍鏈夋娴嬬偣浣嶉泦鍚�")]
         [TypeConverter(typeof(ComplexObjectConvert))]
         [Editor(typeof(ComplexCollectionEditor<MeasurePointSelector>), typeof(UITypeEditor))]
+
+
+
         public List<MeasurePointSelector> MeasurePointNameCollection { get; set; } = new List<MeasurePointSelector>();
 
 
diff --git a/src/Bro.M141.Process/M141Process_ImageCheck.cs b/src/Bro.M141.Process/M141Process_ImageCheck.cs
index 3836a93..118ce5a 100644
--- a/src/Bro.M141.Process/M141Process_ImageCheck.cs
+++ b/src/Bro.M141.Process/M141Process_ImageCheck.cs
@@ -8,7 +8,9 @@
 using Microsoft.VisualBasic;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
+using NPOI.SS.UserModel;
 using NPOI.Util;
+using NPOI.XSSF.UserModel;
 using Sunny.UI;
 using System.Data;
 using System.Data.SqlTypes;
@@ -439,6 +441,8 @@
 
             return msg;
         }
+        
+
 
 
         [ProcessMethod("", "ProductDataUpload", "浜у搧鏁版嵁姹囨��", InvokeType.TestInvoke)]
@@ -503,6 +507,109 @@
         }
 
 
+        private bool _isDemoStarted = false;
+        [ProcessMethod("OfflineDemo", "OfflineDemo", "绂荤嚎娴嬭瘯", InvokeType.CalibInvoke)]
+        public ResponseMessage OfflineDemo(IOperationConfig config, IDevice invokeDevice, IDevice sourceDevice)
+        {
+            if (config is OfflineDemoOperationConfig opConfig)
+            {
+                if (_isDemoStarted)
+                {
+                    _isDemoStarted = false;
+                }
+                else
+                {
+                    _isDemoStarted = true;
+                    OfflineDemoAsync(opConfig.ImageFolder);
+                }
+            }
+
+            return new ResponseMessage();
+        }
+
+        private async void OfflineDemoAsync(string imageFolder)
+        {
+            await Task.Run(() =>
+            {
+                var imageFileNames = new DirectoryInfo(imageFolder).GetFiles().Select(u => u.FullName).ToList();
+
+                for (int i = 0; i < imageFileNames.Count; i++)
+                {
+                    if (!_isDemoStarted)
+                    {
+                        return;
+                    }
+
+                    var imageFile = Path.GetFileNameWithoutExtension(imageFileNames[i]);
+                    if (imageFile.EndsWith("Fit"))
+                    {
+                        continue;
+                    }
+
+                    var nameDatas = imageFile.Split(new char[] { '_'}, StringSplitOptions.RemoveEmptyEntries).ToList();
+                    if (nameDatas.Count != 5)
+                    {
+                        LogAsync(DateTime.Now, EnumHelper.LogLevel.Error, $"鏂囦欢{imageFile}鍛藉悕涓嶇鍚堣鑼冿紝涓嶆墽琛岀绾挎祴璇�");
+                        continue;
+                    }
+
+                    var sn = nameDatas[0];
+                    var imageSeq = nameDatas[1];
+
+                    var measureBind = M141Config.MeasureBindCollection.FirstOrDefault(u => u.ImageSaveSeq == imageSeq);
+                    if (measureBind == null || !measureBind.IsFixed)
+                    {
+                        LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"绂荤嚎娴嬭瘯锛屽伐浣峽(measureBind == null ? "鏈尮閰�" : $"{measureBind.WorkPosition}鏈紑鍚�")}");
+                        continue;
+                    }
+
+                    LogAsync(DateTime.Now, EnumHelper.LogLevel.Action, $"绂荤嚎娴嬭瘯锛屼骇鍝亄sn}寮�濮嬪伐浣峽measureBind.WorkPosition}绂荤嚎妫�娴�");
+                    MLImageSet imgSet = new MLImageSet();
+                    imgSet.HImage = new HalconDotNet.HImage(imageFileNames[i]);
+                    imgSet.PID = sn;
+
+                    var detectResults = ML.RunMLDetectionSync(imgSet, null, measureBind.DetectionId);
+
+                    imgSet.HImage?.Dispose();
+                    imgSet.HImage = null;
+
+
+
+                    //var defectFields = M141Config.DefectLocationSettings.FirstOrDefault(u => u.PositionCode == measureBind.WorkPosition);
+
+
+                    //var list = detectResults.SelectMany(u => u.NetResults.SelectMany(m => m.DetectDetails)).ToList();
+                    ////if (list.Count > 0)
+                    ////{
+                    ////    //list.ForEach(d =>
+                    ////    //{
+                    ////    //    //if (defectFields == null)
+                    ////    //    //{
+                    ////    //    //    d.Tag = "";
+                    ////    //    //}
+                    ////    //    //else
+                    ////    //    //{
+                    ////    //    //    RectangleF rect = new RectangleF(d.Rect.Point_LU.X, d.Rect.Point_LU.Y, d.Rect.Width, d.Rect.Height);
+                    ////    //    //    //var rectList = defectFields.Display.RectDict.Where(u => rect.IntersectsWith(u.Value)).ToList();
+                    ////    //    //    //if (rectList.Count > 0)
+                    ////    //    //    //{
+                    ////    //    //    //    d.Tag = string.Join(" ", rectList.Select(u => u.Key).OrderBy(u => u));
+                    ////    //    //    //}
+                    ////    //    //    //else
+                    ////    //    //    //{
+                    ////    //    //    //    d.Tag = "";
+                    ////    //    //    //}
+                    ////    //    //}
+                    ////    //});
+                    ////}
+
+                    //Bitmap originImage = new Bitmap(imageFileNames[i]);
+                    //DetectResultSaveExcelAsync(detectResults, sn, originImage, DateTime.Now);
+                }
+            });
+        }
+    
+
 
         [ProcessMethod("printer", "printer", "鎵撳嵃鏈烘墦鍗�", InvokeType.TestInvoke)]
         public ResponseMessage Printer(IOperationConfig config, IDevice invokeDevice, IDevice sourceDevice)
@@ -560,6 +667,9 @@
             return specList;
         }
 
+
+
+
         protected void FillSpecResults(string pid, List<ISpec> detectSpec, List<double> results, string SEQUENCE)
         {
             detectSpec.ForEach(s =>
diff --git a/src/Bro.M141.Process/Properties/launchSettings.json b/src/Bro.M141.Process/Properties/launchSettings.json
new file mode 100644
index 0000000..cda8467
--- /dev/null
+++ b/src/Bro.M141.Process/Properties/launchSettings.json
@@ -0,0 +1,7 @@
+{
+  "profiles": {
+    "Bro.M141.Process": {
+      "commandName": "Project"
+    }
+  }
+}
\ No newline at end of file
diff --git a/src/Bro.M141_AOI1.Process/AOI1Process.cs b/src/Bro.M141_AOI1.Process/AOI1Process.cs
index 823c420..21d38da 100644
--- a/src/Bro.M141_AOI1.Process/AOI1Process.cs
+++ b/src/Bro.M141_AOI1.Process/AOI1Process.cs
@@ -389,5 +389,7 @@
 
 
 
+
+
     }
 }

--
Gitblit v1.8.0