From b32f934398ee9f957a583e5ff6c35e6fb465823e Mon Sep 17 00:00:00 2001
From: Administrator <Administrator@DESKTOP-1VKMM8S>
Date: 星期一, 15 三月 2021 20:44:42 +0800
Subject: [PATCH] 1.删除3月15号数据报表。

---
 P066.Data/Form1.cs |  189 +++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 166 insertions(+), 23 deletions(-)

diff --git a/P066.Data/Form1.cs b/P066.Data/Form1.cs
index c1c8143..df02e6e 100644
--- a/P066.Data/Form1.cs
+++ b/P066.Data/Form1.cs
@@ -8,6 +8,8 @@
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using System.IO;
+using Bro.Common;
+using Bro.Common.Util;
 
 namespace P066.Data
 {
@@ -15,10 +17,16 @@
     {
         DirectoryInfo directoryInfo1;
         DirectoryInfo directoryInfo2;
+        private P066RunParam runparam = new P066RunParam();
 
+        
         public Form1()
         {
             InitializeComponent();
+            //ConfigHelper.Save(@"D:\P066-Data\P066XML\1.xml", runparam);
+            runparam = ConfigHelper.Load<P066RunParam>(@"D:\P066-Data\P066XML\Jin_Mid.xml");
+            
+
         }
 
         private void btnLoadData1_Click(object sender, EventArgs e)
@@ -91,29 +99,54 @@
                     JudgeListSum.AddRange(judgeList);
 
                 }
-                judgeList = GetLocation(judgeList);
-                //缁欓暅澶村尯鍒嗕綅缃強瑙掑害
-                list = GetLocation(list);
+
                 string currPath = "";
                 #region//鍒ゆ柇鏄垵妫�鏂囦欢澶硅繕鏄妫�鏂囦欢澶�
-                if (fileinfos1[i].Name.Contains("鍒濇"))
+                if (fileinfos1[i].Name.Contains("鍒濇涓"))
                 {
                     ChuNum++;
-                    filenameDir = "鍒濇";
-                    filename = "鍒濇"+ ChuNum;
+                    filenameDir = "鍒濇涓鐧界偣";
+                    filename = "鍒濇涓鐧界偣" + ChuNum;
+                    judgeList = GetMidLocation(judgeList);
+                    //缁欓暅澶村尯鍒嗕綅缃強瑙掑害
+                    list = GetMidLocation(list);
                 }
-               else if (fileinfos1[i].Name.Contains("澶嶆")&& fileinfos1[i].Name.Contains("鐧界偣"))
+               else if (fileinfos1[i].Name.Contains("澶嶆涓")&& fileinfos1[i].Name.Contains("鐧界偣"))
                 {
                     FuNum=FuNum+1;
-                    filenameDir = "澶嶆";
-                    filename = "澶嶆" + FuNum;
+                    filenameDir = "澶嶆涓鐧界偣";
+                    filename = "澶嶆涓鐧界偣" + FuNum;
+                    judgeList = GetMidLocation(judgeList);
+                    //缁欓暅澶村尯鍒嗕綅缃強瑙掑害
+                    list = GetMidLocation(list);
                 }
-                else if ( fileinfos1[i].Name.Contains("澶嶆")&&fileinfos1[i].Name.Contains("鍒櫧"))
+                else if ( fileinfos1[i].Name.Contains("澶嶆涓") &&fileinfos1[i].Name.Contains("鍒櫧"))
                     {
                         GuaNum=GuaNum+1;
-                        filenameDir = "鍒櫧";
-                        filename = "鍒櫧" + GuaNum;
-                    }
+                        filenameDir = "澶嶆涓鍒櫧";
+                        filename = "澶嶆涓鍒櫧" + GuaNum;
+                    judgeList = GetBkLocation(judgeList);
+                    //缁欓暅澶村尯鍒嗕綅缃強瑙掑害
+                    list = GetBkLocation(list);
+                }
+               else if (fileinfos1[i].Name.Contains("鍒濇鑳屾澘"))
+                {
+                    ChuNum++;
+                    filenameDir = "鍒濇鑳屾澘鐧界偣";
+                    filename = "鍒濇鑳屾澘鐧界偣" + ChuNum;
+                    judgeList = GetBkLocation(judgeList);
+                    //缁欓暅澶村尯鍒嗕綅缃強瑙掑害
+                    list = GetBkLocation(list);
+                }
+                else if (fileinfos1[i].Name.Contains("澶嶆鑳屾澘") && fileinfos1[i].Name.Contains("鐧界偣"))
+                {
+                    FuNum = FuNum + 1;
+                    filenameDir = "澶嶆鑳屾澘鐧界偣";
+                    filename = "澶嶆鑳屾澘鐧界偣" + FuNum;
+                    judgeList = GetBkLocation(judgeList);
+                    //缁欓暅澶村尯鍒嗕綅缃強瑙掑害
+                    list = GetBkLocation(list);
+                }
 
                 currPath = directoryInfo1.Parent.Parent.FullName;
                 string subPath = currPath + "/" + filenameDir + "鍚堝苟鍚�" + "/";
