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

namespace MainShell.DeviceMaintance.Model
{
    [Export(typeof(IParameter))]
    public class NeedlePrintCalibrateSetting : ParameterBase
    {
        public NeedlePrintCalibrateParameter NeedlePrintCalibrateParameter { get; set; } = new NeedlePrintCalibrateParameter();
        public NeedlePrintCalibrateSetting() { }
        public override void Copy(IParameter source)
        {
            if (source is NeedlePrintCalibrateSetting setting)
            {
                ReflectionExtension.Copy(NeedlePrintCalibrateParameter, setting.NeedlePrintCalibrateParameter);

            }
        }
    }

    public class NeedlePrintCalibrateParameter : PropertyChangedBase, IParameterItem
    {
        private MPoint _startPoint = new MPoint();
        public MPoint StartPoint
        {
            get { return _startPoint; }
            set { SetAndNotify(ref _startPoint, value); }
        }

        private MPoint _endPoint = new MPoint();
        public MPoint EndPoint
        {
            get { return _endPoint; }
            set { SetAndNotify(ref _endPoint, value); }
        }

        private MPoint _avoidancePoint = new MPoint();

        public MPoint AvoidancePoint
        {
            get { return _avoidancePoint; }
            set { SetAndNotify(ref _avoidancePoint, value); }
        }

        private double _z1WorkHeight;

        public double Z1WorkHeight
        {
            get { return _z1WorkHeight; }
            set { SetAndNotify(ref _z1WorkHeight, value); }
        }

        private double _z2WorkHeight;

        public double Z2WorkHeight
        {
            get { return _z2WorkHeight; }
            set { SetAndNotify(ref _z2WorkHeight, value); }
        }

        private double _xPitch;

        public double Xpitch
        {
            get { return _xPitch; }
            set { SetAndNotify(ref _xPitch, value); }
        }

        private double _yPitch;

        public double Ypitch
        {
            get { return _yPitch; }
            set { SetAndNotify(ref _yPitch, value); }
        }

        private int _usedNum;

        public int UsedNum
        {
            get { return _usedNum; }
            set { SetAndNotify(ref _usedNum, value); }
        }

        private int _sleepTime = 1000;
        public int SleepTime
        {
            get { return _sleepTime; }
            set { SetAndNotify(ref _sleepTime, value); }
        }

        public IParameterItem Clone()
        {
            return MemberwiseClone() as NeedlePrintCalibrateParameter;
        }
    }
}
