diff --git a/HisenceYoloDetection/MainForm.Designer.cs b/HisenceYoloDetection/MainForm.Designer.cs index 9a0ae84..d5e8472 100644 --- a/HisenceYoloDetection/MainForm.Designer.cs +++ b/HisenceYoloDetection/MainForm.Designer.cs @@ -29,12 +29,6 @@ private void InitializeComponent() { components = new System.ComponentModel.Container(); - 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(); - OpenCvSharp.Mat mat6 = new OpenCvSharp.Mat(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); tabPage2 = new TabPage(); panel1 = new Panel(); @@ -126,18 +120,9 @@ panel4 = new Panel(); panel5 = new Panel(); groupBox2 = new GroupBox(); - canvas5 = new XKRS.UI.Canvas(); - canvas4 = new XKRS.UI.Canvas(); - canvas3 = new XKRS.UI.Canvas(); - canvas1 = new XKRS.UI.Canvas(); - originMat2Show = new PictureBox(); - ResultMatShow2 = new PictureBox(); - originMatShow2 = new PictureBox(); originMatShow = new PictureBox(); ResultMatShow = new PictureBox(); panel8 = new Panel(); - canvas6 = new XKRS.UI.Canvas(); - canvas2 = new XKRS.UI.Canvas(); textBox2 = new TextBox(); label36 = new Label(); textBox1 = new TextBox(); @@ -212,9 +197,6 @@ panel4.SuspendLayout(); panel5.SuspendLayout(); groupBox2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)originMat2Show).BeginInit(); - ((System.ComponentModel.ISupportInitialize)ResultMatShow2).BeginInit(); - ((System.ComponentModel.ISupportInitialize)originMatShow2).BeginInit(); ((System.ComponentModel.ISupportInitialize)originMatShow).BeginInit(); ((System.ComponentModel.ISupportInitialize)ResultMatShow).BeginInit(); panel8.SuspendLayout(); @@ -231,7 +213,7 @@ tabPage2.Margin = new Padding(4, 2, 4, 2); tabPage2.Name = "tabPage2"; tabPage2.Padding = new Padding(4, 2, 4, 2); - tabPage2.Size = new Size(1643, 719); + tabPage2.Size = new Size(1276, 719); tabPage2.TabIndex = 1; tabPage2.Text = "PLC"; tabPage2.UseVisualStyleBackColor = true; @@ -279,7 +261,7 @@ DistanceShow.Margin = new Padding(4, 2, 4, 2); DistanceShow.Name = "DistanceShow"; DistanceShow.ReadOnly = true; - DistanceShow.Size = new Size(127, 26); + DistanceShow.Size = new Size(127, 23); DistanceShow.TabIndex = 10; // // label21 @@ -288,7 +270,7 @@ label21.Location = new Point(36, 31); label21.Margin = new Padding(4, 0, 4, 0); label21.Name = "label21"; - label21.Size = new Size(35, 16); + label21.Size = new Size(36, 17); label21.TabIndex = 0; label21.Text = "测距"; // @@ -297,7 +279,7 @@ txtSetValue.Location = new Point(738, 73); txtSetValue.Margin = new Padding(4, 2, 4, 2); txtSetValue.Name = "txtSetValue"; - txtSetValue.Size = new Size(251, 26); + txtSetValue.Size = new Size(251, 23); txtSetValue.TabIndex = 14; // // groupBox4 @@ -366,7 +348,7 @@ SetlnEditmiZOP.Location = new Point(526, 296); SetlnEditmiZOP.Margin = new Padding(4, 2, 4, 2); SetlnEditmiZOP.Name = "SetlnEditmiZOP"; - SetlnEditmiZOP.Size = new Size(127, 26); + SetlnEditmiZOP.Size = new Size(127, 23); SetlnEditmiZOP.TabIndex = 27; // // SetlnEditmiYOP @@ -374,7 +356,7 @@ SetlnEditmiYOP.Location = new Point(329, 296); SetlnEditmiYOP.Margin = new Padding(4, 2, 4, 2); SetlnEditmiYOP.Name = "SetlnEditmiYOP"; - SetlnEditmiYOP.Size = new Size(127, 26); + SetlnEditmiYOP.Size = new Size(127, 23); SetlnEditmiYOP.TabIndex = 26; // // SetlnEditmiXOP @@ -382,7 +364,7 @@ SetlnEditmiXOP.Location = new Point(138, 296); SetlnEditmiXOP.Margin = new Padding(4, 2, 4, 2); SetlnEditmiXOP.Name = "SetlnEditmiXOP"; - SetlnEditmiXOP.Size = new Size(127, 26); + SetlnEditmiXOP.Size = new Size(127, 23); SetlnEditmiXOP.TabIndex = 25; // // SetlnEditmiZH @@ -390,7 +372,7 @@ SetlnEditmiZH.Location = new Point(526, 242); SetlnEditmiZH.Margin = new Padding(4, 2, 4, 2); SetlnEditmiZH.Name = "SetlnEditmiZH"; - SetlnEditmiZH.Size = new Size(127, 26); + SetlnEditmiZH.Size = new Size(127, 23); SetlnEditmiZH.TabIndex = 23; // // SetlnEditmiYH @@ -398,7 +380,7 @@ SetlnEditmiYH.Location = new Point(329, 242); SetlnEditmiYH.Margin = new Padding(4, 2, 4, 2); SetlnEditmiYH.Name = "SetlnEditmiYH"; - SetlnEditmiYH.Size = new Size(127, 26); + SetlnEditmiYH.Size = new Size(127, 23); SetlnEditmiYH.TabIndex = 22; // // SetlnEditmiXH @@ -406,7 +388,7 @@ SetlnEditmiXH.Location = new Point(138, 242); SetlnEditmiXH.Margin = new Padding(4, 2, 4, 2); SetlnEditmiXH.Name = "SetlnEditmiXH"; - SetlnEditmiXH.Size = new Size(127, 26); + SetlnEditmiXH.Size = new Size(127, 23); SetlnEditmiXH.TabIndex = 21; // // lnEditmiZOP @@ -414,7 +396,7 @@ lnEditmiZOP.Location = new Point(526, 189); lnEditmiZOP.Margin = new Padding(4, 2, 4, 2); lnEditmiZOP.Name = "lnEditmiZOP"; - lnEditmiZOP.Size = new Size(127, 26); + lnEditmiZOP.Size = new Size(127, 23); lnEditmiZOP.TabIndex = 19; // // lnEditmiYOP @@ -422,7 +404,7 @@ lnEditmiYOP.Location = new Point(329, 189); lnEditmiYOP.Margin = new Padding(4, 2, 4, 2); lnEditmiYOP.Name = "lnEditmiYOP"; - lnEditmiYOP.Size = new Size(127, 26); + lnEditmiYOP.Size = new Size(127, 23); lnEditmiYOP.TabIndex = 18; // // lnEditmiXOP @@ -430,7 +412,7 @@ lnEditmiXOP.Location = new Point(138, 189); lnEditmiXOP.Margin = new Padding(4, 2, 4, 2); lnEditmiXOP.Name = "lnEditmiXOP"; - lnEditmiXOP.Size = new Size(127, 26); + lnEditmiXOP.Size = new Size(127, 23); lnEditmiXOP.TabIndex = 17; // // label17 @@ -439,7 +421,7 @@ label17.Location = new Point(41, 191); label17.Margin = new Padding(4, 0, 4, 0); label17.Name = "label17"; - label17.Size = new Size(63, 16); + label17.Size = new Size(64, 17); label17.TabIndex = 16; label17.Text = "定位位置"; // @@ -449,7 +431,7 @@ lnEditmiZS.Margin = new Padding(4, 2, 4, 2); lnEditmiZS.Name = "lnEditmiZS"; lnEditmiZS.ReadOnly = true; - lnEditmiZS.Size = new Size(127, 26); + lnEditmiZS.Size = new Size(127, 23); lnEditmiZS.TabIndex = 15; // // lnEditmiYS @@ -458,7 +440,7 @@ lnEditmiYS.Margin = new Padding(4, 2, 4, 2); lnEditmiYS.Name = "lnEditmiYS"; lnEditmiYS.ReadOnly = true; - lnEditmiYS.Size = new Size(127, 26); + lnEditmiYS.Size = new Size(127, 23); lnEditmiYS.TabIndex = 14; // // lnEditmiXS @@ -467,7 +449,7 @@ lnEditmiXS.Margin = new Padding(4, 2, 4, 2); lnEditmiXS.Name = "lnEditmiXS"; lnEditmiXS.ReadOnly = true; - lnEditmiXS.Size = new Size(127, 26); + lnEditmiXS.Size = new Size(127, 23); lnEditmiXS.TabIndex = 13; // // label16 @@ -476,7 +458,7 @@ label16.Location = new Point(10, 138); label16.Margin = new Padding(4, 0, 4, 0); label16.Name = "label16"; - label16.Size = new Size(91, 16); + label16.Size = new Size(92, 17); label16.TabIndex = 12; label16.Text = "当前定位速度"; // @@ -486,7 +468,7 @@ lnEditmiZHS.Margin = new Padding(4, 2, 4, 2); lnEditmiZHS.Name = "lnEditmiZHS"; lnEditmiZHS.ReadOnly = true; - lnEditmiZHS.Size = new Size(127, 26); + lnEditmiZHS.Size = new Size(127, 23); lnEditmiZHS.TabIndex = 11; // // lnEditmiYHS @@ -495,7 +477,7 @@ lnEditmiYHS.Margin = new Padding(4, 2, 4, 2); lnEditmiYHS.Name = "lnEditmiYHS"; lnEditmiYHS.ReadOnly = true; - lnEditmiYHS.Size = new Size(127, 26); + lnEditmiYHS.Size = new Size(127, 23); lnEditmiYHS.TabIndex = 10; // // lnEditmiXHS @@ -504,7 +486,7 @@ lnEditmiXHS.Margin = new Padding(4, 2, 4, 2); lnEditmiXHS.Name = "lnEditmiXHS"; lnEditmiXHS.ReadOnly = true; - lnEditmiXHS.Size = new Size(127, 26); + lnEditmiXHS.Size = new Size(127, 23); lnEditmiXHS.TabIndex = 9; // // label15 @@ -513,7 +495,7 @@ label15.Location = new Point(10, 85); label15.Margin = new Padding(4, 0, 4, 0); label15.Name = "label15"; - label15.Size = new Size(91, 16); + label15.Size = new Size(92, 17); label15.TabIndex = 8; label15.Text = "当前手动速度"; // @@ -523,7 +505,7 @@ ZPostion.Location = new Point(580, 42); ZPostion.Margin = new Padding(4, 0, 4, 0); ZPostion.Name = "ZPostion"; - ZPostion.Size = new Size(16, 16); + ZPostion.Size = new Size(16, 17); ZPostion.TabIndex = 7; ZPostion.Text = "0"; // @@ -533,7 +515,7 @@ YPostion.Location = new Point(386, 42); YPostion.Margin = new Padding(4, 0, 4, 0); YPostion.Name = "YPostion"; - YPostion.Size = new Size(16, 16); + YPostion.Size = new Size(16, 17); YPostion.TabIndex = 6; YPostion.Text = "0"; // @@ -543,7 +525,7 @@ XPostion.Location = new Point(185, 42); XPostion.Margin = new Padding(4, 0, 4, 0); XPostion.Name = "XPostion"; - XPostion.Size = new Size(16, 16); + XPostion.Size = new Size(16, 17); XPostion.TabIndex = 5; XPostion.Text = "0"; // @@ -553,7 +535,7 @@ XCurrentPostion.Location = new Point(170, 42); XCurrentPostion.Margin = new Padding(4, 0, 4, 0); XCurrentPostion.Name = "XCurrentPostion"; - XCurrentPostion.Size = new Size(0, 16); + XCurrentPostion.Size = new Size(0, 17); XCurrentPostion.TabIndex = 4; // // label14 @@ -562,7 +544,7 @@ label14.Location = new Point(580, 21); label14.Margin = new Padding(4, 0, 4, 0); label14.Name = "label14"; - label14.Size = new Size(16, 16); + label14.Size = new Size(17, 17); label14.TabIndex = 3; label14.Text = "Z"; // @@ -572,7 +554,7 @@ label13.Location = new Point(386, 18); label13.Margin = new Padding(4, 0, 4, 0); label13.Name = "label13"; - label13.Size = new Size(16, 16); + label13.Size = new Size(17, 17); label13.TabIndex = 2; label13.Text = "Y"; // @@ -582,7 +564,7 @@ label12.Location = new Point(184, 18); label12.Margin = new Padding(4, 0, 4, 0); label12.Name = "label12"; - label12.Size = new Size(17, 16); + label12.Size = new Size(17, 17); label12.TabIndex = 1; label12.Text = "X"; // @@ -592,7 +574,7 @@ label11.Location = new Point(41, 42); label11.Margin = new Padding(4, 0, 4, 0); label11.Name = "label11"; - label11.Size = new Size(63, 16); + label11.Size = new Size(64, 17); label11.TabIndex = 0; label11.Text = "当前位置"; // @@ -798,7 +780,7 @@ writePLCValue.Location = new Point(861, 9); writePLCValue.Margin = new Padding(4, 2, 4, 2); writePLCValue.Name = "writePLCValue"; - writePLCValue.Size = new Size(127, 26); + writePLCValue.Size = new Size(127, 23); writePLCValue.TabIndex = 11; // // label9 @@ -807,7 +789,7 @@ label9.Location = new Point(514, 49); label9.Margin = new Padding(4, 0, 4, 0); label9.Name = "label9"; - label9.Size = new Size(21, 16); + label9.Size = new Size(22, 17); label9.TabIndex = 10; label9.Text = "值"; // @@ -817,7 +799,7 @@ label10.Location = new Point(514, 15); label10.Margin = new Padding(4, 0, 4, 0); label10.Name = "label10"; - label10.Size = new Size(35, 16); + label10.Size = new Size(36, 17); label10.TabIndex = 9; label10.Text = "地址"; // @@ -837,7 +819,7 @@ PLCValue.Location = new Point(577, 43); PLCValue.Margin = new Padding(4, 2, 4, 2); PLCValue.Name = "PLCValue"; - PLCValue.Size = new Size(127, 26); + PLCValue.Size = new Size(127, 23); PLCValue.TabIndex = 8; // // WriteAdress @@ -845,7 +827,7 @@ WriteAdress.Location = new Point(577, 13); WriteAdress.Margin = new Padding(4, 2, 4, 2); WriteAdress.Name = "WriteAdress"; - WriteAdress.Size = new Size(127, 26); + WriteAdress.Size = new Size(127, 23); WriteAdress.TabIndex = 6; // // label6 @@ -854,7 +836,7 @@ label6.Location = new Point(162, 51); label6.Margin = new Padding(4, 0, 4, 0); label6.Name = "label6"; - label6.Size = new Size(21, 16); + label6.Size = new Size(22, 17); label6.TabIndex = 5; label6.Text = "值"; // @@ -864,7 +846,7 @@ label3.Location = new Point(162, 18); label3.Margin = new Padding(4, 0, 4, 0); label3.Name = "label3"; - label3.Size = new Size(35, 16); + label3.Size = new Size(36, 17); label3.TabIndex = 4; label3.Text = "地址"; // @@ -895,7 +877,7 @@ showPLC.Location = new Point(225, 46); showPLC.Margin = new Padding(4, 2, 4, 2); showPLC.Name = "showPLC"; - showPLC.Size = new Size(127, 26); + showPLC.Size = new Size(127, 23); showPLC.TabIndex = 3; // // readPLc @@ -903,18 +885,18 @@ readPLc.Location = new Point(225, 15); readPLc.Margin = new Padding(4, 2, 4, 2); readPLc.Name = "readPLc"; - readPLc.Size = new Size(127, 26); + readPLc.Size = new Size(127, 23); readPLc.TabIndex = 1; // // tabPage1 // tabPage1.Controls.Add(groupBox3); tabPage1.Controls.Add(groupBox1); - tabPage1.Location = new Point(4, 25); + 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(1643, 720); + tabPage1.Size = new Size(1276, 719); tabPage1.TabIndex = 0; tabPage1.Text = "相机"; tabPage1.UseVisualStyleBackColor = true; @@ -978,7 +960,7 @@ label5.Location = new Point(257, 18); label5.Margin = new Padding(4, 0, 4, 0); label5.Name = "label5"; - label5.Size = new Size(63, 16); + label5.Size = new Size(64, 17); label5.TabIndex = 2; label5.Text = "链接相机"; // @@ -1009,7 +991,7 @@ tbGain2.Location = new Point(93, 54); tbGain2.Margin = new Padding(4, 2, 4, 2); tbGain2.Name = "tbGain2"; - tbGain2.Size = new Size(127, 26); + tbGain2.Size = new Size(127, 23); tbGain2.TabIndex = 4; // // tbExposure2 @@ -1017,7 +999,7 @@ tbExposure2.Location = new Point(93, 22); tbExposure2.Margin = new Padding(4, 2, 4, 2); tbExposure2.Name = "tbExposure2"; - tbExposure2.Size = new Size(127, 26); + tbExposure2.Size = new Size(127, 23); tbExposure2.TabIndex = 3; // // label7 @@ -1026,7 +1008,7 @@ label7.Location = new Point(15, 56); label7.Margin = new Padding(4, 0, 4, 0); label7.Name = "label7"; - label7.Size = new Size(35, 16); + label7.Size = new Size(36, 17); label7.TabIndex = 1; label7.Text = "增益"; // @@ -1036,7 +1018,7 @@ label8.Location = new Point(15, 24); label8.Margin = new Padding(4, 0, 4, 0); label8.Name = "label8"; - label8.Size = new Size(35, 16); + label8.Size = new Size(36, 17); label8.TabIndex = 0; label8.Text = "曝光"; // @@ -1101,7 +1083,7 @@ label1.Location = new Point(257, 18); label1.Margin = new Padding(4, 0, 4, 0); label1.Name = "label1"; - label1.Size = new Size(63, 16); + label1.Size = new Size(64, 17); label1.TabIndex = 2; label1.Text = "链接相机"; // @@ -1132,7 +1114,7 @@ tbGain.Location = new Point(93, 54); tbGain.Margin = new Padding(4, 2, 4, 2); tbGain.Name = "tbGain"; - tbGain.Size = new Size(127, 26); + tbGain.Size = new Size(127, 23); tbGain.TabIndex = 4; // // tbExposure @@ -1140,7 +1122,7 @@ tbExposure.Location = new Point(93, 22); tbExposure.Margin = new Padding(4, 2, 4, 2); tbExposure.Name = "tbExposure"; - tbExposure.Size = new Size(127, 26); + tbExposure.Size = new Size(127, 23); tbExposure.TabIndex = 3; // // label2 @@ -1149,7 +1131,7 @@ label2.Location = new Point(15, 56); label2.Margin = new Padding(4, 0, 4, 0); label2.Name = "label2"; - label2.Size = new Size(35, 16); + label2.Size = new Size(36, 17); label2.TabIndex = 1; label2.Text = "增益"; // @@ -1159,7 +1141,7 @@ label4.Location = new Point(15, 24); label4.Margin = new Padding(4, 0, 4, 0); label4.Name = "label4"; - label4.Size = new Size(35, 16); + label4.Size = new Size(36, 17); label4.TabIndex = 0; label4.Text = "曝光"; // @@ -1174,16 +1156,16 @@ tabControl1.Margin = new Padding(4, 2, 4, 2); tabControl1.Name = "tabControl1"; tabControl1.SelectedIndex = 0; - tabControl1.Size = new Size(1651, 749); + tabControl1.Size = new Size(1284, 749); tabControl1.TabIndex = 0; // // tabPage5 // tabPage5.Controls.Add(panel4); - tabPage5.Location = new Point(4, 25); + tabPage5.Location = new Point(4, 26); tabPage5.Margin = new Padding(4, 2, 4, 2); tabPage5.Name = "tabPage5"; - tabPage5.Size = new Size(1643, 720); + tabPage5.Size = new Size(1276, 719); tabPage5.TabIndex = 3; tabPage5.Text = "流程"; tabPage5.UseVisualStyleBackColor = true; @@ -1195,7 +1177,7 @@ panel4.Location = new Point(0, 0); panel4.Margin = new Padding(4, 2, 4, 2); panel4.Name = "panel4"; - panel4.Size = new Size(1643, 720); + panel4.Size = new Size(1276, 719); panel4.TabIndex = 0; // // panel5 @@ -1206,170 +1188,46 @@ panel5.Location = new Point(0, 0); panel5.Margin = new Padding(4, 2, 4, 2); panel5.Name = "panel5"; - panel5.Size = new Size(1643, 718); + panel5.Size = new Size(1276, 718); panel5.TabIndex = 0; // // groupBox2 // groupBox2.AutoSize = true; - groupBox2.Controls.Add(canvas5); - groupBox2.Controls.Add(canvas4); - groupBox2.Controls.Add(canvas3); - groupBox2.Controls.Add(canvas1); - groupBox2.Controls.Add(originMat2Show); - groupBox2.Controls.Add(ResultMatShow2); - groupBox2.Controls.Add(originMatShow2); groupBox2.Controls.Add(originMatShow); groupBox2.Controls.Add(ResultMatShow); - groupBox2.Dock = DockStyle.Left; groupBox2.Location = new Point(0, 0); groupBox2.Margin = new Padding(4, 2, 4, 2); groupBox2.Name = "groupBox2"; groupBox2.Padding = new Padding(4, 2, 4, 2); - groupBox2.Size = new Size(1083, 718); + groupBox2.Size = new Size(738, 718); groupBox2.TabIndex = 0; groupBox2.TabStop = false; groupBox2.Text = "图片"; groupBox2.Enter += groupBox2_Enter; // - // canvas5 - // - canvas5.AllowSelectDefect = true; - canvas5.BrushColor = null; - canvas5.ImagePath = ""; - mat1.IsEnabledDispose = true; - canvas5.ImaMAt = mat1; - canvas5.ImgData = null; - canvas5.Location = new Point(693, 440); - canvas5.MoveStep = 5F; - canvas5.Name = "canvas5"; - canvas5.Route = 0D; - canvas5.Scale = 1D; - canvas5.Size = new Size(337, 200); - canvas5.TabIndex = 12; - canvas5.WholeScale = 0F; - canvas5.XMove = 0F; - canvas5.XScale = 0F; - canvas5.YMove = 0F; - canvas5.YScale = 0F; - // - // canvas4 - // - canvas4.AllowSelectDefect = true; - canvas4.BrushColor = null; - canvas4.ImagePath = ""; - mat2.IsEnabledDispose = true; - canvas4.ImaMAt = mat2; - canvas4.ImgData = null; - canvas4.Location = new Point(350, 440); - canvas4.MoveStep = 5F; - canvas4.Name = "canvas4"; - canvas4.Route = 0D; - canvas4.Scale = 1D; - canvas4.Size = new Size(337, 200); - canvas4.TabIndex = 11; - canvas4.WholeScale = 0F; - canvas4.XMove = 0F; - canvas4.XScale = 0F; - canvas4.YMove = 0F; - canvas4.YScale = 0F; - // - // canvas3 - // - canvas3.AllowSelectDefect = true; - canvas3.BrushColor = null; - canvas3.ImagePath = ""; - mat3.IsEnabledDispose = true; - canvas3.ImaMAt = mat3; - canvas3.ImgData = null; - canvas3.Location = new Point(7, 440); - canvas3.MoveStep = 5F; - canvas3.Name = "canvas3"; - canvas3.Route = 0D; - canvas3.Scale = 1D; - canvas3.Size = new Size(337, 200); - canvas3.TabIndex = 10; - canvas3.WholeScale = 0F; - canvas3.XMove = 0F; - canvas3.XScale = 0F; - canvas3.YMove = 0F; - canvas3.YScale = 0F; - // - // canvas1 - // - canvas1.AllowSelectDefect = true; - canvas1.BrushColor = null; - canvas1.ImagePath = ""; - mat4.IsEnabledDispose = true; - canvas1.ImaMAt = mat4; - canvas1.ImgData = null; - canvas1.Location = new Point(738, 226); - canvas1.MoveStep = 5F; - canvas1.Name = "canvas1"; - canvas1.Route = 0D; - canvas1.Scale = 1D; - canvas1.Size = new Size(337, 200); - canvas1.TabIndex = 9; - canvas1.WholeScale = 0F; - canvas1.XMove = 0F; - canvas1.XScale = 0F; - canvas1.YMove = 0F; - canvas1.YScale = 0F; - // - // originMat2Show - // - originMat2Show.Location = new Point(738, 19); - originMat2Show.Margin = new Padding(4, 2, 4, 2); - originMat2Show.Name = "originMat2Show"; - originMat2Show.Size = new Size(337, 200); - originMat2Show.SizeMode = PictureBoxSizeMode.StretchImage; - originMat2Show.TabIndex = 8; - originMat2Show.TabStop = false; - // - // ResultMatShow2 - // - ResultMatShow2.Location = new Point(382, 226); - ResultMatShow2.Margin = new Padding(4, 2, 4, 2); - ResultMatShow2.Name = "ResultMatShow2"; - ResultMatShow2.Size = new Size(348, 200); - ResultMatShow2.SizeMode = PictureBoxSizeMode.StretchImage; - ResultMatShow2.TabIndex = 5; - ResultMatShow2.TabStop = false; - // - // originMatShow2 - // - originMatShow2.Location = new Point(8, 226); - originMatShow2.Margin = new Padding(4, 2, 4, 2); - originMatShow2.Name = "originMatShow2"; - originMatShow2.Size = new Size(366, 200); - originMatShow2.SizeMode = PictureBoxSizeMode.StretchImage; - originMatShow2.TabIndex = 4; - originMatShow2.TabStop = false; - // // originMatShow // originMatShow.Location = new Point(8, 21); originMatShow.Margin = new Padding(4, 2, 4, 2); originMatShow.Name = "originMatShow"; - originMatShow.Size = new Size(366, 200); + originMatShow.Size = new Size(351, 200); originMatShow.SizeMode = PictureBoxSizeMode.StretchImage; originMatShow.TabIndex = 3; originMatShow.TabStop = false; // // ResultMatShow // - ResultMatShow.Location = new Point(382, 21); + ResultMatShow.Location = new Point(367, 21); ResultMatShow.Margin = new Padding(4, 2, 4, 2); ResultMatShow.Name = "ResultMatShow"; - ResultMatShow.Size = new Size(348, 200); + ResultMatShow.Size = new Size(363, 200); ResultMatShow.SizeMode = PictureBoxSizeMode.StretchImage; ResultMatShow.TabIndex = 2; ResultMatShow.TabStop = false; // // panel8 // - panel8.Controls.Add(canvas6); - panel8.Controls.Add(canvas2); panel8.Controls.Add(textBox2); panel8.Controls.Add(label36); panel8.Controls.Add(textBox1); @@ -1386,63 +1244,20 @@ panel8.Controls.Add(ScanDevList); panel8.Controls.Add(DevNameCombo); panel8.Controls.Add(InitMachine); - panel8.Location = new Point(1091, 0); + panel8.Location = new Point(738, 0); panel8.Margin = new Padding(4, 2, 4, 2); panel8.Name = "panel8"; - panel8.Size = new Size(552, 718); + panel8.Size = new Size(905, 718); panel8.TabIndex = 2; panel8.Paint += panel8_Paint; // - // canvas6 - // - canvas6.AllowSelectDefect = true; - canvas6.BrushColor = null; - canvas6.ImagePath = ""; - mat5.IsEnabledDispose = true; - canvas6.ImaMAt = mat5; - canvas6.ImgData = null; - canvas6.Location = new Point(10, 440); - canvas6.Margin = new Padding(4, 3, 4, 3); - canvas6.MoveStep = 5F; - canvas6.Name = "canvas6"; - canvas6.Route = 0D; - canvas6.Scale = 1D; - canvas6.Size = new Size(433, 188); - canvas6.TabIndex = 13; - canvas6.WholeScale = 0F; - canvas6.XMove = 0F; - canvas6.XScale = 0F; - canvas6.YMove = 0F; - canvas6.YScale = 0F; - // - // canvas2 - // - canvas2.AllowSelectDefect = true; - canvas2.BrushColor = null; - canvas2.ImagePath = ""; - mat6.IsEnabledDispose = true; - canvas2.ImaMAt = mat6; - canvas2.ImgData = null; - canvas2.Location = new Point(10, 226); - canvas2.MoveStep = 5F; - canvas2.Name = "canvas2"; - canvas2.Route = 0D; - canvas2.Scale = 1D; - canvas2.Size = new Size(337, 200); - canvas2.TabIndex = 18; - canvas2.WholeScale = 0F; - canvas2.XMove = 0F; - canvas2.XScale = 0F; - canvas2.YMove = 0F; - canvas2.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, 26); + textBox2.Size = new Size(82, 23); textBox2.TabIndex = 17; // // label36 @@ -1450,7 +1265,7 @@ label36.AutoSize = true; label36.Location = new Point(353, 290); label36.Name = "label36"; - label36.Size = new Size(63, 16); + label36.Size = new Size(64, 17); label36.TabIndex = 16; label36.Text = "日误检率"; // @@ -1460,7 +1275,7 @@ textBox1.Margin = new Padding(4, 2, 4, 2); textBox1.Name = "textBox1"; textBox1.ReadOnly = true; - textBox1.Size = new Size(82, 26); + textBox1.Size = new Size(82, 23); textBox1.TabIndex = 15; // // label35 @@ -1468,7 +1283,7 @@ label35.AutoSize = true; label35.Location = new Point(353, 240); label35.Name = "label35"; - label35.Size = new Size(49, 16); + label35.Size = new Size(50, 17); label35.TabIndex = 14; label35.Text = "误检率"; // @@ -1478,13 +1293,13 @@ 实时显示.Location = new Point(427, 24); 实时显示.Margin = new Padding(4, 0, 4, 0); 实时显示.Name = "实时显示"; - 实时显示.Size = new Size(63, 16); + 实时显示.Size = new Size(64, 17); 实时显示.TabIndex = 12; 实时显示.Text = "实时显示"; // // OKOrNGShow // - OKOrNGShow.Location = new Point(327, 56); + OKOrNGShow.Location = new Point(299, 53); OKOrNGShow.Margin = new Padding(4, 2, 4, 2); OKOrNGShow.Name = "OKOrNGShow"; OKOrNGShow.Size = new Size(235, 168); @@ -1498,7 +1313,7 @@ OKDNum.Margin = new Padding(4, 2, 4, 2); OKDNum.Name = "OKDNum"; OKDNum.ReadOnly = true; - OKDNum.Size = new Size(127, 26); + OKDNum.Size = new Size(127, 23); OKDNum.TabIndex = 10; // // label20 @@ -1507,7 +1322,7 @@ label20.Location = new Point(32, 201); label20.Margin = new Padding(4, 0, 4, 0); label20.Name = "label20"; - label20.Size = new Size(56, 16); + label20.Size = new Size(56, 17); label20.TabIndex = 9; label20.Text = "OK个数"; // @@ -1517,7 +1332,7 @@ NGDNum.Margin = new Padding(4, 2, 4, 2); NGDNum.Name = "NGDNum"; NGDNum.ReadOnly = true; - NGDNum.Size = new Size(127, 26); + NGDNum.Size = new Size(127, 23); NGDNum.TabIndex = 8; // // label19 @@ -1526,7 +1341,7 @@ label19.Location = new Point(32, 156); label19.Margin = new Padding(4, 0, 4, 0); label19.Name = "label19"; - label19.Size = new Size(56, 16); + label19.Size = new Size(57, 17); label19.TabIndex = 7; label19.Text = "NG个数"; // @@ -1536,7 +1351,7 @@ AllDSum.Margin = new Padding(4, 2, 4, 2); AllDSum.Name = "AllDSum"; AllDSum.ReadOnly = true; - AllDSum.Size = new Size(127, 26); + AllDSum.Size = new Size(127, 23); AllDSum.TabIndex = 6; // // label18 @@ -1545,7 +1360,7 @@ label18.Location = new Point(32, 114); label18.Margin = new Padding(4, 0, 4, 0); label18.Name = "label18"; - label18.Size = new Size(49, 16); + label18.Size = new Size(50, 17); label18.TabIndex = 5; label18.Text = "总个数"; // @@ -1577,7 +1392,7 @@ DevNameCombo.Location = new Point(32, 22); DevNameCombo.Margin = new Padding(4, 2, 4, 2); DevNameCombo.Name = "DevNameCombo"; - DevNameCombo.Size = new Size(256, 24); + DevNameCombo.Size = new Size(256, 25); DevNameCombo.TabIndex = 1; // // InitMachine @@ -1597,7 +1412,7 @@ tabPage3.Location = new Point(4, 26); tabPage3.Margin = new Padding(4, 2, 4, 2); tabPage3.Name = "tabPage3"; - tabPage3.Size = new Size(1643, 719); + tabPage3.Size = new Size(1276, 719); tabPage3.TabIndex = 4; tabPage3.Text = "录入新型号"; tabPage3.UseVisualStyleBackColor = true; @@ -1653,7 +1468,7 @@ WhiteBanCbx.Location = new Point(742, 231); WhiteBanCbx.Margin = new Padding(4, 2, 4, 2); WhiteBanCbx.Name = "WhiteBanCbx"; - WhiteBanCbx.Size = new Size(40, 20); + WhiteBanCbx.Size = new Size(41, 21); WhiteBanCbx.TabIndex = 40; WhiteBanCbx.Text = "是"; WhiteBanCbx.UseVisualStyleBackColor = true; @@ -1664,7 +1479,7 @@ label33.Location = new Point(471, 232); label33.Margin = new Padding(4, 0, 4, 0); label33.Name = "label33"; - label33.Size = new Size(161, 16); + label33.Size = new Size(162, 17); label33.TabIndex = 39; label33.Text = "面板第二块区域是白板吗"; // @@ -1674,7 +1489,7 @@ label28.Location = new Point(23, 187); label28.Margin = new Padding(4, 0, 4, 0); label28.Name = "label28"; - label28.Size = new Size(100, 16); + label28.Size = new Size(101, 17); label28.TabIndex = 14; label28.Text = "第一次拍照Z轴"; // @@ -1694,7 +1509,7 @@ modelChangeCbx.Location = new Point(1059, 14); modelChangeCbx.Margin = new Padding(4, 2, 4, 2); modelChangeCbx.Name = "modelChangeCbx"; - modelChangeCbx.Size = new Size(241, 26); + modelChangeCbx.Size = new Size(241, 23); modelChangeCbx.TabIndex = 34; modelChangeCbx.Text = "D:\\Hisence\\config\\chinese.json"; // @@ -1704,7 +1519,7 @@ label34.Location = new Point(923, 19); label34.Margin = new Padding(4, 0, 4, 0); label34.Name = "label34"; - label34.Size = new Size(91, 16); + label34.Size = new Size(92, 17); label34.TabIndex = 33; label34.Text = "面板语言选择"; // @@ -1746,7 +1561,7 @@ Cam2MatCbx.Location = new Point(608, 190); Cam2MatCbx.Margin = new Padding(4, 2, 4, 2); Cam2MatCbx.Name = "Cam2MatCbx"; - Cam2MatCbx.Size = new Size(279, 26); + Cam2MatCbx.Size = new Size(279, 23); Cam2MatCbx.TabIndex = 29; Cam2MatCbx.Text = "D:\\Hisence\\类型\\Lp\\002jpg"; // @@ -1756,7 +1571,7 @@ label22.Location = new Point(471, 190); label22.Margin = new Padding(4, 0, 4, 0); label22.Name = "label22"; - label22.Size = new Size(91, 16); + label22.Size = new Size(92, 17); label22.TabIndex = 28; label22.Text = "面板第二张图"; // @@ -1765,7 +1580,7 @@ Cam1MatCbx.Location = new Point(608, 142); Cam1MatCbx.Margin = new Padding(4, 2, 4, 2); Cam1MatCbx.Name = "Cam1MatCbx"; - Cam1MatCbx.Size = new Size(279, 26); + Cam1MatCbx.Size = new Size(279, 23); Cam1MatCbx.TabIndex = 27; Cam1MatCbx.Text = "D:\\Hisence\\类型\\Lp\\001.jpg"; // @@ -1775,7 +1590,7 @@ label23.Location = new Point(472, 147); label23.Margin = new Padding(4, 0, 4, 0); label23.Name = "label23"; - label23.Size = new Size(91, 16); + label23.Size = new Size(92, 17); label23.TabIndex = 26; label23.Text = "面板第一张图"; // @@ -1795,7 +1610,7 @@ DetectBArMatbox.Location = new Point(607, 104); DetectBArMatbox.Margin = new Padding(4, 2, 4, 2); DetectBArMatbox.Name = "DetectBArMatbox"; - DetectBArMatbox.Size = new Size(280, 26); + DetectBArMatbox.Size = new Size(280, 23); DetectBArMatbox.TabIndex = 24; DetectBArMatbox.Text = "D:\\Hisence\\类型\\Lp202452414231.jpg"; // @@ -1805,7 +1620,7 @@ label24.Location = new Point(471, 110); label24.Margin = new Padding(4, 0, 4, 0); label24.Name = "label24"; - label24.Size = new Size(63, 16); + label24.Size = new Size(64, 17); label24.TabIndex = 23; label24.Text = "条码录入"; // @@ -1825,7 +1640,7 @@ moveTwoZbox.Location = new Point(607, 56); moveTwoZbox.Margin = new Padding(4, 2, 4, 2); moveTwoZbox.Name = "moveTwoZbox"; - moveTwoZbox.Size = new Size(280, 26); + moveTwoZbox.Size = new Size(280, 23); moveTwoZbox.TabIndex = 21; moveTwoZbox.Text = "0"; // @@ -1835,7 +1650,7 @@ label25.Location = new Point(471, 62); label25.Margin = new Padding(4, 0, 4, 0); label25.Name = "label25"; - label25.Size = new Size(100, 16); + label25.Size = new Size(101, 17); label25.TabIndex = 20; label25.Text = "第二次拍照Z轴"; // @@ -1844,7 +1659,7 @@ moveTwoYbox.Location = new Point(607, 11); moveTwoYbox.Margin = new Padding(4, 2, 4, 2); moveTwoYbox.Name = "moveTwoYbox"; - moveTwoYbox.Size = new Size(280, 26); + moveTwoYbox.Size = new Size(280, 23); moveTwoYbox.TabIndex = 19; moveTwoYbox.Text = "0"; // @@ -1854,7 +1669,7 @@ label26.Location = new Point(471, 17); label26.Margin = new Padding(4, 0, 4, 0); label26.Name = "label26"; - label26.Size = new Size(100, 16); + label26.Size = new Size(101, 17); label26.TabIndex = 18; label26.Text = "第二次拍照Y轴"; // @@ -1863,7 +1678,7 @@ moveTwoXbox.Location = new Point(143, 229); moveTwoXbox.Margin = new Padding(4, 2, 4, 2); moveTwoXbox.Name = "moveTwoXbox"; - moveTwoXbox.Size = new Size(287, 26); + moveTwoXbox.Size = new Size(287, 23); moveTwoXbox.TabIndex = 17; moveTwoXbox.Text = "54964"; // @@ -1873,7 +1688,7 @@ label27.Location = new Point(21, 233); label27.Margin = new Padding(4, 0, 4, 0); label27.Name = "label27"; - label27.Size = new Size(101, 16); + label27.Size = new Size(101, 17); label27.TabIndex = 16; label27.Text = "第二次拍照X轴"; // @@ -1882,7 +1697,7 @@ moveZbox.Location = new Point(143, 182); moveZbox.Margin = new Padding(4, 2, 4, 2); moveZbox.Name = "moveZbox"; - moveZbox.Size = new Size(287, 26); + moveZbox.Size = new Size(287, 23); moveZbox.TabIndex = 15; moveZbox.Text = "0"; // @@ -1891,7 +1706,7 @@ moveYbox.Location = new Point(143, 137); moveYbox.Margin = new Padding(4, 2, 4, 2); moveYbox.Name = "moveYbox"; - moveYbox.Size = new Size(287, 26); + moveYbox.Size = new Size(287, 23); moveYbox.TabIndex = 13; moveYbox.Text = "0"; // @@ -1901,7 +1716,7 @@ label29.Location = new Point(22, 143); label29.Margin = new Padding(4, 0, 4, 0); label29.Name = "label29"; - label29.Size = new Size(100, 16); + label29.Size = new Size(101, 17); label29.TabIndex = 12; label29.Text = "第一次拍照Y轴"; // @@ -1910,7 +1725,7 @@ moveXbox.Location = new Point(143, 98); moveXbox.Margin = new Padding(4, 2, 4, 2); moveXbox.Name = "moveXbox"; - moveXbox.Size = new Size(287, 26); + moveXbox.Size = new Size(287, 23); moveXbox.TabIndex = 11; moveXbox.Text = "8974"; // @@ -1920,7 +1735,7 @@ label30.Location = new Point(22, 104); label30.Margin = new Padding(4, 0, 4, 0); label30.Name = "label30"; - label30.Size = new Size(101, 16); + label30.Size = new Size(101, 17); label30.TabIndex = 10; label30.Text = "第一次拍照X轴"; // @@ -1929,7 +1744,7 @@ OcrBarBox.Location = new Point(143, 50); OcrBarBox.Margin = new Padding(4, 2, 4, 2); OcrBarBox.Name = "OcrBarBox"; - OcrBarBox.Size = new Size(287, 26); + OcrBarBox.Size = new Size(287, 23); OcrBarBox.TabIndex = 5; OcrBarBox.Text = "1234567890"; // @@ -1939,7 +1754,7 @@ label31.Location = new Point(18, 56); label31.Margin = new Padding(4, 0, 4, 0); label31.Name = "label31"; - label31.Size = new Size(35, 16); + label31.Size = new Size(36, 17); label31.TabIndex = 4; label31.Text = "条码"; // @@ -1948,7 +1763,7 @@ TypeBox.Location = new Point(143, 11); TypeBox.Margin = new Padding(4, 2, 4, 2); TypeBox.Name = "TypeBox"; - TypeBox.Size = new Size(287, 26); + TypeBox.Size = new Size(287, 23); TypeBox.TabIndex = 3; TypeBox.Text = "1"; // @@ -1969,7 +1784,7 @@ label32.Location = new Point(18, 17); label32.Margin = new Padding(4, 0, 4, 0); label32.Name = "label32"; - label32.Size = new Size(35, 16); + label32.Size = new Size(36, 17); label32.TabIndex = 1; label32.Text = "类型"; // @@ -1989,7 +1804,7 @@ richTextBox1.Location = new Point(0, 754); richTextBox1.Margin = new Padding(4, 2, 4, 2); richTextBox1.Name = "richTextBox1"; - richTextBox1.Size = new Size(1651, 166); + richTextBox1.Size = new Size(1284, 166); richTextBox1.TabIndex = 1; richTextBox1.Text = ""; // @@ -2000,13 +1815,13 @@ // // MainForm // - AutoScaleDimensions = new SizeF(9F, 16F); + AutoScaleDimensions = new SizeF(8F, 17F); AutoScaleMode = AutoScaleMode.Font; BackColor = SystemColors.ActiveCaption; - ClientSize = new Size(1651, 920); + ClientSize = new Size(1284, 920); Controls.Add(richTextBox1); Controls.Add(tabControl1); - Font = new Font("华文中宋", 10.5F, FontStyle.Regular, GraphicsUnit.Point); + Font = new Font("Microsoft Sans Serif", 10.5F, FontStyle.Regular, GraphicsUnit.Point); Icon = (Icon)resources.GetObject("$this.Icon"); Margin = new Padding(4, 2, 4, 2); Name = "MainForm"; @@ -2032,9 +1847,6 @@ panel5.ResumeLayout(false); panel5.PerformLayout(); groupBox2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)originMat2Show).EndInit(); - ((System.ComponentModel.ISupportInitialize)ResultMatShow2).EndInit(); - ((System.ComponentModel.ISupportInitialize)originMatShow2).EndInit(); ((System.ComponentModel.ISupportInitialize)originMatShow).EndInit(); ((System.ComponentModel.ISupportInitialize)ResultMatShow).EndInit(); panel8.ResumeLayout(false); @@ -2121,8 +1933,6 @@ private Label label15; private Button StartDecBtn; private ContextMenuStrip contextMenuStrip1; - private PictureBox ResultMatShow2; - private PictureBox originMatShow2; private TextBox OKDNum; private Label label20; private TextBox NGDNum; @@ -2207,7 +2017,6 @@ private XKRS.UI.Canvas DefetShow4; private XKRS.UI.Canvas DefetShow3; private XKRS.UI.Canvas DefetShow2; - private PictureBox originMat2Show; private XKRS.UI.Canvas DefetShow7; private XKRS.UI.Canvas DefetShow6; private Button handStopBtn; diff --git a/HisenceYoloDetection/MainForm.cs b/HisenceYoloDetection/MainForm.cs index d596bd2..00638da 100644 --- a/HisenceYoloDetection/MainForm.cs +++ b/HisenceYoloDetection/MainForm.cs @@ -342,37 +342,37 @@ namespace HisenceYoloDetection { //ַ //string url = "https://inner-apisix.hisense.com/mes-plus/api/Fcc/GetWorkOrderBOMlnfo?user_key=k7gzo1fsfcami7n5hmpxtybyluf9xeue"; - string url = "https://echo.hoppscotch.io"; - string PostUrl = url; - DateTime dt= DateTime.Now; + ////string url = "https://echo.hoppscotch.io"; + //string PostUrl = url; + //DateTime dt= DateTime.Now; - string starttime=string.Format("{0:yyyy_mm_dd}", dt); //17 17 2017 2017 + //string starttime=string.Format("{0:yyyy_mm_dd}", dt); //17 17 2017 2017 - string startTime = starttime; - string EndTime = starttime; - string lineBody = "ZZ-P"; - string MaterialDescripts = ""; - string MaterialDescripts2 = "չ"; - JObject patientinfo = new JObject(); - JArray ids = new JArray(); - ids.Add(MaterialDescripts); - ids.Add(MaterialDescripts2); - patientinfo["startTime"] = startTime; - patientinfo["EndTime"] = EndTime; - patientinfo["lineBody"] = lineBody; - patientinfo["MaterialDescripts"] = ids; - string sendData = JsonConvert.SerializeObject(patientinfo); - //eg: UrlҪĸʽsendData={"ids":[123],"Name":С} - string resultData = Post(sendData, PostUrl); - resultData = "{\r\n\t\"Result\": [],\r\n\t\"success\": false,\r\n\t\"ReturnMsg\": \"-starttime ȷ!\"\r\n}"; - JObject jo = (JObject)JsonConvert.DeserializeObject(resultData); - string sucessIf = jo["success"].ToString(); - if(sucessIf.ToLower()=="true") - { - string ProductType = jo["ProductType"].ToString(); - string FinalDefIo = jo["FinalDefIo"].ToString(); - //ֶ - } + //string startTime = starttime; + //string EndTime = starttime; + //string lineBody = "ZZ-P"; + //string MaterialDescripts = ""; + //string MaterialDescripts2 = "չ"; + //JObject patientinfo = new JObject(); + //JArray ids = new JArray(); + //ids.Add(MaterialDescripts); + //ids.Add(MaterialDescripts2); + //patientinfo["startTime"] = startTime; + //patientinfo["EndTime"] = EndTime; + //patientinfo["lineBody"] = lineBody; + //patientinfo["MaterialDescripts"] = ids; + //string sendData = JsonConvert.SerializeObject(patientinfo); + ////eg: UrlҪĸʽsendData={"ids":[123],"Name":С} + //string resultData = Post(sendData, PostUrl); + //resultData = "{\r\n\t\"Result\": [],\r\n\t\"success\": false,\r\n\t\"ReturnMsg\": \"-starttime ȷ!\"\r\n}"; + //JObject jo = (JObject)JsonConvert.DeserializeObject(resultData); + //string sucessIf = jo["success"].ToString(); + //if(sucessIf.ToLower()=="true") + //{ + // string ProductType = jo["ProductType"].ToString(); + // string FinalDefIo = jo["FinalDefIo"].ToString(); + // //ֶ + //} if (_runHandleBefore == null) { _runHandleBefore = new AutoResetEvent(false); @@ -1182,9 +1182,8 @@ namespace HisenceYoloDetection { _runHandleBefore.WaitOne(); //ijɺͺŵĶԽ - - // if(Oldm_sKEYENCEBar!= m_sKEYENCEBar) - { +#if false + { // Oldm_sKEYENCEBar= m_sKEYENCEBar; //ȡ //ַ @@ -1223,10 +1222,13 @@ namespace HisenceYoloDetection //ֶ } } - //xKNow = GetModeFromBar("VWJ070633V0WW80F0120356");//ݿвѯֵ - - - if(xKNow==null) +#endif + // if(Oldm_sKEYENCEBar!= m_sKEYENCEBar) + + xKNow = GetModeFromBar("VWJ070541V0WW824F120223");//ݿвѯֵ + + + if (xKNow==null) { myLog("ݿûƥ" + m_sKEYENCEBar, DateTime.Now); break; @@ -1288,8 +1290,8 @@ namespace HisenceYoloDetection // var resultMap = GetResultImage(resultMask, detectionResultShapes); } #endregion - int YPos = 8715; - int ZPos = 25000; + int YPos = 14957; + int ZPos = 4382; bool StopM = false;//һźŵ /// /// ϴ»544Ƿ񴥷䴫 @@ -1337,8 +1339,79 @@ namespace HisenceYoloDetection } if (iNum1 >= 2) { -#if true - + if (bBar) + { + _runHandleBefore.WaitOne(); + //ijɺͺŵĶԽ +#if false + { + // Oldm_sKEYENCEBar= m_sKEYENCEBar; + //ȡ + //ַ + string url = "https://inner-apisix.hisense.com/mes-plus/api/Fcc/GetWorkOrderBOMlnfo?user_key=k7gzo1fsfcami7n5hmpxtybyluf9xeue"; + // string url = "https://echo.hoppscotch.io"; + string PostUrl = url; + DateTime dt = DateTime.Now; + + string starttime = string.Format("{0:yyyy_mm_dd}", dt); //17 17 2017 2017 + + string startTime = starttime; + string EndTime = starttime; + string lineBody = "ZZ-P";// + string MaterialDescripts = ""; + string MaterialDescripts2 = "չ"; + JObject patientinfo = new JObject(); + JArray ids = new JArray(); + ids.Add(MaterialDescripts); + ids.Add(MaterialDescripts2); + patientinfo["startTime"] = startTime; + patientinfo["EndTime"] = EndTime; + patientinfo["lineBody"] = lineBody; + patientinfo["MaterialDescripts"] = ids; + string sendData = JsonConvert.SerializeObject(patientinfo); + //eg: UrlҪĸʽsendData={"ids":[123],"Name":С} + string resultData = Post(sendData, PostUrl); + resultData = "{\r\n\t\"Result\": [],\r\n\t\"success\": false,\r\n\t\"ReturnMsg\": \"-starttime ȷ!\"\r\n}"; + JObject jo = (JObject)JsonConvert.DeserializeObject(resultData); + string sucessIf = jo["success"].ToString(); + if (sucessIf.ToLower() == "true") + { + string ProductType = jo["ProductType"].ToString(); + string FinalDefIo = jo["FinalDefIo"].ToString(); + //WEBAPIõ + xKNow = GetModeFromBar(ProductType);//ݿвѯֵ + //ֶ + } + } +#endif + // if(Oldm_sKEYENCEBar!= m_sKEYENCEBar) + + xKNow = GetModeFromBar("VWJ070541V0WW824F120223");//ݿвѯֵ + + + if (xKNow == null) + { + myLog("ݿûƥ" + m_sKEYENCEBar, DateTime.Now); + break; + } + //if(xKNow.OcrBar!= Old_xKNow.OcrBar) + //{ + + //} + if (Regex.IsMatch(xKNow.MoveX.ToString(), @"^[0-9]+$") && Regex.IsMatch(xKNow.MoveY.ToString(), @"^[0-9]+$") && Regex.IsMatch(xKNow.MoveZ.ToString(), @"^[0-9]+$")) + { + // Old_xKNow = xKNow; + myLog("ͺƥɹ" + xKNow.OcrBar, DateTime.Now); + bBarTriger = true; + //MoveToP(xKNow.MoveX, xKNow.MoveY, xKNow.MoveZ);// PLCƵƶ + } + + break; + } + Thread.Sleep(2); + bBar = false; +#if true + if (bBarTriger)//֤ { @@ -1381,15 +1454,15 @@ namespace HisenceYoloDetection //Cam2.SnapshotCount = 0; //Cam2.Snapshot(); - myLog("ڶβɼͼ", DateTime.Now); + //myLog("ڶβɼͼ", DateTime.Now); //if (xKNow != null) //{ // MoveToP(xKNow.MoveTwoX, xKNow.MoveTwoY, xKNow.MoveTwoZ); //} - MoveToP(51043, YPos, ZPos + (int)(dismove)); - Cam1.Snapshot(); + // MoveToP(51043, YPos, ZPos + (int)(dismove)); + //Cam1.Snapshot(); MoveToP(5815, YPos, ZPos); melsecPLCTCPDriver.WriteInt("550", 0);// //Thread.Sleep(300);//ϴ»ܹȥ @@ -1541,7 +1614,7 @@ namespace HisenceYoloDetection //Cam1ImgTwo = cameraMat; IfCam1TwoTriger = true; - originMatShow2.Image = cameraMat.ToBitmap(); + //originMatShow2.Image = cameraMat.ToBitmap(); _runHandleAfter.Set(); } @@ -1569,7 +1642,7 @@ namespace HisenceYoloDetection Cam2ImgShowBar = cameraMat; IfCam2Triger = true; - originMat2Show.Image = cameraMat.ToBitmap(); + //originMat2Show.Image = cameraMat.ToBitmap(); //_runHandleAfter.Set(); // CamShow2.ImaMAt = cameraMat; cameraMat.ImWrite(fitImageFolder + dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString() + "1.jpg"); @@ -1709,26 +1782,26 @@ namespace HisenceYoloDetection } - // - MLRequest req2 = new MLRequest(); - req2.currentMat = Cam1ImgTwo; - req2.ResizeWidth = 640; - req2.ResizeHeight = 640; - req2.Score = 0.3f; - req2.in_lable_path = LablePath;//ǩ· - req2.confThreshold = 0.3f;//ģŶ - req2.iouThreshold = 0.4f;//IOU - req2.out_node_name = "output"; - MLResult mL2 = simboObjectDetection.RunInferenceFixed(req2); - if (mL2.ResultMap != null) - { - mL2.ResultMap.Save("D://cam1//" + dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString() + "2result.jpg"); - ResultMatShow2.Image = mL2.ResultMap; - } + //// + //MLRequest req2 = new MLRequest(); + //req2.currentMat = Cam1ImgTwo; + //req2.ResizeWidth = 640; + //req2.ResizeHeight = 640; + //req2.Score = 0.3f; + //req2.in_lable_path = LablePath;//ǩ· + //req2.confThreshold = 0.3f;//ģŶ + //req2.iouThreshold = 0.4f;//IOU + //req2.out_node_name = "output"; + //MLResult mL2 = simboObjectDetection.RunInferenceFixed(req2); + //if (mL2.ResultMap != null) + //{ + // mL2.ResultMap.Save("D://cam1//" + dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString() + "2result.jpg"); + // ResultMatShow2.Image = mL2.ResultMap; + //} List strMatListTwo = new List(); List strMatFuzzyListTwo = new List(); - Mat mResultCut2 = req2.currentMat.Clone(); + // Mat mResultCut2 = req2.currentMat.Clone(); Dictionary keyValueResult = new Dictionary(); Dictionary keyValueResult2 = new Dictionary(); #region ִжλȶ @@ -1736,10 +1809,10 @@ namespace HisenceYoloDetection string[] listLabels = xKNow.Detect.Split(","); MLResult MLsum = mL; - for (int i = 0; i < mL2.ResultDetails.Count; i++) - { - MLsum.ResultDetails.Add((DetectionResultDetail)mL2.ResultDetails[i]); - } + //for (int i = 0; i < mL2.ResultDetails.Count; i++) + //{ + // MLsum.ResultDetails.Add((DetectionResultDetail)mL2.ResultDetails[i]); + //} string[] RealLabels = new string[MLsum.ResultDetails.Count]; string detstr = ""; for (int i = 0; i < MLsum.ResultDetails.Count; i++) @@ -1759,7 +1832,7 @@ namespace HisenceYoloDetection HashSet set1 = new HashSet(listLabels); HashSet set2 = new HashSet(RealLabels); bool MatchStr = set1.SetEquals(set2); - #endregion + #endregion //ȶ ϸȶ if (MatchStr) { @@ -1770,7 +1843,7 @@ namespace HisenceYoloDetection InsertSqlRunDataButton(ref keyValueResult, false, ref mResultCut, mL, mLButton, ref xK_HisenceSQLWord, ref xK_MatchDet, ref strMatListOne, ref strMatFuzzyListOne, ref paddleOcrModel); - InsertSqlRunData(ref keyValueResult2, false, ref mResultCut2, mL2, ref xK_HisenceSQLWord, ref xK_MatchDet, ref strMatListTwo, ref strMatFuzzyListTwo, ref paddleOcrModel); + // InsertSqlRunData(ref keyValueResult2, false, ref mResultCut2, mL2, ref xK_HisenceSQLWord, ref xK_MatchDet, ref strMatListTwo, ref strMatFuzzyListTwo, ref paddleOcrModel); sw.Stop(); myLog("ʱ" + sw.ElapsedMilliseconds, DateTime.Now); @@ -2133,7 +2206,7 @@ namespace HisenceYoloDetection CheckDiffSciHelper1.CheckDiffSci(path2, pathmat, rect2, rect2, false, "D://Hisence//Test1"); */ - OnGetBar(); + // OnGetBar(); melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//Ƶ TriggerCameral2(); ReadyDetect(); @@ -2538,36 +2611,36 @@ namespace HisenceYoloDetection - MLRequest CamTwoI = new MLRequest(); - CamTwoI.currentMat = Cv2.ImRead(Cam1TwoPath); - CamTwoI.ResizeWidth = 640; - CamTwoI.ResizeHeight = 640; - CamTwoI.Score = 0.3f; - CamTwoI.in_lable_path = LablePath;//ǩ· - CamTwoI.confThreshold = 0.3f;//ģŶ - CamTwoI.iouThreshold = 0.4f;//IOU - CamTwoI.out_node_name = "output"; - MLResult mL4 = simboObjectDetection.RunInferenceFixed(CamTwoI); - //if (mL4.IsSuccess) - //{ - // DateTime dt = DateTime.Now; - // mL4.ResultMap.Save("D:\\Hisence\\detImages\\" + dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString() + "2result.jpg"); + //MLRequest CamTwoI = new MLRequest(); + //CamTwoI.currentMat = Cv2.ImRead(Cam1TwoPath); + //CamTwoI.ResizeWidth = 640; + //CamTwoI.ResizeHeight = 640; + //CamTwoI.Score = 0.3f; + //CamTwoI.in_lable_path = LablePath;//ǩ· + //CamTwoI.confThreshold = 0.3f;//ģŶ + //CamTwoI.iouThreshold = 0.4f;//IOU + //CamTwoI.out_node_name = "output"; + //MLResult mL4 = simboObjectDetection.RunInferenceFixed(CamTwoI); + ////if (mL4.IsSuccess) + ////{ + //// DateTime dt = DateTime.Now; + //// mL4.ResultMap.Save("D:\\Hisence\\detImages\\" + dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString() + "2result.jpg"); - //} - List strMatListTwo = new List(); - List strMatFuzzyListTwo = new List(); - Mat mResultCut2 = CamTwoI.currentMat.Clone(); - Dictionary keyValueResult2 = new Dictionary(); - InsertSqlRunData(ref keyValueResult2, true, ref mResultCut2, mL4, ref xK_HisenceSQLWord, ref xkWord, ref strMatListTwo, ref strMatFuzzyListTwo, ref paddleOcrModel); + ////} + //List strMatListTwo = new List(); + //List strMatFuzzyListTwo = new List(); + //Mat mResultCut2 = CamTwoI.currentMat.Clone(); + //Dictionary keyValueResult2 = new Dictionary(); + //InsertSqlRunData(ref keyValueResult2, true, ref mResultCut2, mL4, ref xK_HisenceSQLWord, ref xkWord, ref strMatListTwo, ref strMatFuzzyListTwo, ref paddleOcrModel); InsertXKHisenceWordData(xkWord);//ؼֱвһ //ı - List bingji = strMatListOne.Union(strMatListTwo).ToList();//ȫ - List Fuzzybingji = strMatFuzzyListOne.Union(strMatFuzzyListTwo).ToList();//ȫ - string OcrTextone = bingji.Join("##"); - string OcrTextTwo = Fuzzybingji.Join("##"); + //List bingji = strMatListOne.Union(strMatListTwo).ToList();//ȫ + //List Fuzzybingji = strMatFuzzyListOne.Union(strMatFuzzyListTwo).ToList();//ȫ + string OcrTextone = strMatListOne.Join("##"); + string OcrTextTwo = strMatFuzzyListOne.Join("##"); //string OcrTextinsert = ""; //List bingji = strMatListListOne.Union(strMatListListTwo).ToList();//ȫ @@ -2580,10 +2653,10 @@ namespace HisenceYoloDetection //ҵʶ MLResult MLsum = mL3; - for (int v = 0; v < mL4.ResultDetails.Count; v++) - { - MLsum.ResultDetails.Add(mL4.ResultDetails[v]); - } + //for (int v = 0; v < mL4.ResultDetails.Count; v++) + //{ + // MLsum.ResultDetails.Add(mL4.ResultDetails[v]); + //} for (int v = 0; v < MLsum.ResultDetails.Count; v++) { diff --git a/HisenceYoloDetection/MainForm.resx b/HisenceYoloDetection/MainForm.resx index 62ad5ac..cbb8e7a 100644 --- a/HisenceYoloDetection/MainForm.resx +++ b/HisenceYoloDetection/MainForm.resx @@ -142,7 +142,7 @@ 733, 17 - 25 + 29 diff --git a/HisenceYoloDetection/TCPClienDriver.cs b/HisenceYoloDetection/TCPClienDriver.cs index ba29b8c..999890a 100644 --- a/HisenceYoloDetection/TCPClienDriver.cs +++ b/HisenceYoloDetection/TCPClienDriver.cs @@ -18,10 +18,10 @@ namespace HisenceYoloDetection public void Strart() { client = new TcpClient(); - // client.Host = "192.168.3.100"; - // client.Port= 9004; - client.Host = "127.0.0.1"; - client.Port = 9000; + client.Host = "192.168.3.100"; + client.Port= 9004; + //client.Host = "127.0.0.1"; + //client.Port = 9000; client.Connect(); client.OnDataReceived += Client_OnDataReceived;