using System;
using System.Linq;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace INT_LKD_2.DataStore
{
    #region Recipe
    public class Recipe
    {
        #region Field
        private int m_NUMBER;

        private string m_NAME;
        private string m_LOT;

        private string m_DIFF_LR_LIMIT;
        private string m_DIFF_LR_DELAY_SEC;
        private int m_DIFF_LR_CYCLE;

        private string m_DISP_JUDG_EMPTY_LEVEL;
        private string m_DISP_JUDG_MAX_DIFF;
        private string m_DISP_JUDG_MIN_HEIGHT;
        private bool m_DISP_JUDG_ENABLE;

        private int m_VACUUM_START_SEC;
        private int m_VACUUM_HOLD1_SEC;
        private int m_VACUUM_HOLD2_SEC;
        private int m_VACUUM_BREAK_SEC;
        private string m_VACUUM_GUAGE_LEVEL;
        #endregion

        #region Constructor
        public Recipe()
        {
            this.Initialize();
        }
        #endregion

        #region Property
        public int NUMBER
        {
            get { return this.m_NUMBER; }
            set { this.m_NUMBER = value; }
        }

        public string NAME
        {
            get { return this.m_NAME; }
            set { this.m_NAME = value; }
        }
        public string LOT
        {
            get { return this.m_LOT; }
            set { this.m_LOT = value; }
        }

        public string DIFF_LR_LIMIT
        {
            get { return this.m_DIFF_LR_LIMIT; }
            set { this.m_DIFF_LR_LIMIT = value; }
        }
        public string DIFF_LR_DELAY_SEC
        {
            get { return this.m_DIFF_LR_DELAY_SEC; }
            set { this.m_DIFF_LR_DELAY_SEC = value; }
        }
        public int DIFF_LR_CYCLE
        {
            get { return this.m_DIFF_LR_CYCLE; }
            set { this.m_DIFF_LR_CYCLE = value; }
        }

        public string DISP_JUDG_EMPTY_LEVEL
        {
            get { return this.m_DISP_JUDG_EMPTY_LEVEL; }
            set { this.m_DISP_JUDG_EMPTY_LEVEL = value; }
        }
        public string DISP_JUDG_MAX_DIFF
        {
            get { return this.m_DISP_JUDG_MAX_DIFF; }
            set { this.m_DISP_JUDG_MAX_DIFF = value; }
        }
        public string DISP_JUDG_MIN_HEIGHT
        {
            get { return this.m_DISP_JUDG_MIN_HEIGHT; }
            set { this.m_DISP_JUDG_MIN_HEIGHT = value; }
        }
        public bool DISP_JUDG_ENABLE
        {
            get { return this.m_DISP_JUDG_ENABLE; }
            set { this.m_DISP_JUDG_ENABLE = value; }
        }

        public int VACUUM_START_SEC
        {
            get { return this.m_VACUUM_START_SEC; }
            set { this.m_VACUUM_START_SEC = value; }
        }
        public int VACUUM_HOLD1_SEC
        {
            get { return this.m_VACUUM_HOLD1_SEC; }
            set { this.m_VACUUM_HOLD1_SEC = value; }
        }
        public int VACUUM_HOLD2_SEC
        {
            get { return this.m_VACUUM_HOLD2_SEC; }
            set { this.m_VACUUM_HOLD2_SEC = value; }
        }
        public int VACUUM_BREAK_SEC
        {
            get { return this.m_VACUUM_BREAK_SEC; }
            set { this.m_VACUUM_BREAK_SEC = value; }
        }
        public string VACUUM_GUAGE_LEVEL
        {
            get { return this.m_VACUUM_GUAGE_LEVEL; }
            set { this.m_VACUUM_GUAGE_LEVEL = value; }
        }
        #endregion

        #region Method
        public void Initialize()
        {
            this.NUMBER = 1;
            this.NAME = "INTECH";
            this.LOT = "LOT";

            this.DIFF_LR_LIMIT = "10.00";
            this.DIFF_LR_DELAY_SEC = "0.5";
            this.DIFF_LR_CYCLE = 5;

            this.DISP_JUDG_EMPTY_LEVEL = "70.00";
            this.DISP_JUDG_MAX_DIFF = "0.50";
            this.DISP_JUDG_MIN_HEIGHT = "3.00";
            this.DISP_JUDG_ENABLE = true;

            this.VACUUM_START_SEC = 20;
            this.VACUUM_HOLD1_SEC = 15;
            this.VACUUM_HOLD2_SEC = 1;
            this.VACUUM_BREAK_SEC = 5;
            this.VACUUM_GUAGE_LEVEL = "-85.0";
        }
        #endregion
    } 
    #endregion

    #region StructRecipe
    [StructLayout(LayoutKind.Sequential)]
    public struct StructRecipe
    {
        public int NUMBER;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)]
        public string NAME;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)]
        public string LOT;

        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
        public string DIFF_LR_LIMIT;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
        public string DIFF_LR_DELAY_SEC;
        public int DIFF_LR_CYCLE;

        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
        public string DISP_JUDG_EMPTY_LEVEL;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
        public string DISP_JUDG_MAX_DIFF;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
        public string DISP_JUDG_MIN_HEIGHT;
        public bool DISP_JUDG_ENABLE;

        public int VACUUM_START_SEC;
        public int VACUUM_HOLD1_SEC;
        public int VACUUM_HOLD2_SEC;
        public int VACUUM_BREAK_SEC;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 10)]
        public string VACUUM_GUAGE_LEVEL;
    }
    #endregion
}