@@ -288,6 +321,14 @@
                         if (distance < 20)
                         {
                             itemToRemove.Add(list2[j]);
+                            //if (list1[i].PostTreatmentResults=="")
+                            //{
+                            //    list1[i].PostTreatmentResults = list2[j].PostTreatmentResults;
+                            //}
+                            //else
+                            //{
+                            //    list2[j].PostTreatmentResults = list1[i].PostTreatmentResults;
+                            //}
                         }
                     }
                 }
@@ -376,6 +417,14 @@
                                 list1[i].JudgmentResult = "NG";
                                 list2[j].JudgmentResult = "NG";
                             }
+                            //if (list1[i].PostTreatmentResults == "")
+                            //{
+                            //    list1[i].PostTreatmentResults = list2[j].PostTreatmentResults;
+                            //}
+                            //else
+                            //{
+                            //    list2[j].PostTreatmentResults = list1[i].PostTreatmentResults;
+                            //}
 
                         }
                     }
@@ -531,8 +580,8 @@
             return dataList;
         }
       
-
-        private List<ResultData> GetLocation(List<ResultData> list)
+        //鑾峰彇涓瑙掑害鍜屼綅缃�
+        private List<ResultData> GetMidLocation(List<ResultData> list)
         {
             var group = list.GroupBy(a => a.TimeTip);
             foreach (var item in group)
@@ -549,11 +598,11 @@
                     listLensnumber1[k].angle = lenAngle;
 
                     var distance = GetDistance(1050, 1050, listLensnumber1[k].X, listLensnumber1[k].Y);
-                    if (distance <= 298.022)
+                    if (distance <= runparam.MidLens1R1)
                     {
                         listLensnumber1[k].location = "闀滃ご";
                     }
-                    else if (298.022 < distance && distance <= 521.171)
+                    else if (runparam.MidLens1R1 < distance && distance <= runparam.MidLens1R2)
                     {
                         listLensnumber1[k].location = "鏂滈潰";
                     }
@@ -574,11 +623,11 @@
                     }
                     listLensnumber2[k].angle = lenAngle;
                     var distance = GetDistance(1050, 1050, listLensnumber2[k].X, listLensnumber2[k].Y);
-                    if (distance <= 367.696)
+                    if (distance <= runparam.MidLens2R1)
                     {
                         listLensnumber2[k].location = "闀滃ご";
                     }
-                    else if (367.696 < distance && distance <= 653.911)
+                    else if (runparam.MidLens2R1 < distance && distance <= runparam.MidLens2R2)
                     {
                         listLensnumber2[k].location = "鏂滈潰";
                     }
@@ -598,11 +647,11 @@
                     }
                     listLensnumber3[k].angle = lenAngle;
                     var distance = GetDistance(1050, 1050, listLensnumber3[k].X, listLensnumber3[k].Y);
-                    if (distance <= 339.246)
+                    if (distance <= runparam.MidLens3R1)
                     {
                         listLensnumber3[k].location = "闀滃ご";
                     }
-                    else if (distance < 339.246 && distance <= 520.584)
+                    else if ( runparam.MidLens3R1< distance && distance <= runparam.MidLens3R2)
                     {
                         listLensnumber3[k].location = "鏂滈潰";
                     }
@@ -622,11 +671,11 @@
                     }
                     listLensnumber4[k].angle = lenAngle;
                     var distance = GetDistance(1050, 1050, listLensnumber4[k].X, listLensnumber4[k].Y);
-                    if (distance <= 104.895)
+                    if (distance <= runparam.MidLens4R1)
                     {
                         listLensnumber4[k].location = "闀滃ご";
                     }
