From 964a38ebb607a39ca87dd882e5d5debf09903600 Mon Sep 17 00:00:00 2001 From: lhiven <236881222@qq.com> Date: Fri, 11 Aug 2023 08:18:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9=E8=BD=B4=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E7=9A=84=E5=A4=8D=E5=88=B6=E3=80=81=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.Controls/AxisProperty.Designer.cs | 2 ++ Rs.Controls/AxisProperty.cs | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/Rs.Controls/AxisProperty.Designer.cs b/Rs.Controls/AxisProperty.Designer.cs index 284d23b..10b1297 100644 --- a/Rs.Controls/AxisProperty.Designer.cs +++ b/Rs.Controls/AxisProperty.Designer.cs @@ -190,6 +190,7 @@ this.label4.Size = new System.Drawing.Size(35, 12); this.label4.TabIndex = 0; this.label4.Text = "轴号:"; + this.label4.DoubleClick += new System.EventHandler(this.label4_DoubleClick); // // txtAxisName // @@ -206,6 +207,7 @@ this.label3.Size = new System.Drawing.Size(35, 12); this.label3.TabIndex = 0; this.label3.Text = "别名:"; + this.label3.DoubleClick += new System.EventHandler(this.label3_DoubleClick); // // txtCardId // diff --git a/Rs.Controls/AxisProperty.cs b/Rs.Controls/AxisProperty.cs index 9a6c543..5ffcf37 100644 --- a/Rs.Controls/AxisProperty.cs +++ b/Rs.Controls/AxisProperty.cs @@ -11,6 +11,9 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using Rs.Framework; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; namespace Rs.MotionPlat { @@ -152,5 +155,29 @@ namespace Rs.MotionPlat } } } + + private void label3_DoubleClick(object sender, EventArgs e) + { + CopyObject.SetObject(m_axis); + } + + private void label4_DoubleClick(object sender, EventArgs e) + { + IAxis axis = CopyObject.GetObject(); + if (axis != null) + { + //深度COPY + foreach(PropertyInfo pi in axis.Config.GetType().GetProperties()) + { + Attribute attr = pi.GetCustomAttribute(typeof(CopyAttribute)); + if(attr!=null) + { + pi.SetValue(m_axis.Config, pi.GetValue(axis.Config, null)); + } + } + DataBinding(); + } + + } } }