增加对轴属性的复制、粘贴功能

master
lhiven 2 years ago
parent d843e6b467
commit 964a38ebb6

@ -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
//

@ -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<IAxis>.SetObject(m_axis);
}
private void label4_DoubleClick(object sender, EventArgs e)
{
IAxis axis = CopyObject<IAxis>.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();
}
}
}
}

Loading…
Cancel
Save