using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;


namespace Project
{

    public class SystemSetting : arUtil.Setting
    {
        public int SaftySensor_Threshold { get; set; }


        #region "System Setting"
        public int MotaxisCount { get; set; }
        #endregion



        #region "Signal Reverse"
       

        [Category("Signal Reverse")]
        public Boolean ReverseSIG_Emgergency { get; set; }
        [Category("Signal Reverse")]
        public Boolean ReverseSIG_ButtonAir { get; set; }
        [Category("Signal Reverse")]
        public Boolean ReverseSIG_DoorF { get; set; }
        [Category("Signal Reverse")]
        public Boolean ReverseSIG_DoorR { get; set; }
        [Category("Signal Reverse")]
        public Boolean ReverseSIG_AirCheck { get; set; }
        [Category("Signal Reverse")]
        public Boolean ReverseSIG_PortLimitUp { get; set; }
        [Category("Signal Reverse")]
        public Boolean ReverseSIG_PortLimitDn { get; set; }
        [Category("Signal Reverse")]
        public Boolean ReverseSIG_PortDetect0Up { get; set; }
        [Category("Signal Reverse")]
        public Boolean ReverseSIG_PortDetect1Up { get; set; }
        [Category("Signal Reverse")]
        public Boolean ReverseSIG_PortDetect2Up { get; set; }
        [Category("Signal Reverse")]
        public Boolean ReverseSIG_PickerSafe { get; set; }

        #endregion

        #region "Axis-0 Setting (Y-Picker)"

        [Category("Axis-0 Setting (Y-Picker)")]
        public Boolean axis0_disable_orgsensor { get; set; }

        [Category("Axis-0 Setting (Y-Picker)"), DisplayName("Home Speed (High)")]
        public double HSpeed0H { get; set; }
        [Category("Axis-0 Setting (Y-Picker)"), DisplayName("Home Speed (Low)")]
        public double HSpeed0L { get; set; }
        [Category("Axis-0 Setting (Y-Picker)"), DisplayName("Home Speed (Acc/Dcc)")]
        public double HAcc0 { get; set; }
        [Category("Axis-0 Setting (Y-Picker)")]
        public double SWLimitP0 { get; set; }
        #endregion

        #region "Axis-1 Setting"

        [Category("Axis-1 Setting"), DisplayName("★ Disable Origin Sensor")]
        public Boolean axis1_disable_orgsensor { get; set; }

        [Category("Axis-1 Setting"), DisplayName("Home Speed (High)")]
        public double HSpeed1H { get; set; }
        [Category("Axis-1 Setting"), DisplayName("Home Speed (Low)")]
        public double HSpeed1L { get; set; }
        [Category("Axis-1 Setting"), DisplayName("Home Speed (Acc/Dcc)")]
        public double HAcc1 { get; set; }
        [Category("Axis-1 Setting")]
        public double SWLimitP1 { get; set; }
        #endregion

        #region "Axis-2 Setting"

        [Category("Axis-2 Setting"), DisplayName("★ Disable Origin Sensor")]
        public Boolean axis2_disable_orgsensor { get; set; }

        [Category("Axis-2 Setting"), DisplayName("Home Speed (High)")]
        public double HSpeed2H { get; set; }
        [Category("Axis-2 Setting"), DisplayName("Home Speed (Low)")]
        public double HSpeed2L { get; set; }
        [Category("Axis-2 Setting"), DisplayName("Home Speed (Acc/Dcc)")]
        public double HAcc2 { get; set; }
        [Category("Axis-2 Setting")]
        public double SWLimitP2 { get; set; }
        #endregion

        #region "Axis-3 Setting"

        [Category("Axis-3 Setting"), DisplayName("★ Disable Origin Sensor")]
        public Boolean axis3_disable_orgsensor { get; set; }

        [Category("Axis-3 Setting"), DisplayName("Home Speed (High)")]
        public double HSpeed3H { get; set; }
        [Category("Axis-3 Setting"), DisplayName("Home Speed (Low)")]
        public double HSpeed3L { get; set; }
        [Category("Axis-3 Setting"), DisplayName("Home Speed (Acc/Dcc)")]
        public double HAcc3 { get; set; }
        [Category("Axis-3 Setting")]
        public double SWLimitP3 { get; set; }
        #endregion

        #region "Axis-4 Setting"

        [Category("Axis-4 Setting"), DisplayName("★ Disable Origin Sensor")]
        public Boolean axis4_disable_orgsensor { get; set; }

        [Category("Axis-4 Setting"), DisplayName("Home Speed (High)")]
        public double HSpeed4H { get; set; }
        [Category("Axis-4 Setting"), DisplayName("Home Speed (Low)")]
        public double HSpeed4L { get; set; }
        [Category("Axis-4 Setting"), DisplayName("Home Speed (Acc/Dcc)")]
        public double HAcc4 { get; set; }
        [Category("Axis-4 Setting")]
        public double SWLimitP4 { get; set; }
        #endregion

