From b9043b82660dd55b48842f932c158d5a3f75bbcd Mon Sep 17 00:00:00 2001 From: lhiven Date: Fri, 2 Aug 2024 16:14:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=99=E7=9B=98=E4=B8=AD?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=90=AC=E8=BF=90=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/Entitys/TestFixtureManager.cs | 1 + Rs.DeweyTester/Rs.DeweyTester.csproj | 1 + .../SysConfig/CommonConfig.Designer.cs | 22 ++++-- Rs.DeweyTester/SysConfig/CommonConfig.resx | 68 +++++++++++++------ Rs.DeweyTester/TestFrm.Designer.cs | 13 ++++ Rs.DeweyTester/TestFrm.cs | 23 +++++-- Rs.DeweyTester/Vision/BaseVision.cs | 14 +++- 7 files changed, 110 insertions(+), 32 deletions(-) diff --git a/Rs.DeweyTester/Entitys/TestFixtureManager.cs b/Rs.DeweyTester/Entitys/TestFixtureManager.cs index cfe5770..8108d53 100644 --- a/Rs.DeweyTester/Entitys/TestFixtureManager.cs +++ b/Rs.DeweyTester/Entitys/TestFixtureManager.cs @@ -451,6 +451,7 @@ namespace Rs.MotionPlat.Entitys { msg = $"StartTest#{sn}#MS001#OP#DXD#GRR_GRR_DXD_202203120320#Production#LF1#MOS#T1#0#0#Paint#0#R1C5#SP0012#1$"; } + LogHelper.Debug(msg); // string msg = $"StartTest#123#{GlobalVar.MachineID}#op#{GlobalVar.Config}#Lot#Mode#SiteID#ProjectID#RetryMode#{mtcp}#Mtcp#configD#DualMode#R1C1#SubLotName#{noise}$"; //msg = $"StartTest#{Product.SN}#MS001#OP#DXD#GRR_GRR_DXD_202203120320#Production#LF1#MOS#T1#0#0#Paint#0#R1C5#SP0012#1$"; Send(msg); diff --git a/Rs.DeweyTester/Rs.DeweyTester.csproj b/Rs.DeweyTester/Rs.DeweyTester.csproj index 34bc211..75a5103 100644 --- a/Rs.DeweyTester/Rs.DeweyTester.csproj +++ b/Rs.DeweyTester/Rs.DeweyTester.csproj @@ -147,6 +147,7 @@ + diff --git a/Rs.DeweyTester/SysConfig/CommonConfig.Designer.cs b/Rs.DeweyTester/SysConfig/CommonConfig.Designer.cs index babee78..25f41a4 100644 --- a/Rs.DeweyTester/SysConfig/CommonConfig.Designer.cs +++ b/Rs.DeweyTester/SysConfig/CommonConfig.Designer.cs @@ -74,6 +74,7 @@ this.cboxEnableTC3 = new System.Windows.Forms.CheckBox(); this.cboxEnableTC2 = new System.Windows.Forms.CheckBox(); this.cboxEnableTC1 = new System.Windows.Forms.CheckBox(); + this.cboxEnableBeforePlaceProductGrab = new System.Windows.Forms.CheckBox(); this.cboxDisableBuzzer = new System.Windows.Forms.CheckBox(); this.cboxCheckVisionSwOpened = new System.Windows.Forms.CheckBox(); this.cboxIsSimTest = new System.Windows.Forms.CheckBox(); @@ -108,7 +109,7 @@ this.txtControlCenterPort = new System.Windows.Forms.TextBox(); this.cboxEnableExceptionHandlingNozzle = new System.Windows.Forms.CheckBox(); this.cboxEnableScanBarCodeByDownCamera = new System.Windows.Forms.CheckBox(); - this.cboxEnableBeforePlaceProductGrab = new System.Windows.Forms.CheckBox(); + this.cboxEnableVirtualBarCode = new System.Windows.Forms.CheckBox(); this.tableLayoutPanel1.SuspendLayout(); this.groupBox8.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -324,6 +325,7 @@ this.groupBox1.Controls.Add(this.cboxEnableTC3); this.groupBox1.Controls.Add(this.cboxEnableTC2); this.groupBox1.Controls.Add(this.cboxEnableTC1); + this.groupBox1.Controls.Add(this.cboxEnableVirtualBarCode); this.groupBox1.Controls.Add(this.cboxEnableBeforePlaceProductGrab); this.groupBox1.Controls.Add(this.cboxDisableBuzzer); this.groupBox1.Controls.Add(this.cboxCheckVisionSwOpened); @@ -486,6 +488,13 @@ this.cboxEnableTC1.UseVisualStyleBackColor = true; this.cboxEnableTC1.CheckedChanged += new System.EventHandler(this.cboxFixture_CheckedChanged); // + // cboxEnableBeforePlaceProductGrab + // + resources.ApplyResources(this.cboxEnableBeforePlaceProductGrab, "cboxEnableBeforePlaceProductGrab"); + this.cboxEnableBeforePlaceProductGrab.Name = "cboxEnableBeforePlaceProductGrab"; + this.cboxEnableBeforePlaceProductGrab.UseVisualStyleBackColor = true; + this.cboxEnableBeforePlaceProductGrab.CheckedChanged += new System.EventHandler(this.cbox_CheckedChanged); + // // cboxDisableBuzzer // resources.ApplyResources(this.cboxDisableBuzzer, "cboxDisableBuzzer"); @@ -730,12 +739,12 @@ this.cboxEnableScanBarCodeByDownCamera.Name = "cboxEnableScanBarCodeByDownCamera"; this.cboxEnableScanBarCodeByDownCamera.UseVisualStyleBackColor = true; // - // cboxEnableBeforePlaceProductGrab + // cboxEnableVirtualBarCode // - resources.ApplyResources(this.cboxEnableBeforePlaceProductGrab, "cboxEnableBeforePlaceProductGrab"); - this.cboxEnableBeforePlaceProductGrab.Name = "cboxEnableBeforePlaceProductGrab"; - this.cboxEnableBeforePlaceProductGrab.UseVisualStyleBackColor = true; - this.cboxEnableBeforePlaceProductGrab.CheckedChanged += new System.EventHandler(this.cbox_CheckedChanged); + resources.ApplyResources(this.cboxEnableVirtualBarCode, "cboxEnableVirtualBarCode"); + this.cboxEnableVirtualBarCode.Name = "cboxEnableVirtualBarCode"; + this.cboxEnableVirtualBarCode.UseVisualStyleBackColor = true; + this.cboxEnableVirtualBarCode.CheckedChanged += new System.EventHandler(this.cbox_CheckedChanged); // // CommonConfig // @@ -847,5 +856,6 @@ private System.Windows.Forms.TextBox txtProjectID; private System.Windows.Forms.CheckBox cboxDisableBuzzer; private System.Windows.Forms.CheckBox cboxEnableBeforePlaceProductGrab; + private System.Windows.Forms.CheckBox cboxEnableVirtualBarCode; } } \ No newline at end of file diff --git a/Rs.DeweyTester/SysConfig/CommonConfig.resx b/Rs.DeweyTester/SysConfig/CommonConfig.resx index c1dd754..52f16a0 100644 --- a/Rs.DeweyTester/SysConfig/CommonConfig.resx +++ b/Rs.DeweyTester/SysConfig/CommonConfig.resx @@ -1377,6 +1377,36 @@ 16 + + True + + + NoControl + + + 638, 148 + + + 108, 16 + + + 8 + + + 启用虚拟二维码 + + + cboxEnableVirtualBarCode + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 17 + True @@ -1384,7 +1414,7 @@ NoControl - 638, 183 + 638, 109 96, 16 @@ -1405,7 +1435,7 @@ groupBox1 - 17 + 18 True @@ -1435,7 +1465,7 @@ groupBox1 - 18 + 19 True @@ -1465,7 +1495,7 @@ groupBox1 - 19 + 20 True @@ -1495,7 +1525,7 @@ groupBox1 - 20 + 21 True @@ -1525,7 +1555,7 @@ groupBox1 - 21 + 22 True @@ -1555,7 +1585,7 @@ groupBox1 - 22 + 23 True @@ -1585,7 +1615,7 @@ groupBox1 - 23 + 24 True @@ -1615,7 +1645,7 @@ groupBox1 - 24 + 25 True @@ -1645,7 +1675,7 @@ groupBox1 - 25 + 26 True @@ -1675,7 +1705,7 @@ groupBox1 - 26 + 27 True @@ -1705,7 +1735,7 @@ groupBox1 - 27 + 28 False @@ -1732,7 +1762,7 @@ groupBox1 - 28 + 29 True @@ -1762,7 +1792,7 @@ groupBox1 - 29 + 30 True @@ -1792,7 +1822,7 @@ groupBox1 - 30 + 31 True @@ -1822,7 +1852,7 @@ groupBox1 - 31 + 32 True @@ -1852,7 +1882,7 @@ groupBox1 - 32 + 33 True @@ -1882,7 +1912,7 @@ groupBox1 - 33 + 34 True @@ -1912,7 +1942,7 @@ groupBox1 - 34 + 35 Fill diff --git a/Rs.DeweyTester/TestFrm.Designer.cs b/Rs.DeweyTester/TestFrm.Designer.cs index 210172a..48d8d17 100644 --- a/Rs.DeweyTester/TestFrm.Designer.cs +++ b/Rs.DeweyTester/TestFrm.Designer.cs @@ -68,6 +68,7 @@ this.button7 = new System.Windows.Forms.Button(); this.button8 = new System.Windows.Forms.Button(); this.button9 = new System.Windows.Forms.Button(); + this.button10 = new System.Windows.Forms.Button(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -529,11 +530,22 @@ this.button9.UseVisualStyleBackColor = true; this.button9.Click += new System.EventHandler(this.button9_Click); // + // button10 + // + this.button10.Location = new System.Drawing.Point(853, 371); + this.button10.Name = "button10"; + this.button10.Size = new System.Drawing.Size(75, 23); + this.button10.TabIndex = 39; + this.button10.Text = "button10"; + this.button10.UseVisualStyleBackColor = true; + this.button10.Click += new System.EventHandler(this.button10_Click); + // // TestFrm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1336, 854); + this.Controls.Add(this.button10); this.Controls.Add(this.button9); this.Controls.Add(this.button8); this.Controls.Add(this.button7); @@ -602,5 +614,6 @@ private System.Windows.Forms.Button button7; private System.Windows.Forms.Button button8; private System.Windows.Forms.Button button9; + private System.Windows.Forms.Button button10; } } \ No newline at end of file diff --git a/Rs.DeweyTester/TestFrm.cs b/Rs.DeweyTester/TestFrm.cs index 6d0b531..3405107 100644 --- a/Rs.DeweyTester/TestFrm.cs +++ b/Rs.DeweyTester/TestFrm.cs @@ -311,7 +311,7 @@ namespace Rs.MotionPlat private void button7_Click(object sender, EventArgs e) { - + DischargeModuleGoSafePosFlow.Instance.GoSafePostion(); } private void button9_Click(object sender, EventArgs e) @@ -322,16 +322,31 @@ namespace Rs.MotionPlat TraySlot slot = GlobalTray.GrrTray.GetSlot(ESlotStatus.Have); if(slot==null) { + DischargeModuleGoSafePosFlow.Instance.GoSafePostion(); break; } else { - StockTakeFlow.Instance.Take(ETrayType.Grab, slot.Index, 1); - slot = GlobalTray.RetestTray.GetSlot(ESlotStatus.NotHave); - StockPlaceFlow.Instance.Place(ETrayType.ReTest, slot.Index, 1); + ProductLocationResult fixtureret = FixedGrabProductFlow.Instance.Grab(ETrayType.Grr, slot.Index, 1); + if(fixtureret!=null && fixtureret.Result== EOneGrabSixteenResult.Ok || fixtureret.Result== EOneGrabSixteenResult.Slant) + { + StockTakeFlow.Instance.Take(ETrayType.Grr, slot.Index, 1,fixtureret,false); + GlobalTray.GrrTray.ChangeStatus(slot.Index, ESlotStatus.NotHave); + slot = GlobalTray.RetestTray.GetSlot(ESlotStatus.NotHave); + if(slot!=null) + { + StockPlaceFlow.Instance.Place(ETrayType.ReTest, slot.Index, 1); + } + } + } } }); } + + private void button10_Click(object sender, EventArgs e) + { + StockLocationFlow.Instance.Grab(ETrayType.Grr, 1); + } } } diff --git a/Rs.DeweyTester/Vision/BaseVision.cs b/Rs.DeweyTester/Vision/BaseVision.cs index f6edae5..a4f75ee 100644 --- a/Rs.DeweyTester/Vision/BaseVision.cs +++ b/Rs.DeweyTester/Vision/BaseVision.cs @@ -131,9 +131,17 @@ namespace Rs.MotionPlat.Vision } else { - result.Result = true; - result.OffsetX = double.Parse(results[2]); - result.OffsetY = double.Parse(results[3]); + try + { + result.Result = true; + result.OffsetX = double.Parse(results[2]); + result.OffsetY = double.Parse(results[3]); + } + catch (Exception) + { + + } + } NozzleCalibReciveEvent.Set(); }