| | |
| | | using Bro.Common.Base; |
| | | using Bro.Common.Helper; |
| | | using Bro.Common.Interface; |
| | | using Bro.Common.Model; |
| | | using Bro.Process; |
| | | using System; |
| | |
| | | public List<KeyResult> KeyResultCollection { get; set; } = new List<KeyResult>(); |
| | | #endregion |
| | | |
| | | [Category("背景图片设置")] |
| | | [Category("离线测试模式")] |
| | | [Description("true:设备离线模式 false:设备连线模式")] |
| | | [DisplayName("离线模式")] |
| | | public bool IsOfflineMode { get; set; } = false; |
| | | |
| | | [Category("显示配置")] |
| | | [Description("运行背景图片路径")] |
| | | [Editor(typeof(FileDialogEditor), typeof(UITypeEditor))] |
| | | [DisplayName("背景图片")] |
| | | public string BackgroundImagePath { get; set; } |
| | | |
| | | [Category("显示配置")] |
| | | [Description("键盘关键键位布局显示")] |
| | | [TypeConverter(typeof(CollectionCountConvert))] |
| | | [Editor(typeof(ComplexCollectionEditor<KeyLocation>), typeof(UITypeEditor))] |
| | | [DisplayName("键位显示")] |
| | | public List<KeyLocation> KeyLocationCollection { get; set; } = new List<KeyLocation>(); |
| | | |
| | | [Category("检测设置")] |
| | | [Description("拍摄点位设置集合")] |
| | |
| | | [Editor(typeof(ComplexCollectionEditor<MeasurementUnit>), typeof(UITypeEditor))] |
| | | public List<MeasurementUnit> MeasurementUnitCollection { get; set; } = new List<MeasurementUnit>(); |
| | | |
| | | [Category("检测设置")] |
| | | [Description("平面补偿值")] |
| | | [DisplayName("4.平面补偿值")] |
| | | public double PlanCompensation { get; set; } |
| | | |
| | | [Category("检测设置")] |
| | | [Description("数据精度设置")] |
| | | [DisplayName("5.数据精度位数")] |
| | | public int Precision { get; set; } = 3; |
| | | |
| | | //[Category("检测设置")] |
| | | //[DisplayName("结果数据保存路径")] |
| | | //[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; } = ""; |
| | |
| | | |
| | | [Category("MES设置")] |
| | | [Description("true:数据上传至MES false:数据不上传")] |
| | | [DisplayName("MES上传启用")] |
| | | [ReadOnly(true)] |
| | | public bool IsEnableMESUpload { get; set; } = false; |
| | | |
| | | [Category("MES设置")] |
| | | [Description("true:检测用户登录 false:不强制用户登录")] |
| | | [DisplayName("用户登录检测")] |
| | | [Browsable(false)] |
| | | public bool IsUserLoginCheck { get; set; } = false; |
| | | |
| | | [Category("MES设置")] |
| | | [Description("MES上传路径")] |
| | | [DisplayName("MES上传路径")] |
| | | public string MESURL { get; set; } = ""; |
| | | |
| | | [Category("MES设置")] |
| | | [Description("站点编码")] |
| | | [DisplayName("站点编码")] |
| | | public string StationCode { get; set; } = ""; |
| | | |
| | | [Category("MES设置")] |
| | | [Description("Project编码")] |
| | | [DisplayName("Project编码")] |
| | | public string ProjectCode { get; set; } = ""; |
| | | |
| | | [Category("MES设置")] |
| | | [Description("线体编码")] |
| | | [DisplayName("线体编码")] |
| | | public string LineCode { get; set; } = ""; |
| | | |
| | | [Category("MES设置")] |
| | | [Description("验证当前允许新增次数[FALSE=不验证 TRUE=限制两次以下(包含两次)]")] |
| | | [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; |
| | | } |
| | | |
| | | [Device("KeyUnitGenerate", "单键生成配置", EnumHelper.DeviceAttributeType.OperationConfig)] |
| | | public class KeyUnitGenerateConfig : OperationConfigBase |
| | | { |
| | | [Category("键名配置")] |
| | | [Description("开始键")] |
| | | [TypeConverter(typeof(KeyNameDictConverter))] |
| | | public string StartKey { get; set; } |
| | | |
| | | [Category("键名配置")] |
| | | [Description("结束键")] |
| | | [TypeConverter(typeof(KeyNameDictConverter))] |
| | | public string EndKey { get; set; } |
| | | |
| | | [Category("图像来源")] |
| | | [Description("拍照点位")] |
| | | [TypeConverter(typeof(SnapshotPointConverter))] |
| | | public string SnapshotPointId { get; set; } |
| | | |
| | | [Category("算法配置")] |
| | | [Description("单键检测配置算法类型")] |
| | | [TypeConverter(typeof(KeyAlgorithemConverter))] |
| | | public string KeyAlgorithemId { get; set; } |
| | | |
| | | [Category("算法配置")] |
| | | [Description("单键检测配置结果类型")] |
| | | [TypeConverter(typeof(KeyResultConverter))] |
| | | public string KeyResultId { get; set; } |
| | | } |
| | | |
| | | 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>(); |
| | | } |
| | | } |
| | | } |
| | | } |