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

namespace INT_PT002.DataStore
{
    public class Recipe
    {
        #region Field
        private int m_NUMBER;
        private string m_NAME;
        private string m_LOT;

        private string m_DISP_JUDG_STD_LEVEL;
        private string m_DISP_JUDG_MIN_LEVEL;
        private string m_DISP_JUDG_EMPTY_LEVEL;
        private int m_DISP_HOLD_DELAY_MSEC;

        private string m_DIFF_LR_SECOND;
        private string m_DIFF_LR_TOTAL;
        private string m_DIFF_LR_MEAN;
        private int m_DIFF_HOLD_DELAY_MSEC;

        private int m_VACUUM_RELIEF;
        private int m_VACUUM_HOLD1;
        private int m_VACUUM_HOLD2;
        private int m_VACUUM_BLOWOFF;
        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 DISP_JUDG_STD_LEVEL
        {
            get { return this.m_DISP_JUDG_STD_LEVEL; }
            set { this.m_DISP_JUDG_STD_LEVEL = value; }
        }
        public string DISP_JUDG_MIN_LEVEL
        {
            get { return this.m_DISP_JUDG_MIN_LEVEL; }
            set { this.m_DISP_JUDG_MIN_LEVEL = value; }
        }
        public string DISP_JUDG_EMPTY_LEVEL
        {
            get { return this.m_DISP_JUDG_EMPTY_LEVEL; }
            set { this.m_DISP_JUDG_EMPTY_LEVEL = value; }
        }
        public int DISP_HOLD_DELAY_MSEC
        {
            get { return this.m_DISP_HOLD_DELAY_MSEC; }
            set { this.m_DISP_HOLD_DELAY_MSEC = value; }
        }

        public string DIFF_LR_SECOND
        {
            get { return this.m_DIFF_LR_SECOND; }
            set { this.m_DIFF_LR_SECOND = value; }
        }
        public string DIFF_LR_TOTAL
        {
            get { return this.m_DIFF_LR_TOTAL; }
            set { this.m_DIFF_LR_TOTAL = value; }
        }
        public string DIFF_LR_MEAN
        {
            get { return this.m_DIFF_LR_MEAN; }
            set { this.m_DIFF_LR_MEAN = value; }
        }
        public int DIFF_HOLD_DELAY_MSEC
        {
            get { return this.m_DIFF_HOLD_DELAY_MSEC; }
            set { this.m_DIFF_HOLD_DELAY_MSEC = value; }
        }

        public int VACUUM_RELIEF
        {
            get { return this.m_VACUUM_RELIEF; }
            set { this.m_VACUUM_RELIEF = value; }
        }
        public int VACUUM_HOLD1
        {
            get { return this.m_VACUUM_HOLD1; }
            set { this.m_VACUUM_HOLD1 = value; }
        }
        public int VACUUM_HOLD2
        {
            get { return this.m_VACUUM_HOLD2; }
            set { this.m_VACUUM_HOLD2 = value; }
        }
        public int VACUUM_BLOWOFF
        {
            get { return this.m_VACUUM_BLOWOFF; }
            set { this.m_VACUUM_BLOWOFF = 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 1";
            this.LOT = "LOT 1";

            this.DISP_JUDG_STD_LEVEL = "0.15";
            this.DISP_JUDG_MIN_LEVEL = "2.50";
            this.DISP_JUDG_EMPTY_LEVEL = "80.00";
            this.DISP_HOLD_DELAY_MSEC = 100;

            this.DIFF_LR_SECOND = "500.00";
            this.DIFF_LR_TOTAL = "5000.00";
            this.DIFF_LR_MEAN = "2.00";
            this.DIFF_HOLD_DELAY_MSEC = 1500;

            this.VACUUM_RELIEF = 20;
            this.VACUUM_HOLD1 = 40;
            this.VACUUM_HOLD2 = 1;
            this.VACUUM_BLOWOFF = 5;
            this.VACUUM_GUAGE_LEVEL = "-88.0";
        }
        #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 DISP_JUDG_STD_LEVEL;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
        public string DISP_JUDG_MIN_LEVEL;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
        public string DISP_JUDG_EMPTY_LEVEL;
        public int DISP_HOLD_DELAY_MSEC;

        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
        public string DIFF_LR_SECOND;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
        public string DIFF_LR_TOTAL;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)]
        public string DIFF_LR_MEAN;
        public int DIFF_HOLD_DELAY_MSEC;

        public int VACUUM_RELIEF;
        public int VACUUM_HOLD1;
        public int VACUUM_HOLD2;
        public int VACUUM_BLOWOFF;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 10)]
        public string VACUUM_GUAGE_LEVEL;
    }
    #endregion
}
