| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- using System.ComponentModel;
- using Plugins.Motion.Core;
- using PropertyGridLib.Attributes;
- using PropertyGridLib.Controls;
- using TeamAAS.FlowEditor.Plugins;
- using TeamAAS.FlowEngine.FormulaData;
- namespace Plugins.Motion.Models
- {
- [System.Serializable]
- public class MotionAxisModel : BasePluginModel
- {
- [DisplayName("运动卡")]
- [Description("从已配置的运动卡中选择")]
- [Category("I.设备")]
- [TypeConverter(typeof(MotionCardNameConverter))]
- public string MotionCardName { get; set; } = "";
- [DisplayName("轴号")]
- [Description("轴号从 0 开始;使能/下使能/停止可用 -1 表示全部轴")]
- [Category("I.设备")]
- public int AxisNo { get; set; } = 0;
- [DisplayName("未连接时自动连接")]
- [Description("运动卡未连接时先尝试 Open")]
- [Category("II.执行选项")]
- public bool AutoConnect { get; set; } = true;
- }
- [System.Serializable]
- public class MotionEnableModel : MotionAxisModel { }
- [System.Serializable]
- public class MotionDisableModel : MotionAxisModel { }
- [System.Serializable]
- public class MotionStopModel : MotionAxisModel
- {
- [DisplayName("急停")]
- [Description("勾选后对整卡急停;不勾选则平滑停止指定轴")]
- [Category("II.执行选项")]
- public bool Emergency { get; set; } = false;
- }
- [System.Serializable]
- public class MotionWaitModel : MotionAxisModel
- {
- [DisplayName("未使能时自动使能")]
- [Description("当前轴未使能时,先自动使能再执行本节点;不勾选则未使能直接失败")]
- [Category("II.执行选项")]
- public bool AutoEnable { get; set; } = false;
- [DisplayName("等待超时(ms)")]
- [Description("等待运动完成的超时时间,0 表示不限时(仍受节点 TimeoutMs 约束)")]
- [Category("II.执行选项")]
- public int WaitTimeoutMs { get; set; } = 10000;
- }
- [System.Serializable]
- public class MotionHomeModel : MotionWaitModel
- {
- [DisplayName("回零模式")]
- [Description("0=Default,1=限位,2=Home 开关,3=Z 相")]
- [Category("III.运动参数")]
- public int HomeMode { get; set; } = 0;
- }
- [System.Serializable]
- public class MotionMoveAbsModel : MotionWaitModel
- {
- [DisplayName("目标位置")]
- [Description("绝对定位目标,可用公式绑定视觉补偿")]
- [Category("III.运动参数")]
- [FormulaEditor(typeof(PluginDataProvider))]
- public FormulaBound<double> TargetPosition { get; set; } = new FormulaBound<double>(0);
- [DisplayName("速度")]
- [Description("定位速度")]
- [Category("III.运动参数")]
- [FormulaEditor(typeof(PluginDataProvider))]
- public FormulaBound<double> Velocity { get; set; } = new FormulaBound<double>(100);
- [DisplayName("到位容差")]
- [Description("到位后实际位置与目标的允许偏差")]
- [Category("III.运动参数")]
- public double InPositionTolerance { get; set; } = 0.01;
- }
- [System.Serializable]
- public class MotionMoveRelModel : MotionWaitModel
- {
- [DisplayName("相对距离")]
- [Description("相对当前实际位置的位移,可用公式绑定")]
- [Category("III.运动参数")]
- [FormulaEditor(typeof(PluginDataProvider))]
- public FormulaBound<double> Distance { get; set; } = new FormulaBound<double>(10);
- [DisplayName("速度")]
- [Description("定位速度")]
- [Category("III.运动参数")]
- [FormulaEditor(typeof(PluginDataProvider))]
- public FormulaBound<double> Velocity { get; set; } = new FormulaBound<double>(100);
- [DisplayName("到位容差")]
- [Description("到位后实际位移与指令的允许偏差")]
- [Category("III.运动参数")]
- public double InPositionTolerance { get; set; } = 0.01;
- }
- }
|