From eea11b147943ef3baeaf3c6643d5e3b17d375629 Mon Sep 17 00:00:00 2001 From: lhiven Date: Fri, 14 Nov 2025 07:59:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=A6=E5=8F=91=E4=B8=8B?= =?UTF-8?q?=E7=9B=B8=E6=9C=BA=E6=8B=8D=E7=85=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/TestFrm.Designer.cs | 33 +- Rs.DeweyTester/TestFrm.cs | 105 ++--- Rs.DeweyTester/TestFrm.resx | 611 ++++++----------------------- 3 files changed, 175 insertions(+), 574 deletions(-) diff --git a/Rs.DeweyTester/TestFrm.Designer.cs b/Rs.DeweyTester/TestFrm.Designer.cs index baa2669..5c5bd7b 100644 --- a/Rs.DeweyTester/TestFrm.Designer.cs +++ b/Rs.DeweyTester/TestFrm.Designer.cs @@ -29,7 +29,6 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TestFrm)); - this.button24 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button(); this.button5 = new System.Windows.Forms.Button(); this.button11 = new System.Windows.Forms.Button(); @@ -57,6 +56,8 @@ this.label1 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.button2 = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); this.button9 = new System.Windows.Forms.Button(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.comboBox3 = new System.Windows.Forms.ComboBox(); @@ -81,14 +82,6 @@ this.groupBox5.SuspendLayout(); this.SuspendLayout(); // - // button24 - // - this.button24.ForeColor = System.Drawing.Color.Black; - resources.ApplyResources(this.button24, "button24"); - this.button24.Name = "button24"; - this.button24.UseVisualStyleBackColor = true; - this.button24.Click += new System.EventHandler(this.button24_Click); - // // button4 // this.button4.ForeColor = System.Drawing.Color.Black; @@ -317,14 +310,31 @@ // // groupBox3 // - this.groupBox3.Controls.Add(this.button24); + this.groupBox3.Controls.Add(this.button2); this.groupBox3.Controls.Add(this.button4); + this.groupBox3.Controls.Add(this.button1); this.groupBox3.Controls.Add(this.button5); this.groupBox3.ForeColor = System.Drawing.Color.White; resources.ApplyResources(this.groupBox3, "groupBox3"); this.groupBox3.Name = "groupBox3"; this.groupBox3.TabStop = false; // + // button2 + // + this.button2.ForeColor = System.Drawing.Color.Black; + resources.ApplyResources(this.button2, "button2"); + this.button2.Name = "button2"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click_2); + // + // button1 + // + this.button1.ForeColor = System.Drawing.Color.Black; + resources.ApplyResources(this.button1, "button1"); + this.button1.Name = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click_2); + // // button9 // this.button9.ForeColor = System.Drawing.Color.Black; @@ -469,7 +479,6 @@ } #endregion - private System.Windows.Forms.Button button24; private System.Windows.Forms.Button button4; private System.Windows.Forms.Button button5; private System.Windows.Forms.Button button11; @@ -514,5 +523,7 @@ private System.Windows.Forms.GroupBox groupBox5; private System.Windows.Forms.Button btnEnd; private System.Windows.Forms.Button btnStart; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button1; } } \ No newline at end of file diff --git a/Rs.DeweyTester/TestFrm.cs b/Rs.DeweyTester/TestFrm.cs index 0281657..21bd132 100644 --- a/Rs.DeweyTester/TestFrm.cs +++ b/Rs.DeweyTester/TestFrm.cs @@ -87,82 +87,7 @@ namespace Rs.MotionPlat bool stop = false; private void button24_Click(object sender, EventArgs e) { - int step = 0; - int num = 0; - Task.Run(() => { - TargetPosition targetPos = new TargetPosition(); - while (true) - { - if(stop) - { - Thread.Sleep(100); - continue; - } - switch (step) - { - case 0: - num++; - if(num%2==0) - { - //targetPos.X = GlobalVar.Fixture5GrabImageX;// 831; - targetPos.X = 930;// GlobalVar.Fixture4GrabImageX;// 831; - targetPos.Y1 = GlobalVar.FixtureSideY1; - targetPos.Y2 = -320.256; - } - else - { - //targetPos.X = GlobalVar.Fixture5GrabImageX;// 831; - targetPos.X = 300;// GlobalVar.Fixture4GrabImageX;// 831; - targetPos.Y1 = GlobalVar.FixtureSideY1; - targetPos.Y2 = -329.256; - } - if (GroupAxisMove.XY1Y2MovePos(targetPos, GlobalVar.WholeSpeed, EGoWhichSide.FixtureSide)) - { - step++; - } - break; - case 1: - if(Ops.IsStop("LoadX", "LoadY1", "LoadY2")) - { - step++; - } - break; - case 2: - targetPos.X = GlobalVar.Fixture5GrabImageX; - targetPos.Y1 = GlobalVar.FixtureSideY1; - targetPos.Y2 = GlobalVar.Fixture5GrabImageY2; - if (GroupAxisMove.XY1Y2MovePos(targetPos, GlobalVar.WholeSpeed, EGoWhichSide.FixtureSide)) - { - step++; - } - break; - case 3: - if (Ops.IsStop("LoadX", "LoadY1", "LoadY2")) - { - if(AxisArrived.LoadXY1Y2IsArrived(targetPos.X,targetPos.Y1,targetPos.Y2)) - { - Thread.Sleep(100); - string logInfo = $"x:{Ops.GetCurPosition(AxisControl.LoadX)},y1:{Ops.GetCurPosition(AxisControl.LoadY1)},y2:{Ops.GetCurPosition(AxisControl.LoadY2)}"; - MessageQueue.Instance.Insert(logInfo); - step++; - } - - //Thread.Sleep(1000); - - } - break; - case 4: - UpCameraHelper.Grab(); - VisionResult vr = VisionHelper.Grab(EVisionScene.FixtureDumpProduct); - if(vr != null && vr.Result) - { - step = 0; - } - break; - } - } - }); } private void button1_Click_1(object sender, EventArgs e) @@ -186,14 +111,15 @@ namespace Rs.MotionPlat AxisControl.LoadY2.ComparePulse((ushort)GlobalVar.HightChannel, false); } - static bool bContinueGrab = false; + static bool bContinueGrab1 = false; + static bool bContinueGrab2 = false; private void button5_Click_1(object sender, EventArgs e) { - bContinueGrab=!bContinueGrab; - if(bContinueGrab) + bContinueGrab1=!bContinueGrab1; + if(bContinueGrab1) { Task.Run(() => { - while (bContinueGrab) + while (bContinueGrab1) { AxisControl.LoadY2.ComparePulse((ushort)GlobalVar.HightChannel, false); Thread.Sleep(500); @@ -325,5 +251,26 @@ namespace Rs.MotionPlat { bPrecisionVerify = false; } + + + private void button1_Click_2(object sender, EventArgs e) + { + bContinueGrab2 = !bContinueGrab2; + if (bContinueGrab2) + { + Task.Run(() => { + while (bContinueGrab2) + { + AxisControl.LoadY2.ComparePulse(2, false); + Thread.Sleep(500); + } + }); + } + } + + private void button2_Click_2(object sender, EventArgs e) + { + AxisControl.LoadY2.ComparePulse(2, false); + } } } diff --git a/Rs.DeweyTester/TestFrm.resx b/Rs.DeweyTester/TestFrm.resx index 1ad4ffe..039b3c1 100644 --- a/Rs.DeweyTester/TestFrm.resx +++ b/Rs.DeweyTester/TestFrm.resx @@ -118,45 +118,18 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 24, 116 - - - 119, 55 - - - - 20 - - - 重复精度验证 - - - False - - - button24 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox3 - - - 0 - - 24, 29 + 24, 111 119, 55 + 23 - 相机触发 + 下相机触发 button4 @@ -171,7 +144,7 @@ 1 - 204, 29 + 204, 111 119, 55 @@ -180,7 +153,7 @@ 23 - 相机循环触发 + 下相机循环触发 button5 @@ -192,7 +165,7 @@ groupBox3 - 2 + 3 68, 103 @@ -242,222 +215,6 @@ 16 - - radioButton16 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 0 - - - radioButton6 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 1 - - - radioButton15 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 2 - - - radioButton5 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 3 - - - radioButton14 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 4 - - - radioButton3 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 5 - - - radioButton13 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 6 - - - radioButton8 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 7 - - - radioButton12 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 8 - - - radioButton4 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 9 - - - radioButton11 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 10 - - - radioButton7 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 11 - - - radioButton10 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 12 - - - radioButton2 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 13 - - - radioButton9 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 14 - - - radioButton1 - - - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 15 - - - 840, 12 - - - 336, 187 - - - 31 - - - 飞拍 - - - groupBox1 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - True @@ -890,80 +647,29 @@ 15 - - comboBox1 + + 840, 12 - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 336, 187 - - groupBox2 + + 31 - - 0 + + 飞拍 - - label2 + + groupBox1 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 1 - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 2 - - - textBox1 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 3 - - - 415, 25 - - - 362, 174 - - - 32 - - - Test - - - False - - - groupBox2 - - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 3 + + 4 1 @@ -1079,6 +785,88 @@ 3 + + 415, 25 + + + 362, 174 + + + 32 + + + Test + + + False + + + groupBox2 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + + NoControl + + + 24, 20 + + + 119, 55 + + + 23 + + + 上相机触发 + + + button2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 0 + + + NoControl + + + 204, 20 + + + 119, 55 + + + 23 + + + 上相机循环触发 + + + button1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox3 + + + 2 + 29, 12 @@ -1127,174 +915,6 @@ 6 - - comboBox3 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 0 - - - comboBox2 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 1 - - - label8 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 2 - - - textBox3 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 3 - - - label7 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 4 - - - label4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 5 - - - textBox6 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 7 - - - textBox2 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 8 - - - label6 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 9 - - - label3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 10 - - - textBox5 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 11 - - - label5 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox4 - - - 12 - - - 29, 241 - - - 336, 122 - - - 41 - - - 产品搬运 - - - groupBox4 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - 211, 114 @@ -1619,7 +1239,30 @@ 12 - + + 29, 241 + + + 336, 122 + + + 41 + + + 产品搬运 + + + groupBox4 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + NoControl @@ -1711,6 +1354,6 @@ TestFrm - Rs.MotionPlat.BaseForm, Rs.MotionPlat, Version=1.20.24.29, Culture=neutral, PublicKeyToken=null + Rs.MotionPlat.BaseForm, Rs.MotionPlat, Version=20.25.41.1, Culture=neutral, PublicKeyToken=null \ No newline at end of file