-                    else if (104.895 < distance && distance <= 239.48)
+                    else if (runparam.MidLens4R1 < distance && distance <= runparam.MidLens4R2)
                     {
                         listLensnumber4[k].location = "鏂滈潰";
                     }
@@ -640,7 +689,101 @@
             }
             return list;
         }
+        //鑾峰彇鑳屾澘瑙掑害鍜屼綅缃�
+        private List<ResultData> GetBkLocation(List<ResultData> list)
+        {
+            var group = list.GroupBy(a => a.TimeTip);
+            foreach (var item in group)
+            {
+                //璁$畻闀滃ご1缂洪櫡浣嶇疆鍙婅搴�
+                var listLensnumber1 = list.FindAll(a => a.TimeTip == item.Key && a.Lensnumber == 1);
+                for (int k = 0; k < listLensnumber1.Count; k++)
+                {
+                    var lenAngle = GetAngle(listLensnumber1[k].X, listLensnumber1[k].Y);
+                    if (lenAngle < 0)
+                    {
+                        lenAngle = 360 + lenAngle;
+                    }
+                    listLensnumber1[k].angle = lenAngle;
 
+                    var distance = GetDistance(1050, 1050, listLensnumber1[k].X, listLensnumber1[k].Y);
+                    if (distance <= runparam.BkLens1R1)
+                    {
+                        listLensnumber1[k].location = "鍙鍖�";
+                    }
+
+                    else
+                    {
+                        listLensnumber1[k].location = "闈炲彲瑙嗗尯";
+                    }
+
+                }
+                //璁$畻闀滃ご2浣嶇疆鍙婅搴�
+                var listLensnumber2 = list.FindAll(a => a.TimeTip == item.Key && a.Lensnumber == 2);
+                for (int k = 0; k < listLensnumber2.Count; k++)
+                {
+                    var lenAngle = GetAngle(listLensnumber2[k].X, listLensnumber2[k].Y);
+                    if (lenAngle < 0)
+                    {
+                        lenAngle = 360 + lenAngle;
+                    }
+                    listLensnumber2[k].angle = lenAngle;
+                    var distance = GetDistance(1050, 1050, listLensnumber2[k].X, listLensnumber2[k].Y);
+                    if (distance <= runparam.BkLens2R1)
+                    {
+                        listLensnumber2[k].location = "鍙鍖�";
+                    }
+                    else
+                    {
+                        listLensnumber2[k].location = "闈炲彲瑙嗗尯";
+                    }
+                }
+                //璁$畻闀滃ご3浣嶇疆鍙婅搴�
+                var listLensnumber3 = list.FindAll(a => a.TimeTip == item.Key && a.Lensnumber == 3);
+                for (int k = 0; k < listLensnumber3.Count; k++)
+                {
+                    var lenAngle = GetAngle(listLensnumber3[k].X, listLensnumber3[k].Y);
+                    if (lenAngle < 0)
+                    {
+                        lenAngle = 360 + lenAngle;
+                    }
+                    listLensnumber3[k].angle = lenAngle;
+                    var distance = GetDistance(1050, 1050, listLensnumber3[k].X, listLensnumber3[k].Y);
+                    if (distance <= runparam.BkLens3R1)
+                    {
+                        listLensnumber3[k].location = "鍙鍖�";
+                    }
+
+                    else
+                    {
+                        listLensnumber3[k].location = "闈炲彲瑙嗗尯";
+                    }
+                }
+                //璁$畻闀滃ご4浣嶇疆鍙婅搴�
+                var listLensnumber4 = list.FindAll(a => a.TimeTip == item.Key && a.Lensnumber == 4);
+                for (int k = 0; k < listLensnumber4.Count; k++)
+                {
+                    var lenAngle = GetAngle(listLensnumber4[k].X, listLensnumber4[k].Y);
+                    if (lenAngle < 0)
+                    {
+                        lenAngle = 360 + lenAngle;
+                    }
+                    listLensnumber4[k].angle = lenAngle;
+                    var distance = GetDistance(1050, 1050, listLensnumber4[k].X, listLensnumber4[k].Y);
+                    if (distance <= runparam.BkLens4R1)
+                    {
+                        listLensnumber4[k].location = "鍙鍖�";
+                    }
+                    else
+                    {
+                        listLensnumber4[k].location = "闈炲彲瑙嗗尯";
+
+                    }
+                }
+
+            }
+            return list;
+        }
 
         private void WriteJR(List<ResultData> Lens,string item,int LensNumb, string file12)
         {

--
Gitblit v1.8.0