From 02bcaef4c4276c7d99b450b920eaebd1d78ba414 Mon Sep 17 00:00:00 2001 From: lhiven Date: Wed, 11 Sep 2024 16:52:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BA=E9=AB=98=E5=8D=A1=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8D=95=E8=8E=B7=E6=B2=BF=E7=9A=84=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GugaoPulseAxisProperty.Designer.cs | 33 +- Rs.Controls/GugaoPulseAxisProperty.resx | 446 +++++------------- Rs.Motion/Base/Config/AxisConfig.cs | 5 + Rs.Motion/GugaoPulse/GugaoPulseAxis.cs | 2 +- 4 files changed, 134 insertions(+), 352 deletions(-) diff --git a/Rs.Controls/GugaoPulseAxisProperty.Designer.cs b/Rs.Controls/GugaoPulseAxisProperty.Designer.cs index 7f3bc50..4bf36fb 100644 --- a/Rs.Controls/GugaoPulseAxisProperty.Designer.cs +++ b/Rs.Controls/GugaoPulseAxisProperty.Designer.cs @@ -31,8 +31,6 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GugaoPulseAxisProperty)); this.btnSave = new System.Windows.Forms.Button(); this.gboxCardProperty = new System.Windows.Forms.GroupBox(); - this.txtCardMc = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); this.txtAxisId = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); this.txtAxisName = new System.Windows.Forms.TextBox(); @@ -48,6 +46,8 @@ this.txtHomeOffset = new System.Windows.Forms.TextBox(); this.label23 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label(); + this.txtCaptureEdge = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); this.txtNeedGoHome = new System.Windows.Forms.TextBox(); this.label51 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); @@ -104,8 +104,6 @@ // // gboxCardProperty // - this.gboxCardProperty.Controls.Add(this.txtCardMc); - this.gboxCardProperty.Controls.Add(this.label2); this.gboxCardProperty.Controls.Add(this.txtAxisId); this.gboxCardProperty.Controls.Add(this.label4); this.gboxCardProperty.Controls.Add(this.txtAxisName); @@ -116,17 +114,6 @@ this.gboxCardProperty.Name = "gboxCardProperty"; this.gboxCardProperty.TabStop = false; // - // txtCardMc - // - resources.ApplyResources(this.txtCardMc, "txtCardMc"); - this.txtCardMc.Name = "txtCardMc"; - this.txtCardMc.ReadOnly = true; - // - // label2 - // - resources.ApplyResources(this.label2, "label2"); - this.label2.Name = "label2"; - // // txtAxisId // resources.ApplyResources(this.txtAxisId, "txtAxisId"); @@ -171,6 +158,8 @@ this.gboxHomePro.Controls.Add(this.txtHomeOffset); this.gboxHomePro.Controls.Add(this.label23); this.gboxHomePro.Controls.Add(this.label12); + this.gboxHomePro.Controls.Add(this.txtCaptureEdge); + this.gboxHomePro.Controls.Add(this.label5); this.gboxHomePro.Controls.Add(this.txtNeedGoHome); this.gboxHomePro.Controls.Add(this.label51); this.gboxHomePro.Controls.Add(this.label10); @@ -218,6 +207,16 @@ resources.ApplyResources(this.label12, "label12"); this.label12.Name = "label12"; // + // txtCaptureEdge + // + resources.ApplyResources(this.txtCaptureEdge, "txtCaptureEdge"); + this.txtCaptureEdge.Name = "txtCaptureEdge"; + // + // label5 + // + resources.ApplyResources(this.label5, "label5"); + this.label5.Name = "label5"; + // // txtNeedGoHome // resources.ApplyResources(this.txtNeedGoHome, "txtNeedGoHome"); @@ -491,8 +490,6 @@ private System.Windows.Forms.Button btnSave; private System.Windows.Forms.GroupBox gboxCardProperty; - private System.Windows.Forms.TextBox txtCardMc; - private System.Windows.Forms.Label label2; private System.Windows.Forms.TextBox txtAxisId; private System.Windows.Forms.Label label4; private System.Windows.Forms.TextBox txtAxisName; @@ -550,5 +547,7 @@ private System.Windows.Forms.Label label9; private System.Windows.Forms.TextBox txtNeedGoHome; private System.Windows.Forms.Label label51; + private System.Windows.Forms.TextBox txtCaptureEdge; + private System.Windows.Forms.Label label5; } } diff --git a/Rs.Controls/GugaoPulseAxisProperty.resx b/Rs.Controls/GugaoPulseAxisProperty.resx index ef89a5e..b9a0fd7 100644 --- a/Rs.Controls/GugaoPulseAxisProperty.resx +++ b/Rs.Controls/GugaoPulseAxisProperty.resx @@ -126,13 +126,13 @@ - 宋体, 14pt + 宋体, 20pt 0, 0 - 596, 62 + 596, 74 @@ -153,177 +153,6 @@ 3 - - txtCardMc - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxCardProperty - - - 0 - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxCardProperty - - - 1 - - - txtAxisId - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxCardProperty - - - 2 - - - label4 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxCardProperty - - - 3 - - - txtAxisName - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxCardProperty - - - 4 - - - label3 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxCardProperty - - - 5 - - - txtCardId - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxCardProperty - - - 6 - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxCardProperty - - - 7 - - - Top - - - 0, 62 - - - 596, 44 - - - 5 - - - 卡属性 - - - gboxCardProperty - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - 436, 43 - - - 100, 21 - - - 1 - - - txtCardMc - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxCardProperty - - - 0 - - - True - - - 378, 46 - - - 23, 12 - - - 0 - - - Mc: - - - label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxCardProperty - - - 1 - 436, 15 @@ -343,7 +172,7 @@ gboxCardProperty - 2 + 0 True @@ -370,7 +199,7 @@ gboxCardProperty - 3 + 1 159, 15 @@ -391,7 +220,7 @@ gboxCardProperty - 4 + 2 True @@ -418,7 +247,7 @@ gboxCardProperty - 5 + 3 159, 49 @@ -439,7 +268,7 @@ gboxCardProperty - 6 + 4 True @@ -466,166 +295,34 @@ gboxCardProperty - 7 - - - txtHomeDir - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxHomePro - - - 0 - - - txtHomeMode - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxHomePro - - - 1 - - - label6 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxHomePro - - - 2 - - - txtHomeSpeed - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxHomePro - - - 3 - - - label11 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxHomePro - - - 4 - - - txtHomeOffset - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxHomePro - - 5 - - label23 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxHomePro - - - 6 - - - label12 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxHomePro - - - 7 - - - txtNeedGoHome - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxHomePro - - - 8 - - - label51 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxHomePro - - - 9 - - - label10 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - gboxHomePro - - - 10 - - + Top - - 0, 106 + + 0, 74 - - 596, 132 + + 596, 72 - - 6 + + 5 - - 回原属性 + + 卡属性 - - gboxHomePro + + gboxCardProperty - + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - - 1 + + 2 159, 18 @@ -673,16 +370,16 @@ True - 374, 20 + 353, 21 - 53, 12 + 59, 12 0 - 回原模式 + 回原模式: label6 @@ -795,8 +492,11 @@ True + + NoControl + - 348, 57 + 344, 56 71, 12 @@ -819,6 +519,57 @@ 7 + + 436, 88 + + + 100, 21 + + + 1 + + + txtCaptureEdge + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gboxHomePro + + + 8 + + + True + + + NoControl + + + 365, 94 + + + 47, 12 + + + 0 + + + 捕获沿: + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + gboxHomePro + + + 9 + 159, 94 @@ -838,7 +589,7 @@ gboxHomePro - 8 + 10 True @@ -865,7 +616,7 @@ gboxHomePro - 9 + 11 True @@ -892,7 +643,34 @@ gboxHomePro - 10 + 12 + + + Top + + + 0, 146 + + + 596, 129 + + + 6 + + + 回原属性 + + + gboxHomePro + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 True @@ -1837,10 +1615,10 @@ Fill - 0, 238 + 0, 275 - 596, 663 + 596, 626 7 diff --git a/Rs.Motion/Base/Config/AxisConfig.cs b/Rs.Motion/Base/Config/AxisConfig.cs index 4b47b13..b7b4cb5 100644 --- a/Rs.Motion/Base/Config/AxisConfig.cs +++ b/Rs.Motion/Base/Config/AxisConfig.cs @@ -55,6 +55,11 @@ namespace Rs.Motion.Base.Config [CopyAttribute] public ushort HomeOrgLogic { get; set; } = 0; + [XmlElement] + [CommonPropertyDescription("设置捕获沿:0-下降沿,1-上升沿")] + [CopyAttribute] + public ushort CaptureEdge { get; set; } = 0; + [XmlElement] [LeisaiPropertyDescription("回零速度模式: \r\n0:低速回零 \r\n1:高速回零")] [ZTMPropertyDescription("不用此属性")] diff --git a/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs b/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs index fafea77..5a4b307 100644 --- a/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs +++ b/Rs.Motion/GugaoPulse/GugaoPulseAxis.cs @@ -808,7 +808,7 @@ namespace Rs.Motion.GugaoPulse homePrm.homeOffset = (int)dfHome_offset; homePrm.searchHomeDistance = 0; homePrm.searchIndexDistance = 0; - homePrm.edge = (short)(Config.HomeOrgLogic == 0 ? 1 : 0); + homePrm.edge = (short)(Config.CaptureEdge); apiResult = mc_pulse.GT_GoHome((short)Config.CardId, (short)Config.AxisId, ref homePrm);