From 1e67c67c0038fe62c0019561b1f42dbc94468055 Mon Sep 17 00:00:00 2001 From: lhiven <236881222@qq.com> Date: Thu, 21 Sep 2023 18:55:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9C=A8=E4=BF=9D=E5=8E=8B?= =?UTF-8?q?=E8=BD=B4=E4=B8=8B=E5=8E=8B=E6=97=B6=E4=BD=8E=E9=80=9F=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E9=98=B6=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.SkyLine/Commom/GlobalVar.cs | 11 ++ Rs.SkyLine/Flow/TurnoverFlow.cs | 47 ++++-- Rs.SkyLine/SysConfig/CommonConfig.Designer.cs | 143 ++++++++++++------ Rs.SkyLine/SysConfig/CommonConfig.cs | 10 ++ 4 files changed, 152 insertions(+), 59 deletions(-) diff --git a/Rs.SkyLine/Commom/GlobalVar.cs b/Rs.SkyLine/Commom/GlobalVar.cs index 3d9865a..dcf8303 100644 --- a/Rs.SkyLine/Commom/GlobalVar.cs +++ b/Rs.SkyLine/Commom/GlobalVar.cs @@ -366,5 +366,16 @@ namespace Rs.Framework return SysConfigParam.GetValue(nameof(DownCameraFlyRegrabNum)); } } + + /// + /// 保压低速 + /// + public static int PressLowSpeed + { + get + { + return SysConfigParam.GetValue (nameof(PressLowSpeed)); + } + } } } diff --git a/Rs.SkyLine/Flow/TurnoverFlow.cs b/Rs.SkyLine/Flow/TurnoverFlow.cs index 9af60a9..cd9f18a 100644 --- a/Rs.SkyLine/Flow/TurnoverFlow.cs +++ b/Rs.SkyLine/Flow/TurnoverFlow.cs @@ -36,10 +36,12 @@ namespace Rs.MotionPlat.Flow 测试位放料完成真空检测, 到测试保压位上方, 等待到测试保压位上方, - 到测试保压位下方, - 等待到测试保压位下方, + 到测试保压位下方1, + 等待到测试保压位下方1, + 到测试保压位下方2, + 等待到测试保压位下方2, + - 测试完成抬起, 等待测试完成抬起, 到测试取料位上方, @@ -371,25 +373,52 @@ namespace Rs.MotionPlat.Flow logInfo = $"已运动到测试保压位上方"; MessageQueue.Instance.Insert(logInfo); LogHelper.Debug(logInfo); - Step = ETurnoverFlowStep.到测试保压位下方; + Step = ETurnoverFlowStep.到测试保压位下方1; } break; - case ETurnoverFlowStep.到测试保压位下方: + case ETurnoverFlowStep.到测试保压位下方1: targetPos = SysConfigParam.GetValue("PressZ"); + targetPos = targetPos + SysConfigParam.GetValue("PressLowSpeedOffset"); errCode = AxisControl.PressZ.MovePos(targetPos, GlobalVar.WholeSpeed); if(errCode== Motion.ErrorCode.Ok) { - logInfo = $"到测试保压位下方"; + logInfo = $"到测试保压位下方1"; + MessageQueue.Instance.Insert(logInfo); + LogHelper.Debug(logInfo); + + Step = ETurnoverFlowStep.等待到测试保压位下方1; + } + break; + case ETurnoverFlowStep.等待到测试保压位下方1: + if (Ops.IsStop(AxisControl.PressZ)) + { + logInfo = $"已到测试保压位下方1 PressZ at:{Ops.GetCurPosition(AxisAlias.PressZ)}"; + MessageQueue.Instance.Insert(logInfo); + LogHelper.Debug(logInfo); + + //ClosePressVac(); + //Thread.Sleep(GlobalVar.PresseCloseVacSuctionDelaytime); + //loadOk = true; + Step = ETurnoverFlowStep.到测试保压位下方2; + } + break; + + case ETurnoverFlowStep.到测试保压位下方2: + targetPos = SysConfigParam.GetValue("PressZ"); + errCode = AxisControl.PressZ.MovePos(targetPos, GlobalVar.PressLowSpeed); + if (errCode == Motion.ErrorCode.Ok) + { + logInfo = $"到测试保压位下方2"; MessageQueue.Instance.Insert(logInfo); LogHelper.Debug(logInfo); - Step = ETurnoverFlowStep.等待到测试保压位下方; + Step = ETurnoverFlowStep.等待到测试保压位下方2; } break; - case ETurnoverFlowStep.等待到测试保压位下方: + case ETurnoverFlowStep.等待到测试保压位下方2: if (Ops.IsStop(AxisControl.PressZ)) { - logInfo = $"已到测试保压位下方 PressZ at:{Ops.GetCurPosition(AxisAlias.PressZ)}"; + logInfo = $"已到测试保压位下方2 PressZ at:{Ops.GetCurPosition(AxisAlias.PressZ)}"; MessageQueue.Instance.Insert(logInfo); LogHelper.Debug(logInfo); diff --git a/Rs.SkyLine/SysConfig/CommonConfig.Designer.cs b/Rs.SkyLine/SysConfig/CommonConfig.Designer.cs index 6a456f5..fbac14b 100644 --- a/Rs.SkyLine/SysConfig/CommonConfig.Designer.cs +++ b/Rs.SkyLine/SysConfig/CommonConfig.Designer.cs @@ -30,6 +30,8 @@ { this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.txtDownCameraFlyRegrabNum = new System.Windows.Forms.TextBox(); + this.label14 = new System.Windows.Forms.Label(); this.txtFlyGrabGain = new System.Windows.Forms.TextBox(); this.label13 = new System.Windows.Forms.Label(); this.txtFlyGrabExposureTime = new System.Windows.Forms.TextBox(); @@ -71,7 +73,7 @@ this.tbarFlyCameraSpeed = new System.Windows.Forms.TrackBar(); this.label7 = new System.Windows.Forms.Label(); this.tbarWholeSpeed = new System.Windows.Forms.TrackBar(); - this.label6 = new System.Windows.Forms.Label(); + this.lblTakeTraySpeed = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); this.lblFlyCameraSpeed = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); @@ -82,8 +84,9 @@ this.label27 = new System.Windows.Forms.Label(); this.txtControlCenterIP = new System.Windows.Forms.TextBox(); this.label26 = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.txtDownCameraFlyRegrabNum = new System.Windows.Forms.TextBox(); + this.label20 = new System.Windows.Forms.Label(); + this.lblPressLowSpeed = new System.Windows.Forms.Label(); + this.tbarPressLowSpeed = new System.Windows.Forms.TrackBar(); this.tableLayoutPanel1.SuspendLayout(); this.groupBox3.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -97,6 +100,7 @@ ((System.ComponentModel.ISupportInitialize)(this.tbarTakeTraySpeed)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbarFlyCameraSpeed)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbarWholeSpeed)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.tbarPressLowSpeed)).BeginInit(); this.SuspendLayout(); // // tableLayoutPanel1 @@ -134,6 +138,29 @@ this.groupBox3.TabStop = false; this.groupBox3.Text = "参数设定"; // + // txtDownCameraFlyRegrabNum + // + this.txtDownCameraFlyRegrabNum.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(16)))), ((int)(((byte)(16)))), ((int)(((byte)(16))))); + this.txtDownCameraFlyRegrabNum.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.txtDownCameraFlyRegrabNum.Font = new System.Drawing.Font("宋体", 9F); + this.txtDownCameraFlyRegrabNum.ForeColor = System.Drawing.Color.White; + this.txtDownCameraFlyRegrabNum.Location = new System.Drawing.Point(566, 38); + this.txtDownCameraFlyRegrabNum.Name = "txtDownCameraFlyRegrabNum"; + this.txtDownCameraFlyRegrabNum.Size = new System.Drawing.Size(83, 21); + this.txtDownCameraFlyRegrabNum.TabIndex = 42; + this.txtDownCameraFlyRegrabNum.Text = "5"; + this.txtDownCameraFlyRegrabNum.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtDownCameraFlyRegrabNum.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtSysParam_KeyUp); + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(465, 40); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(95, 12); + this.label14.TabIndex = 0; + this.label14.Text = "下相机重拍次数:"; + // // txtFlyGrabGain // this.txtFlyGrabGain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(16)))), ((int)(((byte)(16)))), ((int)(((byte)(16))))); @@ -466,13 +493,16 @@ this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.cboxUpCameraName); this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.tbarPressLowSpeed); this.groupBox1.Controls.Add(this.tbarTakeTraySpeed); this.groupBox1.Controls.Add(this.tbarFlyCameraSpeed); this.groupBox1.Controls.Add(this.label7); this.groupBox1.Controls.Add(this.tbarWholeSpeed); - this.groupBox1.Controls.Add(this.label6); + this.groupBox1.Controls.Add(this.lblPressLowSpeed); + this.groupBox1.Controls.Add(this.lblTakeTraySpeed); this.groupBox1.Controls.Add(this.label8); this.groupBox1.Controls.Add(this.lblFlyCameraSpeed); + this.groupBox1.Controls.Add(this.label20); this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.lblWholeSpeed); this.groupBox1.Controls.Add(this.label3); @@ -539,7 +569,7 @@ this.cboxCurRecipe.FormattingEnabled = true; this.cboxCurRecipe.Items.AddRange(new object[] { "Default"}); - this.cboxCurRecipe.Location = new System.Drawing.Point(112, 297); + this.cboxCurRecipe.Location = new System.Drawing.Point(112, 310); this.cboxCurRecipe.Name = "cboxCurRecipe"; this.cboxCurRecipe.Size = new System.Drawing.Size(348, 20); this.cboxCurRecipe.TabIndex = 1; @@ -547,7 +577,7 @@ // cboxDownScanCameraName // this.cboxDownScanCameraName.FormattingEnabled = true; - this.cboxDownScanCameraName.Location = new System.Drawing.Point(112, 260); + this.cboxDownScanCameraName.Location = new System.Drawing.Point(112, 273); this.cboxDownScanCameraName.Name = "cboxDownScanCameraName"; this.cboxDownScanCameraName.Size = new System.Drawing.Size(348, 20); this.cboxDownScanCameraName.TabIndex = 1; @@ -555,7 +585,7 @@ // cboxDownLocationCameraName // this.cboxDownLocationCameraName.FormattingEnabled = true; - this.cboxDownLocationCameraName.Location = new System.Drawing.Point(112, 221); + this.cboxDownLocationCameraName.Location = new System.Drawing.Point(112, 234); this.cboxDownLocationCameraName.Name = "cboxDownLocationCameraName"; this.cboxDownLocationCameraName.Size = new System.Drawing.Size(348, 20); this.cboxDownLocationCameraName.TabIndex = 1; @@ -563,7 +593,7 @@ // label4 // this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(39, 300); + this.label4.Location = new System.Drawing.Point(39, 313); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(35, 12); this.label4.TabIndex = 0; @@ -572,7 +602,7 @@ // cboxUpCameraName // this.cboxUpCameraName.FormattingEnabled = true; - this.cboxUpCameraName.Location = new System.Drawing.Point(112, 184); + this.cboxUpCameraName.Location = new System.Drawing.Point(112, 197); this.cboxUpCameraName.Name = "cboxUpCameraName"; this.cboxUpCameraName.Size = new System.Drawing.Size(348, 20); this.cboxUpCameraName.TabIndex = 1; @@ -580,7 +610,7 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(39, 263); + this.label2.Location = new System.Drawing.Point(39, 276); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(59, 12); this.label2.TabIndex = 0; @@ -598,7 +628,7 @@ this.tbarTakeTraySpeed.TabIndex = 1; this.tbarTakeTraySpeed.TickStyle = System.Windows.Forms.TickStyle.None; this.tbarTakeTraySpeed.Value = 1; - this.tbarTakeTraySpeed.ValueChanged += new System.EventHandler(this.tbarFlyCameraSpeed_ValueChanged); + this.tbarTakeTraySpeed.ValueChanged += new System.EventHandler(this.tbarTakeTraySpeed_ValueChanged); // // tbarFlyCameraSpeed // @@ -617,7 +647,7 @@ // label7 // this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(27, 224); + this.label7.Location = new System.Drawing.Point(27, 237); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(71, 12); this.label7.TabIndex = 0; @@ -637,19 +667,19 @@ this.tbarWholeSpeed.Value = 1; this.tbarWholeSpeed.ValueChanged += new System.EventHandler(this.tbarWholeSpeed_ValueChanged); // - // label6 + // lblTakeTraySpeed // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(490, 99); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(17, 12); - this.label6.TabIndex = 0; - this.label6.Text = "5%"; + this.lblTakeTraySpeed.AutoSize = true; + this.lblTakeTraySpeed.Location = new System.Drawing.Point(490, 99); + this.lblTakeTraySpeed.Name = "lblTakeTraySpeed"; + this.lblTakeTraySpeed.Size = new System.Drawing.Size(17, 12); + this.lblTakeTraySpeed.TabIndex = 0; + this.lblTakeTraySpeed.Text = "5%"; // // label8 // this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(51, 187); + this.label8.Location = new System.Drawing.Point(51, 200); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(47, 12); this.label8.TabIndex = 0; @@ -667,7 +697,7 @@ // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(12, 99); + this.label5.Location = new System.Drawing.Point(17, 99); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(83, 12); this.label5.TabIndex = 0; @@ -685,7 +715,7 @@ // label3 // this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(39, 69); + this.label3.Location = new System.Drawing.Point(41, 69); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(59, 12); this.label3.TabIndex = 0; @@ -694,7 +724,7 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(39, 32); + this.label1.Location = new System.Drawing.Point(41, 32); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(59, 12); this.label1.TabIndex = 0; @@ -706,7 +736,7 @@ this.txtControlCenterPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtControlCenterPort.Font = new System.Drawing.Font("宋体", 9F); this.txtControlCenterPort.ForeColor = System.Drawing.Color.White; - this.txtControlCenterPort.Location = new System.Drawing.Point(378, 146); + this.txtControlCenterPort.Location = new System.Drawing.Point(378, 159); this.txtControlCenterPort.Name = "txtControlCenterPort"; this.txtControlCenterPort.Size = new System.Drawing.Size(93, 21); this.txtControlCenterPort.TabIndex = 42; @@ -716,7 +746,7 @@ // label27 // this.label27.AutoSize = true; - this.label27.Location = new System.Drawing.Point(309, 148); + this.label27.Location = new System.Drawing.Point(309, 161); this.label27.Name = "label27"; this.label27.Size = new System.Drawing.Size(59, 12); this.label27.TabIndex = 0; @@ -728,7 +758,7 @@ this.txtControlCenterIP.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtControlCenterIP.Font = new System.Drawing.Font("宋体", 9F); this.txtControlCenterIP.ForeColor = System.Drawing.Color.White; - this.txtControlCenterIP.Location = new System.Drawing.Point(112, 144); + this.txtControlCenterIP.Location = new System.Drawing.Point(112, 157); this.txtControlCenterIP.Name = "txtControlCenterIP"; this.txtControlCenterIP.Size = new System.Drawing.Size(178, 21); this.txtControlCenterIP.TabIndex = 42; @@ -738,34 +768,43 @@ // label26 // this.label26.AutoSize = true; - this.label26.Location = new System.Drawing.Point(51, 146); + this.label26.Location = new System.Drawing.Point(51, 159); this.label26.Name = "label26"; this.label26.Size = new System.Drawing.Size(47, 12); this.label26.TabIndex = 0; this.label26.Text = "中控IP:"; // - // label14 - // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(465, 40); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(95, 12); - this.label14.TabIndex = 0; - this.label14.Text = "下相机重拍次数:"; - // - // txtDownCameraFlyRegrabNum - // - this.txtDownCameraFlyRegrabNum.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(16)))), ((int)(((byte)(16)))), ((int)(((byte)(16))))); - this.txtDownCameraFlyRegrabNum.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.txtDownCameraFlyRegrabNum.Font = new System.Drawing.Font("宋体", 9F); - this.txtDownCameraFlyRegrabNum.ForeColor = System.Drawing.Color.White; - this.txtDownCameraFlyRegrabNum.Location = new System.Drawing.Point(566, 38); - this.txtDownCameraFlyRegrabNum.Name = "txtDownCameraFlyRegrabNum"; - this.txtDownCameraFlyRegrabNum.Size = new System.Drawing.Size(83, 21); - this.txtDownCameraFlyRegrabNum.TabIndex = 42; - this.txtDownCameraFlyRegrabNum.Text = "5"; - this.txtDownCameraFlyRegrabNum.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - this.txtDownCameraFlyRegrabNum.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtSysParam_KeyUp); + // label20 + // + this.label20.AutoSize = true; + this.label20.Location = new System.Drawing.Point(47, 126); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(53, 12); + this.label20.TabIndex = 0; + this.label20.Text = "保压低速"; + // + // lblPressLowSpeed + // + this.lblPressLowSpeed.AutoSize = true; + this.lblPressLowSpeed.Location = new System.Drawing.Point(490, 126); + this.lblPressLowSpeed.Name = "lblPressLowSpeed"; + this.lblPressLowSpeed.Size = new System.Drawing.Size(17, 12); + this.lblPressLowSpeed.TabIndex = 0; + this.lblPressLowSpeed.Text = "5%"; + // + // tbarPressLowSpeed + // + this.tbarPressLowSpeed.AutoSize = false; + this.tbarPressLowSpeed.LargeChange = 1; + this.tbarPressLowSpeed.Location = new System.Drawing.Point(105, 122); + this.tbarPressLowSpeed.Maximum = 100; + this.tbarPressLowSpeed.Minimum = 1; + this.tbarPressLowSpeed.Name = "tbarPressLowSpeed"; + this.tbarPressLowSpeed.Size = new System.Drawing.Size(379, 24); + this.tbarPressLowSpeed.TabIndex = 1; + this.tbarPressLowSpeed.TickStyle = System.Windows.Forms.TickStyle.None; + this.tbarPressLowSpeed.Value = 1; + this.tbarPressLowSpeed.ValueChanged += new System.EventHandler(this.tbarPressLowSpeed_ValueChanged); // // CommonConfig // @@ -795,6 +834,7 @@ ((System.ComponentModel.ISupportInitialize)(this.tbarTakeTraySpeed)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbarFlyCameraSpeed)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbarWholeSpeed)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.tbarPressLowSpeed)).EndInit(); this.ResumeLayout(false); } @@ -823,7 +863,7 @@ private System.Windows.Forms.ComboBox cboxCurRecipe; private System.Windows.Forms.Label label4; private System.Windows.Forms.TrackBar tbarTakeTraySpeed; - private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label lblTakeTraySpeed; private System.Windows.Forms.Label label5; private System.Windows.Forms.CheckBox cboxCheckSafeEnable; private System.Windows.Forms.GroupBox groupBox2; @@ -857,5 +897,8 @@ private System.Windows.Forms.Label label12; private System.Windows.Forms.TextBox txtDownCameraFlyRegrabNum; private System.Windows.Forms.Label label14; + private System.Windows.Forms.TrackBar tbarPressLowSpeed; + private System.Windows.Forms.Label lblPressLowSpeed; + private System.Windows.Forms.Label label20; } } \ No newline at end of file diff --git a/Rs.SkyLine/SysConfig/CommonConfig.cs b/Rs.SkyLine/SysConfig/CommonConfig.cs index d60b506..9b754d8 100644 --- a/Rs.SkyLine/SysConfig/CommonConfig.cs +++ b/Rs.SkyLine/SysConfig/CommonConfig.cs @@ -107,6 +107,16 @@ namespace Rs.MotionPlat.SysConfig lblFlyCameraSpeed.Text = $"{tbarFlyCameraSpeed.Value}%"; } + private void tbarTakeTraySpeed_ValueChanged(object sender, EventArgs e) + { + lblTakeTraySpeed.Text = $"{tbarTakeTraySpeed.Value}%"; + } + + private void tbarPressLowSpeed_ValueChanged(object sender, EventArgs e) + { + lblPressLowSpeed.Text = $"{tbarPressLowSpeed.Value}%"; + } + public void txtSysParam_KeyUp(object sender, KeyEventArgs e) { UpdateSysParam((TextBox)sender);