patrick
2019-12-10 1c4426810c71eead57084be8a18ade8d314dd8c4
src/A032.Process/Calibration/CalibrationConfig.cs
@@ -1,6 +1,7 @@
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;
@@ -14,10 +15,10 @@
namespace A032.Process.Calibration
{
    [Device("CalibrationCollection", "多步标定配置", EnumHelper.DeviceAttributeType.OperationConfig)]
    public class CalibrationConfigCollection : OperationConfigBase
    public class CalibrationConfigCollection : OperationConfigBase, IComplexDisplay,IHalconToolPath
    {
        [Category("关联配置")]
        [Description("位置代码")]
        [Description("位置序号")]
        [TypeConverter(typeof(PositionCodeConverter))]
        public string PositionCode { get; set; }
@@ -31,10 +32,24 @@
        [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:{PositionCode}; 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]
@@ -63,7 +78,7 @@
        [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("相机操作配置")]
@@ -71,11 +86,17 @@
        [Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))]
        public HalconRelatedCameraOprerationConfigBase CameraOpConfig { get; set; } = new HalconRelatedCameraOprerationConfigBase();
        //[Category("运动平台设置")]
        //[Description("平台当前坐标")]
        //[TypeConverter(typeof(ComplexObjectConvert))]
        //[Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))]
        //public CustomizedPoint CurrentPlatPoint { get; set; } = new CustomizedPoint();
        [Category("运动平台设置")]
        [Description("平台当前坐标")]
        [Description("机器人运动坐标")]
        [TypeConverter(typeof(ComplexObjectConvert))]
        [Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))]
        public CustomizedPoint CurrentPlatPoint { get; set; } = new CustomizedPoint();
        public RobotPoint PlatPoint { get; set; } = new RobotPoint();
        public event PropertyChangedEventHandler PropertyChanged;
@@ -83,5 +104,10 @@
        {
            return JsonConvert.SerializeObject(this);
        }
        public List<string> GetHalconToolPathList()
        {
            return CameraOpConfig.GetHalconToolPathList();
        }
    }
}