| | |
| | | using Bro.Common.Base; |
| | | using Bro.Common.Helper; |
| | | using Bro.Common.Model; |
| | | using Bro.Common.Model.Interface; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | namespace A032.Process.Calibration |
| | | { |
| | | [Device("CalibrationCollection", "多步标定配置", EnumHelper.DeviceAttributeType.OperationConfig)] |
| | | public class CalibrationConfigCollection : OperationConfigBase |
| | | public class CalibrationConfigCollection : OperationConfigBase, IComplexDisplay,IHalconToolPath |
| | | { |
| | | [Category("关联配置")] |
| | | [Description("位置代码")] |
| | | [TypeConverter(typeof(PositionCodeConverter))] |
| | | public string PositionCode { get; set; } |
| | | [Description("位置序号")] |
| | | [TypeConverter(typeof(PositionNoConverter))] |
| | | public int PositionNo { get; set; } |
| | | |
| | | [Category("关联配置")] |
| | | [Description("适用相机编号")] |
| | |
| | | [TypeConverter(typeof(CollectionCountConvert))] |
| | | [Editor(typeof(ComplexCollectionEditor<CalibrationConfig>), typeof(UITypeEditor))] |
| | | public List<CalibrationConfig> Configs { get; set; } = new List<CalibrationConfig>(); |
| | | |
| | | [Category("显示配置")] |
| | | [Description("是否显示UI,从UI启动标定")] |
| | | public bool IsStartedFromUI { get; set; } = false; |
| | | |
| | | public string GetDisplayText() |
| | | { |
| | | return $"PositionNo:{PositionNo}; Configs:{Configs.Count}"; |
| | | } |
| | | |
| | | public List<string> GetHalconToolPathList() |
| | | { |
| | | return Configs.SelectMany(c => c.GetHalconToolPathList()).ToList(); |
| | | } |
| | | } |
| | | |
| | | //[Device("Calibration", "单步标定配置", EnumHelper.DeviceAttributeType.OperationConfig)] |
| | | public class CalibrationConfig : OperationConfigBase, IComplexDisplay, INotifyPropertyChanged |
| | | public class CalibrationConfig : OperationConfigBase, IComplexDisplay, INotifyPropertyChanged, IHalconToolPath |
| | | { |
| | | private Bitmap image = null; |
| | | [JsonIgnore] |
| | |
| | | [Description("图像标准点坐标")] |
| | | [TypeConverter(typeof(ComplexObjectConvert))] |
| | | [Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))] |
| | | public CustomizedPoint ImageMarkPoint { get; set; } = new CustomizedPoint(); |
| | | public CustomizedPointWithAngle ImageMarkPoint { get; set; } = new CustomizedPointWithAngle(); |
| | | |
| | | [Category("相机配置")] |
| | | [Description("相机操作配置")] |
| | |
| | | { |
| | | return JsonConvert.SerializeObject(this); |
| | | } |
| | | |
| | | public List<string> GetHalconToolPathList() |
| | | { |
| | | return CameraOpConfig.GetHalconToolPathList(); |
| | | } |
| | | } |
| | | } |