| | |
| | | using Bro.Common.Base; |
| | | using Bro.Common.Helper; |
| | | using Bro.Common.Interface; |
| | | using Bro.Common.Model; |
| | | using Bro.Process; |
| | | using System; |
| | |
| | | [Editor(typeof(ComplexCollectionEditor<KeyResult>), typeof(UITypeEditor))] |
| | | public List<KeyResult> KeyResultCollection { get; set; } = new List<KeyResult>(); |
| | | #endregion |
| | | |
| | | [Category("离线测试模式")] |
| | | [Description("true:设备离线模式 false:设备连线模式")] |
| | | [DisplayName("离线模式")] |
| | | public bool IsOfflineMode { get; set; } = false; |
| | | |
| | | [Category("显示配置")] |
| | | [Description("运行背景图片路径")] |
| | |
| | | //[Editor(typeof(FoldDialogEditor), typeof(UITypeEditor))] |
| | | //public string ResultDataSaveFolder { get; set; } = ""; |
| | | |
| | | [Category("图片保存配置")] |
| | | [Category("单键图片保存配置")] |
| | | [Description("单键图片保存配置")] |
| | | [TypeConverter(typeof(ComplexObjectConvert))] |
| | | [Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))] |
| | | public ImageSaveOption ImageSaveOption { get; set; } = new ImageSaveOption(); |
| | | |
| | | [Category("图片保存配置")] |
| | | [Category("单键图片保存配置")] |
| | | [Description("单键图片保存目录路径")] |
| | | [Editor(typeof(FoldDialogEditor), typeof(UITypeEditor))] |
| | | public string ImageSaveFolder { get; set; } = ""; |
| | |
| | | [DisplayName("多次验证开关")] |
| | | public bool IsDisableMultipleCheckTimes { get; set; } |
| | | |
| | | [Category("MES设置")] |
| | | [Description("键名和上传代码映射关系")] |
| | | [DisplayName("键名映射")] |
| | | [TypeConverter(typeof(CollectionCountConvert))] |
| | | [Editor(typeof(ComplexCollectionEditor<KeyCodeMap>), typeof(UITypeEditor))] |
| | | public List<KeyCodeMap> KeyCodeMappingCollection { get; set; } = new List<KeyCodeMap>(); |
| | | |
| | | [Category("MES设置")] |
| | | [Description("MES数据详细记录开关")] |
| | | [DisplayName("MES日志开关")] |
| | | public bool IsEnableMESLog { get; set; } = false; |
| | | |
| | | [Category("复位设置")] |
| | | [Description("大复位需要信号持续时间,复位信号持续超出该时间执行大复位,单位:s")] |
| | | [DisplayName("大复位持续信号长度")] |
| | | public int FullResetRequiredDuration { get; set; } = 3; |
| | | } |
| | | |
| | | [Device("Demostration", "Demo操作配置", EnumHelper.DeviceAttributeType.OperationConfig)] |
| | | public class DemostrationOperationConfig : OperationConfigBase, IHalconToolPath |
| | | { |
| | | [Category("组合操作配置集合")] |
| | | [Description("组合操作配置集合")] |
| | | [TypeConverter(typeof(CollectionCountConvert))] |
| | | [Editor(typeof(ComplexCollectionEditor<OperationCombination>), typeof(UITypeEditor))] |
| | | public List<OperationCombination> DemoOperations { get; set; } = new List<OperationCombination>(); |
| | | |
| | | public List<string> GetHalconToolPathList() |
| | | { |
| | | return DemoOperations.SelectMany(d => d.GetHalconToolPathList()).ToList(); |
| | | } |
| | | } |
| | | |
| | | [Device("ManualTest", "手动测试操作配置", EnumHelper.DeviceAttributeType.OperationConfig)] |
| | | public class ManualTestOperationConfig : OperationConfigBase |
| | | { |
| | | [Category("手动测试配置")] |
| | | [Description("手动测试重复次数")] |
| | | public int RepeatTimes { get; set; } = 1; |
| | | } |
| | | |
| | | public class OperationCombination : IComplexDisplay, IHalconToolPath |
| | | { |
| | | [Category("运动机构配置")] |
| | | [Description("运动机构配置")] |
| | | [TypeConverter(typeof(ComplexObjectConvert))] |
| | | [Editor(typeof(IOperationConfigByDeviceEditor), typeof(UITypeEditor))] |
| | | public DeviceOpBind MotionOp { get; set; } = new DeviceOpBind(); |
| | | |
| | | [Category("相机和操作配置")] |
| | | [Description("相机和操作配置")] |
| | | [TypeConverter(typeof(ComplexObjectConvert))] |
| | | [Editor(typeof(IOperationConfigByDeviceEditor), typeof(UITypeEditor))] |
| | | public DeviceOpBind CameraOp { get; set; } = new DeviceOpBind(); |
| | | |
| | | public string GetDisplayText() |
| | | { |
| | | return MotionOp.GetDisplayText() + "\t" + CameraOp.GetDisplayText(); |
| | | } |
| | | |
| | | public List<string> GetHalconToolPathList() |
| | | { |
| | | if (CameraOp.OpConfig is IHalconToolPath path) |
| | | { |
| | | return path.GetHalconToolPathList(); |
| | | } |
| | | else |
| | | { |
| | | return new List<string>(); |
| | | } |
| | | } |
| | | } |
| | | } |