| | |
| | | public abstract void ResetAlarm(); |
| | | public abstract ResponseMessage Run(IOperationConfig config); |
| | | |
| | | public void ExcuteMonitorInvoke(DateTime dateTime, string invokeDevice, IDevice device, IMonitorSet monitorSet) |
| | | public virtual void ExcuteMonitorInvoke(DateTime dateTime, string invokeDevice, IDevice device, IMonitorSet monitorSet) |
| | | { |
| | | OnMonitorInvoke?.BeginInvoke(dateTime, invokeDevice, device, monitorSet, null, null); |
| | | OnMonitorInvoke?.BeginInvoke(dateTime, invokeDevice, device, monitorSet, OnMethodInvoked, null); |
| | | } |
| | | |
| | | public void ExcuteMonitorAlarm(DateTime dateTime, IDevice device, IWarningSet warningSet) |
| | | public abstract void OnMethodInvoked(IAsyncResult ar); |
| | | |
| | | public virtual void ExcuteMonitorAlarm(DateTime dateTime, IDevice device, IWarningSet warningSet) |
| | | { |
| | | OnMonitorAlarm?.BeginInvoke(dateTime, device, warningSet, null, null); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// IO的监听值 |
| | | /// </summary> |
| | | public List<IOItem> MonitorValues { get; set; } = new List<IOItem>(); |
| | | |
| | | public abstract void WriteOutput(short cardNum, short index, IOValue value); |
| | | /// <summary> |
| | | /// 轴的运动状态值 |
| | | /// </summary> |
| | | public List<AxisMovingStatus> AxisMovingOptionValues { get; set; } = new List<AxisMovingStatus>(); |
| | | |
| | | public abstract void WriteOutput(short index, IOValue value); |
| | | } |
| | | |
| | | public class MotionCardInitialConfigBase : InitialConfigBase, IMonitorConfig |
| | |
| | | public List<IMonitorSet> GetAllMonitorSet() |
| | | { |
| | | WarningSetCollection.ForEach(m => m.Source = this.Name); |
| | | |
| | | MonitorSetCollection.ForEach(m => m.SourceDevice = this.Id); |
| | | return MonitorSetCollection; |
| | | } |
| | |
| | | [Device("MotionCardBase", "板卡操作配置基类", EnumHelper.DeviceAttributeType.OperationConfig)] |
| | | public class MotionCardOperationConfigBase : OperationConfigBase, IComplexDisplay |
| | | { |
| | | [Category("板卡操作")] |
| | | [Description("板卡操作配置基类集合,依次执行")] |
| | | [TypeConverter(typeof(CollectionCountConvert))] |
| | | [Editor(typeof(ComplexCollectionEditor<MotionCardOperationSet>), typeof(UITypeEditor))] |
| | | public List<MotionCardOperationSet> OperationCollection { get; set; } = new List<MotionCardOperationSet>(); |
| | | |
| | | public string GetDisplayText() |
| | | { |
| | | return string.Join(" ", OperationCollection.Select(u => u.GetDisplayText())); |
| | | } |
| | | } |
| | | |
| | | [Device("MotionOperationSet", "运动操作配置基类", EnumHelper.DeviceAttributeType.OperationConfig)] |
| | | public class MotionCardOperationSet : IComplexDisplay |
| | | { |
| | | [Category("IO操作配置")] |
| | | [DisplayName("IO预检查定义集合")] |
| | | [Description("IO预检查定义集合")] |
| | | [TypeConverter(typeof(CollectionCountConvert))] |
| | | [Editor(typeof(IORefrenceItemCollectionEditor), typeof(UITypeEditor))] |
| | | public List<IORefrenceItem> PreCheckIOCollection { get; set; } = new List<IORefrenceItem>(); |
| | | |
| | | [Category("IO操作配置")] |
| | | [Description("超时设置,单位:ms")] |
| | | [DisplayName("IO预检查超时")] |
| | | public int PreCheckIOTimeout { get; set; } = 0; |
| | | |
| | | [Category("IO操作配置")] |
| | | [DisplayName("IO输出定义集合")] |
| | |
| | | [Description("IO确认定义集合")] |
| | | [TypeConverter(typeof(CollectionCountConvert))] |
| | | public List<IORefrenceItem> IOConfirmCollection { get; set; } = new List<IORefrenceItem>(); |
| | | [Category("IO操作配置")] |
| | | [Description("超时设置,单位:ms")] |
| | | [DisplayName("IO确认超时")] |
| | | public int IOConfirmTimeout { get; set; } = 0; |
| | | |
| | | //[Category("板卡运动配置")] |
| | | //[DisplayName("运动配置集合")] |
| | | //[Description("MovingOps:运动配置集合")] |
| | | //[TypeConverter(typeof(CollectionCountConvert))] |
| | | //[Editor(typeof(ComplexCollectionEditor<MovingOption>), typeof(UITypeEditor))] |
| | | //public List<MovingOption> MovingOps { get; set; } = new List<MovingOption>(); |
| | | [Category("板卡运动配置")] |
| | | [DisplayName("运动配置集合")] |
| | | [Description("MovingOps:运动配置集合")] |
| | | [TypeConverter(typeof(CollectionCountConvert))] |
| | | [Editor(typeof(ComplexCollectionEditor<MovingOption>), typeof(UITypeEditor))] |
| | | public List<MovingOption> MovingOps { get; set; } = new List<MovingOption>(); |
| | | [TypeConverter(typeof(ComplexObjectConvert))] |
| | | [Editor(typeof(PropertyObjectEditor),typeof(UITypeEditor))] |
| | | public MotionOperationCollection MotionOperationCollection { get; set; } = new MotionOperationCollection(); |
| | | |
| | | |
| | | public string GetDisplayText() |
| | | { |
| | |
| | | } |
| | | |
| | | string moving = ""; |
| | | MovingOps.ForEach(i => |
| | | { |
| | | moving += i.GetDisplayText() + " "; |
| | | }); |
| | | if (moving != "") |
| | | { |
| | | moving = " 运动:" + moving; |
| | | } |
| | | //MovingOps.ForEach(i => |
| | | //{ |
| | | // moving += i.GetDisplayText() + " "; |
| | | //}); |
| | | //if (moving != "") |
| | | //{ |
| | | // moving = " 运动:" + moving; |
| | | //} |
| | | |
| | | return (preCheck + output + confirm + moving).Trim(); |
| | | } |
| | | } |
| | | |
| | | [Device("MotionCardOperationConfigCollection", "板卡操作配置基类集合", EnumHelper.DeviceAttributeType.OperationConfig)] |
| | | public class MotionCardOperationConfigCollection : OperationConfigBase |
| | | public class MotionOperationCollection : OperationConfigBase, IComplexDisplay |
| | | { |
| | | [Category("复位操作")] |
| | | [Description("板卡操作配置基类集合,依次执行")] |
| | | [Category("运动配置")] |
| | | [DisplayName("运动配置集合")] |
| | | [Description("MovingOps:运动配置集合")] |
| | | [TypeConverter(typeof(CollectionCountConvert))] |
| | | [Editor(typeof(ComplexCollectionEditor<MotionCardOperationConfigBase>), typeof(UITypeEditor))] |
| | | public List<MotionCardOperationConfigBase> MotionCardOpsCollection { get; set; } = new List<MotionCardOperationConfigBase>(); |
| | | [Editor(typeof(ComplexCollectionEditor<MovingOption>), typeof(UITypeEditor))] |
| | | public List<MovingOption> MovingOps { get; set; } = new List<MovingOption>(); |
| | | |
| | | public string GetDisplayText() |
| | | { |
| | | return $"{string.Join(" ", MovingOps.Select(u => u.GetDisplayText()))}"; |
| | | } |
| | | } |
| | | |
| | | //[Device("MotionCardOperationConfigCollection", "板卡操作配置基类集合", EnumHelper.DeviceAttributeType.OperationConfig)] |
| | | //public class MotionCardOperationConfigCollection : OperationConfigBase |
| | | //{ |
| | | // [Category("复位操作")] |
| | | // [Description("板卡操作配置基类集合,依次执行")] |
| | | // [TypeConverter(typeof(CollectionCountConvert))] |
| | | // [Editor(typeof(ComplexCollectionEditor<MotionCardOperationConfigBase>), typeof(UITypeEditor))] |
| | | // public List<MotionCardOperationConfigBase> MotionCardOpsCollection { get; set; } = new List<MotionCardOperationConfigBase>(); |
| | | //} |
| | | |
| | | public class IORefrenceItemCollectionEditor : CollectionEditor |
| | | { |
| | | protected override CollectionForm CreateCollectionForm() |