From d82f308fed1b15b470c1b76e0b1db1dd4c26d296 Mon Sep 17 00:00:00 2001 From: "xhm\\HP" <1173131411@qq.com> Date: Thu, 27 Jun 2024 14:40:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=AD=97=E7=AC=A6=E6=AF=94?= =?UTF-8?q?=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HisenceYoloDetection/MainForm.cs | 6 +++--- HisenceYoloDetection/ManagerModelHelper.cs | 11 +++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/HisenceYoloDetection/MainForm.cs b/HisenceYoloDetection/MainForm.cs index cc2a2a1..29f18a3 100644 --- a/HisenceYoloDetection/MainForm.cs +++ b/HisenceYoloDetection/MainForm.cs @@ -189,8 +189,8 @@ namespace HisenceYoloDetection private void MainForm_Load(object sender, EventArgs e) { - string s1 = "ECO4060##Coton20℃##Rapide15mns"; - string s2 = "Eco4060##Coton20℃##Rapide15mns"; + string s1 = "0##Ec04060##20℃##Rapide15mns"; + string s2 = "ECO4060##20°C##Rapide15mns"; bool st = ManagerModelHelper.StrMatch2(s1, s2); @@ -2727,7 +2727,7 @@ namespace HisenceYoloDetection myLog("插入每块板需要的时间" + sw.ElapsedMilliseconds, DateTime.Now); keyValueResult.Add(blockIndex, blockMatchI); - + } diff --git a/HisenceYoloDetection/ManagerModelHelper.cs b/HisenceYoloDetection/ManagerModelHelper.cs index bc5a96f..d77cd96 100644 --- a/HisenceYoloDetection/ManagerModelHelper.cs +++ b/HisenceYoloDetection/ManagerModelHelper.cs @@ -227,10 +227,13 @@ namespace HisenceYoloDetection } static bool AreMoreThanHalfEqual(string[] array1, string[] array2) { + string Sqltext = array1.Join(""); + string Realtext = array2.Join(""); int io = 0; - foreach (string ch1 in array1) + + foreach (char ch2 in Realtext) { - foreach (string ch2 in array2) + foreach (char ch1 in Sqltext) { if (ch1 == ch2) { @@ -249,7 +252,7 @@ namespace HisenceYoloDetection //int intersectionCount = set1.Intersect(set2).Count(); // 鍒ゆ柇浜ら泦鏁伴噺鏄惁瓒呰繃涓鍗 - return io > array1.Length / 2; + return io >=Sqltext.Length / 2; } public static bool StrMatch2(string SqlText, string DetText) { @@ -277,7 +280,7 @@ namespace HisenceYoloDetection Console.WriteLine("瀛楃涓蹭腑涓嶅寘鍚暟瀛"); } bool areEqual ; - if (numbers2.Length>2&& numbers.Length > 2) + if (numbers2.Length>0&& numbers.Length > 0) { areEqual = AreMoreThanHalfEqual(numbers, numbers2); }