diff --git a/HisenceYoloDetection/HisenceYoloDetection.csproj b/HisenceYoloDetection/HisenceYoloDetection.csproj index 3727869..c5049ed 100644 --- a/HisenceYoloDetection/HisenceYoloDetection.csproj +++ b/HisenceYoloDetection/HisenceYoloDetection.csproj @@ -12,6 +12,7 @@ + diff --git a/HisenceYoloDetection/MainForm.Designer.cs b/HisenceYoloDetection/MainForm.Designer.cs index 909151c..661e2ee 100644 --- a/HisenceYoloDetection/MainForm.Designer.cs +++ b/HisenceYoloDetection/MainForm.Designer.cs @@ -35,9 +35,6 @@ OpenCvSharp.Mat mat4 = new OpenCvSharp.Mat(); OpenCvSharp.Mat mat5 = new OpenCvSharp.Mat(); OpenCvSharp.Mat mat6 = new OpenCvSharp.Mat(); - OpenCvSharp.Mat mat7 = new OpenCvSharp.Mat(); - OpenCvSharp.Mat mat8 = new OpenCvSharp.Mat(); - OpenCvSharp.Mat mat9 = new OpenCvSharp.Mat(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); tabPage2 = new TabPage(); panel1 = new Panel(); @@ -102,8 +99,6 @@ showPLC = new TextBox(); readPLc = new TextBox(); tabPage1 = new TabPage(); - CamShow2 = new XKRS.UI.Canvas(); - CamShow1 = new XKRS.UI.Canvas(); groupBox3 = new GroupBox(); SnapshotCam2 = new Button(); button3 = new Button(); @@ -130,9 +125,23 @@ tabPage5 = new TabPage(); panel4 = new Panel(); panel5 = new Panel(); - DefetShow7 = new XKRS.UI.Canvas(); - DefetShow6 = new XKRS.UI.Canvas(); + 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(); + textBox2 = new TextBox(); + label36 = new Label(); + textBox1 = new TextBox(); + label35 = new Label(); + canvas6 = new XKRS.UI.Canvas(); + canvas2 = new XKRS.UI.Canvas(); 实时显示 = new Label(); OKOrNGShow = new PictureBox(); OKDNum = new TextBox(); @@ -145,18 +154,6 @@ ScanDevList = new Button(); DevNameCombo = new ComboBox(); InitMachine = new Button(); - DefetShow2 = new XKRS.UI.Canvas(); - panel6 = new Panel(); - groupBox2 = new GroupBox(); - DefetShow5 = new XKRS.UI.Canvas(); - DefetShow4 = new XKRS.UI.Canvas(); - DefetShow3 = new XKRS.UI.Canvas(); - originMat2Show = new PictureBox(); - DefetShow1 = new XKRS.UI.Canvas(); - ResultMatShow2 = new PictureBox(); - originMatShow2 = new PictureBox(); - originMatShow = new PictureBox(); - ResultMatShow = new PictureBox(); tabPage3 = new TabPage(); panel2 = new Panel(); WhiteBanCbx = new CheckBox(); @@ -214,15 +211,14 @@ tabPage5.SuspendLayout(); panel4.SuspendLayout(); panel5.SuspendLayout(); - panel8.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)OKOrNGShow).BeginInit(); - panel6.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(); + ((System.ComponentModel.ISupportInitialize)OKOrNGShow).BeginInit(); tabPage3.SuspendLayout(); panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)InsertDataDgv).BeginInit(); @@ -232,9 +228,10 @@ // tabPage2.Controls.Add(panel1); tabPage2.Location = new Point(4, 26); + tabPage2.Margin = new Padding(4, 2, 4, 2); tabPage2.Name = "tabPage2"; - tabPage2.Padding = new Padding(3); - tabPage2.Size = new Size(1276, 765); + tabPage2.Padding = new Padding(4, 2, 4, 2); + tabPage2.Size = new Size(1643, 719); tabPage2.TabIndex = 1; tabPage2.Text = "PLC"; tabPage2.UseVisualStyleBackColor = true; @@ -257,44 +254,50 @@ panel1.Controls.Add(readAdress); panel1.Controls.Add(showPLC); panel1.Controls.Add(readPLc); - panel1.Location = new Point(6, 6); + panel1.Location = new Point(8, 6); + panel1.Margin = new Padding(4, 2, 4, 2); panel1.Name = "panel1"; - panel1.Size = new Size(1171, 489); + panel1.Size = new Size(1506, 461); panel1.TabIndex = 4; // // groupBox5 // groupBox5.Controls.Add(DistanceShow); groupBox5.Controls.Add(label21); - groupBox5.Location = new Point(806, 10); + groupBox5.Location = new Point(1036, 9); + groupBox5.Margin = new Padding(4, 2, 4, 2); groupBox5.Name = "groupBox5"; - groupBox5.Size = new Size(356, 100); + groupBox5.Padding = new Padding(4, 2, 4, 2); + groupBox5.Size = new Size(458, 94); groupBox5.TabIndex = 15; groupBox5.TabStop = false; groupBox5.Text = "实时显示"; // // DistanceShow // - DistanceShow.Location = new Point(86, 30); + DistanceShow.Location = new Point(111, 29); + DistanceShow.Margin = new Padding(4, 2, 4, 2); DistanceShow.Name = "DistanceShow"; DistanceShow.ReadOnly = true; - DistanceShow.Size = new Size(100, 23); + DistanceShow.Size = new Size(127, 26); DistanceShow.TabIndex = 10; // // label21 // label21.AutoSize = true; - label21.Location = new Point(28, 33); + label21.Location = new Point(36, 31); + label21.Margin = new Padding(4, 0, 4, 0); label21.Name = "label21"; - label21.Size = new Size(32, 17); + label21.Size = new Size(35, 16); label21.TabIndex = 0; label21.Text = "测距"; // // txtSetValue // - txtSetValue.Location = new Point(574, 78); + txtSetValue.Location = new Point(738, 73); + txtSetValue.Margin = new Padding(4, 2, 4, 2); txtSetValue.Name = "txtSetValue"; - txtSetValue.Size = new Size(196, 23); + txtSetValue.Size = new Size(251, 26); txtSetValue.TabIndex = 14; // // groupBox4 @@ -327,18 +330,21 @@ groupBox4.Controls.Add(label13); groupBox4.Controls.Add(label12); groupBox4.Controls.Add(label11); - groupBox4.Location = new Point(611, 107); + groupBox4.Location = new Point(786, 101); + groupBox4.Margin = new Padding(4, 2, 4, 2); groupBox4.Name = "groupBox4"; - groupBox4.Size = new Size(557, 373); + groupBox4.Padding = new Padding(4, 2, 4, 2); + groupBox4.Size = new Size(716, 351); groupBox4.TabIndex = 13; groupBox4.TabStop = false; groupBox4.Text = "位置显示"; // // SetAutoSpeed // - SetAutoSpeed.Location = new Point(8, 315); + SetAutoSpeed.Location = new Point(10, 296); + SetAutoSpeed.Margin = new Padding(4, 2, 4, 2); SetAutoSpeed.Name = "SetAutoSpeed"; - SetAutoSpeed.Size = new Size(88, 23); + SetAutoSpeed.Size = new Size(113, 32); SetAutoSpeed.TabIndex = 29; SetAutoSpeed.Text = "设置自动速度"; SetAutoSpeed.UseVisualStyleBackColor = true; @@ -346,9 +352,10 @@ // // SetHandleSpeed // - SetHandleSpeed.Location = new Point(8, 258); + SetHandleSpeed.Location = new Point(10, 242); + SetHandleSpeed.Margin = new Padding(4, 2, 4, 2); SetHandleSpeed.Name = "SetHandleSpeed"; - SetHandleSpeed.Size = new Size(88, 23); + SetHandleSpeed.Size = new Size(113, 26); SetHandleSpeed.TabIndex = 28; SetHandleSpeed.Text = "设置手动速度"; SetHandleSpeed.UseVisualStyleBackColor = true; @@ -356,210 +363,236 @@ // // SetlnEditmiZOP // - SetlnEditmiZOP.Location = new Point(409, 315); + SetlnEditmiZOP.Location = new Point(526, 296); + SetlnEditmiZOP.Margin = new Padding(4, 2, 4, 2); SetlnEditmiZOP.Name = "SetlnEditmiZOP"; - SetlnEditmiZOP.Size = new Size(100, 23); + SetlnEditmiZOP.Size = new Size(127, 26); SetlnEditmiZOP.TabIndex = 27; // // SetlnEditmiYOP // - SetlnEditmiYOP.Location = new Point(256, 315); + SetlnEditmiYOP.Location = new Point(329, 296); + SetlnEditmiYOP.Margin = new Padding(4, 2, 4, 2); SetlnEditmiYOP.Name = "SetlnEditmiYOP"; - SetlnEditmiYOP.Size = new Size(100, 23); + SetlnEditmiYOP.Size = new Size(127, 26); SetlnEditmiYOP.TabIndex = 26; // // SetlnEditmiXOP // - SetlnEditmiXOP.Location = new Point(107, 315); + SetlnEditmiXOP.Location = new Point(138, 296); + SetlnEditmiXOP.Margin = new Padding(4, 2, 4, 2); SetlnEditmiXOP.Name = "SetlnEditmiXOP"; - SetlnEditmiXOP.Size = new Size(100, 23); + SetlnEditmiXOP.Size = new Size(127, 26); SetlnEditmiXOP.TabIndex = 25; // // SetlnEditmiZH // - SetlnEditmiZH.Location = new Point(409, 258); + SetlnEditmiZH.Location = new Point(526, 242); + SetlnEditmiZH.Margin = new Padding(4, 2, 4, 2); SetlnEditmiZH.Name = "SetlnEditmiZH"; - SetlnEditmiZH.Size = new Size(100, 23); + SetlnEditmiZH.Size = new Size(127, 26); SetlnEditmiZH.TabIndex = 23; // // SetlnEditmiYH // - SetlnEditmiYH.Location = new Point(256, 258); + SetlnEditmiYH.Location = new Point(329, 242); + SetlnEditmiYH.Margin = new Padding(4, 2, 4, 2); SetlnEditmiYH.Name = "SetlnEditmiYH"; - SetlnEditmiYH.Size = new Size(100, 23); + SetlnEditmiYH.Size = new Size(127, 26); SetlnEditmiYH.TabIndex = 22; // // SetlnEditmiXH // - SetlnEditmiXH.Location = new Point(107, 258); + SetlnEditmiXH.Location = new Point(138, 242); + SetlnEditmiXH.Margin = new Padding(4, 2, 4, 2); SetlnEditmiXH.Name = "SetlnEditmiXH"; - SetlnEditmiXH.Size = new Size(100, 23); + SetlnEditmiXH.Size = new Size(127, 26); SetlnEditmiXH.TabIndex = 21; // // lnEditmiZOP // - lnEditmiZOP.Location = new Point(409, 200); + lnEditmiZOP.Location = new Point(526, 189); + lnEditmiZOP.Margin = new Padding(4, 2, 4, 2); lnEditmiZOP.Name = "lnEditmiZOP"; - lnEditmiZOP.Size = new Size(100, 23); + lnEditmiZOP.Size = new Size(127, 26); lnEditmiZOP.TabIndex = 19; // // lnEditmiYOP // - lnEditmiYOP.Location = new Point(256, 200); + lnEditmiYOP.Location = new Point(329, 189); + lnEditmiYOP.Margin = new Padding(4, 2, 4, 2); lnEditmiYOP.Name = "lnEditmiYOP"; - lnEditmiYOP.Size = new Size(100, 23); + lnEditmiYOP.Size = new Size(127, 26); lnEditmiYOP.TabIndex = 18; // // lnEditmiXOP // - lnEditmiXOP.Location = new Point(107, 200); + lnEditmiXOP.Location = new Point(138, 189); + lnEditmiXOP.Margin = new Padding(4, 2, 4, 2); lnEditmiXOP.Name = "lnEditmiXOP"; - lnEditmiXOP.Size = new Size(100, 23); + lnEditmiXOP.Size = new Size(127, 26); lnEditmiXOP.TabIndex = 17; // // label17 // label17.AutoSize = true; - label17.Location = new Point(32, 203); + label17.Location = new Point(41, 191); + label17.Margin = new Padding(4, 0, 4, 0); label17.Name = "label17"; - label17.Size = new Size(56, 17); + label17.Size = new Size(63, 16); label17.TabIndex = 16; label17.Text = "定位位置"; // // lnEditmiZS // - lnEditmiZS.Location = new Point(409, 144); + lnEditmiZS.Location = new Point(526, 136); + lnEditmiZS.Margin = new Padding(4, 2, 4, 2); lnEditmiZS.Name = "lnEditmiZS"; lnEditmiZS.ReadOnly = true; - lnEditmiZS.Size = new Size(100, 23); + lnEditmiZS.Size = new Size(127, 26); lnEditmiZS.TabIndex = 15; // // lnEditmiYS // - lnEditmiYS.Location = new Point(256, 144); + lnEditmiYS.Location = new Point(329, 136); + lnEditmiYS.Margin = new Padding(4, 2, 4, 2); lnEditmiYS.Name = "lnEditmiYS"; lnEditmiYS.ReadOnly = true; - lnEditmiYS.Size = new Size(100, 23); + lnEditmiYS.Size = new Size(127, 26); lnEditmiYS.TabIndex = 14; // // lnEditmiXS // - lnEditmiXS.Location = new Point(107, 144); + lnEditmiXS.Location = new Point(138, 136); + lnEditmiXS.Margin = new Padding(4, 2, 4, 2); lnEditmiXS.Name = "lnEditmiXS"; lnEditmiXS.ReadOnly = true; - lnEditmiXS.Size = new Size(100, 23); + lnEditmiXS.Size = new Size(127, 26); lnEditmiXS.TabIndex = 13; // // label16 // label16.AutoSize = true; - label16.Location = new Point(8, 147); + label16.Location = new Point(10, 138); + label16.Margin = new Padding(4, 0, 4, 0); label16.Name = "label16"; - label16.Size = new Size(80, 17); + label16.Size = new Size(91, 16); label16.TabIndex = 12; label16.Text = "当前定位速度"; // // lnEditmiZHS // - lnEditmiZHS.Location = new Point(409, 87); + lnEditmiZHS.Location = new Point(526, 82); + lnEditmiZHS.Margin = new Padding(4, 2, 4, 2); lnEditmiZHS.Name = "lnEditmiZHS"; lnEditmiZHS.ReadOnly = true; - lnEditmiZHS.Size = new Size(100, 23); + lnEditmiZHS.Size = new Size(127, 26); lnEditmiZHS.TabIndex = 11; // // lnEditmiYHS // - lnEditmiYHS.Location = new Point(256, 87); + lnEditmiYHS.Location = new Point(329, 82); + lnEditmiYHS.Margin = new Padding(4, 2, 4, 2); lnEditmiYHS.Name = "lnEditmiYHS"; lnEditmiYHS.ReadOnly = true; - lnEditmiYHS.Size = new Size(100, 23); + lnEditmiYHS.Size = new Size(127, 26); lnEditmiYHS.TabIndex = 10; // // lnEditmiXHS // - lnEditmiXHS.Location = new Point(107, 87); + lnEditmiXHS.Location = new Point(138, 82); + lnEditmiXHS.Margin = new Padding(4, 2, 4, 2); lnEditmiXHS.Name = "lnEditmiXHS"; lnEditmiXHS.ReadOnly = true; - lnEditmiXHS.Size = new Size(100, 23); + lnEditmiXHS.Size = new Size(127, 26); lnEditmiXHS.TabIndex = 9; // // label15 // label15.AutoSize = true; - label15.Location = new Point(8, 90); + label15.Location = new Point(10, 85); + label15.Margin = new Padding(4, 0, 4, 0); label15.Name = "label15"; - label15.Size = new Size(80, 17); + label15.Size = new Size(91, 16); label15.TabIndex = 8; label15.Text = "当前手动速度"; // // ZPostion // ZPostion.AutoSize = true; - ZPostion.Location = new Point(451, 45); + ZPostion.Location = new Point(580, 42); + ZPostion.Margin = new Padding(4, 0, 4, 0); ZPostion.Name = "ZPostion"; - ZPostion.Size = new Size(15, 17); + ZPostion.Size = new Size(16, 16); ZPostion.TabIndex = 7; ZPostion.Text = "0"; // // YPostion // YPostion.AutoSize = true; - YPostion.Location = new Point(300, 45); + YPostion.Location = new Point(386, 42); + YPostion.Margin = new Padding(4, 0, 4, 0); YPostion.Name = "YPostion"; - YPostion.Size = new Size(15, 17); + YPostion.Size = new Size(16, 16); YPostion.TabIndex = 6; YPostion.Text = "0"; // // XPostion // XPostion.AutoSize = true; - XPostion.Location = new Point(144, 45); + XPostion.Location = new Point(185, 42); + XPostion.Margin = new Padding(4, 0, 4, 0); XPostion.Name = "XPostion"; - XPostion.Size = new Size(15, 17); + XPostion.Size = new Size(16, 16); XPostion.TabIndex = 5; XPostion.Text = "0"; // // XCurrentPostion // XCurrentPostion.AutoSize = true; - XCurrentPostion.Location = new Point(132, 45); + XCurrentPostion.Location = new Point(170, 42); + XCurrentPostion.Margin = new Padding(4, 0, 4, 0); XCurrentPostion.Name = "XCurrentPostion"; - XCurrentPostion.Size = new Size(0, 17); + XCurrentPostion.Size = new Size(0, 16); XCurrentPostion.TabIndex = 4; // // label14 // label14.AutoSize = true; - label14.Location = new Point(451, 22); + label14.Location = new Point(580, 21); + label14.Margin = new Padding(4, 0, 4, 0); label14.Name = "label14"; - label14.Size = new Size(15, 17); + label14.Size = new Size(16, 16); label14.TabIndex = 3; label14.Text = "Z"; // // label13 // label13.AutoSize = true; - label13.Location = new Point(300, 19); + label13.Location = new Point(386, 18); + label13.Margin = new Padding(4, 0, 4, 0); label13.Name = "label13"; - label13.Size = new Size(15, 17); + label13.Size = new Size(16, 16); label13.TabIndex = 2; label13.Text = "Y"; // // label12 // label12.AutoSize = true; - label12.Location = new Point(143, 19); + label12.Location = new Point(184, 18); + label12.Margin = new Padding(4, 0, 4, 0); label12.Name = "label12"; - label12.Size = new Size(16, 17); + label12.Size = new Size(17, 16); label12.TabIndex = 1; label12.Text = "X"; // // label11 // label11.AutoSize = true; - label11.Location = new Point(32, 45); + label11.Location = new Point(41, 42); + label11.Margin = new Padding(4, 0, 4, 0); label11.Name = "label11"; - label11.Size = new Size(56, 17); + label11.Size = new Size(63, 16); label11.TabIndex = 0; label11.Text = "当前位置"; // @@ -579,18 +612,21 @@ ModeleShow.Controls.Add(PLCPostion); ModeleShow.Controls.Add(PLCDiskZero); ModeleShow.Controls.Add(PLCPowerON); - ModeleShow.Location = new Point(14, 107); + ModeleShow.Location = new Point(18, 101); + ModeleShow.Margin = new Padding(4, 2, 4, 2); ModeleShow.Name = "ModeleShow"; - ModeleShow.Size = new Size(579, 373); + ModeleShow.Padding = new Padding(4, 2, 4, 2); + ModeleShow.Size = new Size(744, 351); ModeleShow.TabIndex = 12; ModeleShow.TabStop = false; ModeleShow.Text = "模组显示"; // // handStopBtn // - handStopBtn.Location = new Point(266, 266); + handStopBtn.Location = new Point(342, 250); + handStopBtn.Margin = new Padding(4, 2, 4, 2); handStopBtn.Name = "handStopBtn"; - handStopBtn.Size = new Size(125, 82); + handStopBtn.Size = new Size(161, 78); handStopBtn.TabIndex = 23; handStopBtn.Text = "手动阻塞"; handStopBtn.UseVisualStyleBackColor = true; @@ -598,9 +634,10 @@ // // HandRuningBtn // - HandRuningBtn.Location = new Point(410, 266); + HandRuningBtn.Location = new Point(527, 250); + HandRuningBtn.Margin = new Padding(4, 2, 4, 2); HandRuningBtn.Name = "HandRuningBtn"; - HandRuningBtn.Size = new Size(125, 82); + HandRuningBtn.Size = new Size(161, 78); HandRuningBtn.TabIndex = 22; HandRuningBtn.Text = "手动放行"; HandRuningBtn.UseVisualStyleBackColor = true; @@ -609,9 +646,10 @@ // ZBackwardrbx // ZBackwardrbx.Appearance = Appearance.Button; - ZBackwardrbx.Location = new Point(410, 180); + ZBackwardrbx.Location = new Point(527, 169); + ZBackwardrbx.Margin = new Padding(4, 2, 4, 2); ZBackwardrbx.Name = "ZBackwardrbx"; - ZBackwardrbx.Size = new Size(125, 62); + ZBackwardrbx.Size = new Size(161, 58); ZBackwardrbx.TabIndex = 21; ZBackwardrbx.Text = "Z反向"; ZBackwardrbx.TextAlign = ContentAlignment.MiddleCenter; @@ -621,9 +659,10 @@ // YBackwardrbx // YBackwardrbx.Appearance = Appearance.Button; - YBackwardrbx.Location = new Point(266, 180); + YBackwardrbx.Location = new Point(342, 169); + YBackwardrbx.Margin = new Padding(4, 2, 4, 2); YBackwardrbx.Name = "YBackwardrbx"; - YBackwardrbx.Size = new Size(125, 62); + YBackwardrbx.Size = new Size(161, 58); YBackwardrbx.TabIndex = 20; YBackwardrbx.Text = "Y反向"; YBackwardrbx.TextAlign = ContentAlignment.MiddleCenter; @@ -633,9 +672,10 @@ // XBackwardrbx // XBackwardrbx.Appearance = Appearance.Button; - XBackwardrbx.Location = new Point(126, 180); + XBackwardrbx.Location = new Point(162, 169); + XBackwardrbx.Margin = new Padding(4, 2, 4, 2); XBackwardrbx.Name = "XBackwardrbx"; - XBackwardrbx.Size = new Size(125, 62); + XBackwardrbx.Size = new Size(161, 58); XBackwardrbx.TabIndex = 19; XBackwardrbx.Text = "X反向"; XBackwardrbx.TextAlign = ContentAlignment.MiddleCenter; @@ -645,9 +685,10 @@ // ZForwardrbx // ZForwardrbx.Appearance = Appearance.Button; - ZForwardrbx.Location = new Point(410, 105); + ZForwardrbx.Location = new Point(527, 98); + ZForwardrbx.Margin = new Padding(4, 2, 4, 2); ZForwardrbx.Name = "ZForwardrbx"; - ZForwardrbx.Size = new Size(125, 62); + ZForwardrbx.Size = new Size(161, 58); ZForwardrbx.TabIndex = 18; ZForwardrbx.Text = "Z正向"; ZForwardrbx.TextAlign = ContentAlignment.MiddleCenter; @@ -657,9 +698,10 @@ // YForwardrbx // YForwardrbx.Appearance = Appearance.Button; - YForwardrbx.Location = new Point(266, 102); + YForwardrbx.Location = new Point(342, 96); + YForwardrbx.Margin = new Padding(4, 2, 4, 2); YForwardrbx.Name = "YForwardrbx"; - YForwardrbx.Size = new Size(125, 62); + YForwardrbx.Size = new Size(161, 58); YForwardrbx.TabIndex = 17; YForwardrbx.Text = "Y正向"; YForwardrbx.TextAlign = ContentAlignment.MiddleCenter; @@ -669,9 +711,10 @@ // XForwardrbx // XForwardrbx.Appearance = Appearance.Button; - XForwardrbx.Location = new Point(126, 105); + XForwardrbx.Location = new Point(162, 98); + XForwardrbx.Margin = new Padding(4, 2, 4, 2); XForwardrbx.Name = "XForwardrbx"; - XForwardrbx.Size = new Size(125, 62); + XForwardrbx.Size = new Size(161, 58); XForwardrbx.TabIndex = 16; XForwardrbx.Text = "X正向"; XForwardrbx.TextAlign = ContentAlignment.MiddleCenter; @@ -681,9 +724,10 @@ // ZZerorbx // ZZerorbx.Appearance = Appearance.Button; - ZZerorbx.Location = new Point(410, 22); + ZZerorbx.Location = new Point(527, 21); + ZZerorbx.Margin = new Padding(4, 2, 4, 2); ZZerorbx.Name = "ZZerorbx"; - ZZerorbx.Size = new Size(125, 62); + ZZerorbx.Size = new Size(161, 58); ZZerorbx.TabIndex = 15; ZZerorbx.Text = "Z归零"; ZZerorbx.TextAlign = ContentAlignment.MiddleCenter; @@ -693,9 +737,10 @@ // YZerorbx // YZerorbx.Appearance = Appearance.Button; - YZerorbx.Location = new Point(266, 22); + YZerorbx.Location = new Point(342, 21); + YZerorbx.Margin = new Padding(4, 2, 4, 2); YZerorbx.Name = "YZerorbx"; - YZerorbx.Size = new Size(125, 62); + YZerorbx.Size = new Size(161, 58); YZerorbx.TabIndex = 14; YZerorbx.Text = "Y归零"; YZerorbx.TextAlign = ContentAlignment.MiddleCenter; @@ -705,9 +750,10 @@ // XZerorbx // XZerorbx.Appearance = Appearance.Button; - XZerorbx.Location = new Point(126, 22); + XZerorbx.Location = new Point(162, 21); + XZerorbx.Margin = new Padding(4, 2, 4, 2); XZerorbx.Name = "XZerorbx"; - XZerorbx.Size = new Size(125, 62); + XZerorbx.Size = new Size(161, 58); XZerorbx.TabIndex = 13; XZerorbx.Text = "X归零"; XZerorbx.TextAlign = ContentAlignment.MiddleCenter; @@ -716,9 +762,10 @@ // // PLCPostion // - PLCPostion.Location = new Point(6, 266); + PLCPostion.Location = new Point(8, 250); + PLCPostion.Margin = new Padding(4, 2, 4, 2); PLCPostion.Name = "PLCPostion"; - PLCPostion.Size = new Size(97, 101); + PLCPostion.Size = new Size(125, 95); PLCPostion.TabIndex = 2; PLCPostion.Text = "定位"; PLCPostion.UseVisualStyleBackColor = true; @@ -726,9 +773,10 @@ // // PLCDiskZero // - PLCDiskZero.Location = new Point(6, 141); + PLCDiskZero.Location = new Point(8, 133); + PLCDiskZero.Margin = new Padding(4, 2, 4, 2); PLCDiskZero.Name = "PLCDiskZero"; - PLCDiskZero.Size = new Size(97, 101); + PLCDiskZero.Size = new Size(125, 95); PLCDiskZero.TabIndex = 1; PLCDiskZero.Text = "归零"; PLCDiskZero.UseVisualStyleBackColor = true; @@ -736,9 +784,10 @@ // // PLCPowerON // - PLCPowerON.Location = new Point(6, 22); + PLCPowerON.Location = new Point(8, 21); + PLCPowerON.Margin = new Padding(4, 2, 4, 2); PLCPowerON.Name = "PLCPowerON"; - PLCPowerON.Size = new Size(97, 101); + PLCPowerON.Size = new Size(125, 95); PLCPowerON.TabIndex = 0; PLCPowerON.Text = "使能ON"; PLCPowerON.UseVisualStyleBackColor = true; @@ -746,34 +795,38 @@ // // writePLCValue // - writePLCValue.Location = new Point(670, 10); + writePLCValue.Location = new Point(861, 9); + writePLCValue.Margin = new Padding(4, 2, 4, 2); writePLCValue.Name = "writePLCValue"; - writePLCValue.Size = new Size(100, 23); + writePLCValue.Size = new Size(127, 26); writePLCValue.TabIndex = 11; // // label9 // label9.AutoSize = true; - label9.Location = new Point(400, 52); + label9.Location = new Point(514, 49); + label9.Margin = new Padding(4, 0, 4, 0); label9.Name = "label9"; - label9.Size = new Size(20, 17); + label9.Size = new Size(21, 16); label9.TabIndex = 10; label9.Text = "值"; // // label10 // label10.AutoSize = true; - label10.Location = new Point(400, 16); + label10.Location = new Point(514, 15); + label10.Margin = new Padding(4, 0, 4, 0); label10.Name = "label10"; - label10.Size = new Size(32, 17); + label10.Size = new Size(35, 16); label10.TabIndex = 9; label10.Text = "地址"; // // wirteAdressBtn // - wirteAdressBtn.Location = new Point(574, 13); + wirteAdressBtn.Location = new Point(738, 13); + wirteAdressBtn.Margin = new Padding(4, 2, 4, 2); wirteAdressBtn.Name = "wirteAdressBtn"; - wirteAdressBtn.Size = new Size(75, 23); + wirteAdressBtn.Size = new Size(99, 43); wirteAdressBtn.TabIndex = 7; wirteAdressBtn.Text = "写地址INT"; wirteAdressBtn.UseVisualStyleBackColor = true; @@ -781,41 +834,46 @@ // // PLCValue // - PLCValue.Location = new Point(449, 46); + PLCValue.Location = new Point(577, 43); + PLCValue.Margin = new Padding(4, 2, 4, 2); PLCValue.Name = "PLCValue"; - PLCValue.Size = new Size(100, 23); + PLCValue.Size = new Size(127, 26); PLCValue.TabIndex = 8; // // WriteAdress // - WriteAdress.Location = new Point(449, 13); + WriteAdress.Location = new Point(577, 13); + WriteAdress.Margin = new Padding(4, 2, 4, 2); WriteAdress.Name = "WriteAdress"; - WriteAdress.Size = new Size(100, 23); + WriteAdress.Size = new Size(127, 26); WriteAdress.TabIndex = 6; // // label6 // label6.AutoSize = true; - label6.Location = new Point(126, 55); + label6.Location = new Point(162, 51); + label6.Margin = new Padding(4, 0, 4, 0); label6.Name = "label6"; - label6.Size = new Size(20, 17); + label6.Size = new Size(21, 16); label6.TabIndex = 5; label6.Text = "值"; // // label3 // label3.AutoSize = true; - label3.Location = new Point(126, 19); + label3.Location = new Point(162, 18); + label3.Margin = new Padding(4, 0, 4, 0); label3.Name = "label3"; - label3.Size = new Size(32, 17); + label3.Size = new Size(35, 16); label3.TabIndex = 4; label3.Text = "地址"; // // ConnectPLC // - ConnectPLC.Location = new Point(14, 16); + ConnectPLC.Location = new Point(18, 15); + ConnectPLC.Margin = new Padding(4, 2, 4, 2); ConnectPLC.Name = "ConnectPLC"; - ConnectPLC.Size = new Size(99, 56); + ConnectPLC.Size = new Size(127, 53); ConnectPLC.TabIndex = 0; ConnectPLC.Text = "链接PLC"; ConnectPLC.UseVisualStyleBackColor = true; @@ -823,9 +881,10 @@ // // readAdress // - readAdress.Location = new Point(300, 16); + readAdress.Location = new Point(386, 15); + readAdress.Margin = new Padding(4, 2, 4, 2); readAdress.Name = "readAdress"; - readAdress.Size = new Size(75, 23); + readAdress.Size = new Size(98, 41); readAdress.TabIndex = 2; readAdress.Text = "读地址INT"; readAdress.UseVisualStyleBackColor = true; @@ -833,74 +892,33 @@ // // showPLC // - showPLC.Location = new Point(175, 49); + showPLC.Location = new Point(225, 46); + showPLC.Margin = new Padding(4, 2, 4, 2); showPLC.Name = "showPLC"; - showPLC.Size = new Size(100, 23); + showPLC.Size = new Size(127, 26); showPLC.TabIndex = 3; // // readPLc // - readPLc.Location = new Point(175, 16); + readPLc.Location = new Point(225, 15); + readPLc.Margin = new Padding(4, 2, 4, 2); readPLc.Name = "readPLc"; - readPLc.Size = new Size(100, 23); + readPLc.Size = new Size(127, 26); readPLc.TabIndex = 1; // // tabPage1 // - tabPage1.Controls.Add(CamShow2); - tabPage1.Controls.Add(CamShow1); tabPage1.Controls.Add(groupBox3); tabPage1.Controls.Add(groupBox1); - tabPage1.Location = new Point(4, 26); + tabPage1.Location = new Point(4, 25); + tabPage1.Margin = new Padding(4, 2, 4, 2); tabPage1.Name = "tabPage1"; - tabPage1.Padding = new Padding(3); - tabPage1.Size = new Size(1276, 765); + tabPage1.Padding = new Padding(4, 2, 4, 2); + tabPage1.Size = new Size(1643, 720); tabPage1.TabIndex = 0; tabPage1.Text = "相机"; tabPage1.UseVisualStyleBackColor = true; // - // CamShow2 - // - CamShow2.AllowSelectDefect = true; - CamShow2.BrushColor = null; - CamShow2.ImagePath = ""; - mat1.IsEnabledDispose = true; - CamShow2.ImaMAt = mat1; - CamShow2.ImgData = null; - CamShow2.Location = new Point(578, 6); - CamShow2.MoveStep = 5F; - CamShow2.Name = "CamShow2"; - CamShow2.Route = 0D; - CamShow2.Scale = 1D; - CamShow2.Size = new Size(690, 310); - CamShow2.TabIndex = 21; - CamShow2.WholeScale = 0F; - CamShow2.XMove = 0F; - CamShow2.XScale = 0F; - CamShow2.YMove = 0F; - CamShow2.YScale = 0F; - // - // CamShow1 - // - CamShow1.AllowSelectDefect = true; - CamShow1.BrushColor = null; - CamShow1.ImagePath = ""; - mat2.IsEnabledDispose = true; - CamShow1.ImaMAt = mat2; - CamShow1.ImgData = null; - CamShow1.Location = new Point(14, 6); - CamShow1.MoveStep = 5F; - CamShow1.Name = "CamShow1"; - CamShow1.Route = 0D; - CamShow1.Scale = 1D; - CamShow1.Size = new Size(546, 293); - CamShow1.TabIndex = 20; - CamShow1.WholeScale = 0F; - CamShow1.XMove = 0F; - CamShow1.XScale = 0F; - CamShow1.YMove = 0F; - CamShow1.YScale = 0F; - // // groupBox3 // groupBox3.Controls.Add(SnapshotCam2); @@ -913,18 +931,21 @@ groupBox3.Controls.Add(tbExposure2); groupBox3.Controls.Add(label7); groupBox3.Controls.Add(label8); - groupBox3.Location = new Point(566, 322); + groupBox3.Location = new Point(728, 303); + groupBox3.Margin = new Padding(4, 2, 4, 2); groupBox3.Name = "groupBox3"; - groupBox3.Size = new Size(300, 174); + groupBox3.Padding = new Padding(4, 2, 4, 2); + groupBox3.Size = new Size(386, 163); groupBox3.TabIndex = 19; groupBox3.TabStop = false; groupBox3.Text = "参数"; // // SnapshotCam2 // - SnapshotCam2.Location = new Point(200, 143); + SnapshotCam2.Location = new Point(257, 135); + SnapshotCam2.Margin = new Padding(4, 2, 4, 2); SnapshotCam2.Name = "SnapshotCam2"; - SnapshotCam2.Size = new Size(75, 23); + SnapshotCam2.Size = new Size(96, 22); SnapshotCam2.TabIndex = 9; SnapshotCam2.Text = "拍照"; SnapshotCam2.UseVisualStyleBackColor = true; @@ -932,9 +953,10 @@ // // button3 // - button3.Location = new Point(200, 91); + button3.Location = new Point(257, 86); + button3.Margin = new Padding(4, 2, 4, 2); button3.Name = "button3"; - button3.Size = new Size(75, 23); + button3.Size = new Size(96, 22); button3.TabIndex = 8; button3.Text = "关闭"; button3.UseVisualStyleBackColor = true; @@ -942,9 +964,10 @@ // bnSetParam2 // bnSetParam2.Enabled = false; - bnSetParam2.Location = new Point(97, 135); + bnSetParam2.Location = new Point(125, 127); + bnSetParam2.Margin = new Padding(4, 2, 4, 2); bnSetParam2.Name = "bnSetParam2"; - bnSetParam2.Size = new Size(75, 23); + bnSetParam2.Size = new Size(96, 22); bnSetParam2.TabIndex = 7; bnSetParam2.Text = "设置参数"; bnSetParam2.UseVisualStyleBackColor = true; @@ -952,17 +975,19 @@ // label5 // label5.AutoSize = true; - label5.Location = new Point(200, 19); + label5.Location = new Point(257, 18); + label5.Margin = new Padding(4, 0, 4, 0); label5.Name = "label5"; - label5.Size = new Size(56, 17); + label5.Size = new Size(63, 16); label5.TabIndex = 2; label5.Text = "链接相机"; // // Cam2OpenBtn // - Cam2OpenBtn.Location = new Point(200, 44); + Cam2OpenBtn.Location = new Point(257, 41); + Cam2OpenBtn.Margin = new Padding(4, 2, 4, 2); Cam2OpenBtn.Name = "Cam2OpenBtn"; - Cam2OpenBtn.Size = new Size(75, 23); + Cam2OpenBtn.Size = new Size(96, 22); Cam2OpenBtn.TabIndex = 1; Cam2OpenBtn.Text = "开启"; Cam2OpenBtn.UseVisualStyleBackColor = true; @@ -970,9 +995,10 @@ // // bnGetParam2 // - bnGetParam2.Location = new Point(12, 135); + bnGetParam2.Location = new Point(15, 127); + bnGetParam2.Margin = new Padding(4, 2, 4, 2); bnGetParam2.Name = "bnGetParam2"; - bnGetParam2.Size = new Size(75, 23); + bnGetParam2.Size = new Size(96, 22); bnGetParam2.TabIndex = 6; bnGetParam2.Text = "获取参数"; bnGetParam2.UseVisualStyleBackColor = true; @@ -980,33 +1006,37 @@ // // tbGain2 // - tbGain2.Location = new Point(72, 57); + tbGain2.Location = new Point(93, 54); + tbGain2.Margin = new Padding(4, 2, 4, 2); tbGain2.Name = "tbGain2"; - tbGain2.Size = new Size(100, 23); + tbGain2.Size = new Size(127, 26); tbGain2.TabIndex = 4; // // tbExposure2 // - tbExposure2.Location = new Point(72, 23); + tbExposure2.Location = new Point(93, 22); + tbExposure2.Margin = new Padding(4, 2, 4, 2); tbExposure2.Name = "tbExposure2"; - tbExposure2.Size = new Size(100, 23); + tbExposure2.Size = new Size(127, 26); tbExposure2.TabIndex = 3; // // label7 // label7.AutoSize = true; - label7.Location = new Point(12, 60); + label7.Location = new Point(15, 56); + label7.Margin = new Padding(4, 0, 4, 0); label7.Name = "label7"; - label7.Size = new Size(32, 17); + label7.Size = new Size(35, 16); label7.TabIndex = 1; label7.Text = "增益"; // // label8 // label8.AutoSize = true; - label8.Location = new Point(12, 25); + label8.Location = new Point(15, 24); + label8.Margin = new Padding(4, 0, 4, 0); label8.Name = "label8"; - label8.Size = new Size(32, 17); + label8.Size = new Size(35, 16); label8.TabIndex = 0; label8.Text = "曝光"; // @@ -1022,18 +1052,21 @@ groupBox1.Controls.Add(tbExposure); groupBox1.Controls.Add(label2); groupBox1.Controls.Add(label4); - groupBox1.Location = new Point(8, 311); + groupBox1.Location = new Point(10, 293); + groupBox1.Margin = new Padding(4, 2, 4, 2); groupBox1.Name = "groupBox1"; - groupBox1.Size = new Size(300, 174); + groupBox1.Padding = new Padding(4, 2, 4, 2); + groupBox1.Size = new Size(386, 163); groupBox1.TabIndex = 17; groupBox1.TabStop = false; groupBox1.Text = "参数"; // // SnapshotCam1 // - SnapshotCam1.Location = new Point(200, 143); + SnapshotCam1.Location = new Point(257, 135); + SnapshotCam1.Margin = new Padding(4, 2, 4, 2); SnapshotCam1.Name = "SnapshotCam1"; - SnapshotCam1.Size = new Size(75, 23); + SnapshotCam1.Size = new Size(96, 22); SnapshotCam1.TabIndex = 9; SnapshotCam1.Text = "拍照"; SnapshotCam1.UseVisualStyleBackColor = true; @@ -1041,9 +1074,10 @@ // // button2 // - button2.Location = new Point(200, 91); + button2.Location = new Point(257, 86); + button2.Margin = new Padding(4, 2, 4, 2); button2.Name = "button2"; - button2.Size = new Size(75, 23); + button2.Size = new Size(96, 22); button2.TabIndex = 8; button2.Text = "关闭"; button2.UseVisualStyleBackColor = true; @@ -1052,9 +1086,10 @@ // bnSetParam // bnSetParam.Enabled = false; - bnSetParam.Location = new Point(97, 135); + bnSetParam.Location = new Point(125, 127); + bnSetParam.Margin = new Padding(4, 2, 4, 2); bnSetParam.Name = "bnSetParam"; - bnSetParam.Size = new Size(75, 23); + bnSetParam.Size = new Size(96, 22); bnSetParam.TabIndex = 7; bnSetParam.Text = "设置参数"; bnSetParam.UseVisualStyleBackColor = true; @@ -1063,17 +1098,19 @@ // label1 // label1.AutoSize = true; - label1.Location = new Point(200, 19); + label1.Location = new Point(257, 18); + label1.Margin = new Padding(4, 0, 4, 0); label1.Name = "label1"; - label1.Size = new Size(56, 17); + label1.Size = new Size(63, 16); label1.TabIndex = 2; label1.Text = "链接相机"; // // Cam1OpenBtn // - Cam1OpenBtn.Location = new Point(200, 44); + Cam1OpenBtn.Location = new Point(257, 41); + Cam1OpenBtn.Margin = new Padding(4, 2, 4, 2); Cam1OpenBtn.Name = "Cam1OpenBtn"; - Cam1OpenBtn.Size = new Size(75, 23); + Cam1OpenBtn.Size = new Size(96, 22); Cam1OpenBtn.TabIndex = 1; Cam1OpenBtn.Text = "开启"; Cam1OpenBtn.UseVisualStyleBackColor = true; @@ -1081,9 +1118,10 @@ // // bnGetParam // - bnGetParam.Location = new Point(12, 135); + bnGetParam.Location = new Point(15, 127); + bnGetParam.Margin = new Padding(4, 2, 4, 2); bnGetParam.Name = "bnGetParam"; - bnGetParam.Size = new Size(75, 23); + bnGetParam.Size = new Size(96, 22); bnGetParam.TabIndex = 6; bnGetParam.Text = "获取参数"; bnGetParam.UseVisualStyleBackColor = true; @@ -1091,33 +1129,37 @@ // // tbGain // - tbGain.Location = new Point(72, 57); + tbGain.Location = new Point(93, 54); + tbGain.Margin = new Padding(4, 2, 4, 2); tbGain.Name = "tbGain"; - tbGain.Size = new Size(100, 23); + tbGain.Size = new Size(127, 26); tbGain.TabIndex = 4; // // tbExposure // - tbExposure.Location = new Point(72, 23); + tbExposure.Location = new Point(93, 22); + tbExposure.Margin = new Padding(4, 2, 4, 2); tbExposure.Name = "tbExposure"; - tbExposure.Size = new Size(100, 23); + tbExposure.Size = new Size(127, 26); tbExposure.TabIndex = 3; // // label2 // label2.AutoSize = true; - label2.Location = new Point(12, 60); + label2.Location = new Point(15, 56); + label2.Margin = new Padding(4, 0, 4, 0); label2.Name = "label2"; - label2.Size = new Size(32, 17); + label2.Size = new Size(35, 16); label2.TabIndex = 1; label2.Text = "增益"; // // label4 // label4.AutoSize = true; - label4.Location = new Point(12, 25); + label4.Location = new Point(15, 24); + label4.Margin = new Padding(4, 0, 4, 0); label4.Name = "label4"; - label4.Size = new Size(32, 17); + label4.Size = new Size(35, 16); label4.TabIndex = 0; label4.Text = "曝光"; // @@ -1129,17 +1171,19 @@ tabControl1.Controls.Add(tabPage3); tabControl1.Dock = DockStyle.Top; tabControl1.Location = new Point(0, 0); + tabControl1.Margin = new Padding(4, 2, 4, 2); tabControl1.Name = "tabControl1"; tabControl1.SelectedIndex = 0; - tabControl1.Size = new Size(1284, 795); + tabControl1.Size = new Size(1651, 749); tabControl1.TabIndex = 0; // // tabPage5 // tabPage5.Controls.Add(panel4); - tabPage5.Location = new Point(4, 26); + tabPage5.Location = new Point(4, 25); + tabPage5.Margin = new Padding(4, 2, 4, 2); tabPage5.Name = "tabPage5"; - tabPage5.Size = new Size(1276, 765); + tabPage5.Size = new Size(1643, 720); tabPage5.TabIndex = 3; tabPage5.Text = "流程"; tabPage5.UseVisualStyleBackColor = true; @@ -1149,67 +1193,187 @@ panel4.Controls.Add(panel5); panel4.Dock = DockStyle.Fill; panel4.Location = new Point(0, 0); + panel4.Margin = new Padding(4, 2, 4, 2); panel4.Name = "panel4"; - panel4.Size = new Size(1276, 765); + panel4.Size = new Size(1643, 720); panel4.TabIndex = 0; // // panel5 // - panel5.Controls.Add(DefetShow7); - panel5.Controls.Add(DefetShow6); + panel5.Controls.Add(groupBox2); panel5.Controls.Add(panel8); - panel5.Controls.Add(DefetShow2); - panel5.Controls.Add(panel6); panel5.Dock = DockStyle.Top; panel5.Location = new Point(0, 0); + panel5.Margin = new Padding(4, 2, 4, 2); panel5.Name = "panel5"; - panel5.Size = new Size(1276, 762); + panel5.Size = new Size(1643, 718); panel5.TabIndex = 0; // - // DefetShow7 + // groupBox2 // - DefetShow7.AllowSelectDefect = true; - DefetShow7.BrushColor = null; - DefetShow7.ImagePath = ""; + 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(1102, 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(758, 464); + 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(382, 464); + 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; - DefetShow7.ImaMAt = mat3; - DefetShow7.ImgData = null; - DefetShow7.Location = new Point(1021, 464); - DefetShow7.MoveStep = 5F; - DefetShow7.Name = "DefetShow7"; - DefetShow7.Route = 0D; - DefetShow7.Scale = 1D; - DefetShow7.Size = new Size(209, 196); - DefetShow7.TabIndex = 12; - DefetShow7.WholeScale = 0F; - DefetShow7.XMove = 0F; - DefetShow7.XScale = 0F; - DefetShow7.YMove = 0F; - DefetShow7.YScale = 0F; + canvas3.ImaMAt = mat3; + canvas3.ImgData = null; + canvas3.Location = new Point(8, 464); + 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; // - // DefetShow6 + // canvas1 // - DefetShow6.AllowSelectDefect = true; - DefetShow6.BrushColor = null; - DefetShow6.ImagePath = ""; + canvas1.AllowSelectDefect = true; + canvas1.BrushColor = null; + canvas1.ImagePath = ""; mat4.IsEnabledDispose = true; - DefetShow6.ImaMAt = mat4; - DefetShow6.ImgData = null; - DefetShow6.Location = new Point(751, 464); - DefetShow6.MoveStep = 5F; - DefetShow6.Name = "DefetShow6"; - DefetShow6.Route = 0D; - DefetShow6.Scale = 1D; - DefetShow6.Size = new Size(209, 196); - DefetShow6.TabIndex = 11; - DefetShow6.WholeScale = 0F; - DefetShow6.XMove = 0F; - DefetShow6.XScale = 0F; - DefetShow6.YMove = 0F; - DefetShow6.YScale = 0F; + 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.SizeMode = PictureBoxSizeMode.StretchImage; + originMatShow.TabIndex = 3; + originMatShow.TabStop = false; + // + // ResultMatShow + // + ResultMatShow.Location = new Point(382, 21); + ResultMatShow.Margin = new Padding(4, 2, 4, 2); + ResultMatShow.Name = "ResultMatShow"; + ResultMatShow.Size = new Size(348, 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(canvas6); + panel8.Controls.Add(canvas2); panel8.Controls.Add(实时显示); panel8.Controls.Add(OKOrNGShow); panel8.Controls.Add(OKDNum); @@ -1222,86 +1386,175 @@ panel8.Controls.Add(ScanDevList); panel8.Controls.Add(DevNameCombo); panel8.Controls.Add(InitMachine); - panel8.Location = new Point(853, 0); + panel8.Location = new Point(1091, 0); + panel8.Margin = new Padding(4, 2, 4, 2); panel8.Name = "panel8"; - panel8.Size = new Size(440, 244); + panel8.Size = new Size(552, 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, 26); + textBox2.TabIndex = 17; + // + // label36 + // + label36.AutoSize = true; + label36.Location = new Point(353, 290); + label36.Name = "label36"; + label36.Size = new Size(63, 16); + 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, 26); + textBox1.TabIndex = 15; + // + // label35 + // + label35.AutoSize = true; + label35.Location = new Point(353, 240); + label35.Name = "label35"; + label35.Size = new Size(49, 16); + label35.TabIndex = 14; + label35.Text = "误检率"; + // + // canvas6 + // + canvas6.AllowSelectDefect = true; + canvas6.BrushColor = null; + canvas6.ImagePath = ""; + mat5.IsEnabledDispose = true; + canvas6.ImaMAt = mat5; + canvas6.ImgData = null; + canvas6.Location = new Point(19, 454); + canvas6.MoveStep = 5F; + canvas6.Name = "canvas6"; + canvas6.Route = 0D; + canvas6.Scale = 1D; + canvas6.Size = new Size(318, 200); + 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(19, 238); + canvas2.Margin = new Padding(4, 3, 4, 3); + canvas2.MoveStep = 5F; + canvas2.Name = "canvas2"; + canvas2.Route = 0D; + canvas2.Scale = 1D; + canvas2.Size = new Size(318, 188); + canvas2.TabIndex = 10; + canvas2.WholeScale = 0F; + canvas2.XMove = 0F; + canvas2.XScale = 0F; + canvas2.YMove = 0F; + canvas2.YScale = 0F; + // // 实时显示 // 实时显示.AutoSize = true; - 实时显示.Location = new Point(332, 26); + 实时显示.Location = new Point(427, 24); + 实时显示.Margin = new Padding(4, 0, 4, 0); 实时显示.Name = "实时显示"; - 实时显示.Size = new Size(56, 17); + 实时显示.Size = new Size(63, 16); 实时显示.TabIndex = 12; 实时显示.Text = "实时显示"; // // OKOrNGShow // - OKOrNGShow.Location = new Point(254, 60); + OKOrNGShow.Location = new Point(327, 56); + OKOrNGShow.Margin = new Padding(4, 2, 4, 2); OKOrNGShow.Name = "OKOrNGShow"; - OKOrNGShow.Size = new Size(183, 179); + OKOrNGShow.Size = new Size(235, 168); OKOrNGShow.SizeMode = PictureBoxSizeMode.CenterImage; OKOrNGShow.TabIndex = 11; OKOrNGShow.TabStop = false; // // OKDNum // - OKDNum.Location = new Point(132, 207); + OKDNum.Location = new Point(130, 196); + OKDNum.Margin = new Padding(4, 2, 4, 2); OKDNum.Name = "OKDNum"; OKDNum.ReadOnly = true; - OKDNum.Size = new Size(100, 23); + OKDNum.Size = new Size(127, 26); OKDNum.TabIndex = 10; // // label20 // label20.AutoSize = true; - label20.Location = new Point(56, 211); + label20.Location = new Point(32, 201); + label20.Margin = new Padding(4, 0, 4, 0); label20.Name = "label20"; - label20.Size = new Size(50, 17); + label20.Size = new Size(56, 16); label20.TabIndex = 9; label20.Text = "OK个数"; // // NGDNum // - NGDNum.Location = new Point(132, 160); + NGDNum.Location = new Point(130, 153); + NGDNum.Margin = new Padding(4, 2, 4, 2); NGDNum.Name = "NGDNum"; NGDNum.ReadOnly = true; - NGDNum.Size = new Size(100, 23); + NGDNum.Size = new Size(127, 26); NGDNum.TabIndex = 8; // // label19 // label19.AutoSize = true; - label19.Location = new Point(56, 164); + label19.Location = new Point(32, 156); + label19.Margin = new Padding(4, 0, 4, 0); label19.Name = "label19"; - label19.Size = new Size(51, 17); + label19.Size = new Size(56, 16); label19.TabIndex = 7; label19.Text = "NG个数"; // // AllDSum // - AllDSum.Location = new Point(132, 115); + AllDSum.Location = new Point(130, 111); + AllDSum.Margin = new Padding(4, 2, 4, 2); AllDSum.Name = "AllDSum"; AllDSum.ReadOnly = true; - AllDSum.Size = new Size(100, 23); + AllDSum.Size = new Size(127, 26); AllDSum.TabIndex = 6; // // label18 // label18.AutoSize = true; - label18.Location = new Point(56, 119); + label18.Location = new Point(32, 114); + label18.Margin = new Padding(4, 0, 4, 0); label18.Name = "label18"; - label18.Size = new Size(44, 17); + label18.Size = new Size(49, 16); label18.TabIndex = 5; label18.Text = "总个数"; // // StartDecBtn // - StartDecBtn.Location = new Point(131, 60); + StartDecBtn.Location = new Point(168, 56); + StartDecBtn.Margin = new Padding(4, 2, 4, 2); StartDecBtn.Name = "StartDecBtn"; - StartDecBtn.Size = new Size(94, 43); + StartDecBtn.Size = new Size(121, 40); StartDecBtn.TabIndex = 3; StartDecBtn.Text = "开启检测"; StartDecBtn.UseVisualStyleBackColor = true; @@ -1309,9 +1562,10 @@ // // ScanDevList // - ScanDevList.Location = new Point(231, 23); + ScanDevList.Location = new Point(297, 22); + ScanDevList.Margin = new Padding(4, 2, 4, 2); ScanDevList.Name = "ScanDevList"; - ScanDevList.Size = new Size(75, 23); + ScanDevList.Size = new Size(96, 22); ScanDevList.TabIndex = 2; ScanDevList.Text = "Scan"; ScanDevList.UseVisualStyleBackColor = true; @@ -1320,205 +1574,30 @@ // DevNameCombo // DevNameCombo.FormattingEnabled = true; - DevNameCombo.Location = new Point(25, 23); + DevNameCombo.Location = new Point(32, 22); + DevNameCombo.Margin = new Padding(4, 2, 4, 2); DevNameCombo.Name = "DevNameCombo"; - DevNameCombo.Size = new Size(200, 25); + DevNameCombo.Size = new Size(256, 24); DevNameCombo.TabIndex = 1; // // InitMachine // - InitMachine.Location = new Point(24, 60); + InitMachine.Location = new Point(31, 56); + InitMachine.Margin = new Padding(4, 2, 4, 2); InitMachine.Name = "InitMachine"; - InitMachine.Size = new Size(94, 43); + InitMachine.Size = new Size(121, 40); InitMachine.TabIndex = 0; InitMachine.Text = "初始化设备"; InitMachine.UseVisualStyleBackColor = true; InitMachine.Click += InitMachine_Click; // - // DefetShow2 - // - DefetShow2.AllowSelectDefect = true; - DefetShow2.BrushColor = null; - DefetShow2.ImagePath = ""; - mat5.IsEnabledDispose = true; - DefetShow2.ImaMAt = mat5; - DefetShow2.ImgData = null; - DefetShow2.Location = new Point(850, 249); - DefetShow2.MoveStep = 5F; - DefetShow2.Name = "DefetShow2"; - DefetShow2.Route = 0D; - DefetShow2.Scale = 1D; - DefetShow2.Size = new Size(285, 196); - DefetShow2.TabIndex = 9; - DefetShow2.WholeScale = 0F; - DefetShow2.XMove = 0F; - DefetShow2.XScale = 0F; - DefetShow2.YMove = 0F; - DefetShow2.YScale = 0F; - // - // panel6 - // - panel6.Controls.Add(groupBox2); - panel6.Location = new Point(0, 0); - panel6.Name = "panel6"; - panel6.Size = new Size(847, 759); - panel6.TabIndex = 1; - // - // groupBox2 - // - groupBox2.AutoSize = true; - groupBox2.Controls.Add(DefetShow5); - groupBox2.Controls.Add(DefetShow4); - groupBox2.Controls.Add(DefetShow3); - groupBox2.Controls.Add(originMat2Show); - groupBox2.Controls.Add(DefetShow1); - groupBox2.Controls.Add(ResultMatShow2); - groupBox2.Controls.Add(originMatShow2); - groupBox2.Controls.Add(originMatShow); - groupBox2.Controls.Add(ResultMatShow); - groupBox2.Location = new Point(8, 4); - groupBox2.Name = "groupBox2"; - groupBox2.Size = new Size(885, 768); - groupBox2.TabIndex = 0; - groupBox2.TabStop = false; - groupBox2.Text = "图片"; - groupBox2.Enter += groupBox2_Enter; - // - // DefetShow5 - // - DefetShow5.AllowSelectDefect = true; - DefetShow5.BrushColor = null; - DefetShow5.ImagePath = ""; - mat6.IsEnabledDispose = true; - DefetShow5.ImaMAt = mat6; - DefetShow5.ImgData = null; - DefetShow5.Location = new Point(537, 460); - DefetShow5.MoveStep = 5F; - DefetShow5.Name = "DefetShow5"; - DefetShow5.Route = 0D; - DefetShow5.Scale = 1D; - DefetShow5.Size = new Size(209, 196); - DefetShow5.TabIndex = 10; - DefetShow5.WholeScale = 0F; - DefetShow5.XMove = 0F; - DefetShow5.XScale = 0F; - DefetShow5.YMove = 0F; - DefetShow5.YScale = 0F; - // - // DefetShow4 - // - DefetShow4.AllowSelectDefect = true; - DefetShow4.BrushColor = null; - DefetShow4.ImagePath = ""; - mat7.IsEnabledDispose = true; - DefetShow4.ImaMAt = mat7; - DefetShow4.ImgData = null; - DefetShow4.Location = new Point(297, 460); - DefetShow4.MoveStep = 5F; - DefetShow4.Name = "DefetShow4"; - DefetShow4.Route = 0D; - DefetShow4.Scale = 1D; - DefetShow4.Size = new Size(220, 196); - DefetShow4.TabIndex = 11; - DefetShow4.WholeScale = 0F; - DefetShow4.XMove = 0F; - DefetShow4.XScale = 0F; - DefetShow4.YMove = 0F; - DefetShow4.YScale = 0F; - // - // DefetShow3 - // - DefetShow3.AllowSelectDefect = true; - DefetShow3.BrushColor = null; - DefetShow3.ImagePath = ""; - mat8.IsEnabledDispose = true; - DefetShow3.ImaMAt = mat8; - DefetShow3.ImgData = null; - DefetShow3.Location = new Point(6, 460); - DefetShow3.MoveStep = 5F; - DefetShow3.Name = "DefetShow3"; - DefetShow3.Route = 0D; - DefetShow3.Scale = 1D; - DefetShow3.Size = new Size(285, 196); - DefetShow3.TabIndex = 10; - DefetShow3.WholeScale = 0F; - DefetShow3.XMove = 0F; - DefetShow3.XScale = 0F; - DefetShow3.YMove = 0F; - DefetShow3.YScale = 0F; - // - // originMat2Show - // - originMat2Show.Location = new Point(574, 21); - originMat2Show.Name = "originMat2Show"; - originMat2Show.Size = new Size(271, 213); - originMat2Show.SizeMode = PictureBoxSizeMode.StretchImage; - originMat2Show.TabIndex = 8; - originMat2Show.TabStop = false; - // - // DefetShow1 - // - DefetShow1.AllowSelectDefect = true; - DefetShow1.BrushColor = null; - DefetShow1.ImagePath = ""; - mat9.IsEnabledDispose = true; - DefetShow1.ImaMAt = mat9; - DefetShow1.ImgData = null; - DefetShow1.Location = new Point(574, 245); - DefetShow1.MoveStep = 5F; - DefetShow1.Name = "DefetShow1"; - DefetShow1.Route = 0D; - DefetShow1.Scale = 1D; - DefetShow1.Size = new Size(254, 209); - DefetShow1.TabIndex = 7; - DefetShow1.WholeScale = 0F; - DefetShow1.XMove = 0F; - DefetShow1.XScale = 0F; - DefetShow1.YMove = 0F; - DefetShow1.YScale = 0F; - // - // ResultMatShow2 - // - ResultMatShow2.Location = new Point(297, 241); - ResultMatShow2.Name = "ResultMatShow2"; - ResultMatShow2.Size = new Size(271, 213); - ResultMatShow2.SizeMode = PictureBoxSizeMode.StretchImage; - ResultMatShow2.TabIndex = 5; - ResultMatShow2.TabStop = false; - // - // originMatShow2 - // - originMatShow2.Location = new Point(6, 241); - originMatShow2.Name = "originMatShow2"; - originMatShow2.Size = new Size(285, 213); - originMatShow2.SizeMode = PictureBoxSizeMode.StretchImage; - originMatShow2.TabIndex = 4; - originMatShow2.TabStop = false; - // - // originMatShow - // - originMatShow.Location = new Point(6, 22); - originMatShow.Name = "originMatShow"; - originMatShow.Size = new Size(285, 213); - originMatShow.SizeMode = PictureBoxSizeMode.StretchImage; - originMatShow.TabIndex = 3; - originMatShow.TabStop = false; - // - // ResultMatShow - // - ResultMatShow.Location = new Point(297, 22); - ResultMatShow.Name = "ResultMatShow"; - ResultMatShow.Size = new Size(271, 213); - ResultMatShow.SizeMode = PictureBoxSizeMode.StretchImage; - ResultMatShow.TabIndex = 2; - ResultMatShow.TabStop = false; - // // 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, 765); + tabPage3.Size = new Size(1643, 719); tabPage3.TabIndex = 4; tabPage3.Text = "录入新型号"; tabPage3.UseVisualStyleBackColor = true; @@ -1559,9 +1638,10 @@ panel2.Controls.Add(queryALLBtn); panel2.Controls.Add(label32); panel2.Controls.Add(InsertDataDgv); - panel2.Location = new Point(8, 3); + panel2.Location = new Point(10, 2); + panel2.Margin = new Padding(4, 2, 4, 2); panel2.Name = "panel2"; - panel2.Size = new Size(1260, 533); + panel2.Size = new Size(1620, 502); panel2.TabIndex = 1; panel2.Paint += panel2_Paint; // @@ -1570,9 +1650,10 @@ WhiteBanCbx.AutoSize = true; WhiteBanCbx.Checked = true; WhiteBanCbx.CheckState = CheckState.Checked; - WhiteBanCbx.Location = new Point(577, 245); + WhiteBanCbx.Location = new Point(742, 231); + WhiteBanCbx.Margin = new Padding(4, 2, 4, 2); WhiteBanCbx.Name = "WhiteBanCbx"; - WhiteBanCbx.Size = new Size(39, 21); + WhiteBanCbx.Size = new Size(40, 20); WhiteBanCbx.TabIndex = 40; WhiteBanCbx.Text = "是"; WhiteBanCbx.UseVisualStyleBackColor = true; @@ -1580,26 +1661,29 @@ // label33 // label33.AutoSize = true; - label33.Location = new Point(366, 246); + label33.Location = new Point(471, 232); + label33.Margin = new Padding(4, 0, 4, 0); label33.Name = "label33"; - label33.Size = new Size(140, 17); + label33.Size = new Size(161, 16); label33.TabIndex = 39; label33.Text = "面板第二块区域是白板吗"; // // label28 // label28.AutoSize = true; - label28.Location = new Point(18, 199); + label28.Location = new Point(23, 187); + label28.Margin = new Padding(4, 0, 4, 0); label28.Name = "label28"; - label28.Size = new Size(87, 17); + label28.Size = new Size(100, 16); label28.TabIndex = 14; label28.Text = "第一次拍照Z轴"; // // openModelBtn // - openModelBtn.Location = new Point(1042, 15); + openModelBtn.Location = new Point(1340, 14); + openModelBtn.Margin = new Padding(4, 2, 4, 2); openModelBtn.Name = "openModelBtn"; - openModelBtn.Size = new Size(75, 23); + openModelBtn.Size = new Size(96, 26); openModelBtn.TabIndex = 37; openModelBtn.Text = "打开模型"; openModelBtn.UseVisualStyleBackColor = true; @@ -1607,26 +1691,29 @@ // // modelChangeCbx // - modelChangeCbx.Location = new Point(824, 15); + modelChangeCbx.Location = new Point(1059, 14); + modelChangeCbx.Margin = new Padding(4, 2, 4, 2); modelChangeCbx.Name = "modelChangeCbx"; - modelChangeCbx.Size = new Size(188, 23); + modelChangeCbx.Size = new Size(241, 26); modelChangeCbx.TabIndex = 34; modelChangeCbx.Text = "D:\\Hisence\\config\\chinese.json"; // // label34 // label34.AutoSize = true; - label34.Location = new Point(718, 21); + label34.Location = new Point(923, 19); + label34.Margin = new Padding(4, 0, 4, 0); label34.Name = "label34"; - label34.Size = new Size(80, 17); + label34.Size = new Size(91, 16); label34.TabIndex = 33; label34.Text = "面板语言选择"; // // button4 // - button4.Location = new Point(697, 110); + button4.Location = new Point(896, 104); + button4.Margin = new Padding(4, 2, 4, 2); button4.Name = "button4"; - button4.Size = new Size(75, 23); + button4.Size = new Size(96, 34); button4.TabIndex = 32; button4.Text = "打开文件"; button4.UseVisualStyleBackColor = true; @@ -1634,9 +1721,10 @@ // // OpenTwoDirBtn // - OpenTwoDirBtn.Location = new Point(697, 202); + OpenTwoDirBtn.Location = new Point(895, 184); + OpenTwoDirBtn.Margin = new Padding(4, 2, 4, 2); OpenTwoDirBtn.Name = "OpenTwoDirBtn"; - OpenTwoDirBtn.Size = new Size(75, 23); + OpenTwoDirBtn.Size = new Size(96, 35); OpenTwoDirBtn.TabIndex = 31; OpenTwoDirBtn.Text = "打开文件"; OpenTwoDirBtn.UseVisualStyleBackColor = true; @@ -1644,9 +1732,10 @@ // // OpenDirBtn // - OpenDirBtn.Location = new Point(697, 154); + OpenDirBtn.Location = new Point(895, 142); + OpenDirBtn.Margin = new Padding(4, 2, 4, 2); OpenDirBtn.Name = "OpenDirBtn"; - OpenDirBtn.Size = new Size(75, 23); + OpenDirBtn.Size = new Size(96, 34); OpenDirBtn.TabIndex = 30; OpenDirBtn.Text = "打开文件"; OpenDirBtn.UseVisualStyleBackColor = true; @@ -1654,43 +1743,48 @@ // // Cam2MatCbx // - Cam2MatCbx.Location = new Point(473, 202); + Cam2MatCbx.Location = new Point(608, 190); + Cam2MatCbx.Margin = new Padding(4, 2, 4, 2); Cam2MatCbx.Name = "Cam2MatCbx"; - Cam2MatCbx.Size = new Size(218, 23); + Cam2MatCbx.Size = new Size(279, 26); Cam2MatCbx.TabIndex = 29; Cam2MatCbx.Text = "D:\\Hisence\\类型\\Lp\\002jpg"; // // label22 // label22.AutoSize = true; - label22.Location = new Point(366, 202); + label22.Location = new Point(471, 190); + label22.Margin = new Padding(4, 0, 4, 0); label22.Name = "label22"; - label22.Size = new Size(80, 17); + label22.Size = new Size(91, 16); label22.TabIndex = 28; label22.Text = "面板第二张图"; // // Cam1MatCbx // - Cam1MatCbx.Location = new Point(473, 151); + Cam1MatCbx.Location = new Point(608, 142); + Cam1MatCbx.Margin = new Padding(4, 2, 4, 2); Cam1MatCbx.Name = "Cam1MatCbx"; - Cam1MatCbx.Size = new Size(218, 23); + Cam1MatCbx.Size = new Size(279, 26); Cam1MatCbx.TabIndex = 27; Cam1MatCbx.Text = "D:\\Hisence\\类型\\Lp\\001.jpg"; // // label23 // label23.AutoSize = true; - label23.Location = new Point(367, 157); + label23.Location = new Point(472, 147); + label23.Margin = new Padding(4, 0, 4, 0); label23.Name = "label23"; - label23.Size = new Size(80, 17); + label23.Size = new Size(91, 16); label23.TabIndex = 26; label23.Text = "面板第一张图"; // // QueryoneBtn // - QueryoneBtn.Location = new Point(838, 222); + QueryoneBtn.Location = new Point(1077, 209); + QueryoneBtn.Margin = new Padding(4, 2, 4, 2); QueryoneBtn.Name = "QueryoneBtn"; - QueryoneBtn.Size = new Size(115, 53); + QueryoneBtn.Size = new Size(148, 50); QueryoneBtn.TabIndex = 25; QueryoneBtn.Text = "条件查询"; QueryoneBtn.UseVisualStyleBackColor = true; @@ -1698,26 +1792,29 @@ // // DetectBArMatbox // - DetectBArMatbox.Location = new Point(472, 110); + DetectBArMatbox.Location = new Point(607, 104); + DetectBArMatbox.Margin = new Padding(4, 2, 4, 2); DetectBArMatbox.Name = "DetectBArMatbox"; - DetectBArMatbox.Size = new Size(219, 23); + DetectBArMatbox.Size = new Size(280, 26); DetectBArMatbox.TabIndex = 24; DetectBArMatbox.Text = "D:\\Hisence\\类型\\Lp202452414231.jpg"; // // label24 // label24.AutoSize = true; - label24.Location = new Point(366, 116); + label24.Location = new Point(471, 110); + label24.Margin = new Padding(4, 0, 4, 0); label24.Name = "label24"; - label24.Size = new Size(56, 17); + label24.Size = new Size(63, 16); label24.TabIndex = 23; label24.Text = "条码录入"; // // InsertBtn // - InsertBtn.Location = new Point(838, 92); + InsertBtn.Location = new Point(1077, 87); + InsertBtn.Margin = new Padding(4, 2, 4, 2); InsertBtn.Name = "InsertBtn"; - InsertBtn.Size = new Size(115, 47); + InsertBtn.Size = new Size(148, 45); InsertBtn.TabIndex = 22; InsertBtn.Text = "插入"; InsertBtn.UseVisualStyleBackColor = true; @@ -1725,127 +1822,142 @@ // // moveTwoZbox // - moveTwoZbox.Location = new Point(472, 59); + moveTwoZbox.Location = new Point(607, 56); + moveTwoZbox.Margin = new Padding(4, 2, 4, 2); moveTwoZbox.Name = "moveTwoZbox"; - moveTwoZbox.Size = new Size(219, 23); + moveTwoZbox.Size = new Size(280, 26); moveTwoZbox.TabIndex = 21; moveTwoZbox.Text = "0"; // // label25 // label25.AutoSize = true; - label25.Location = new Point(366, 65); + label25.Location = new Point(471, 62); + label25.Margin = new Padding(4, 0, 4, 0); label25.Name = "label25"; - label25.Size = new Size(87, 17); + label25.Size = new Size(100, 16); label25.TabIndex = 20; label25.Text = "第二次拍照Z轴"; // // moveTwoYbox // - moveTwoYbox.Location = new Point(472, 12); + moveTwoYbox.Location = new Point(607, 11); + moveTwoYbox.Margin = new Padding(4, 2, 4, 2); moveTwoYbox.Name = "moveTwoYbox"; - moveTwoYbox.Size = new Size(219, 23); + moveTwoYbox.Size = new Size(280, 26); moveTwoYbox.TabIndex = 19; moveTwoYbox.Text = "0"; // // label26 // label26.AutoSize = true; - label26.Location = new Point(366, 18); + label26.Location = new Point(471, 17); + label26.Margin = new Padding(4, 0, 4, 0); label26.Name = "label26"; - label26.Size = new Size(87, 17); + label26.Size = new Size(100, 16); label26.TabIndex = 18; label26.Text = "第二次拍照Y轴"; // // moveTwoXbox // - moveTwoXbox.Location = new Point(111, 243); + moveTwoXbox.Location = new Point(143, 229); + moveTwoXbox.Margin = new Padding(4, 2, 4, 2); moveTwoXbox.Name = "moveTwoXbox"; - moveTwoXbox.Size = new Size(224, 23); + moveTwoXbox.Size = new Size(287, 26); moveTwoXbox.TabIndex = 17; moveTwoXbox.Text = "54964"; // // label27 // label27.AutoSize = true; - label27.Location = new Point(16, 248); + label27.Location = new Point(21, 233); + label27.Margin = new Padding(4, 0, 4, 0); label27.Name = "label27"; - label27.Size = new Size(88, 17); + label27.Size = new Size(101, 16); label27.TabIndex = 16; label27.Text = "第二次拍照X轴"; // // moveZbox // - moveZbox.Location = new Point(111, 193); + moveZbox.Location = new Point(143, 182); + moveZbox.Margin = new Padding(4, 2, 4, 2); moveZbox.Name = "moveZbox"; - moveZbox.Size = new Size(224, 23); + moveZbox.Size = new Size(287, 26); moveZbox.TabIndex = 15; moveZbox.Text = "0"; // // moveYbox // - moveYbox.Location = new Point(111, 146); + moveYbox.Location = new Point(143, 137); + moveYbox.Margin = new Padding(4, 2, 4, 2); moveYbox.Name = "moveYbox"; - moveYbox.Size = new Size(224, 23); + moveYbox.Size = new Size(287, 26); moveYbox.TabIndex = 13; moveYbox.Text = "0"; // // label29 // label29.AutoSize = true; - label29.Location = new Point(17, 152); + label29.Location = new Point(22, 143); + label29.Margin = new Padding(4, 0, 4, 0); label29.Name = "label29"; - label29.Size = new Size(87, 17); + label29.Size = new Size(100, 16); label29.TabIndex = 12; label29.Text = "第一次拍照Y轴"; // // moveXbox // - moveXbox.Location = new Point(111, 104); + moveXbox.Location = new Point(143, 98); + moveXbox.Margin = new Padding(4, 2, 4, 2); moveXbox.Name = "moveXbox"; - moveXbox.Size = new Size(224, 23); + moveXbox.Size = new Size(287, 26); moveXbox.TabIndex = 11; moveXbox.Text = "8974"; // // label30 // label30.AutoSize = true; - label30.Location = new Point(17, 110); + label30.Location = new Point(22, 104); + label30.Margin = new Padding(4, 0, 4, 0); label30.Name = "label30"; - label30.Size = new Size(88, 17); + label30.Size = new Size(101, 16); label30.TabIndex = 10; label30.Text = "第一次拍照X轴"; // // OcrBarBox // - OcrBarBox.Location = new Point(111, 54); + OcrBarBox.Location = new Point(143, 50); + OcrBarBox.Margin = new Padding(4, 2, 4, 2); OcrBarBox.Name = "OcrBarBox"; - OcrBarBox.Size = new Size(224, 23); + OcrBarBox.Size = new Size(287, 26); OcrBarBox.TabIndex = 5; OcrBarBox.Text = "1234567890"; // // label31 // label31.AutoSize = true; - label31.Location = new Point(14, 60); + label31.Location = new Point(18, 56); + label31.Margin = new Padding(4, 0, 4, 0); label31.Name = "label31"; - label31.Size = new Size(32, 17); + label31.Size = new Size(35, 16); label31.TabIndex = 4; label31.Text = "条码"; // // TypeBox // - TypeBox.Location = new Point(111, 12); + TypeBox.Location = new Point(143, 11); + TypeBox.Margin = new Padding(4, 2, 4, 2); TypeBox.Name = "TypeBox"; - TypeBox.Size = new Size(224, 23); + TypeBox.Size = new Size(287, 26); TypeBox.TabIndex = 3; TypeBox.Text = "1"; // // queryALLBtn // - queryALLBtn.Location = new Point(838, 157); + queryALLBtn.Location = new Point(1077, 147); + queryALLBtn.Margin = new Padding(4, 2, 4, 2); queryALLBtn.Name = "queryALLBtn"; - queryALLBtn.Size = new Size(115, 59); + queryALLBtn.Size = new Size(148, 56); queryALLBtn.TabIndex = 2; queryALLBtn.Text = "查询全部"; queryALLBtn.UseVisualStyleBackColor = true; @@ -1854,27 +1966,30 @@ // label32 // label32.AutoSize = true; - label32.Location = new Point(14, 18); + label32.Location = new Point(18, 17); + label32.Margin = new Padding(4, 0, 4, 0); label32.Name = "label32"; - label32.Size = new Size(32, 17); + label32.Size = new Size(35, 16); label32.TabIndex = 1; label32.Text = "类型"; // // InsertDataDgv // InsertDataDgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; - InsertDataDgv.Location = new Point(12, 281); + InsertDataDgv.Location = new Point(15, 264); + InsertDataDgv.Margin = new Padding(4, 2, 4, 2); InsertDataDgv.Name = "InsertDataDgv"; InsertDataDgv.RowTemplate.Height = 25; - InsertDataDgv.Size = new Size(1245, 219); + InsertDataDgv.Size = new Size(1601, 206); InsertDataDgv.TabIndex = 0; // // richTextBox1 // richTextBox1.Dock = DockStyle.Bottom; - richTextBox1.Location = new Point(0, 801); + richTextBox1.Location = new Point(0, 754); + richTextBox1.Margin = new Padding(4, 2, 4, 2); richTextBox1.Name = "richTextBox1"; - richTextBox1.Size = new Size(1284, 176); + richTextBox1.Size = new Size(1651, 166); richTextBox1.TabIndex = 1; richTextBox1.Text = ""; // @@ -1885,14 +2000,18 @@ // // MainForm // - AutoScaleDimensions = new SizeF(7F, 17F); + AutoScaleDimensions = new SizeF(9F, 16F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1284, 977); + BackColor = SystemColors.ActiveCaption; + ClientSize = new Size(1651, 920); Controls.Add(richTextBox1); Controls.Add(tabControl1); + Font = new Font("华文中宋", 10.5F, FontStyle.Regular, GraphicsUnit.Point); Icon = (Icon)resources.GetObject("$this.Icon"); + Margin = new Padding(4, 2, 4, 2); Name = "MainForm"; Text = "海信视觉防差错"; + FormClosing += MainForm_FormClosing; Load += MainForm_Load; tabPage2.ResumeLayout(false); panel1.ResumeLayout(false); @@ -1911,17 +2030,16 @@ tabPage5.ResumeLayout(false); panel4.ResumeLayout(false); panel5.ResumeLayout(false); - panel8.ResumeLayout(false); - panel8.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)OKOrNGShow).EndInit(); - panel6.ResumeLayout(false); - panel6.PerformLayout(); + 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); + panel8.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)OKOrNGShow).EndInit(); tabPage3.ResumeLayout(false); panel2.ResumeLayout(false); panel2.PerformLayout(); @@ -1938,7 +2056,6 @@ private TabPage tabPage5; private Panel panel4; private Panel panel7; - private Panel panel6; private Panel panel5; private Panel panel8; private GroupBox groupBox2; @@ -2094,5 +2211,15 @@ private XKRS.UI.Canvas DefetShow7; private XKRS.UI.Canvas DefetShow6; private Button handStopBtn; + private XKRS.UI.Canvas canvas1; + private XKRS.UI.Canvas canvas5; + private XKRS.UI.Canvas canvas4; + private XKRS.UI.Canvas canvas3; + private XKRS.UI.Canvas canvas6; + private XKRS.UI.Canvas canvas2; + private TextBox textBox1; + private Label label35; + private TextBox textBox2; + private Label label36; } } diff --git a/HisenceYoloDetection/MainForm.cs b/HisenceYoloDetection/MainForm.cs index 876542f..9a2f192 100644 --- a/HisenceYoloDetection/MainForm.cs +++ b/HisenceYoloDetection/MainForm.cs @@ -22,6 +22,7 @@ using System.Net; using System.Numerics; using System.Text; using System.Text.RegularExpressions; +using System.Threading; using System.Windows.Forms; using XKRS.Device.SimboVision.SimboHelper; using XKRS.UI; @@ -64,6 +65,9 @@ namespace HisenceYoloDetection List xKHisences = new List(); static AutoResetEvent myResetEvent = new AutoResetEvent(false); + + AutoResetEvent _runHandleBefore = new AutoResetEvent(false); + ManualResetEvent _runHandleAfter = new ManualResetEvent(false); bool PLC545 = false; bool PLC548 = false; @@ -103,7 +107,11 @@ namespace HisenceYoloDetection string Cam1OnePath = ""; string Cam1TwoPath = ""; string ModelChangePath = ""; - + // + string GreenLightingAdress = ""; + string YellowLightingAdress = ""; + string RedLightingAdress = ""; + string WaringAdress = ""; /// /// 鿴б /// @@ -191,8 +199,21 @@ namespace HisenceYoloDetection /// private void MainForm_Load(object sender, EventArgs e) { + //ַ + + - string s1 = "gorenjeSTEAMTECHSNOWFLAKEDRUM65kg"; + if (_runHandleBefore == null) + { + _runHandleBefore = new AutoResetEvent(false); + } + + if (_runHandleAfter == null) + { + _runHandleAfter = new ManualResetEvent(false); + } + + string s1 = "gorenjeSTEAMTECHSNOWFLAKEDRUM65kg"; string s2 = "STEAMTECHSNOWFLAKEDRUM65kg"; bool st = ManagerModelHelper.StrMatch(s1, s2); @@ -268,6 +289,8 @@ namespace HisenceYoloDetection OnSpeedShow();//߳̿ٶʾڽ OnPostionShow();//߳̿λʾڽ + melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 1);//Ƶ + //t = new System.Timers.Timer(10000);//ʵTimer࣬üʱΪ10000룻 //t.Elapsed += new System.Timers.ElapsedEventHandler(Execute);//ʱʱִ¼ //t.AutoReset = true;//ִһΣfalseһֱִ(true) @@ -277,7 +300,7 @@ namespace HisenceYoloDetection } public void Execute(object source, System.Timers.ElapsedEventArgs e) { - + t.Stop(); //ȹرնʱ //melsecPLCTCPDriver.WriteInt("548", 1); //Thread.Sleep(1000); @@ -525,7 +548,7 @@ namespace HisenceYoloDetection // tbFrameRate.Enabled = false; bnGetParam.Enabled = false; bnSetParam.Enabled = false; - + } private void button3_Click(object sender, EventArgs e) { @@ -592,7 +615,7 @@ namespace HisenceYoloDetection //Scanner.OnClientDataReceived += OnDataReceived; //Scanner.btnSendMsg("LON\r");//Ϳָ //myLog("Ͷʿɨǹָ", DateTime.Now); - + //PLCʹܿ melsecPLCTCPDriver.WriteInt("581", 0);//λɿ melsecPLCTCPDriver.WriteInt("504", 0);//λɿ @@ -983,11 +1006,12 @@ namespace HisenceYoloDetection } if (iNum1 >= 2) { + if (bBar) { + _runHandleBefore.WaitOne(); bBarTriger = true;//޸ijջȡͺ - Cam2.SnapshotCount = 0; - Cam2.Snapshot(); + xKNow = GetModeFromBar("VWJ070633V0WW80F0120356");//ݿвѯֵ //xKNow = GetModeFromBar(m_sKEYENCEBar);//ݿвѯֵ @@ -1094,15 +1118,15 @@ namespace HisenceYoloDetection { //if (bBarTriger) { - -#if true - if(!StopM) + +#if false + if (!StopM) { melsecPLCTCPDriver.WriteInt("550", 1);// StopM = true; } - + myLog("һβɼͼ", DateTime.Now); //ƶģ βĵַ Ƿǰƶ MoveToP(5815, YPos, ZPos); @@ -1123,7 +1147,7 @@ namespace HisenceYoloDetection double disreal = average * (-0.54054) + 1324.3232; //-׼=Ҫƶľ double dismove = disreal - 876; - if (dismove > 0 && dismove < 4000) + if (dismove > -4000 && dismove < 4000) { MoveToP(5815, YPos, ZPos + (int)(dismove)); } @@ -1135,18 +1159,18 @@ namespace HisenceYoloDetection Cam2.SnapshotCount = 0; Cam2.Snapshot(); myLog("ڶβɼͼ", DateTime.Now); + //if (xKNow != null) //{ // MoveToP(xKNow.MoveTwoX, xKNow.MoveTwoY, xKNow.MoveTwoZ); //} - //currentXP = 54964; - //Thread.Sleep(2000);//ɾ + MoveToP(51043, YPos, ZPos + (int)(dismove)); Cam1.Snapshot(); MoveToP(5815, YPos, ZPos); melsecPLCTCPDriver.WriteInt("550", 0);// - //Thread.Sleep(300);//ϴ»ܹȥ - + //Thread.Sleep(300);//ϴ»ܹȥ + //if (xKNow != null) //{ // MoveToP(xKNow.MoveX, xKNow.MoveY, xKNow.MoveZ); @@ -1277,8 +1301,8 @@ namespace HisenceYoloDetection { - //Cam1ImgOne = Cv2.ImRead("D:\\Hisence\\\\1\\001.jpg"); ; - Cam1ImgOne = cameraMat; + Cam1ImgOne = Cv2.ImRead("D:\\Hisence\\\\1\\001.jpg"); ; + //Cam1ImgOne = cameraMat; IfCam1OneTriger = true; originMatShow.Image = cameraMat.ToBitmap(); //pictureBox1.Image = cameraMat.ToBitmap(); @@ -1288,13 +1312,13 @@ namespace HisenceYoloDetection //ڶ if (SnapshotCount == 2) { - // Mat mat = Cv2.ImRead("D:\\Hisence\\\\1\\002.jpg"); - // Cam1ImgTwo = mat; - Cam1ImgTwo = cameraMat; + + Cam1ImgTwo = Cv2.ImRead("D:\\Hisence\\\\1\\002.jpg"); + //Cam1ImgTwo = cameraMat; IfCam1TwoTriger = true; originMatShow2.Image = cameraMat.ToBitmap(); - + _runHandleAfter.Set(); } @@ -1320,8 +1344,9 @@ namespace HisenceYoloDetection // Mat mat = Cv2.ImRead("F:\\ϴ»\\cam1\\2024517161641.jpg"); 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"); @@ -1329,6 +1354,7 @@ namespace HisenceYoloDetection public volatile int AllDsums = 0; public volatile int NGDsums = 0; public volatile int OKDsums = 0; + public volatile int WUsums = 0; /// /// ʼʶ /// @@ -1341,6 +1367,8 @@ namespace HisenceYoloDetection { try { + //ź ʹ䲻Ӻ˸ + _runHandleAfter.WaitOne(); //2һ if (IfCam2Triger) { @@ -1360,7 +1388,8 @@ namespace HisenceYoloDetection sw.WriteLine(IOcrBAr + "\n"); sw.Flush(); } - IOcrBAr = "BatchW96DHModelWF3S7021BWPl"; + // IOcrBAr = "BatchW9659ModelWNHPI74SCPSDE"; + IOcrBAr = "W821PWMS27106WD2"; //ݿȶ xKNow = GetModeFromBar(IOcrBAr);//ݿвѯֵ List xkWordList = ManagerModelHelper.GetModeWordFromBar(IOcrBAr); @@ -1405,8 +1434,11 @@ namespace HisenceYoloDetection } //1ڶ - if (IfCam1TwoTriger && bBarTriger) + // if (IfCam1TwoTriger && bBarTriger) { + IfCam1TwoTriger = false; + bBarTriger = false; + _runHandleAfter.Reset(); //ʼ Defet_OnDetectionDone(whiteMat, 1); Defet_OnDetectionDone(whiteMat, 2); @@ -1415,8 +1447,7 @@ namespace HisenceYoloDetection Defet_OnDetectionDone(whiteMat, 5); Defet_OnDetectionDone(whiteMat, 6); Defet_OnDetectionDone(whiteMat, 7); - - + XK_HisenceWord xK_MatchDet = new XK_HisenceWord(); xK_MatchDet.TwoIFWhile = xK_HisenceSQLWord.TwoIFWhile; AllDsums++; @@ -1438,25 +1469,14 @@ namespace HisenceYoloDetection List strMatListOne = new List(); List strMatFuzzyListOne = new List(); Mat mResultCut = req.currentMat.Clone(); - Mat mCut = new Mat(); - Stopwatch sw = new Stopwatch(); - sw.Start(); - Dictionary keyValueResult = new Dictionary(); - InsertSqlRunDataButton(ref keyValueResult, false, ref mCut, ref mResultCut, mL, mLButton, ref xK_HisenceSQLWord, ref xK_MatchDet, ref strMatListOne, ref strMatFuzzyListOne, ref paddleOcrModel); - sw.Stop(); - myLog("ʱ" + sw.ElapsedMilliseconds, DateTime.Now); + if (mL.ResultMap != null) { mL.ResultMap.Save("D://cam1//" + dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString() + "1result.jpg"); ResultMatShow.Image = mL.ResultMap; } - else - { - Mat res_yolo = Cv2.ImRead("ng.jpg"); - - ResultMatShow.Image = res_yolo.ToBitmap(); - }//޷򶨵ͼƬ˸else޷ + // MLRequest req2 = new MLRequest(); req2.currentMat = Cam1ImgTwo; @@ -1468,18 +1488,18 @@ namespace HisenceYoloDetection req2.iouThreshold = 0.4f;//IOU req2.out_node_name = "output"; MLResult mL2 = simboObjectDetection.RunInferenceFixed(req2); - List strMatListTwo = new List(); - List strMatFuzzyListTwo = new List(); - Mat mResultCut2 = req2.currentMat.Clone(); - Dictionary keyValueResult2 = new Dictionary(); - InsertSqlRunData(ref keyValueResult2, false, ref mResultCut2, mL2, ref xK_HisenceSQLWord, ref xK_MatchDet, ref strMatListTwo, ref strMatFuzzyListTwo, ref paddleOcrModel); - 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(); + Dictionary keyValueResult = new Dictionary(); + Dictionary keyValueResult2 = new Dictionary(); + #region ִжλȶ //ִжλ string[] listLabels = xKNow.Detect.Split(","); @@ -1507,6 +1527,25 @@ namespace HisenceYoloDetection HashSet set1 = new HashSet(listLabels); HashSet set2 = new HashSet(RealLabels); bool MatchStr = set1.SetEquals(set2); + #endregion + //ȶ ϸȶ + if (MatchStr) + { + //Mat mCut = new Mat(); + Stopwatch sw = new Stopwatch(); + sw.Start(); + + 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); + sw.Stop(); + myLog("ʱ" + sw.ElapsedMilliseconds, DateTime.Now); + + } + + + if (MatchStr) { @@ -1523,9 +1562,7 @@ namespace HisenceYoloDetection // int sqlblocksum= - IfCam1TwoTriger = false; - bBarTriger = false; - + melsecPLCTCPDriver.WriteInt("550", 0);// if (MatchStr) @@ -1543,14 +1580,39 @@ namespace HisenceYoloDetection } else { - NGDsums++; + melsecPLCTCPDriver.WriteInt(RedLightingAdress, 1);// + melsecPLCTCPDriver.WriteInt(WaringAdress, 1);// myLog("ƥʧ", DateTime.Now); - //ʾ - // InsertXK_HisenceWordMatchData(xK_MatchDet, false); - this.Invoke(new Action(() => + //ΪжǷNGϴ» + DialogResult dr = MessageBox.Show("Ƿ죿", "Ƿ", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); + if (dr == DialogResult.OK) { - OKOrNGShow.Image = NGbitmap; - })); + melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);// + melsecPLCTCPDriver.WriteInt(WaringAdress, 0);// + OKDsums++; + WUsums++; + this.Invoke(new Action(() => + { + double percent = (double)WUsums/ AllDsums; + string percentText = percent.ToString("0.0%");//percentTextֵΪ10.0% + textBox1.Text = percentText; + OKOrNGShow.Image = OKbitmap; + })); + + } + else + { + NGDsums++; + melsecPLCTCPDriver.WriteInt(WaringAdress, 0);// + melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);// + + this.Invoke(new Action(() => + { + OKOrNGShow.Image = NGbitmap; + })); + } + + } @@ -1559,7 +1621,7 @@ namespace HisenceYoloDetection } catch (Exception e) { - + throw e; } finally { @@ -1639,7 +1701,7 @@ namespace HisenceYoloDetection { m_sKEYENCEBar = System.Text.Encoding.UTF8.GetString(data); // myLog("ͺOcr" + m_sKEYENCEBar, DateTime.Now); - + _runHandleBefore.Set(); bBar = true; } @@ -1838,6 +1900,7 @@ namespace HisenceYoloDetection */ //OnGetBar(); + melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//Ƶ TriggerCameral2(); ReadyDetect(); myLog("̳ɹ", DateTime.Now); @@ -2235,9 +2298,9 @@ namespace HisenceYoloDetection List strMatListOne = new List(); List strMatFuzzyListOne = new List(); Mat mResultCut = CamOneI.currentMat.Clone(); - Mat mCut = new Mat(); + //Mat mCut = new Mat(); Dictionary keyValueResult = new Dictionary(); - InsertSqlRunDataButton(ref keyValueResult, true, ref mCut, ref mResultCut, mL3, mLButton, ref xK_HisenceSQLWord, ref xkWord, ref strMatListOne, ref strMatFuzzyListOne, ref paddleOcrModel); + InsertSqlRunDataButton(ref keyValueResult, true, ref mResultCut, mL3, mLButton, ref xK_HisenceSQLWord, ref xkWord, ref strMatListOne, ref strMatFuzzyListOne, ref paddleOcrModel); @@ -2641,37 +2704,37 @@ namespace HisenceYoloDetection { case 1: { - DefetShow1.ImaMAt = detectionImage; + canvas1.ImaMAt = detectionImage; } break; case 2: { - DefetShow2.ImaMAt = detectionImage; + canvas2.ImaMAt = detectionImage; } break; case 3: { - DefetShow3.ImaMAt = detectionImage; + canvas3.ImaMAt = detectionImage; } break; case 4: { - DefetShow4.ImaMAt = detectionImage; + canvas4.ImaMAt = detectionImage; } break; case 5: { - DefetShow5.ImaMAt = detectionImage; + canvas5.ImaMAt = detectionImage; } break; case 6: { - DefetShow6.ImaMAt = detectionImage; + canvas6.ImaMAt = detectionImage; } break; case 7: { - DefetShow7.ImaMAt = detectionImage; + // canvas7.ImaMAt = detectionImage; } break; case 8: @@ -2701,7 +2764,7 @@ namespace HisenceYoloDetection /// صĶλĽ /// /// - public void InsertSqlRunDataButton(ref Dictionary keyValueResult, bool saveimage, ref Mat CutMat, ref Mat currentMatC, MLResult cam1TwoML, MLResult cam1Button, ref XK_HisenceWord SQlxK_HisenceWord, ref XK_HisenceWord xK_HisenceWord, ref List strMatList, ref List strMatRefList, ref PaddleOcrModel IOcrModel) + public void InsertSqlRunDataButton(ref Dictionary keyValueResult, bool saveimage, ref Mat currentMatC, MLResult cam1TwoML, MLResult cam1Button, ref XK_HisenceWord SQlxK_HisenceWord, ref XK_HisenceWord xK_HisenceWord, ref List strMatList, ref List strMatRefList, ref PaddleOcrModel IOcrModel) { #if true //try @@ -2923,7 +2986,7 @@ namespace HisenceYoloDetection //ʾİ DisplayResult(mLcut); Defet_OnDetectionDone(mLcut.ResultMap.ToMat(), 1); - + string Path_1 = Path.Combine("D:\\Hisence\\Test\\1\\ng", filenameone + "_res.png"); Cv2.ImWrite(Path_1, mLcut.ResultMap.ToMat()); @@ -3081,22 +3144,22 @@ namespace HisenceYoloDetection Rect rect = new Rect(0, 0, 0, 0); string PathSql = SQlxK_HisenceWord.SixblockPath; - + //һֱΪtrue juanjiMatch = CheckDiffSciHelper.CheckDiffSci(PathSql, CutBlockMat, rect, rect, false, "D://Hisence//Test"); + juanjiMatch = true; if (!OneIF1 || !juanjiMatch) - if (!OneIF) - { - OneIF = false; - // DisplayResult(mLcut); - //ʾİ - // mLcut.ResultMap; - Defet_OnDetectionDone(mLcut.ResultMap.ToMat(), 6); - } - else - { - OneIF = true; - Defet_OnDetectionDone(OKMat, 6); - } + { + OneIF = false; + // DisplayResult(mLcut); + //ʾİ + // mLcut.ResultMap; + Defet_OnDetectionDone(mLcut.ResultMap.ToMat(), 6); + } + else + { + OneIF = true; + Defet_OnDetectionDone(OKMat, 6); + } } } @@ -3228,5 +3291,10 @@ namespace HisenceYoloDetection { melsecPLCTCPDriver.WriteInt("550", 0); } + + private void MainForm_FormClosing(object sender, FormClosingEventArgs e) + { + melsecPLCTCPDriver.WriteInt("550", 0); + } } } diff --git a/HisenceYoloDetection/MelsecPLCTCPDriver.cs b/HisenceYoloDetection/MelsecPLCTCPDriver.cs index ad6e1bf..bc8b626 100644 --- a/HisenceYoloDetection/MelsecPLCTCPDriver.cs +++ b/HisenceYoloDetection/MelsecPLCTCPDriver.cs @@ -11,7 +11,7 @@ using static OpenCvSharp.FileStorage; -public class MelsecPLCTCPDriver +public class MelsecPLCTCPDriver1 { private MelsecMcNet melsecMc = new MelsecMcNet(); // private HslCommunication.ModBus.ModbusTcpNet melsecMc = new HslCommunication.ModBus.ModbusTcpNet(); diff --git a/HisenceYoloDetection/VirtualPLCTCPDriver.cs b/HisenceYoloDetection/VirtualPLCTCPDriver.cs index cb6e723..d52874e 100644 --- a/HisenceYoloDetection/VirtualPLCTCPDriver.cs +++ b/HisenceYoloDetection/VirtualPLCTCPDriver.cs @@ -12,7 +12,7 @@ using static OpenCvSharp.FileStorage; -public class MelsecPLCTCPDriver1 +public class MelsecPLCTCPDriver { // private MelsecMcNet melsecMc = new MelsecMcNet(); // private HslCommunication.ModBus.ModbusTcpNet melsecMc = new HslCommunication.ModBus.ModbusTcpNet(); diff --git a/XKRS.UI/Canvas.cs b/XKRS.UI/Canvas.cs index be54d68..9206283 100644 --- a/XKRS.UI/Canvas.cs +++ b/XKRS.UI/Canvas.cs @@ -399,6 +399,7 @@ namespace XKRS.UI } #endregion + #region 画矩形 GPathList.ForEach(path => {