        #region "Axis-5 Setting"

        [Category("Axis-5 Setting"), DisplayName("★ Disable Origin Sensor")]
        public Boolean axis5_disable_orgsensor { get; set; }

        [Category("Axis-5 Setting"), DisplayName("Home Speed (High)")]
        public double HSpeed5H { get; set; }
        [Category("Axis-5 Setting"), DisplayName("Home Speed (Low)")]
        public double HSpeed5L { get; set; }
        [Category("Axis-5 Setting"), DisplayName("Home Speed (Acc/Dcc)")]
        public double HAcc5 { get; set; }
        [Category("Axis-5 Setting")]
        public double SWLimitP5 { get; set; }
        #endregion

        #region "Axis-6 Setting"

        [Category("Axis-6 Setting"), DisplayName("★ Disable Origin Sensor")]
        public Boolean axis6_disable_orgsensor { get; set; }

        [Category("Axis-6 Setting"), DisplayName("Home Speed (High)")]
        public double HSpeed6H { get; set; }
        [Category("Axis-6 Setting"), DisplayName("Home Speed (Low)")]
        public double HSpeed6L { get; set; }
        [Category("Axis-6 Setting"), DisplayName("Home Speed (Acc/Dcc)")]
        public double HAcc6 { get; set; }
        [Category("Axis-6 Setting")]
        public double SWLimitP6 { get; set; }
        #endregion

        #region "Axis-7 Setting"

        [Category("Axis-7 Setting"), DisplayName("★ Disable Origin Sensor")]
        public Boolean axis7_disable_orgsensor { get; set; }

        [Category("Axis-7 Setting"), DisplayName("Home Speed (High)")]
        public double HSpeed7H { get; set; }
        [Category("Axis-7 Setting"), DisplayName("Home Speed (Low)")]
        public double HSpeed7L { get; set; }
        [Category("Axis-7 Setting"), DisplayName("Home Speed (Acc/Dcc)")]
        public double HAcc7 { get; set; }
        [Category("Axis-7 Setting")]
        public double SWLimitP7 { get; set; }
        #endregion

        #region "disalbe axis"

        [Category("Disable Axis")]
        public Boolean Disable_Axis0 { get; set; }
        [Category("Disable Axis")]
        public Boolean Disable_Axis1 { get; set; }
        [Category("Disable Axis")]
        public Boolean Disable_Axis2 { get; set; }
        [Category("Disable Axis")]
        public Boolean Disable_Axis3 { get; set; }
        [Category("Disable Axis")]
        public Boolean Disable_Axis4 { get; set; }
        [Category("Disable Axis")]
        public Boolean Disable_Axis5 { get; set; }
        [Category("Disable Axis")]
        public Boolean Disable_Axis6 { get; set; }
        [Category("Disable Axis")]
        public Boolean Disable_Axis7 { get; set; }
       
        #endregion


        public SystemSetting()
        {
            this.filename = Util.CurrentPath + "system.xml";
        }
        public override void AfterLoad()
        {
             MotaxisCount = 7;

            if (HSpeed0H == 0) HSpeed0H = 10;
            if (HSpeed0L == 0) HSpeed0L = 5;
            if (HAcc0 == 0) HAcc0 = 100;

            if (HSpeed1H == 0) HSpeed1H = 10;
            if (HSpeed1L == 0) HSpeed1L = 5;
            if (HAcc1 == 0) HAcc1 = 100;

            if (HSpeed2H == 0) HSpeed2H = 10;
            if (HSpeed2L == 0) HSpeed2L = 5;
            if (HAcc2 == 0) HAcc2 = 100;

            if (HSpeed3H == 0) HSpeed3H = 10;
            if (HSpeed3L == 0) HSpeed3L = 5;
            if (HAcc3 == 0) HAcc3 = 100;

            if (HSpeed4H == 0) HSpeed4H = 10;
            if (HSpeed4L == 0) HSpeed4L = 5;
            if (HAcc4 == 0) HAcc4 = 100;

            if (HSpeed5H == 0) HSpeed5H = 10;
            if (HSpeed5L == 0) HSpeed5L = 5;
            if (HAcc5 == 0) HAcc5 = 100;

            if (HSpeed6H == 0) HSpeed6H = 10;
            if (HSpeed6L == 0) HSpeed6L = 5;
            if (HAcc6 == 0) HAcc6 = 100;

            if (HSpeed7H == 0) HSpeed7H = 10;
            if (HSpeed7L == 0) HSpeed7L = 5;
            if (HAcc7 == 0) HAcc7 = 100;


        }
        public override void AfterSave()
        {
            //throw new NotImplementedException();
        }
    }
}
