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(); + } + + } } }