From 9363afc789121c7228875f5aff303d06fa27727a Mon Sep 17 00:00:00 2001 From: lhiven Date: Wed, 10 Jul 2024 14:17:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E6=9C=BA=E9=9D=A2=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E5=92=8C=E8=89=AF=E7=8E=87=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/Flow/HomeFlow.cs | 32 +-- Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs | 2 + Rs.DeweyTester/FormMain.cs | 18 ++ Rs.DeweyTester/FormMain.designer.cs | 212 +++++++++--------- Rs.DeweyTester/FormMain.resx | 6 - 5 files changed, 142 insertions(+), 128 deletions(-) diff --git a/Rs.DeweyTester/Flow/HomeFlow.cs b/Rs.DeweyTester/Flow/HomeFlow.cs index 1c0e755..aaec29d 100644 --- a/Rs.DeweyTester/Flow/HomeFlow.cs +++ b/Rs.DeweyTester/Flow/HomeFlow.cs @@ -162,22 +162,22 @@ namespace Rs.MotionPlat.Flow //{ // StockManager.OpenTray(i); //} - //while (true) - //{ - // if (Ops.IsOn($"满料{i}对射光电")) - // { - // Msgbox.ShowDialog(AlarmCollection.Get(AlarmConstID.料仓有料报警).Transform(i), EButtonType.Ok); - // //打开料仓jia'ci - // Ops.Off($"料仓夹磁气缸{i}夹"); - // Ops.On($"料仓夹磁气缸{i}开"); - // Thread.Sleep(200); - // Msgbox.ShowDialog(AlarmCollection.Get(AlarmConstID.取走顶层料盘报警).Transform(i), EButtonType.Ok); - // } - // else - // { - // break; - // } - //} + while (true) + { + if (Ops.IsOn($"满料{i}对射光电")) + { + Msgbox.ShowDialog(AlarmCollection.Get(AlarmConstID.料仓有料报警).Transform(i), EButtonType.Ok); + //打开料仓jia'ci + Ops.Off($"料仓夹磁气缸{i}夹"); + Ops.On($"料仓夹磁气缸{i}开"); + Thread.Sleep(200); + Msgbox.ShowDialog(AlarmCollection.Get(AlarmConstID.取走顶层料盘报警).Transform(i), EButtonType.Ok); + } + else + { + break; + } + } while (true) { diff --git a/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs b/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs index 63b355b..e3a0bb7 100644 --- a/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs +++ b/Rs.DeweyTester/Flow/SubFlow/StockPlaceFlow.cs @@ -29,6 +29,7 @@ namespace Rs.MotionPlat.Flow.SubFlow /// public class StockPlaceFlow { + public event Action PlaceFinishedEvent; bool finished = true; EStockPlaceFlowStep flowStep = EStockPlaceFlowStep.待触发; public StockPlaceFlow() @@ -180,6 +181,7 @@ namespace Rs.MotionPlat.Flow.SubFlow case EStockPlaceFlowStep.料仓放料完成粘料检测: if (!curNozzle.HasProduct() || GlobalVar.RunSpace) { + PlaceFinishedEvent?.Invoke(curNozzle.Product); logInfo = $"{GetClassName()}检测到吸嘴{curNozzle.NozzleIndex}无粘料,吸嘴{curNozzle.NozzleIndex}把产品SN:{curNozzle.Product.SN}放入OK料盘{curPlaceSlot.Index}穴位"; MessageQueue.Instance.Insert(logInfo); tray.ChangeStatus(curPlaceSlot.Index, ESlotStatus.Have); diff --git a/Rs.DeweyTester/FormMain.cs b/Rs.DeweyTester/FormMain.cs index d76cce3..afd4059 100644 --- a/Rs.DeweyTester/FormMain.cs +++ b/Rs.DeweyTester/FormMain.cs @@ -267,6 +267,24 @@ namespace Rs.MotionPlat uTestCell4.SetIndex(4); uTestCell5.SetIndex(5); uTestCell6.SetIndex(6); + StockPlaceFlow.Instance.PlaceFinishedEvent += (pro) => { + int.TryParse(lblTotalNum.Text, out int totalNum); + int.TryParse(lblPassNum.Text,out int passNum); + int.TryParse(lblNgNum.Text, out int ngNum); + totalNum++; + if (pro.Result == "PASS") + { + passNum++; + } + else + { + ngNum++; + } + lblTotalNum.Text=totalNum.ToString(); + lblPassNum.Text = passNum.ToString(); + lblNgNum.Text = ngNum.ToString(); + lblTotalYield.Text = $"{(passNum / totalNum) * 100}%"; + }; } diff --git a/Rs.DeweyTester/FormMain.designer.cs b/Rs.DeweyTester/FormMain.designer.cs index 54cfde3..55b63e5 100644 --- a/Rs.DeweyTester/FormMain.designer.cs +++ b/Rs.DeweyTester/FormMain.designer.cs @@ -32,8 +32,8 @@ namespace Rs.MotionPlat private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.panel1 = new System.Windows.Forms.Panel(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); @@ -106,6 +106,14 @@ namespace Rs.MotionPlat this.btnBuzzer = new System.Windows.Forms.Button(); this.trayNozzle = new Rs.Controls.RsTray(); this.groupBox38 = new System.Windows.Forms.GroupBox(); + this.lblTotalYield = new System.Windows.Forms.Label(); + this.lblNgNum = new System.Windows.Forms.Label(); + this.lblPassNum = new System.Windows.Forms.Label(); + this.lblTotalNum = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); this.groupBox1 = new System.Windows.Forms.GroupBox(); @@ -151,14 +159,6 @@ namespace Rs.MotionPlat this.timertc4 = new System.Windows.Forms.Timer(this.components); this.timertc5 = new System.Windows.Forms.Timer(this.components); this.timertc6 = new System.Windows.Forms.Timer(this.components); - this.label6 = new System.Windows.Forms.Label(); - this.lblTotalNum = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.label12 = new System.Windows.Forms.Label(); - this.label13 = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); this.panel1.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout(); this.panel3.SuspendLayout(); @@ -241,14 +241,14 @@ namespace Rs.MotionPlat this.dgv_errinfo.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dgv_errinfo.BackgroundColor = System.Drawing.SystemColors.ActiveCaptionText; this.dgv_errinfo.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle3.BackColor = System.Drawing.Color.Red; - dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle3.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dgv_errinfo.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.Red; + dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle1.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgv_errinfo.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dgv_errinfo.ColumnHeadersHeight = 30; this.dgv_errinfo.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridViewTextBoxColumn1, @@ -326,8 +326,8 @@ namespace Rs.MotionPlat // Time // this.Time.DataPropertyName = "Time"; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.Red; - this.Time.DefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.Red; + this.Time.DefaultCellStyle = dataGridViewCellStyle2; this.Time.FillWeight = 25F; this.Time.HeaderText = "Time"; this.Time.MinimumWidth = 6; @@ -1233,9 +1233,9 @@ namespace Rs.MotionPlat // // groupBox38 // - this.groupBox38.Controls.Add(this.label14); - this.groupBox38.Controls.Add(this.label12); - this.groupBox38.Controls.Add(this.label10); + this.groupBox38.Controls.Add(this.lblTotalYield); + this.groupBox38.Controls.Add(this.lblNgNum); + this.groupBox38.Controls.Add(this.lblPassNum); this.groupBox38.Controls.Add(this.lblTotalNum); this.groupBox38.Controls.Add(this.label13); this.groupBox38.Controls.Add(this.label11); @@ -1251,6 +1251,86 @@ namespace Rs.MotionPlat this.groupBox38.TabStop = false; this.groupBox38.Text = "Statistics info"; // + // lblTotalYield + // + this.lblTotalYield.AutoSize = true; + this.lblTotalYield.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.lblTotalYield.Location = new System.Drawing.Point(484, 26); + this.lblTotalYield.Name = "lblTotalYield"; + this.lblTotalYield.Size = new System.Drawing.Size(11, 12); + this.lblTotalYield.TabIndex = 14; + this.lblTotalYield.Text = "0"; + // + // lblNgNum + // + this.lblNgNum.AutoSize = true; + this.lblNgNum.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.lblNgNum.Location = new System.Drawing.Point(372, 26); + this.lblNgNum.Name = "lblNgNum"; + this.lblNgNum.Size = new System.Drawing.Size(11, 12); + this.lblNgNum.TabIndex = 14; + this.lblNgNum.Text = "0"; + // + // lblPassNum + // + this.lblPassNum.AutoSize = true; + this.lblPassNum.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.lblPassNum.Location = new System.Drawing.Point(234, 26); + this.lblPassNum.Name = "lblPassNum"; + this.lblPassNum.Size = new System.Drawing.Size(11, 12); + this.lblPassNum.TabIndex = 14; + this.lblPassNum.Text = "0"; + // + // lblTotalNum + // + this.lblTotalNum.AutoSize = true; + this.lblTotalNum.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.lblTotalNum.Location = new System.Drawing.Point(96, 26); + this.lblTotalNum.Name = "lblTotalNum"; + this.lblTotalNum.Size = new System.Drawing.Size(11, 12); + this.lblTotalNum.TabIndex = 14; + this.lblTotalNum.Text = "0"; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.label13.Location = new System.Drawing.Point(400, 26); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(77, 12); + this.label13.TabIndex = 14; + this.label13.Text = "Total yield:"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.label11.Location = new System.Drawing.Point(267, 26); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(83, 12); + this.label11.TabIndex = 14; + this.label11.Text = "Total ng num:"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.label7.Location = new System.Drawing.Point(129, 26); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(95, 12); + this.label7.TabIndex = 14; + this.label7.Text = "Total pass num:"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.label6.Location = new System.Drawing.Point(16, 26); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(65, 12); + this.label6.TabIndex = 14; + this.label6.Text = "Total num:"; + // // tabPage2 // this.tabPage2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36))))); @@ -1758,86 +1838,6 @@ namespace Rs.MotionPlat this.timertc6.Interval = 500; this.timertc6.Tick += new System.EventHandler(this.timertc6_Tick); // - // label6 - // - this.label6.AutoSize = true; - this.label6.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label6.Location = new System.Drawing.Point(16, 26); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(65, 12); - this.label6.TabIndex = 14; - this.label6.Text = "Total num:"; - // - // lblTotalNum - // - this.lblTotalNum.AutoSize = true; - this.lblTotalNum.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.lblTotalNum.Location = new System.Drawing.Point(96, 26); - this.lblTotalNum.Name = "lblTotalNum"; - this.lblTotalNum.Size = new System.Drawing.Size(11, 12); - this.lblTotalNum.TabIndex = 14; - this.lblTotalNum.Text = "0"; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label7.Location = new System.Drawing.Point(129, 26); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(95, 12); - this.label7.TabIndex = 14; - this.label7.Text = "Total pass num:"; - // - // label10 - // - this.label10.AutoSize = true; - this.label10.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label10.Location = new System.Drawing.Point(234, 26); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(11, 12); - this.label10.TabIndex = 14; - this.label10.Text = "0"; - // - // label11 - // - this.label11.AutoSize = true; - this.label11.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label11.Location = new System.Drawing.Point(267, 26); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(83, 12); - this.label11.TabIndex = 14; - this.label11.Text = "Total ng num:"; - // - // label12 - // - this.label12.AutoSize = true; - this.label12.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label12.Location = new System.Drawing.Point(372, 26); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(11, 12); - this.label12.TabIndex = 14; - this.label12.Text = "0"; - // - // label13 - // - this.label13.AutoSize = true; - this.label13.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label13.Location = new System.Drawing.Point(400, 26); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(77, 12); - this.label13.TabIndex = 14; - this.label13.Text = "Total yield:"; - // - // label14 - // - this.label14.AutoSize = true; - this.label14.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label14.Location = new System.Drawing.Point(484, 26); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(11, 12); - this.label14.TabIndex = 14; - this.label14.Text = "0"; - // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -2009,9 +2009,9 @@ namespace Rs.MotionPlat private System.Windows.Forms.Label label5; private System.Windows.Forms.Label lblTotalNum; private System.Windows.Forms.Label label6; - private System.Windows.Forms.Label label14; - private System.Windows.Forms.Label label12; - private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label lblTotalYield; + private System.Windows.Forms.Label lblNgNum; + private System.Windows.Forms.Label lblPassNum; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label11; private System.Windows.Forms.Label label7; diff --git a/Rs.DeweyTester/FormMain.resx b/Rs.DeweyTester/FormMain.resx index fc06a1b..915fbba 100644 --- a/Rs.DeweyTester/FormMain.resx +++ b/Rs.DeweyTester/FormMain.resx @@ -132,12 +132,6 @@ True - - True - - - True - 107, 17