From 791bfb85d239c6628cb6e222531877da73019dcd Mon Sep 17 00:00:00 2001 From: YZJ Date: Mon, 15 Jul 2024 17:15:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HisenceYoloDetection/MainForm.Designer.cs | 1185 ++++++++++----------- HisenceYoloDetection/MainForm.cs | 321 +++--- 2 files changed, 741 insertions(+), 765 deletions(-) diff --git a/HisenceYoloDetection/MainForm.Designer.cs b/HisenceYoloDetection/MainForm.Designer.cs index 6bdef76..d6f33c4 100644 --- a/HisenceYoloDetection/MainForm.Designer.cs +++ b/HisenceYoloDetection/MainForm.Designer.cs @@ -29,14 +29,11 @@ private void InitializeComponent() { components = new System.ComponentModel.Container(); -<<<<<<< HEAD OpenCvSharp.Mat mat1 = new OpenCvSharp.Mat(); OpenCvSharp.Mat mat2 = new OpenCvSharp.Mat(); OpenCvSharp.Mat mat3 = new OpenCvSharp.Mat(); OpenCvSharp.Mat mat4 = new OpenCvSharp.Mat(); OpenCvSharp.Mat mat5 = new OpenCvSharp.Mat(); -======= ->>>>>>> 756d23229c59669d628dd94efb8876679bfe21f7 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); tabPage2 = new TabPage(); panel1 = new Panel(); @@ -128,14 +125,9 @@ panel4 = new Panel(); panel5 = new Panel(); groupBox2 = new GroupBox(); - canvas4 = new XKRS.UI.Canvas(); - canvas3 = new XKRS.UI.Canvas(); - canvas2 = new XKRS.UI.Canvas(); - canvas1 = new XKRS.UI.Canvas(); originMatShow = new PictureBox(); ResultMatShow = new PictureBox(); panel8 = new Panel(); - canvas5 = new XKRS.UI.Canvas(); textBox2 = new TextBox(); label36 = new Label(); textBox1 = new TextBox(); @@ -181,6 +173,11 @@ queryALLBtn = new Button(); label32 = new Label(); InsertDataDgv = new DataGridView(); + canvas4 = new XKRS.UI.Canvas(); + canvas3 = new XKRS.UI.Canvas(); + canvas2 = new XKRS.UI.Canvas(); + canvas1 = new XKRS.UI.Canvas(); + canvas5 = new XKRS.UI.Canvas(); timer1 = new System.Windows.Forms.Timer(components); timer2 = new System.Windows.Forms.Timer(components); timer3 = new System.Windows.Forms.Timer(components); @@ -214,11 +211,11 @@ // tabPage2 // tabPage2.Controls.Add(panel1); - tabPage2.Location = new Point(4, 33); + tabPage2.Location = new Point(4, 26); tabPage2.Margin = new Padding(4, 2, 4, 2); tabPage2.Name = "tabPage2"; tabPage2.Padding = new Padding(4, 2, 4, 2); - tabPage2.Size = new Size(1276, 712); + tabPage2.Size = new Size(1276, 719); tabPage2.TabIndex = 1; tabPage2.Text = "PLC"; tabPage2.UseVisualStyleBackColor = true; @@ -241,10 +238,10 @@ panel1.Controls.Add(readAdress); panel1.Controls.Add(showPLC); panel1.Controls.Add(readPLc); - panel1.Location = new Point(8, 6); + panel1.Location = new Point(0, 6); panel1.Margin = new Padding(4, 2, 4, 2); panel1.Name = "panel1"; - panel1.Size = new Size(1506, 461); + panel1.Size = new Size(1514, 713); panel1.TabIndex = 4; // // groupBox5 @@ -266,11 +263,7 @@ DistanceShow.Margin = new Padding(4, 2, 4, 2); DistanceShow.Name = "DistanceShow"; DistanceShow.ReadOnly = true; -<<<<<<< HEAD - DistanceShow.Size = new Size(117, 23); -======= - DistanceShow.Size = new Size(127, 31); ->>>>>>> 756d23229c59669d628dd94efb8876679bfe21f7 + DistanceShow.Size = new Size(127, 23); DistanceShow.TabIndex = 10; // // label21 @@ -279,7 +272,7 @@ label21.Location = new Point(36, 31); label21.Margin = new Padding(4, 0, 4, 0); label21.Name = "label21"; - label21.Size = new Size(54, 25); + label21.Size = new Size(36, 17); label21.TabIndex = 0; label21.Text = "测距"; // @@ -288,7 +281,7 @@ txtSetValue.Location = new Point(738, 73); txtSetValue.Margin = new Padding(4, 2, 4, 2); txtSetValue.Name = "txtSetValue"; - txtSetValue.Size = new Size(251, 31); + txtSetValue.Size = new Size(251, 23); txtSetValue.TabIndex = 14; // // groupBox4 @@ -357,11 +350,7 @@ SetlnEditmiZOP.Location = new Point(526, 296); SetlnEditmiZOP.Margin = new Padding(4, 2, 4, 2); SetlnEditmiZOP.Name = "SetlnEditmiZOP"; -<<<<<<< HEAD - SetlnEditmiZOP.Size = new Size(116, 23); -======= - SetlnEditmiZOP.Size = new Size(127, 31); ->>>>>>> 756d23229c59669d628dd94efb8876679bfe21f7 + SetlnEditmiZOP.Size = new Size(127, 23); SetlnEditmiZOP.TabIndex = 27; // // SetlnEditmiYOP @@ -369,7 +358,7 @@ SetlnEditmiYOP.Location = new Point(329, 296); SetlnEditmiYOP.Margin = new Padding(4, 2, 4, 2); SetlnEditmiYOP.Name = "SetlnEditmiYOP"; - SetlnEditmiYOP.Size = new Size(127, 31); + SetlnEditmiYOP.Size = new Size(127, 23); SetlnEditmiYOP.TabIndex = 26; // // SetlnEditmiXOP @@ -377,7 +366,7 @@ SetlnEditmiXOP.Location = new Point(138, 296); SetlnEditmiXOP.Margin = new Padding(4, 2, 4, 2); SetlnEditmiXOP.Name = "SetlnEditmiXOP"; - SetlnEditmiXOP.Size = new Size(127, 31); + SetlnEditmiXOP.Size = new Size(127, 23); SetlnEditmiXOP.TabIndex = 25; // // SetlnEditmiZH @@ -385,11 +374,7 @@ SetlnEditmiZH.Location = new Point(526, 242); SetlnEditmiZH.Margin = new Padding(4, 2, 4, 2); SetlnEditmiZH.Name = "SetlnEditmiZH"; -<<<<<<< HEAD - SetlnEditmiZH.Size = new Size(116, 23); -======= - SetlnEditmiZH.Size = new Size(127, 31); ->>>>>>> 756d23229c59669d628dd94efb8876679bfe21f7 + SetlnEditmiZH.Size = new Size(127, 23); SetlnEditmiZH.TabIndex = 23; // // SetlnEditmiYH @@ -397,7 +382,7 @@ SetlnEditmiYH.Location = new Point(329, 242); SetlnEditmiYH.Margin = new Padding(4, 2, 4, 2); SetlnEditmiYH.Name = "SetlnEditmiYH"; - SetlnEditmiYH.Size = new Size(127, 31); + SetlnEditmiYH.Size = new Size(127, 23); SetlnEditmiYH.TabIndex = 22; // // SetlnEditmiXH @@ -405,7 +390,7 @@ SetlnEditmiXH.Location = new Point(138, 242); SetlnEditmiXH.Margin = new Padding(4, 2, 4, 2); SetlnEditmiXH.Name = "SetlnEditmiXH"; - SetlnEditmiXH.Size = new Size(127, 31); + SetlnEditmiXH.Size = new Size(127, 23); SetlnEditmiXH.TabIndex = 21; // // lnEditmiZOP @@ -413,11 +398,7 @@ lnEditmiZOP.Location = new Point(526, 189); lnEditmiZOP.Margin = new Padding(4, 2, 4, 2); lnEditmiZOP.Name = "lnEditmiZOP"; -<<<<<<< HEAD - lnEditmiZOP.Size = new Size(116, 23); -======= - lnEditmiZOP.Size = new Size(127, 31); ->>>>>>> 756d23229c59669d628dd94efb8876679bfe21f7 + lnEditmiZOP.Size = new Size(127, 23); lnEditmiZOP.TabIndex = 19; // // lnEditmiYOP @@ -425,7 +406,7 @@ lnEditmiYOP.Location = new Point(329, 189); lnEditmiYOP.Margin = new Padding(4, 2, 4, 2); lnEditmiYOP.Name = "lnEditmiYOP"; - lnEditmiYOP.Size = new Size(127, 31); + lnEditmiYOP.Size = new Size(127, 23); lnEditmiYOP.TabIndex = 18; // // lnEditmiXOP @@ -433,7 +414,7 @@ lnEditmiXOP.Location = new Point(138, 189); lnEditmiXOP.Margin = new Padding(4, 2, 4, 2); lnEditmiXOP.Name = "lnEditmiXOP"; - lnEditmiXOP.Size = new Size(127, 31); + lnEditmiXOP.Size = new Size(127, 23); lnEditmiXOP.TabIndex = 17; // // label17 @@ -442,7 +423,7 @@ label17.Location = new Point(41, 191); label17.Margin = new Padding(4, 0, 4, 0); label17.Name = "label17"; - label17.Size = new Size(96, 25); + label17.Size = new Size(64, 17); label17.TabIndex = 16; label17.Text = "定位位置"; // @@ -452,11 +433,7 @@ lnEditmiZS.Margin = new Padding(4, 2, 4, 2); lnEditmiZS.Name = "lnEditmiZS"; lnEditmiZS.ReadOnly = true; -<<<<<<< HEAD - lnEditmiZS.Size = new Size(116, 23); -======= - lnEditmiZS.Size = new Size(127, 31); ->>>>>>> 756d23229c59669d628dd94efb8876679bfe21f7 + lnEditmiZS.Size = new Size(127, 23); lnEditmiZS.TabIndex = 15; // // lnEditmiYS @@ -465,7 +442,7 @@ lnEditmiYS.Margin = new Padding(4, 2, 4, 2); lnEditmiYS.Name = "lnEditmiYS"; lnEditmiYS.ReadOnly = true; - lnEditmiYS.Size = new Size(127, 31); + lnEditmiYS.Size = new Size(127, 23); lnEditmiYS.TabIndex = 14; // // lnEditmiXS @@ -474,7 +451,7 @@ lnEditmiXS.Margin = new Padding(4, 2, 4, 2); lnEditmiXS.Name = "lnEditmiXS"; lnEditmiXS.ReadOnly = true; - lnEditmiXS.Size = new Size(127, 31); + lnEditmiXS.Size = new Size(127, 23); lnEditmiXS.TabIndex = 13; // // label16 @@ -483,7 +460,7 @@ label16.Location = new Point(10, 138); label16.Margin = new Padding(4, 0, 4, 0); label16.Name = "label16"; - label16.Size = new Size(138, 25); + label16.Size = new Size(92, 17); label16.TabIndex = 12; label16.Text = "当前定位速度"; // @@ -493,11 +470,7 @@ lnEditmiZHS.Margin = new Padding(4, 2, 4, 2); lnEditmiZHS.Name = "lnEditmiZHS"; lnEditmiZHS.ReadOnly = true; -<<<<<<< HEAD - lnEditmiZHS.Size = new Size(116, 23); -======= - lnEditmiZHS.Size = new Size(127, 31); ->>>>>>> 756d23229c59669d628dd94efb8876679bfe21f7 + lnEditmiZHS.Size = new Size(127, 23); lnEditmiZHS.TabIndex = 11; // // lnEditmiYHS @@ -506,7 +479,7 @@ lnEditmiYHS.Margin = new Padding(4, 2, 4, 2); lnEditmiYHS.Name = "lnEditmiYHS"; lnEditmiYHS.ReadOnly = true; - lnEditmiYHS.Size = new Size(127, 31); + lnEditmiYHS.Size = new Size(127, 23); lnEditmiYHS.TabIndex = 10; // // lnEditmiXHS @@ -515,7 +488,7 @@ lnEditmiXHS.Margin = new Padding(4, 2, 4, 2); lnEditmiXHS.Name = "lnEditmiXHS"; lnEditmiXHS.ReadOnly = true; - lnEditmiXHS.Size = new Size(127, 31); + lnEditmiXHS.Size = new Size(127, 23); lnEditmiXHS.TabIndex = 9; // // label15 @@ -524,7 +497,7 @@ label15.Location = new Point(10, 85); label15.Margin = new Padding(4, 0, 4, 0); label15.Name = "label15"; - label15.Size = new Size(138, 25); + label15.Size = new Size(92, 17); label15.TabIndex = 8; label15.Text = "当前手动速度"; // @@ -534,7 +507,7 @@ ZPostion.Location = new Point(580, 42); ZPostion.Margin = new Padding(4, 0, 4, 0); ZPostion.Name = "ZPostion"; - ZPostion.Size = new Size(24, 25); + ZPostion.Size = new Size(16, 17); ZPostion.TabIndex = 7; ZPostion.Text = "0"; // @@ -544,7 +517,7 @@ YPostion.Location = new Point(386, 42); YPostion.Margin = new Padding(4, 0, 4, 0); YPostion.Name = "YPostion"; - YPostion.Size = new Size(24, 25); + YPostion.Size = new Size(16, 17); YPostion.TabIndex = 6; YPostion.Text = "0"; // @@ -554,7 +527,7 @@ XPostion.Location = new Point(185, 42); XPostion.Margin = new Padding(4, 0, 4, 0); XPostion.Name = "XPostion"; - XPostion.Size = new Size(24, 25); + XPostion.Size = new Size(16, 17); XPostion.TabIndex = 5; XPostion.Text = "0"; // @@ -564,7 +537,7 @@ XCurrentPostion.Location = new Point(170, 42); XCurrentPostion.Margin = new Padding(4, 0, 4, 0); XCurrentPostion.Name = "XCurrentPostion"; - XCurrentPostion.Size = new Size(0, 25); + XCurrentPostion.Size = new Size(0, 17); XCurrentPostion.TabIndex = 4; // // label14 @@ -573,7 +546,7 @@ label14.Location = new Point(580, 21); label14.Margin = new Padding(4, 0, 4, 0); label14.Name = "label14"; - label14.Size = new Size(25, 25); + label14.Size = new Size(17, 17); label14.TabIndex = 3; label14.Text = "Z"; // @@ -583,7 +556,7 @@ label13.Location = new Point(386, 18); label13.Margin = new Padding(4, 0, 4, 0); label13.Name = "label13"; - label13.Size = new Size(27, 25); + label13.Size = new Size(17, 17); label13.TabIndex = 2; label13.Text = "Y"; // @@ -593,7 +566,7 @@ label12.Location = new Point(184, 18); label12.Margin = new Padding(4, 0, 4, 0); label12.Name = "label12"; - label12.Size = new Size(26, 25); + label12.Size = new Size(17, 17); label12.TabIndex = 1; label12.Text = "X"; // @@ -603,7 +576,7 @@ label11.Location = new Point(41, 42); label11.Margin = new Padding(4, 0, 4, 0); label11.Name = "label11"; - label11.Size = new Size(96, 25); + label11.Size = new Size(64, 17); label11.TabIndex = 0; label11.Text = "当前位置"; // @@ -809,7 +782,7 @@ writePLCValue.Location = new Point(861, 9); writePLCValue.Margin = new Padding(4, 2, 4, 2); writePLCValue.Name = "writePLCValue"; - writePLCValue.Size = new Size(127, 31); + writePLCValue.Size = new Size(127, 23); writePLCValue.TabIndex = 11; // // label9 @@ -818,7 +791,7 @@ label9.Location = new Point(514, 49); label9.Margin = new Padding(4, 0, 4, 0); label9.Name = "label9"; - label9.Size = new Size(33, 25); + label9.Size = new Size(22, 17); label9.TabIndex = 10; label9.Text = "值"; // @@ -828,7 +801,7 @@ label10.Location = new Point(514, 15); label10.Margin = new Padding(4, 0, 4, 0); label10.Name = "label10"; - label10.Size = new Size(54, 25); + label10.Size = new Size(36, 17); label10.TabIndex = 9; label10.Text = "地址"; // @@ -848,7 +821,7 @@ PLCValue.Location = new Point(577, 43); PLCValue.Margin = new Padding(4, 2, 4, 2); PLCValue.Name = "PLCValue"; - PLCValue.Size = new Size(127, 31); + PLCValue.Size = new Size(127, 23); PLCValue.TabIndex = 8; // // WriteAdress @@ -856,7 +829,7 @@ WriteAdress.Location = new Point(577, 13); WriteAdress.Margin = new Padding(4, 2, 4, 2); WriteAdress.Name = "WriteAdress"; - WriteAdress.Size = new Size(127, 31); + WriteAdress.Size = new Size(127, 23); WriteAdress.TabIndex = 6; // // label6 @@ -865,7 +838,7 @@ label6.Location = new Point(162, 51); label6.Margin = new Padding(4, 0, 4, 0); label6.Name = "label6"; - label6.Size = new Size(33, 25); + label6.Size = new Size(22, 17); label6.TabIndex = 5; label6.Text = "值"; // @@ -875,7 +848,7 @@ label3.Location = new Point(162, 18); label3.Margin = new Padding(4, 0, 4, 0); label3.Name = "label3"; - label3.Size = new Size(54, 25); + label3.Size = new Size(36, 17); label3.TabIndex = 4; label3.Text = "地址"; // @@ -906,7 +879,7 @@ showPLC.Location = new Point(225, 46); showPLC.Margin = new Padding(4, 2, 4, 2); showPLC.Name = "showPLC"; - showPLC.Size = new Size(127, 31); + showPLC.Size = new Size(127, 23); showPLC.TabIndex = 3; // // readPLc @@ -914,18 +887,18 @@ readPLc.Location = new Point(225, 15); readPLc.Margin = new Padding(4, 2, 4, 2); readPLc.Name = "readPLc"; - readPLc.Size = new Size(127, 31); + readPLc.Size = new Size(127, 23); readPLc.TabIndex = 1; // // tabPage1 // tabPage1.Controls.Add(groupBox3); tabPage1.Controls.Add(groupBox1); - tabPage1.Location = new Point(4, 34); + tabPage1.Location = new Point(4, 26); tabPage1.Margin = new Padding(4, 2, 4, 2); tabPage1.Name = "tabPage1"; tabPage1.Padding = new Padding(4, 2, 4, 2); - tabPage1.Size = new Size(1276, 711); + tabPage1.Size = new Size(1276, 719); tabPage1.TabIndex = 0; tabPage1.Text = "相机"; tabPage1.UseVisualStyleBackColor = true; @@ -989,7 +962,7 @@ label5.Location = new Point(257, 18); label5.Margin = new Padding(4, 0, 4, 0); label5.Name = "label5"; - label5.Size = new Size(96, 25); + label5.Size = new Size(64, 17); label5.TabIndex = 2; label5.Text = "链接相机"; // @@ -1020,7 +993,7 @@ tbGain2.Location = new Point(93, 54); tbGain2.Margin = new Padding(4, 2, 4, 2); tbGain2.Name = "tbGain2"; - tbGain2.Size = new Size(127, 31); + tbGain2.Size = new Size(127, 23); tbGain2.TabIndex = 4; // // tbExposure2 @@ -1028,7 +1001,7 @@ tbExposure2.Location = new Point(93, 22); tbExposure2.Margin = new Padding(4, 2, 4, 2); tbExposure2.Name = "tbExposure2"; - tbExposure2.Size = new Size(127, 31); + tbExposure2.Size = new Size(127, 23); tbExposure2.TabIndex = 3; // // label7 @@ -1037,7 +1010,7 @@ label7.Location = new Point(15, 56); label7.Margin = new Padding(4, 0, 4, 0); label7.Name = "label7"; - label7.Size = new Size(54, 25); + label7.Size = new Size(36, 17); label7.TabIndex = 1; label7.Text = "增益"; // @@ -1047,7 +1020,7 @@ label8.Location = new Point(15, 24); label8.Margin = new Padding(4, 0, 4, 0); label8.Name = "label8"; - label8.Size = new Size(54, 25); + label8.Size = new Size(36, 17); label8.TabIndex = 0; label8.Text = "曝光"; // @@ -1112,7 +1085,7 @@ label1.Location = new Point(257, 18); label1.Margin = new Padding(4, 0, 4, 0); label1.Name = "label1"; - label1.Size = new Size(96, 25); + label1.Size = new Size(64, 17); label1.TabIndex = 2; label1.Text = "链接相机"; // @@ -1143,7 +1116,7 @@ tbGain.Location = new Point(93, 54); tbGain.Margin = new Padding(4, 2, 4, 2); tbGain.Name = "tbGain"; - tbGain.Size = new Size(127, 31); + tbGain.Size = new Size(127, 23); tbGain.TabIndex = 4; // // tbExposure @@ -1151,7 +1124,7 @@ tbExposure.Location = new Point(93, 22); tbExposure.Margin = new Padding(4, 2, 4, 2); tbExposure.Name = "tbExposure"; - tbExposure.Size = new Size(127, 31); + tbExposure.Size = new Size(127, 23); tbExposure.TabIndex = 3; // // label2 @@ -1160,7 +1133,7 @@ label2.Location = new Point(15, 56); label2.Margin = new Padding(4, 0, 4, 0); label2.Name = "label2"; - label2.Size = new Size(54, 25); + label2.Size = new Size(36, 17); label2.TabIndex = 1; label2.Text = "增益"; // @@ -1170,7 +1143,7 @@ label4.Location = new Point(15, 24); label4.Margin = new Padding(4, 0, 4, 0); label4.Name = "label4"; - label4.Size = new Size(54, 25); + label4.Size = new Size(36, 17); label4.TabIndex = 0; label4.Text = "曝光"; // @@ -1191,10 +1164,10 @@ // tabPage5 // tabPage5.Controls.Add(panel4); - tabPage5.Location = new Point(4, 34); + tabPage5.Location = new Point(4, 26); tabPage5.Margin = new Padding(4, 2, 4, 2); tabPage5.Name = "tabPage5"; - tabPage5.Size = new Size(1276, 711); + tabPage5.Size = new Size(1276, 719); tabPage5.TabIndex = 3; tabPage5.Text = "流程"; tabPage5.UseVisualStyleBackColor = true; @@ -1206,7 +1179,7 @@ panel4.Location = new Point(0, 0); panel4.Margin = new Padding(4, 2, 4, 2); panel4.Name = "panel4"; - panel4.Size = new Size(1276, 711); + panel4.Size = new Size(1276, 719); panel4.TabIndex = 0; // // panel5 @@ -1235,6 +1208,522 @@ groupBox2.Text = "图片"; groupBox2.Enter += groupBox2_Enter; // + // originMatShow + // + originMatShow.Location = new Point(8, 21); + originMatShow.Margin = new Padding(4, 2, 4, 2); + originMatShow.Name = "originMatShow"; + originMatShow.Size = new Size(351, 200); + originMatShow.SizeMode = PictureBoxSizeMode.StretchImage; + originMatShow.TabIndex = 3; + originMatShow.TabStop = false; + // + // ResultMatShow + // + ResultMatShow.Location = new Point(367, 21); + ResultMatShow.Margin = new Padding(4, 2, 4, 2); + ResultMatShow.Name = "ResultMatShow"; + ResultMatShow.Size = new Size(363, 200); + ResultMatShow.SizeMode = PictureBoxSizeMode.StretchImage; + ResultMatShow.TabIndex = 2; + ResultMatShow.TabStop = false; + // + // panel8 + // + panel8.Controls.Add(textBox2); + panel8.Controls.Add(label36); + panel8.Controls.Add(textBox1); + panel8.Controls.Add(label35); + panel8.Controls.Add(实时显示); + panel8.Controls.Add(OKOrNGShow); + panel8.Controls.Add(OKDNum); + panel8.Controls.Add(label20); + panel8.Controls.Add(NGDNum); + panel8.Controls.Add(label19); + panel8.Controls.Add(AllDSum); + panel8.Controls.Add(label18); + panel8.Controls.Add(StartDecBtn); + panel8.Controls.Add(ScanDevList); + panel8.Controls.Add(DevNameCombo); + panel8.Controls.Add(InitMachine); + panel8.Location = new Point(738, 0); + panel8.Margin = new Padding(4, 2, 4, 2); + panel8.Name = "panel8"; + panel8.Size = new Size(905, 718); + panel8.TabIndex = 2; + panel8.Paint += panel8_Paint; + // + // textBox2 + // + textBox2.Location = new Point(437, 287); + textBox2.Margin = new Padding(4, 2, 4, 2); + textBox2.Name = "textBox2"; + textBox2.ReadOnly = true; + textBox2.Size = new Size(82, 23); + textBox2.TabIndex = 17; + // + // label36 + // + label36.AutoSize = true; + label36.Location = new Point(353, 290); + label36.Name = "label36"; + label36.Size = new Size(64, 17); + label36.TabIndex = 16; + label36.Text = "日误检率"; + // + // textBox1 + // + textBox1.Location = new Point(437, 237); + textBox1.Margin = new Padding(4, 2, 4, 2); + textBox1.Name = "textBox1"; + textBox1.ReadOnly = true; + textBox1.Size = new Size(82, 23); + textBox1.TabIndex = 15; + // + // label35 + // + label35.AutoSize = true; + label35.Location = new Point(353, 240); + label35.Name = "label35"; + label35.Size = new Size(50, 17); + label35.TabIndex = 14; + label35.Text = "误检率"; + // + // 实时显示 + // + 实时显示.AutoSize = true; + 实时显示.Location = new Point(427, 24); + 实时显示.Margin = new Padding(4, 0, 4, 0); + 实时显示.Name = "实时显示"; + 实时显示.Size = new Size(64, 17); + 实时显示.TabIndex = 12; + 实时显示.Text = "实时显示"; + // + // OKOrNGShow + // + OKOrNGShow.Location = new Point(299, 53); + OKOrNGShow.Margin = new Padding(4, 2, 4, 2); + OKOrNGShow.Name = "OKOrNGShow"; + OKOrNGShow.Size = new Size(235, 168); + OKOrNGShow.SizeMode = PictureBoxSizeMode.CenterImage; + OKOrNGShow.TabIndex = 11; + OKOrNGShow.TabStop = false; + // + // OKDNum + // + OKDNum.Location = new Point(130, 196); + OKDNum.Margin = new Padding(4, 2, 4, 2); + OKDNum.Name = "OKDNum"; + OKDNum.ReadOnly = true; + OKDNum.Size = new Size(127, 23); + OKDNum.TabIndex = 10; + // + // label20 + // + label20.AutoSize = true; + label20.Location = new Point(32, 201); + label20.Margin = new Padding(4, 0, 4, 0); + label20.Name = "label20"; + label20.Size = new Size(56, 17); + label20.TabIndex = 9; + label20.Text = "OK个数"; + // + // NGDNum + // + NGDNum.Location = new Point(130, 153); + NGDNum.Margin = new Padding(4, 2, 4, 2); + NGDNum.Name = "NGDNum"; + NGDNum.ReadOnly = true; + NGDNum.Size = new Size(127, 23); + NGDNum.TabIndex = 8; + // + // label19 + // + label19.AutoSize = true; + label19.Location = new Point(32, 156); + label19.Margin = new Padding(4, 0, 4, 0); + label19.Name = "label19"; + label19.Size = new Size(57, 17); + label19.TabIndex = 7; + label19.Text = "NG个数"; + // + // AllDSum + // + AllDSum.Location = new Point(130, 111); + AllDSum.Margin = new Padding(4, 2, 4, 2); + AllDSum.Name = "AllDSum"; + AllDSum.ReadOnly = true; + AllDSum.Size = new Size(127, 23); + AllDSum.TabIndex = 6; + // + // label18 + // + label18.AutoSize = true; + label18.Location = new Point(32, 114); + label18.Margin = new Padding(4, 0, 4, 0); + label18.Name = "label18"; + label18.Size = new Size(50, 17); + label18.TabIndex = 5; + label18.Text = "总个数"; + // + // StartDecBtn + // + StartDecBtn.Location = new Point(168, 56); + StartDecBtn.Margin = new Padding(4, 2, 4, 2); + StartDecBtn.Name = "StartDecBtn"; + StartDecBtn.Size = new Size(121, 40); + StartDecBtn.TabIndex = 3; + StartDecBtn.Text = "开启检测"; + StartDecBtn.UseVisualStyleBackColor = true; + StartDecBtn.Click += StartDecBtn_Click; + // + // ScanDevList + // + ScanDevList.Location = new Point(296, 18); + ScanDevList.Margin = new Padding(4, 2, 4, 2); + ScanDevList.Name = "ScanDevList"; + ScanDevList.Size = new Size(96, 30); + ScanDevList.TabIndex = 2; + ScanDevList.Text = "Scan"; + ScanDevList.UseVisualStyleBackColor = true; + ScanDevList.Click += ScanDevList_Click; + // + // DevNameCombo + // + DevNameCombo.FormattingEnabled = true; + DevNameCombo.Location = new Point(32, 22); + DevNameCombo.Margin = new Padding(4, 2, 4, 2); + DevNameCombo.Name = "DevNameCombo"; + DevNameCombo.Size = new Size(256, 25); + DevNameCombo.TabIndex = 1; + // + // InitMachine + // + InitMachine.Location = new Point(31, 56); + InitMachine.Margin = new Padding(4, 2, 4, 2); + InitMachine.Name = "InitMachine"; + InitMachine.Size = new Size(121, 40); + InitMachine.TabIndex = 0; + InitMachine.Text = "初始化设备"; + InitMachine.UseVisualStyleBackColor = true; + InitMachine.Click += InitMachine_Click; + // + // tabPage3 + // + tabPage3.Controls.Add(panel2); + tabPage3.Location = new Point(4, 26); + tabPage3.Margin = new Padding(4, 2, 4, 2); + tabPage3.Name = "tabPage3"; + tabPage3.Size = new Size(1276, 719); + tabPage3.TabIndex = 4; + tabPage3.Text = "录入新型号"; + tabPage3.UseVisualStyleBackColor = true; + // + // panel2 + // + panel2.Controls.Add(button1); + panel2.Controls.Add(WhiteBanCbx); + panel2.Controls.Add(label33); + panel2.Controls.Add(label28); + panel2.Controls.Add(openModelBtn); + panel2.Controls.Add(modelChangeCbx); + panel2.Controls.Add(label34); + panel2.Controls.Add(OpenTwoDirBtn); + panel2.Controls.Add(OpenDirBtn); + panel2.Controls.Add(Cam2MatCbx); + panel2.Controls.Add(label22); + panel2.Controls.Add(Cam1MatCbx); + panel2.Controls.Add(label23); + panel2.Controls.Add(QueryoneBtn); + panel2.Controls.Add(InsertBtn); + panel2.Controls.Add(moveZbox); + panel2.Controls.Add(moveYbox); + panel2.Controls.Add(label29); + panel2.Controls.Add(moveXbox); + panel2.Controls.Add(label30); + panel2.Controls.Add(OcrBarBox); + panel2.Controls.Add(label31); + panel2.Controls.Add(TypeBox); + panel2.Controls.Add(queryALLBtn); + panel2.Controls.Add(label32); + panel2.Controls.Add(InsertDataDgv); + panel2.Location = new Point(0, 2); + panel2.Margin = new Padding(4, 2, 4, 2); + panel2.Name = "panel2"; + panel2.Size = new Size(1630, 717); + panel2.TabIndex = 1; + panel2.Paint += panel2_Paint; + // + // button1 + // + button1.ContextMenuStrip = contextMenuStrip1; + button1.Location = new Point(493, 46); + button1.Margin = new Padding(4, 2, 4, 2); + button1.Name = "button1"; + button1.Size = new Size(96, 38); + button1.TabIndex = 41; + button1.Text = "获取"; + button1.UseVisualStyleBackColor = true; + button1.Click += button1_Click_1; + // + // contextMenuStrip1 + // + contextMenuStrip1.ImageScalingSize = new Size(24, 24); + contextMenuStrip1.Name = "contextMenuStrip1"; + contextMenuStrip1.Size = new Size(61, 4); + // + // WhiteBanCbx + // + WhiteBanCbx.AutoSize = true; + WhiteBanCbx.Checked = true; + WhiteBanCbx.CheckState = CheckState.Checked; + WhiteBanCbx.Location = new Point(867, 146); + WhiteBanCbx.Margin = new Padding(4, 2, 4, 2); + WhiteBanCbx.Name = "WhiteBanCbx"; + WhiteBanCbx.Size = new Size(41, 21); + WhiteBanCbx.TabIndex = 40; + WhiteBanCbx.Text = "是"; + WhiteBanCbx.UseVisualStyleBackColor = true; + // + // label33 + // + label33.AutoSize = true; + label33.Location = new Point(596, 147); + label33.Margin = new Padding(4, 0, 4, 0); + label33.Name = "label33"; + label33.Size = new Size(162, 17); + label33.TabIndex = 39; + label33.Text = "面板第二块区域是白板吗"; + // + // label28 + // + label28.AutoSize = true; + label28.Location = new Point(23, 187); + label28.Margin = new Padding(4, 0, 4, 0); + label28.Name = "label28"; + label28.Size = new Size(101, 17); + label28.TabIndex = 14; + label28.Text = "第一次拍照Z轴"; + // + // openModelBtn + // + openModelBtn.Location = new Point(1340, 14); + openModelBtn.Margin = new Padding(4, 2, 4, 2); + openModelBtn.Name = "openModelBtn"; + openModelBtn.Size = new Size(96, 26); + openModelBtn.TabIndex = 37; + openModelBtn.Text = "打开模型"; + openModelBtn.UseVisualStyleBackColor = true; + openModelBtn.Click += openModelBtn_Click; + // + // modelChangeCbx + // + modelChangeCbx.Location = new Point(750, 14); + modelChangeCbx.Margin = new Padding(4, 2, 4, 2); + modelChangeCbx.Name = "modelChangeCbx"; + modelChangeCbx.Size = new Size(241, 23); + modelChangeCbx.TabIndex = 34; + modelChangeCbx.Text = "D:\\Hisence\\config\\chinese.json"; + // + // label34 + // + label34.AutoSize = true; + label34.Location = new Point(597, 14); + label34.Margin = new Padding(4, 0, 4, 0); + label34.Name = "label34"; + label34.Size = new Size(92, 17); + label34.TabIndex = 33; + label34.Text = "面板语言选择"; + // + // OpenTwoDirBtn + // + OpenTwoDirBtn.Location = new Point(1066, 105); + OpenTwoDirBtn.Margin = new Padding(4, 2, 4, 2); + OpenTwoDirBtn.Name = "OpenTwoDirBtn"; + OpenTwoDirBtn.Size = new Size(96, 35); + OpenTwoDirBtn.TabIndex = 31; + OpenTwoDirBtn.Text = "打开文件"; + OpenTwoDirBtn.UseVisualStyleBackColor = true; + OpenTwoDirBtn.Click += OpenTwoDirBtn_Click; + // + // OpenDirBtn + // + OpenDirBtn.Location = new Point(1066, 53); + OpenDirBtn.Margin = new Padding(4, 2, 4, 2); + OpenDirBtn.Name = "OpenDirBtn"; + OpenDirBtn.Size = new Size(96, 34); + OpenDirBtn.TabIndex = 30; + OpenDirBtn.Text = "打开文件"; + OpenDirBtn.UseVisualStyleBackColor = true; + OpenDirBtn.Click += OpenDirBtn_Click; + // + // Cam2MatCbx + // + Cam2MatCbx.Location = new Point(750, 111); + Cam2MatCbx.Margin = new Padding(4, 2, 4, 2); + Cam2MatCbx.Name = "Cam2MatCbx"; + Cam2MatCbx.Size = new Size(279, 23); + Cam2MatCbx.TabIndex = 29; + Cam2MatCbx.Text = "D:\\Hisence\\类型\\Lp\\002jpg"; + // + // label22 + // + label22.AutoSize = true; + label22.Location = new Point(596, 105); + label22.Margin = new Padding(4, 0, 4, 0); + label22.Name = "label22"; + label22.Size = new Size(92, 17); + label22.TabIndex = 28; + label22.Text = "面板第二张图"; + // + // Cam1MatCbx + // + Cam1MatCbx.Location = new Point(750, 59); + Cam1MatCbx.Margin = new Padding(4, 2, 4, 2); + Cam1MatCbx.Name = "Cam1MatCbx"; + Cam1MatCbx.Size = new Size(279, 23); + Cam1MatCbx.TabIndex = 27; + Cam1MatCbx.Text = "D:\\Hisence\\类型\\Lp\\001.jpg"; + // + // label23 + // + label23.AutoSize = true; + label23.Location = new Point(597, 62); + label23.Margin = new Padding(4, 0, 4, 0); + label23.Name = "label23"; + label23.Size = new Size(92, 17); + label23.TabIndex = 26; + label23.Text = "面板第一张图"; + // + // QueryoneBtn + // + QueryoneBtn.Location = new Point(978, 204); + QueryoneBtn.Margin = new Padding(4, 2, 4, 2); + QueryoneBtn.Name = "QueryoneBtn"; + QueryoneBtn.Size = new Size(148, 50); + QueryoneBtn.TabIndex = 25; + QueryoneBtn.Text = "条件查询"; + QueryoneBtn.UseVisualStyleBackColor = true; + QueryoneBtn.Click += QueryoneBtn_Click; + // + // InsertBtn + // + InsertBtn.Location = new Point(608, 204); + InsertBtn.Margin = new Padding(4, 2, 4, 2); + InsertBtn.Name = "InsertBtn"; + InsertBtn.Size = new Size(156, 56); + InsertBtn.TabIndex = 22; + InsertBtn.Text = "插入"; + InsertBtn.UseVisualStyleBackColor = true; + InsertBtn.Click += InsertBtn_Click; + // + // moveZbox + // + moveZbox.Location = new Point(183, 184); + moveZbox.Margin = new Padding(4, 2, 4, 2); + moveZbox.Name = "moveZbox"; + moveZbox.Size = new Size(287, 23); + moveZbox.TabIndex = 15; + moveZbox.Text = "0"; + // + // moveYbox + // + moveYbox.Location = new Point(183, 141); + moveYbox.Margin = new Padding(4, 2, 4, 2); + moveYbox.Name = "moveYbox"; + moveYbox.Size = new Size(287, 23); + moveYbox.TabIndex = 13; + moveYbox.Text = "0"; + // + // label29 + // + label29.AutoSize = true; + label29.Location = new Point(22, 143); + label29.Margin = new Padding(4, 0, 4, 0); + label29.Name = "label29"; + label29.Size = new Size(101, 17); + label29.TabIndex = 12; + label29.Text = "第一次拍照Y轴"; + // + // moveXbox + // + moveXbox.Location = new Point(182, 101); + moveXbox.Margin = new Padding(4, 2, 4, 2); + moveXbox.Name = "moveXbox"; + moveXbox.Size = new Size(287, 23); + moveXbox.TabIndex = 11; + moveXbox.Text = "8974"; + // + // label30 + // + label30.AutoSize = true; + label30.Location = new Point(22, 104); + label30.Margin = new Padding(4, 0, 4, 0); + label30.Name = "label30"; + label30.Size = new Size(101, 17); + label30.TabIndex = 10; + label30.Text = "第一次拍照X轴"; + // + // OcrBarBox + // + OcrBarBox.Location = new Point(183, 56); + OcrBarBox.Margin = new Padding(4, 2, 4, 2); + OcrBarBox.Name = "OcrBarBox"; + OcrBarBox.Size = new Size(287, 23); + OcrBarBox.TabIndex = 5; + OcrBarBox.Text = "1234567890"; + // + // label31 + // + label31.AutoSize = true; + label31.Location = new Point(23, 59); + label31.Margin = new Padding(4, 0, 4, 0); + label31.Name = "label31"; + label31.Size = new Size(27, 17); + label31.TabIndex = 4; + label31.Text = "SN"; + // + // TypeBox + // + TypeBox.Location = new Point(183, 14); + TypeBox.Margin = new Padding(4, 2, 4, 2); + TypeBox.Name = "TypeBox"; + TypeBox.Size = new Size(287, 23); + TypeBox.TabIndex = 3; + TypeBox.Text = "1"; + // + // queryALLBtn + // + queryALLBtn.Location = new Point(798, 204); + queryALLBtn.Margin = new Padding(4, 2, 4, 2); + queryALLBtn.Name = "queryALLBtn"; + queryALLBtn.Size = new Size(148, 56); + queryALLBtn.TabIndex = 2; + queryALLBtn.Text = "查询全部"; + queryALLBtn.UseVisualStyleBackColor = true; + queryALLBtn.Click += queryALLBtn_Click; + // + // label32 + // + label32.AutoSize = true; + label32.Location = new Point(18, 17); + label32.Margin = new Padding(4, 0, 4, 0); + label32.Name = "label32"; + label32.Size = new Size(36, 17); + label32.TabIndex = 1; + label32.Text = "类型"; + // + // InsertDataDgv + // + InsertDataDgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + InsertDataDgv.Location = new Point(15, 264); + InsertDataDgv.Margin = new Padding(4, 2, 4, 2); + InsertDataDgv.Name = "InsertDataDgv"; + InsertDataDgv.RowHeadersWidth = 62; + InsertDataDgv.RowTemplate.Height = 25; + InsertDataDgv.Size = new Size(1601, 206); + InsertDataDgv.TabIndex = 0; + // // canvas4 // canvas4.AllowSelectDefect = true; @@ -1319,51 +1808,6 @@ canvas1.YMove = 0F; canvas1.YScale = 0F; // - // originMatShow - // - originMatShow.Location = new Point(8, 21); - originMatShow.Margin = new Padding(4, 2, 4, 2); - originMatShow.Name = "originMatShow"; - originMatShow.Size = new Size(351, 200); - originMatShow.SizeMode = PictureBoxSizeMode.StretchImage; - originMatShow.TabIndex = 3; - originMatShow.TabStop = false; - // - // ResultMatShow - // - ResultMatShow.Location = new Point(367, 21); - ResultMatShow.Margin = new Padding(4, 2, 4, 2); - ResultMatShow.Name = "ResultMatShow"; - ResultMatShow.Size = new Size(363, 200); - ResultMatShow.SizeMode = PictureBoxSizeMode.StretchImage; - ResultMatShow.TabIndex = 2; - ResultMatShow.TabStop = false; - // - // panel8 - // - panel8.Controls.Add(textBox2); - panel8.Controls.Add(label36); - panel8.Controls.Add(textBox1); - panel8.Controls.Add(label35); - panel8.Controls.Add(实时显示); - panel8.Controls.Add(OKOrNGShow); - panel8.Controls.Add(OKDNum); - panel8.Controls.Add(label20); - panel8.Controls.Add(NGDNum); - panel8.Controls.Add(label19); - panel8.Controls.Add(AllDSum); - panel8.Controls.Add(label18); - panel8.Controls.Add(StartDecBtn); - panel8.Controls.Add(ScanDevList); - panel8.Controls.Add(DevNameCombo); - panel8.Controls.Add(InitMachine); - panel8.Location = new Point(738, 0); - panel8.Margin = new Padding(4, 2, 4, 2); - panel8.Name = "panel8"; - panel8.Size = new Size(905, 718); - panel8.TabIndex = 2; - panel8.Paint += panel8_Paint; - // // canvas5 // canvas5.AllowSelectDefect = true; @@ -1385,477 +1829,6 @@ canvas5.YMove = 0F; canvas5.YScale = 0F; // - // textBox2 - // - textBox2.Location = new Point(437, 287); - textBox2.Margin = new Padding(4, 2, 4, 2); - textBox2.Name = "textBox2"; - textBox2.ReadOnly = true; - textBox2.Size = new Size(82, 31); - textBox2.TabIndex = 17; - // - // label36 - // - label36.AutoSize = true; - label36.Location = new Point(353, 290); - label36.Name = "label36"; - label36.Size = new Size(96, 25); - label36.TabIndex = 16; - label36.Text = "日误检率"; - // - // textBox1 - // - textBox1.Location = new Point(437, 237); - textBox1.Margin = new Padding(4, 2, 4, 2); - textBox1.Name = "textBox1"; - textBox1.ReadOnly = true; - textBox1.Size = new Size(82, 31); - textBox1.TabIndex = 15; - // - // label35 - // - label35.AutoSize = true; - label35.Location = new Point(353, 240); - label35.Name = "label35"; - label35.Size = new Size(75, 25); - label35.TabIndex = 14; - label35.Text = "误检率"; - // - // 实时显示 - // - 实时显示.AutoSize = true; - 实时显示.Location = new Point(427, 24); - 实时显示.Margin = new Padding(4, 0, 4, 0); - 实时显示.Name = "实时显示"; - 实时显示.Size = new Size(96, 25); - 实时显示.TabIndex = 12; - 实时显示.Text = "实时显示"; - // - // OKOrNGShow - // - OKOrNGShow.Location = new Point(299, 53); - OKOrNGShow.Margin = new Padding(4, 2, 4, 2); - OKOrNGShow.Name = "OKOrNGShow"; - OKOrNGShow.Size = new Size(235, 168); - OKOrNGShow.SizeMode = PictureBoxSizeMode.CenterImage; - OKOrNGShow.TabIndex = 11; - OKOrNGShow.TabStop = false; - // - // OKDNum - // - OKDNum.Location = new Point(130, 196); - OKDNum.Margin = new Padding(4, 2, 4, 2); - OKDNum.Name = "OKDNum"; - OKDNum.ReadOnly = true; - OKDNum.Size = new Size(127, 31); - OKDNum.TabIndex = 10; - // - // label20 - // - label20.AutoSize = true; - label20.Location = new Point(32, 201); - label20.Margin = new Padding(4, 0, 4, 0); - label20.Name = "label20"; - label20.Size = new Size(84, 25); - label20.TabIndex = 9; - label20.Text = "OK个数"; - // - // NGDNum - // - NGDNum.Location = new Point(130, 153); - NGDNum.Margin = new Padding(4, 2, 4, 2); - NGDNum.Name = "NGDNum"; - NGDNum.ReadOnly = true; - NGDNum.Size = new Size(127, 31); - NGDNum.TabIndex = 8; - // - // label19 - // - label19.AutoSize = true; - label19.Location = new Point(32, 156); - label19.Margin = new Padding(4, 0, 4, 0); - label19.Name = "label19"; - label19.Size = new Size(85, 25); - label19.TabIndex = 7; - label19.Text = "NG个数"; - // - // AllDSum - // - AllDSum.Location = new Point(130, 111); - AllDSum.Margin = new Padding(4, 2, 4, 2); - AllDSum.Name = "AllDSum"; - AllDSum.ReadOnly = true; - AllDSum.Size = new Size(127, 31); - AllDSum.TabIndex = 6; - // - // label18 - // - label18.AutoSize = true; - label18.Location = new Point(32, 114); - label18.Margin = new Padding(4, 0, 4, 0); - label18.Name = "label18"; - label18.Size = new Size(75, 25); - label18.TabIndex = 5; - label18.Text = "总个数"; - // - // StartDecBtn - // - StartDecBtn.Location = new Point(168, 56); - StartDecBtn.Margin = new Padding(4, 2, 4, 2); - StartDecBtn.Name = "StartDecBtn"; - StartDecBtn.Size = new Size(121, 40); - StartDecBtn.TabIndex = 3; - StartDecBtn.Text = "开启检测"; - StartDecBtn.UseVisualStyleBackColor = true; - StartDecBtn.Click += StartDecBtn_Click; - // - // ScanDevList - // - ScanDevList.Location = new Point(296, 18); - ScanDevList.Margin = new Padding(4, 2, 4, 2); - ScanDevList.Name = "ScanDevList"; - ScanDevList.Size = new Size(96, 30); - ScanDevList.TabIndex = 2; - ScanDevList.Text = "Scan"; - ScanDevList.UseVisualStyleBackColor = true; - ScanDevList.Click += ScanDevList_Click; - // - // DevNameCombo - // - DevNameCombo.FormattingEnabled = true; - DevNameCombo.Location = new Point(32, 22); - DevNameCombo.Margin = new Padding(4, 2, 4, 2); - DevNameCombo.Name = "DevNameCombo"; - DevNameCombo.Size = new Size(256, 33); - DevNameCombo.TabIndex = 1; - // - // InitMachine - // - InitMachine.Location = new Point(31, 56); - InitMachine.Margin = new Padding(4, 2, 4, 2); - InitMachine.Name = "InitMachine"; - InitMachine.Size = new Size(121, 40); - InitMachine.TabIndex = 0; - InitMachine.Text = "初始化设备"; - InitMachine.UseVisualStyleBackColor = true; - InitMachine.Click += InitMachine_Click; - // - // tabPage3 - // - tabPage3.Controls.Add(panel2); - tabPage3.Location = new Point(4, 33); - tabPage3.Margin = new Padding(4, 2, 4, 2); - tabPage3.Name = "tabPage3"; - tabPage3.Size = new Size(1276, 712); - tabPage3.TabIndex = 4; - tabPage3.Text = "录入新型号"; - tabPage3.UseVisualStyleBackColor = true; - // - // panel2 - // - panel2.Controls.Add(button1); - panel2.Controls.Add(WhiteBanCbx); - panel2.Controls.Add(label33); - panel2.Controls.Add(label28); - panel2.Controls.Add(openModelBtn); - panel2.Controls.Add(modelChangeCbx); - panel2.Controls.Add(label34); - panel2.Controls.Add(OpenTwoDirBtn); - panel2.Controls.Add(OpenDirBtn); - panel2.Controls.Add(Cam2MatCbx); - panel2.Controls.Add(label22); - panel2.Controls.Add(Cam1MatCbx); - panel2.Controls.Add(label23); - panel2.Controls.Add(QueryoneBtn); - panel2.Controls.Add(InsertBtn); - panel2.Controls.Add(moveZbox); - panel2.Controls.Add(moveYbox); - panel2.Controls.Add(label29); - panel2.Controls.Add(moveXbox); - panel2.Controls.Add(label30); - panel2.Controls.Add(OcrBarBox); - panel2.Controls.Add(label31); - panel2.Controls.Add(TypeBox); - panel2.Controls.Add(queryALLBtn); - panel2.Controls.Add(label32); - panel2.Controls.Add(InsertDataDgv); - panel2.Location = new Point(10, 2); - panel2.Margin = new Padding(4, 2, 4, 2); - panel2.Name = "panel2"; - panel2.Size = new Size(1620, 502); - panel2.TabIndex = 1; - panel2.Paint += panel2_Paint; - // - // button1 - // - button1.ContextMenuStrip = contextMenuStrip1; - button1.Location = new Point(493, 46); - button1.Margin = new Padding(4, 2, 4, 2); - button1.Name = "button1"; - button1.Size = new Size(96, 38); - button1.TabIndex = 41; - button1.Text = "获取"; - button1.UseVisualStyleBackColor = true; - button1.Click += button1_Click_1; - // - // contextMenuStrip1 - // - contextMenuStrip1.ImageScalingSize = new Size(24, 24); - contextMenuStrip1.Name = "contextMenuStrip1"; - contextMenuStrip1.Size = new Size(61, 4); - // - // WhiteBanCbx - // - WhiteBanCbx.AutoSize = true; - WhiteBanCbx.Checked = true; - WhiteBanCbx.CheckState = CheckState.Checked; - WhiteBanCbx.Location = new Point(867, 146); - WhiteBanCbx.Margin = new Padding(4, 2, 4, 2); - WhiteBanCbx.Name = "WhiteBanCbx"; - WhiteBanCbx.Size = new Size(59, 29); - WhiteBanCbx.TabIndex = 40; - WhiteBanCbx.Text = "是"; - WhiteBanCbx.UseVisualStyleBackColor = true; - // - // label33 - // - label33.AutoSize = true; - label33.Location = new Point(596, 147); - label33.Margin = new Padding(4, 0, 4, 0); - label33.Name = "label33"; - label33.Size = new Size(243, 25); - label33.TabIndex = 39; - label33.Text = "面板第二块区域是白板吗"; - // - // label28 - // - label28.AutoSize = true; - label28.Location = new Point(23, 187); - label28.Margin = new Padding(4, 0, 4, 0); - label28.Name = "label28"; - label28.Size = new Size(151, 25); - label28.TabIndex = 14; - label28.Text = "第一次拍照Z轴"; - // - // openModelBtn - // - openModelBtn.Location = new Point(1340, 14); - openModelBtn.Margin = new Padding(4, 2, 4, 2); - openModelBtn.Name = "openModelBtn"; - openModelBtn.Size = new Size(96, 26); - openModelBtn.TabIndex = 37; - openModelBtn.Text = "打开模型"; - openModelBtn.UseVisualStyleBackColor = true; - openModelBtn.Click += openModelBtn_Click; - // - // modelChangeCbx - // - modelChangeCbx.Location = new Point(750, 14); - modelChangeCbx.Margin = new Padding(4, 2, 4, 2); - modelChangeCbx.Name = "modelChangeCbx"; - modelChangeCbx.Size = new Size(241, 31); - modelChangeCbx.TabIndex = 34; - modelChangeCbx.Text = "D:\\Hisence\\config\\chinese.json"; - // - // label34 - // - label34.AutoSize = true; - label34.Location = new Point(597, 14); - label34.Margin = new Padding(4, 0, 4, 0); - label34.Name = "label34"; - label34.Size = new Size(138, 25); - label34.TabIndex = 33; - label34.Text = "面板语言选择"; - // - // OpenTwoDirBtn - // - OpenTwoDirBtn.Location = new Point(1066, 105); - OpenTwoDirBtn.Margin = new Padding(4, 2, 4, 2); - OpenTwoDirBtn.Name = "OpenTwoDirBtn"; - OpenTwoDirBtn.Size = new Size(96, 35); - OpenTwoDirBtn.TabIndex = 31; - OpenTwoDirBtn.Text = "打开文件"; - OpenTwoDirBtn.UseVisualStyleBackColor = true; - OpenTwoDirBtn.Click += OpenTwoDirBtn_Click; - // - // OpenDirBtn - // - OpenDirBtn.Location = new Point(1066, 53); - OpenDirBtn.Margin = new Padding(4, 2, 4, 2); - OpenDirBtn.Name = "OpenDirBtn"; - OpenDirBtn.Size = new Size(96, 34); - OpenDirBtn.TabIndex = 30; - OpenDirBtn.Text = "打开文件"; - OpenDirBtn.UseVisualStyleBackColor = true; - OpenDirBtn.Click += OpenDirBtn_Click; - // - // Cam2MatCbx - // - Cam2MatCbx.Location = new Point(750, 111); - Cam2MatCbx.Margin = new Padding(4, 2, 4, 2); - Cam2MatCbx.Name = "Cam2MatCbx"; - Cam2MatCbx.Size = new Size(279, 31); - Cam2MatCbx.TabIndex = 29; - Cam2MatCbx.Text = "D:\\Hisence\\类型\\Lp\\002jpg"; - // - // label22 - // - label22.AutoSize = true; - label22.Location = new Point(596, 105); - label22.Margin = new Padding(4, 0, 4, 0); - label22.Name = "label22"; - label22.Size = new Size(138, 25); - label22.TabIndex = 28; - label22.Text = "面板第二张图"; - // - // Cam1MatCbx - // - Cam1MatCbx.Location = new Point(750, 59); - Cam1MatCbx.Margin = new Padding(4, 2, 4, 2); - Cam1MatCbx.Name = "Cam1MatCbx"; - Cam1MatCbx.Size = new Size(279, 31); - Cam1MatCbx.TabIndex = 27; - Cam1MatCbx.Text = "D:\\Hisence\\类型\\Lp\\001.jpg"; - // - // label23 - // - label23.AutoSize = true; - label23.Location = new Point(597, 62); - label23.Margin = new Padding(4, 0, 4, 0); - label23.Name = "label23"; - label23.Size = new Size(138, 25); - label23.TabIndex = 26; - label23.Text = "面板第一张图"; - // - // QueryoneBtn - // - QueryoneBtn.Location = new Point(978, 204); - QueryoneBtn.Margin = new Padding(4, 2, 4, 2); - QueryoneBtn.Name = "QueryoneBtn"; - QueryoneBtn.Size = new Size(148, 50); - QueryoneBtn.TabIndex = 25; - QueryoneBtn.Text = "条件查询"; - QueryoneBtn.UseVisualStyleBackColor = true; - QueryoneBtn.Click += QueryoneBtn_Click; - // - // InsertBtn - // - InsertBtn.Location = new Point(608, 204); - InsertBtn.Margin = new Padding(4, 2, 4, 2); - InsertBtn.Name = "InsertBtn"; - InsertBtn.Size = new Size(156, 56); - InsertBtn.TabIndex = 22; - InsertBtn.Text = "插入"; - InsertBtn.UseVisualStyleBackColor = true; - InsertBtn.Click += InsertBtn_Click; - // - // moveZbox - // - moveZbox.Location = new Point(183, 184); - moveZbox.Margin = new Padding(4, 2, 4, 2); - moveZbox.Name = "moveZbox"; - moveZbox.Size = new Size(287, 31); - moveZbox.TabIndex = 15; - moveZbox.Text = "0"; - // - // moveYbox - // - moveYbox.Location = new Point(183, 141); - moveYbox.Margin = new Padding(4, 2, 4, 2); - moveYbox.Name = "moveYbox"; - moveYbox.Size = new Size(287, 31); - moveYbox.TabIndex = 13; - moveYbox.Text = "0"; - // - // label29 - // - label29.AutoSize = true; - label29.Location = new Point(22, 143); - label29.Margin = new Padding(4, 0, 4, 0); - label29.Name = "label29"; - label29.Size = new Size(153, 25); - label29.TabIndex = 12; - label29.Text = "第一次拍照Y轴"; - // - // moveXbox - // - moveXbox.Location = new Point(182, 101); - moveXbox.Margin = new Padding(4, 2, 4, 2); - moveXbox.Name = "moveXbox"; - moveXbox.Size = new Size(287, 31); - moveXbox.TabIndex = 11; - moveXbox.Text = "8974"; - // - // label30 - // - label30.AutoSize = true; - label30.Location = new Point(22, 104); - label30.Margin = new Padding(4, 0, 4, 0); - label30.Name = "label30"; - label30.Size = new Size(152, 25); - label30.TabIndex = 10; - label30.Text = "第一次拍照X轴"; - // - // OcrBarBox - // - OcrBarBox.Location = new Point(183, 56); - OcrBarBox.Margin = new Padding(4, 2, 4, 2); - OcrBarBox.Name = "OcrBarBox"; - OcrBarBox.Size = new Size(287, 31); - OcrBarBox.TabIndex = 5; - OcrBarBox.Text = "1234567890"; - // - // label31 - // - label31.AutoSize = true; - label31.Location = new Point(23, 59); - label31.Margin = new Padding(4, 0, 4, 0); - label31.Name = "label31"; - label31.Size = new Size(41, 25); - label31.TabIndex = 4; - label31.Text = "SN"; - // - // TypeBox - // - TypeBox.Location = new Point(183, 14); - TypeBox.Margin = new Padding(4, 2, 4, 2); - TypeBox.Name = "TypeBox"; - TypeBox.Size = new Size(287, 31); - TypeBox.TabIndex = 3; - TypeBox.Text = "1"; - // - // queryALLBtn - // - queryALLBtn.Location = new Point(798, 204); - queryALLBtn.Margin = new Padding(4, 2, 4, 2); - queryALLBtn.Name = "queryALLBtn"; - queryALLBtn.Size = new Size(148, 56); - queryALLBtn.TabIndex = 2; - queryALLBtn.Text = "查询全部"; - queryALLBtn.UseVisualStyleBackColor = true; - queryALLBtn.Click += queryALLBtn_Click; - // - // label32 - // - label32.AutoSize = true; - label32.Location = new Point(18, 17); - label32.Margin = new Padding(4, 0, 4, 0); - label32.Name = "label32"; - label32.Size = new Size(54, 25); - label32.TabIndex = 1; - label32.Text = "类型"; - // - // InsertDataDgv - // - InsertDataDgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; - InsertDataDgv.Location = new Point(15, 264); - InsertDataDgv.Margin = new Padding(4, 2, 4, 2); - InsertDataDgv.Name = "InsertDataDgv"; - InsertDataDgv.RowHeadersWidth = 62; - InsertDataDgv.RowTemplate.Height = 25; - InsertDataDgv.Size = new Size(1601, 206); - InsertDataDgv.TabIndex = 0; - // // richTextBox1 // richTextBox1.Dock = DockStyle.Bottom; @@ -1868,7 +1841,7 @@ // // MainForm // - AutoScaleDimensions = new SizeF(12F, 25F); + AutoScaleDimensions = new SizeF(8F, 17F); AutoScaleMode = AutoScaleMode.Font; BackColor = SystemColors.ActiveCaption; ClientSize = new Size(1284, 920); diff --git a/HisenceYoloDetection/MainForm.cs b/HisenceYoloDetection/MainForm.cs index ed681ba..04fc9b3 100644 --- a/HisenceYoloDetection/MainForm.cs +++ b/HisenceYoloDetection/MainForm.cs @@ -283,16 +283,75 @@ namespace HisenceYoloDetection return content; } - #region Post - /// - /// http Post - /// - /// - /// ʵַ - /// Ĭ application/json , application/x-www-form-urlencoded,multipart/form-data,raw,binary - /// Ĭapplication/json - /// - public string Post(string parameterData, string serviceUrl, string contentType = "application/x-www-form-urlencoded", string accept = "application/json") + public static string PostData(string url, string postData) + { + byte[] data = Encoding.UTF8.GetBytes(postData); + + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); + request.Method = "POST"; + request.ContentType = "application/x-www-form-urlencoded"; + request.ContentLength = data.Length; + + using (Stream stream = request.GetRequestStream()) + { + stream.Write(data, 0, data.Length); + } + + using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) + using (StreamReader reader = new StreamReader(response.GetResponseStream())) + { + return reader.ReadToEnd(); + } + } + + static string FindStringAfterColon(string response, string targetString) + { + int targetIndex = response.IndexOf(targetString); + if (targetIndex == -1) + { + Console.WriteLine($"δҵַ: {targetString}"); + return null; + } + + // Ŀַðź + int colonIndex = response.IndexOf(':', targetIndex); + if (colonIndex == -1 || colonIndex <= targetIndex) + { + Console.WriteLine("Ŀַδҵð"); + return null; + } + + // ſʼλ + int startQuoteIndex = response.IndexOf('"', colonIndex + 1); + if (startQuoteIndex == -1) + { + Console.WriteLine("δҵ"); + return null; + } + + // ұպŵλ + int endQuoteIndex = response.IndexOf('"', startQuoteIndex + 1); + if (endQuoteIndex == -1) + { + Console.WriteLine("δҵպϵ"); + return null; + } + + // ȡڵַ + return response.Substring(startQuoteIndex + 1, endQuoteIndex - startQuoteIndex - 1); + } + + + #region Post + /// + /// http Post + /// + /// + /// ʵַ + /// Ĭ application/json , application/x-www-form-urlencoded,multipart/form-data,raw,binary + /// Ĭapplication/json + /// + public string Post(string parameterData, string serviceUrl, string contentType = "application/x-www-form-urlencoded", string accept = "application/json") { try { @@ -347,58 +406,45 @@ namespace HisenceYoloDetection public void GetTypeFromPost() { string url = "http://172.16.139.146/FCCBOMWebService/FCCBomService.asmx/GetFCCBomInfoPDJson"; + string jsonData = @" + { + ""StartTime"": ""2024-07-15"", + ""EndTime"": ""2024-07-15"", + ""LineBody"": ""BZ-PC"" + }"; - DateTime dt = DateTime.Now; - string today = dt.ToString("yyyy-MM-dd"); - string startTime = today; - string endTime = today; - string lineBody = "BZ-PC"; - string materialDescript = ""; + string postData = "inputvalue=" + Uri.EscapeDataString(jsonData); - JObject patientInfo = new JObject + try { - ["StartTime"] = startTime, - ["EndTime"] = endTime, - ["LineBody"] = lineBody, - ["MaterialDescripts"] = new JArray { materialDescript } - }; + string response = PostData(url, postData); - string sendData = patientInfo.ToString(); - string resultData = Post(sendData, url, "application/x-www-form-urlencoded", "application/json"); - if (resultData != null) - { - JObject responseJson = JObject.Parse(resultData); - bool success = responseJson["success"] != null && (bool)responseJson["success"]; - if (success) + + // Ӧ + string finalDefIdToFind = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 7); // Ŀ FinalDefID + string productType = FindStringAfterColon(response, finalDefIdToFind); + if (productType != null) { + Console.WriteLine($"{finalDefIdToFind}: {productType}"); - // string FinalDefIDToFind = m_sKEYENCEBar.Substring(1, 18);// Ŀ FinalDefID - JArray dataArray = responseJson["data"] as JArray; - if (dataArray != null) - { - foreach (JObject dataItem in dataArray) - { - string finalDefID = dataItem["FinalDefID"] != null ? dataItem["FinalDefID"].ToString() : "N/A"; - string productType = dataItem["ProductType"] != null ? dataItem["ProductType"].ToString() : "N/A"; - DayTypeDics.Add(finalDefID, productType); + // дļ - } - } } else { - string returnMsg = responseJson["ReturnMsg"] != null ? responseJson["ReturnMsg"].ToString() : "Unknown error"; - Console.WriteLine("ʧܣ" + returnMsg); + Console.WriteLine($"FinalDefID {finalDefIdToFind} not found in response."); } } - else + catch (Exception ex) { - Console.WriteLine("ʧܣδ"); + Console.WriteLine("Error occurred:"); + Console.WriteLine(ex.Message); } + } /// @@ -411,59 +457,49 @@ namespace HisenceYoloDetection Stopwatch sw = new Stopwatch(); sw.Start(); - string url = "http://172.16.139.146/FCCBOMWebService/FCCBomService.asmx/GetFCCBomInfoPDJson"; + // string url = "http://172.16.139.146/FCCBOMWebService/FCCBomService.asmx/GetFCCBomInfoPDJson"; - DateTime dt = DateTime.Now; - string today = dt.ToString("yyyy-MM-dd"); + // string jsonData = @" + //{ + // ""StartTime"": ""2024-07-15"", + // ""EndTime"": ""2024-07-15"", + // ""LineBody"": ""BZ-PC"" + // }"; - string startTime = today; - string endTime = today; - string lineBody = "BZ-PC"; - string materialDescript = ""; - JObject patientInfo = new JObject - { - ["StartTime"] = startTime, - ["EndTime"] = endTime, - ["LineBody"] = lineBody, - ["MaterialDescripts"] = new JArray { materialDescript } - }; + // string postData = "inputvalue=" + Uri.EscapeDataString(jsonData); - string sendData = patientInfo.ToString(); - string resultData = Post(sendData, url, "application/x-www-form-urlencoded", "application/json"); + // try + // { + // string response = PostData(url, postData); - if (resultData != null) - { - JObject responseJson = JObject.Parse(resultData); - bool success = responseJson["success"] != null && (bool)responseJson["success"]; - if (success) - { - string FinalDefIDToFind = m_sKEYENCEBar.Substring(1, 18);// Ŀ FinalDefID - JArray dataArray = responseJson["data"] as JArray; - if (dataArray != null) - { - foreach (JObject dataItem in dataArray) - { - if (dataItem["FinalDefID"] != null && dataItem["FinalDefID"].ToString() == FinalDefIDToFind) - { - string productType = dataItem["ProductType"] != null ? dataItem["ProductType"].ToString() : "N/A"; - Console.WriteLine($"FinalDefID: {FinalDefIDToFind}, ProductType: {productType}"); - break; - } - } - } - } - else - { - string returnMsg = responseJson["ReturnMsg"] != null ? responseJson["ReturnMsg"].ToString() : "Unknown error"; - Console.WriteLine("ʧܣ" + returnMsg); - } - } - else - { - Console.WriteLine("ʧܣδ"); - } + + // // Ӧ + // string finalDefIdToFind = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 7); + // string productType = FindStringAfterColon(response, finalDefIdToFind); + // if (productType != null) + // { + // Console.WriteLine($"{finalDefIdToFind}: {productType}"); + + // // дļ + + + + // } + // else + // { + // Console.WriteLine($"FinalDefID {finalDefIdToFind} not found in response."); + // } + // } + // catch (Exception ex) + // { + // Console.WriteLine("Error occurred:"); + // Console.WriteLine(ex.Message); + // } + + + sw.Stop(); Console.WriteLine("ʱi" + sw.ElapsedMilliseconds); @@ -558,14 +594,10 @@ namespace HisenceYoloDetection OnSpeedShow();//߳̿ٶʾڽ OnPostionShow();//߳̿λʾڽ -<<<<<<< HEAD + melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 1);//Ƶ melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);//̵ -======= - melsecPLCTCPDriver.WriteInt("554", 1);//Ƶ - melsecPLCTCPDriver.WriteInt("552", 0);//ƴ״̬ - melsecPLCTCPDriver.WriteInt("556", 0); ->>>>>>> 756d23229c59669d628dd94efb8876679bfe21f7 + //t = new System.Timers.Timer(10000);//ʵTimer࣬üʱΪ10000룻 //t.Elapsed += new System.Timers.ElapsedEventHandler(Execute);//ʱʱִ¼ //t.AutoReset = true;//ִһΣfalseһֱִ(true) @@ -1964,31 +1996,23 @@ namespace HisenceYoloDetection } else { -<<<<<<< HEAD + melsecPLCTCPDriver.WriteInt(RedLightingAdress, 1);// melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);//Ƶ melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);//̵ melsecPLCTCPDriver.WriteInt(WaringAdress, 1);// -======= - melsecPLCTCPDriver.WriteInt("552", 1);// - melsecPLCTCPDriver.WriteInt("554", 0);// - melsecPLCTCPDriver.WriteInt("556", 0); - melsecPLCTCPDriver.WriteInt("558", 1);// + //ΪжǷNGϴ» DialogResult dr = MessageBox.Show("Ƿ죿", "Ƿ", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (dr == DialogResult.OK) { -<<<<<<< HEAD + melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);// melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 1);//Ƶ melsecPLCTCPDriver.WriteInt(WaringAdress, 0);// -======= - melsecPLCTCPDriver.WriteInt("552", 0);// - melsecPLCTCPDriver.WriteInt("554", 1);//Ƶ - melsecPLCTCPDriver.WriteInt("558", 0);// ->>>>>>> 756d23229c59669d628dd94efb8876679bfe21f7 + OKDsums++; WUsums++; this.Invoke(new Action(() => @@ -2003,15 +2027,11 @@ namespace HisenceYoloDetection else { NGDsums++; -<<<<<<< HEAD + melsecPLCTCPDriver.WriteInt(WaringAdress, 0);// melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);// melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 1);//Ƶ -======= - melsecPLCTCPDriver.WriteInt("558", 0);// - melsecPLCTCPDriver.WriteInt("552", 0);// - melsecPLCTCPDriver.WriteInt("554", 1);//Ƶ ->>>>>>> 756d23229c59669d628dd94efb8876679bfe21f7 + this.Invoke(new Action(() => { @@ -2321,18 +2341,14 @@ namespace HisenceYoloDetection Rect rect2 = new Rect(0, 0, 0, 0); CheckDiffSciHelper1.CheckDiffSci(path2, pathmat, rect2, rect2, false, "D://Hisence//Test1"); -<<<<<<< HEAD + */ // OnGetBar(); melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//̵ melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);//Ƶ -======= + - */ - // OnGetBar(); - melsecPLCTCPDriver.WriteInt("556", 1);//̵ - melsecPLCTCPDriver.WriteInt("554", 0);//Ƶ TriggerCameral2();//紥 SNȡͺ ݿеõֵ ReadyDetect();//պ߳ ThreadPost();//պȡյͺ @@ -2686,56 +2702,43 @@ namespace HisenceYoloDetection string productType = "N/A"; string url = "http://172.16.139.146/FCCBOMWebService/FCCBomService.asmx/GetFCCBomInfoPDJson"; - DateTime dt = DateTime.Now; - string today = dt.ToString("yyyy-MM-dd"); + string jsonData = @" + { + ""StartTime"": ""2024-07-15"", + ""EndTime"": ""2024-07-15"", + ""LineBody"": ""BZ-PC"" + }"; - string startTime = today; - string endTime = today; - string lineBody = "BZ-PC"; - string materialDescript = ""; - JObject patientInfo = new JObject + string postData = "inputvalue=" + Uri.EscapeDataString(jsonData); + + try { - ["StartTime"] = startTime, - ["EndTime"] = endTime, - ["LineBody"] = lineBody, - ["MaterialDescripts"] = new JArray { materialDescript } - }; + string response = PostData(url, postData); - string sendData = patientInfo.ToString(); - string resultData = Post(sendData, url, "application/x-www-form-urlencoded", "application/json"); - if (resultData != null) - { - JObject responseJson = JObject.Parse(resultData); - bool success = responseJson["success"] != null && (bool)responseJson["success"]; - if (success) + + // Ӧ + string finalDefIdToFind = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 7); // Ŀ FinalDefID + productType = FindStringAfterColon(response, finalDefIdToFind); + if (productType != null) { + Console.WriteLine($"{finalDefIdToFind}: {productType}"); + + // дļ + + - string FinalDefIDToFind = SN.Substring(1, 18);// Ŀ FinalDefID - JArray dataArray = responseJson["data"] as JArray; - if (dataArray != null) - { - foreach (JObject dataItem in dataArray) - { - if (dataItem["FinalDefID"] != null && dataItem["FinalDefID"].ToString() == FinalDefIDToFind) - { - productType = dataItem["ProductType"] != null ? dataItem["ProductType"].ToString() : "N/A"; - Console.WriteLine($"FinalDefID: {FinalDefIDToFind}, ProductType: {productType}"); - break; - } - } - } } else { - string returnMsg = responseJson["ReturnMsg"] != null ? responseJson["ReturnMsg"].ToString() : "Unknown error"; - Console.WriteLine("ʧܣ" + returnMsg); + Console.WriteLine($"FinalDefID {finalDefIdToFind} not found in response."); } } - else + catch (Exception ex) { - Console.WriteLine("ʧܣδ"); + Console.WriteLine("Error occurred:"); + Console.WriteLine(ex.Message); } return productType; // sw.Stop(); @@ -3793,7 +3796,7 @@ namespace HisenceYoloDetection { if (!m_sKEYENCEBar.IsNullOrEmpty()) { - OcrBarBox.Text = m_sKEYENCEBar; + OcrBarBox.Text = m_sKEYENCEBar.Substring(0, m_sKEYENCEBar.Length - 7); } }