using MainShell.Common;
using MwFramework.Controls.UIControl;
using MwFramework.ManagerService;
using Stylet;

namespace MainShell.ParaSetting.Model
{
    public abstract class RunProcessParameterItemBase : PropertyChangedBase, IParameterItem
    {
        private bool _enableProcess;

        public bool EnableProcess
        {
            get { return _enableProcess; }
            set { SetAndNotify(ref _enableProcess, value); }
        }

        public IParameterItem Clone()
        {
            return this.MemberwiseClone() as IParameterItem;
        }
    }

    public class ProductLoadProcessParameter : RunProcessParameterItemBase
    {
    }

    public class ProductUnloadProcessParameter : RunProcessParameterItemBase
    {
    }

    public class ProductPositionProcessParameter : RunProcessParameterItemBase
    {
       
        private double _glassMarkDisMaxOffset = 0.01;
        [WatchValue("标识距离偏差")]
        public double GlassMarkDisMaxOffset
        {
            get { return _glassMarkDisMaxOffset; }
            set { SetAndNotify(ref _glassMarkDisMaxOffset, value); }
        }

       

        private double _pcbLimitAngle = 0.5;

        public double PcbLimitAngle
        {
            get { return _pcbLimitAngle; }
            set { SetAndNotify(ref _pcbLimitAngle, value); }
        }
    }

    public class ProductHeightMeasureProcessParameter : RunProcessParameterItemBase
    {
        private double _heightMeasureLimit = 0.04;
        public double HeightMeasureLimit
        {
            get { return _heightMeasureLimit; }
            set { SetAndNotify(ref _heightMeasureLimit, value); }
        }

        private bool _useHeightOffset = true;
        [WatchValue("使用测高数据补偿")]
        public bool UseHeightOffset
        {
            get { return _useHeightOffset; }
            set { SetAndNotify(ref _useHeightOffset, value); }
        }
    }

    public class WaferLoadProcessParameter : RunProcessParameterItemBase
    {
    }

    public class WaferUnloadProcessParameter : RunProcessParameterItemBase
    {
    }

    public class WaferStraightenProcessParameter : RunProcessParameterItemBase
    {
        private bool _useSingleStraighten;
        [WatchValue("使用单次拉直")]
        public bool UseSingleStraighten
        {
            get { return _useSingleStraighten; }
            set { SetAndNotify(ref _useSingleStraighten, value); }
        }


        private bool _straightAngleDirX = true;
        [WatchValue("拉直方向X")]
        public bool StraightAngleDirX
        {
            get { return _straightAngleDirX; }
            set { SetAndNotify(ref _straightAngleDirX, value); }
        }

        private int _maxBadDieCount = 100;

        public int MaxBadDieCount
        {
            get { return _maxBadDieCount; }
            set { SetAndNotify(ref _maxBadDieCount, value); }
        }
    }

    public class DieRecognizeProcessParameter : RunProcessParameterItemBase
    {
        private bool _useSingleWaferPosition;
        [WatchValue("使用单次芯片定位")]
        public bool UseSingleWaferPosition
        {
            get { return _useSingleWaferPosition; }
            set { SetAndNotify(ref _useSingleWaferPosition, value); }
        }

        private bool _useWaferWaveCheck;
        public bool UseWaferWaveCheck
        {
            get { return _useWaferWaveCheck; }
            set { SetAndNotify(ref _useWaferWaveCheck, value); }
        }

        private bool _changePid = true;
        [WatchValue("PID切换")]
        public bool ChangePid
        {
            get { return _changePid; }
            set { SetAndNotify(ref _changePid, value); }
        }

        private double _dieAngleThreshold = 3;
        [WatchValue("晶粒角度阈值")]
        public double DieAngleThreshold
        {
            get { return _dieAngleThreshold; }
            set { SetAndNotify(ref _dieAngleThreshold, value); }
        }

        private WaferScanMode _waferScanMode = WaferScanMode.FullScan;
        [WatchValue("芯片扫描模式")]
        public WaferScanMode WaferScanMode
        {
            get { return _waferScanMode; }
            set { SetAndNotify(ref _waferScanMode, value); }
        }

    }

    public class BondingProcessParameter : RunProcessParameterItemBase
    {
       

        private bool _isNeedleUpWhenBonding;
        [WatchValue("打件是否针抬高")]
        public bool IsNeedleUpWhenBonding
        {
            get { return _isNeedleUpWhenBonding; }
            set { SetAndNotify(ref _isNeedleUpWhenBonding, value); }
        }


        private bool _useAllDie;
        [WatchValue("晶粒100%消耗")]
        public bool UseAllDie
        {
            get { return _useAllDie; }
            set { SetAndNotify(ref _useAllDie, value); }
        }

        private bool _useAirCoolAllProduce = true;
        [WatchValue("全程气冷")]
        public bool UseAirCoolAllProduce
        {
            get { return _useAirCoolAllProduce; }
            set { SetAndNotify(ref _useAirCoolAllProduce, value); }
        }

        
    }

    public class RecheckProcessParameter : RunProcessParameterItemBase
    {
        private bool _useIrregularRecheck;
        [WatchValue("是否启用不规则复检")]
        public bool UseIrregularRecheck
        {
            get { return _useIrregularRecheck; }
            set { SetAndNotify(ref _useIrregularRecheck, value); }
        }
    }

    public class GlobalRunParameter : RunProcessParameterItemBase
    {
        private int _needleCheckBondingGlassNum;
        [WatchValue("对刀检查需要Bonding数量")]
        public int NeedleCheckBondingGlassNum
        {
            get { return _needleCheckBondingGlassNum; }
            set { SetAndNotify(ref _needleCheckBondingGlassNum, value); }
        }

        private bool _isUseMesLeiMan;
        [WatchValue("是否启用MES-雷曼")]
        public bool IsUseMesLeiMan
        {
            get { return _isUseMesLeiMan; }
            set { SetAndNotify(ref _isUseMesLeiMan, value); }
        }

        private RunningMode _runningMode = RunningMode.生产检测;
        [WatchValue("运行设置")]
        public RunningMode RunningMode
        {
            get { return _runningMode; }
            set { SetAndNotify(ref _runningMode, value); }
        }
    }
}