using MainShell.Models;
using MwFramework.ManagerService;
using Stylet;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MainShell.Recipe.Models.SubstrateParameter
{
    public class SubtrateMarkPars : PropertyChangedBase, IParameterItem
    {
        public CameraConfig MarkVisionConfig { get; set; } = new CameraConfig();
        public UpCamLightConfig MarkLightConfig { get; set; } = new UpCamLightConfig();
        public ObservableCollection<MarkData> MarkDatas { get; set; } = new ObservableCollection<MarkData>();
        public MarkCoordinateGenerationState CoordinateGenerationState { get; set; } = new MarkCoordinateGenerationState();
        public IParameterItem Clone()
        {
            var clone = this.MemberwiseClone() as SubtrateMarkPars;
            if (clone != null)
            {
                clone.MarkVisionConfig = this.MarkVisionConfig.Clone() as CameraConfig;
                clone.MarkLightConfig = this.MarkLightConfig.Clone() as UpCamLightConfig;
                clone.MarkDatas = new ObservableCollection<MarkData>(this.MarkDatas.Select(md => md.Clone() as MarkData));
                clone.CoordinateGenerationState = this.CoordinateGenerationState?.Clone() as MarkCoordinateGenerationState ?? new MarkCoordinateGenerationState();
            }
            return clone;
        }
    }
}
