using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;

using SmartX;
using INT_PT002.DataStore;
using INT_PT002.Controls;
using INT_PT002.Part11_UserManager;
using INT_PT002.DialogForms;

namespace INT_PT002.Forms
{
    public partial class FormMainDisplay3 : Form
    {
        #region Field
        public string ChangeID;
        private bool BeforeEthernetStatus;
        private int FlagIgnoreCNT;
        private string MessageBoxRange;
        private int testIndex;
        private Define.E_ProcessStatus CurrentProcessStatus;
        private bool IsTestMode;

        private Color ColorProgressOn;
        private Color ColorProgressOff;
        private Color ColorProgressTextOn;
        private Color ColorProgressTextOff;
        private Color ColorResultPass;
        private Color ColorResultNG;
        private Color ColorResultNone;
        private Color ColorSensorNormal;
        private Color ColorSensorError;
        private Color ColorNumberSelected;
        private Color ColorNumberUnSelected;
        
        private Collection<SmartLabel> CollectionLabelResult;
        private Collection<SmartLabel> CollectionLabelPressureWorking;
        private Collection<SmartLabel> CollectionLabelPressureMaster;
        private Collection<SmartLabel> CollectionLabelLeakRatePerSec;
        private Collection<SmartLabel> CollectionLabelSbAlarm;
        private Collection<SmartLabel> CollectionLabelNumber;

        private FormMain m_ParentForm;

        private ControlMainDisplay ChildControl;
        public ControlMainModbus ChildModbus;
        #endregion

        #region Constructor
        public FormMainDisplay3(FormMain parent)
        {
            InitializeComponent();

            this.ParentForm = parent;

            this.DefaultSetting();
            this.InitializeData();
            this.InitializeLanguage();
            this.InitializeProcessStatus();
        }
        #endregion

        #region Property
        public FormMain ParentForm
        {
            get { return this.m_ParentForm; }
            private set { this.m_ParentForm = value; }
        }
        #endregion

        #region Method
        private void DefaultSetting()
        {
            int testIndex = 0;
            this.BeforeEthernetStatus = false;
            this.IsTestMode = false;

            this.FlagIgnoreCNT = 0;
            this.MessageBoxRange = "";
            this.CurrentProcessStatus = Define.E_ProcessStatus._0_None;

            this.ColorProgressOff = Color.FromArgb(231, 231, 231);
            this.ColorProgressOn = Color.FromArgb(95, 196, 188);
            this.ColorProgressTextOff = Color.Black;
            this.ColorProgressTextOn = Color.Black;
            this.ColorResultPass = Color.FromArgb(39, 200, 64);
            this.ColorResultNG = Color.FromArgb(254, 70, 70);
            this.ColorResultNone = Color.FromArgb(42, 43, 45);
            this.ColorSensorNormal = Color.FromArgb(39, 200, 64);
            this.ColorSensorError = Color.FromArgb(254, 70, 70);
            this.ColorNumberSelected = Color.Teal;
            this.ColorNumberUnSelected = Color.FromArgb(80, 92, 118);

            this.CollectionLabelResult = new Collection<SmartLabel>();
            this.CollectionLabelResult.Clear();
            this.CollectionLabelResult.Add(this.labelResult1);
            this.CollectionLabelResult.Add(this.labelResult2);
            this.CollectionLabelResult.Add(this.labelResult3);
            this.CollectionLabelResult.Add(this.labelResult4);
            this.CollectionLabelResult.Add(this.labelResult5);
            this.CollectionLabelResult.Add(this.labelResult6);
            this.CollectionLabelResult.Add(this.labelResult7);
            this.CollectionLabelResult.Add(this.labelResult8);
            this.CollectionLabelResult.Add(this.labelResult9);
            this.CollectionLabelResult.Add(this.labelResult10);

            this.CollectionLabelPressureWorking = new Collection<SmartLabel>();
            this.CollectionLabelPressureWorking.Clear();
            this.CollectionLabelPressureWorking.Add(this.labelPressureWorking1);
            this.CollectionLabelPressureWorking.Add(this.labelPressureWorking2);
            this.CollectionLabelPressureWorking.Add(this.labelPressureWorking3);
            this.CollectionLabelPressureWorking.Add(this.labelPressureWorking4);
            this.CollectionLabelPressureWorking.Add(this.labelPressureWorking5);
            this.CollectionLabelPressureWorking.Add(this.labelPressureWorking6);
            this.CollectionLabelPressureWorking.Add(this.labelPressureWorking7);
            this.CollectionLabelPressureWorking.Add(this.labelPressureWorking8);
            this.CollectionLabelPressureWorking.Add(this.labelPressureWorking9);
            this.CollectionLabelPressureWorking.Add(this.labelPressureWorking10);

            this.CollectionLabelPressureMaster = new Collection<SmartLabel>();
            this.CollectionLabelPressureMaster.Clear();
            this.CollectionLabelPressureMaster.Add(this.labelPressureMaster1);
            this.CollectionLabelPressureMaster.Add(this.labelPressureMaster2);
            this.CollectionLabelPressureMaster.Add(this.labelPressureMaster3);
            this.CollectionLabelPressureMaster.Add(this.labelPressureMaster4);
            this.CollectionLabelPressureMaster.Add(this.labelPressureMaster5);
            this.CollectionLabelPressureMaster.Add(this.labelPressureMaster6);
            this.CollectionLabelPressureMaster.Add(this.labelPressureMaster7);
            this.CollectionLabelPressureMaster.Add(this.labelPressureMaster8);
            this.CollectionLabelPressureMaster.Add(this.labelPressureMaster9);
            this.CollectionLabelPressureMaster.Add(this.labelPressureMaster10);

            this.CollectionLabelLeakRatePerSec = new Collection<SmartLabel>();
            this.CollectionLabelLeakRatePerSec.Clear();
            this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec1);
            this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec2);
            this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec3);
            this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec4);
            this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec5);
            this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec6);
            this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec7);
            this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec8);
            this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec9);
            this.CollectionLabelLeakRatePerSec.Add(this.labelLrSec10);

            this.CollectionLabelSbAlarm = new Collection<SmartLabel>();
            this.CollectionLabelSbAlarm.Clear();
            this.CollectionLabelSbAlarm.Add(this.labelSbAlarm1);
            this.CollectionLabelSbAlarm.Add(this.labelSbAlarm2);
            this.CollectionLabelSbAlarm.Add(this.labelSbAlarm3);
            this.CollectionLabelSbAlarm.Add(this.labelSbAlarm4);
            this.CollectionLabelSbAlarm.Add(this.labelSbAlarm5);
            this.CollectionLabelSbAlarm.Add(this.labelSbAlarm6);
            this.CollectionLabelSbAlarm.Add(this.labelSbAlarm7);
            this.CollectionLabelSbAlarm.Add(this.labelSbAlarm8);
            this.CollectionLabelSbAlarm.Add(this.labelSbAlarm9);
            this.CollectionLabelSbAlarm.Add(this.labelSbAlarm10);

            this.CollectionLabelNumber = new Collection<SmartLabel>();
            this.CollectionLabelNumber.Clear();
            this.CollectionLabelNumber.Add(this.labelNumber1);
            this.CollectionLabelNumber.Add(this.labelNumber2);
            this.CollectionLabelNumber.Add(this.labelNumber3);
            this.CollectionLabelNumber.Add(this.labelNumber4);
            this.CollectionLabelNumber.Add(this.labelNumber5);
            this.CollectionLabelNumber.Add(this.labelNumber6);
            this.CollectionLabelNumber.Add(this.labelNumber7);
            this.CollectionLabelNumber.Add(this.labelNumber8);
            this.CollectionLabelNumber.Add(this.labelNumber9);
            this.CollectionLabelNumber.Add(this.labelNumber10);

            this.ChildControl = new ControlMainDisplay(this.ParentForm);
            this.Controls.Add(this.ChildControl);
            this.ChildControl.Location = new Point(0, 118);
            this.ChildControl.BringToFront();
            this.ChildControl.Visible = false;

            this.ChildModbus = new ControlMainModbus(this);
            this.Controls.Add(this.ChildModbus);
            this.ChildModbus.Location = new Point(0, 155);
            this.ChildModbus.BringToFront();
            this.ChildModbus.Visible = false;

            this.buttonRecipeNo.ButtonText = this.ParentForm.SystemConfig.RECIPE_NUMBER.ToString();
            this.UpdateDisplayUser(this.ParentForm.CurrentSystemStatus.CurrentUser);
        }
        private void InitializeData()
        {
            for (int i = 0; i < this.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
            {
                this.CollectionLabelResult[i].Visible = false;
                this.CollectionLabelPressureWorking[i].Text = "0.0";
                this.CollectionLabelPressureMaster[i].Text = "0.0";
                this.CollectionLabelLeakRatePerSec[i].Text = "0.0";
                this.CollectionLabelSbAlarm[i].Visible = false;
                this.SetLabelNumberColor(i, this.ColorNumberUnSelected);
            }
        }
        private void InitializeLanguage()
        {
            switch (this.ParentForm.SystemConfig.LANGUAGE)
            {
                case Define.E_LanguageID.Korean:
                    this.labelProgress0_1.Text = "초기상태";
                    this.labelProgress1_1.Text = "제품이동";
                    this.labelProgress2_1.Text = "측정 중";
                    this.labelProgress3_1.Text = "배출";
                    break;
                case Define.E_LanguageID.English:
                    this.labelProgress0_1.Text = "Ready";
                    this.labelProgress1_1.Text = "Chamber shift";
                    this.labelProgress2_1.Text = "Measuring";
                    this.labelProgress3_1.Text = "Discharge";
                    break;
                default:
                    break;
            }
        }

        private void InitializeProcessStatus()
        {
            this.pictureBoxProgress0_1.Visible = false;
            this.pictureBoxProgress1_34.Visible = false;
            this.pictureBoxProgress2_5.Visible = false;
            this.pictureBoxProgress3_11.Visible = false;

            this.progressBar1.Value = this.progressBar1.Minimum;

            this.SetLabelRoundRectFillColor(this.labelProgress0, this.ColorProgressOff);
            this.SetLabelRoundRectFillColor(this.labelProgress1, this.ColorProgressOff);
            this.SetLabelRoundRectFillColor(this.labelProgress2, this.ColorProgressOff);
            this.SetLabelRoundRectFillColor(this.labelProgress3, this.ColorProgressOff);
            this.SetLabelBackGroundColor(this.labelProgress0_1, this.ColorProgressOff);
            this.SetLabelBackGroundColor(this.labelProgress1_1, this.ColorProgressOff);
            this.SetLabelBackGroundColor(this.labelProgress2_1, this.ColorProgressOff);
            this.SetLabelBackGroundColor(this.labelProgress3_1, this.ColorProgressOff);
            this.SetLabelTextColor(this.labelProgress0_1, this.ColorProgressTextOff);
            this.SetLabelTextColor(this.labelProgress1_1, this.ColorProgressTextOff);
            this.SetLabelTextColor(this.labelProgress2_1, this.ColorProgressTextOff);
            this.SetLabelTextColor(this.labelProgress3_1, this.ColorProgressTextOff);
        }
        private bool UI_Invoke(ThreadStart invoker)
        {
            try
            {
                if (this.InvokeRequired)
                {
                    if (this.IsDisposed)
                        return true;

                    this.Invoke(invoker);
                }
                else
                {
                    invoker();
                }

                return true;

            }
            catch (Exception e)
            {
                return false;
            }

        }
        private void SetLabelBackGroundColor(SmartLabel label, Color c)
        {
            if (label.BackGroundColor != c)
                label.BackGroundColor = c;
        }
        private void SetLabelRoundRectFillColor(SmartLabel label, Color c)
        {
            if (label.RoundRectFillColor != c)
                label.RoundRectFillColor = c;
        }
        private void SetLabelTextColor(SmartLabel label, Color c)
        {
            if (label.TextColor != c)
                label.TextColor = c;
        }
        private void SetLabelNumberColor(int index, Color c)
        {
            if (this.CollectionLabelNumber[index].BackGroundColor != c)
            {
                this.CollectionLabelNumber[index].BackGroundColor = c;
                this.CollectionLabelSbAlarm[index].BackGroundColor = c;
            }
        }

        private void UpdateDisplayUser(UserItem user)
        {
            string id = "", group = "", expireDate = "";

            switch (user.Group)
            {
                case Define.E_UserGroup.None:
                    break;
                case Define.E_UserGroup.Level1:
                    id = user.ID;
                    group = user.Group.ToString();

                    if (this.labelUserLevel.TextColor != this.ParentForm.ColorLogOn)
                        this.labelUserLevel.TextColor = this.labelUserID.TextColor = this.ParentForm.ColorLogOn;

                    this.labelExpireOfPassword.Visible = true;

                    this.buttonUser.ButtonDown();
                    this.buttonRecipeNo.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMainDisplayProductChange;
                    this.buttonClear.Enabled = this.ParentForm.CurrentUserGroup.Level1.IsMainDisplayClear;
                    this.buttonInspection.Enabled = true;
                    this.buttonMenu.Enabled = true;
                    break;
                case Define.E_UserGroup.Level2:
                    id = user.ID;
                    group = user.Group.ToString();

                    if (this.labelUserLevel.TextColor != this.ParentForm.ColorLogOn)
                        this.labelUserLevel.TextColor = this.labelUserID.TextColor = this.ParentForm.ColorLogOn;

                    this.labelExpireOfPassword.Visible = true;

                    this.buttonUser.ButtonDown();
                    this.buttonRecipeNo.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMainDisplayProductChange;
                    this.buttonClear.Enabled = this.ParentForm.CurrentUserGroup.Level2.IsMainDisplayClear;
                    this.buttonInspection.Enabled = true;
                    this.buttonMenu.Enabled = true;
                    break;
                case Define.E_UserGroup.Level3:
                    id = user.ID;
                    group = user.Group.ToString();

                    this.labelExpireOfPassword.Visible = true;

                    if (this.labelUserLevel.TextColor != this.ParentForm.ColorLogOn)
                        this.labelUserLevel.TextColor = this.labelUserID.TextColor = this.ParentForm.ColorLogOn;

                    this.buttonUser.ButtonDown();
                    this.buttonRecipeNo.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayProductChange;
                    this.buttonClear.Enabled = this.ParentForm.CurrentUserGroup.Level3.IsMainDisplayClear;
                    this.buttonInspection.Enabled = true;
                    this.buttonMenu.Enabled = true;
                    break;
                case Define.E_UserGroup.Admin:
                    id = user.ID;
                    group = user.Group.ToString();

                    this.labelExpireOfPassword.Visible = false;

                    if (this.labelUserLevel.TextColor != this.ParentForm.ColorLogOn)
                        this.labelUserLevel.TextColor = this.labelUserID.TextColor = this.ParentForm.ColorLogOn;

                    this.buttonUser.ButtonDown();
                    this.buttonRecipeNo.Enabled = true;
                    this.buttonClear.Enabled = true;
                    this.buttonInspection.Enabled = true;
                    this.buttonMenu.Enabled = true;
                    break;
                case Define.E_UserGroup.Developer:
                    id = user.ID;
                    group = user.Group.ToString();

                    this.labelExpireOfPassword.Visible = true;

                    if (this.labelUserLevel.TextColor != this.ParentForm.ColorLogOn)
                        this.labelUserLevel.TextColor = this.labelUserID.TextColor = this.ParentForm.ColorLogOn;

                    this.buttonUser.ButtonDown();
                    this.buttonRecipeNo.Enabled = true;
                    this.buttonClear.Enabled = true;
                    this.buttonInspection.Enabled = true;
                    this.buttonMenu.Enabled = true;
                    break;
                case Define.E_UserGroup.NotLogin:
                    id = "";
                    group = "";

                    this.labelExpireOfPassword.Visible = false;

                    this.buttonRecipeNo.Enabled = true;
                    this.buttonClear.Enabled = true;
                    this.buttonInspection.Enabled = true;
                    this.buttonMenu.Enabled = true;
                    break;
                case Define.E_UserGroup.LogOut:
                    id = "Log Off";
                    group = "-";

                    this.labelExpireOfPassword.Visible = false;

                    if (this.labelUserLevel.TextColor != this.ParentForm.ColorLogOff)
                        this.labelUserLevel.TextColor = this.labelUserID.TextColor = this.ParentForm.ColorLogOff;

                    this.buttonUser.ButtonUp();
                    this.buttonRecipeNo.Enabled = false;
                    this.buttonClear.Enabled = false;
                    this.buttonInspection.Enabled = false;
                    this.buttonMenu.Enabled = false;
                    break;
                default:
                    break;
            }

            this.buttonRecipeNo.ButtonColor = this.ParentForm.ButtonColorChange(this.buttonRecipeNo.Enabled);
            this.buttonClear.ButtonColor = this.ParentForm.ButtonColorChange(this.buttonClear.Enabled);
            this.buttonInspection.ButtonColor = this.ParentForm.ButtonColorChange(this.buttonInspection.Enabled);
            this.buttonMenu.ButtonColor = this.ParentForm.ButtonColorChange(this.buttonMenu.Enabled);

            expireDate = this.DisplayExpireOfPassword(user.Group);
            if (expireDate != "-")
            {
                int intExpireDate = int.Parse(expireDate);

                if (intExpireDate == 0)
                {
                    this.labelExpireOfPassword.TextColor = this.ParentForm.ColorLogOff;
                    this.labelExpireOfPassword.Text = "D-0";
                }
                else if (intExpireDate < 0)
                {
                    if (intExpireDate * -1 > this.ParentForm.CurrentSystemStatus.CurrentUser.ExpirePassword)
                        expireDate = "-" + (this.ParentForm.CurrentSystemStatus.CurrentUser.ExpirePassword - 1).ToString();

                    this.labelExpireOfPassword.Text = "D" + expireDate;
                    if (intExpireDate >= -10)
                        this.labelExpireOfPassword.TextColor = this.ParentForm.ColorLogOff;
                    else
                        this.labelExpireOfPassword.TextColor = this.ParentForm.ColorLogOn;
                }
                else
                {
                    this.labelExpireOfPassword.TextColor = this.ParentForm.ColorLogOn;
                    this.labelExpireOfPassword.Text = "D+" + expireDate;
                }
            }
            else
            {
                this.labelExpireOfPassword.TextColor = this.ParentForm.ColorLogOn;
                this.labelExpireOfPassword.Text = "-";
            }

            if (this.labelUserLevel.Text != group)
                this.labelUserLevel.Text = group;
            if (this.labelUserID.Text != id)
                this.labelUserID.Text = id;
        }
        private void Login()
        {
            int extract = 0;
            DialogResult result;

            DialogFormLogOn logOn = new DialogFormLogOn(this.ParentForm, false, false);
            result = logOn.ShowDialog();
            if (result == DialogResult.OK)
            {
                if (this.ParentForm.CurrentSystemStatus.CurrentUser.Group == Define.E_UserGroup.Level1 ||
                    this.ParentForm.CurrentSystemStatus.CurrentUser.Group == Define.E_UserGroup.Level2 ||
                    this.ParentForm.CurrentSystemStatus.CurrentUser.Group == Define.E_UserGroup.Level3)
                {
                    // 비밀번호 만료일 10일 미만 체크 후 비밀번호 변경
                    this.PasswordExpirationCheck(this.ParentForm.CurrentSystemStatus.CurrentUser);
                }

                //this.ParentForm.ChildFormMenu.CenterEquipUserGroupEditor.UpdateAllMenu(this.ParentForm.CurrentSystemStatus);
                this.DisplayRefresh();

                this.buttonUser.ButtonDown();
                this.ParentForm.ChildFormMenu.UpdateDisplayUser(this.ParentForm.CurrentSystemStatus.CurrentUser);
            }
            else if (result == DialogResult.Abort)
            {
                // 비밀 번호 변경 띄우기
                DialogFormLogOn logOn1 = new DialogFormLogOn(this.ParentForm, false, true);
                if (logOn1.ShowDialog() == DialogResult.OK)
                {
                    //this.ParentForm.ChildFormMenu.CenterEquipUserGroupEditor.UpdateAllMenu(this.ParentForm.CurrentSystemStatus);
                    this.DisplayRefresh();

                    this.buttonUser.ButtonDown();
                    this.ParentForm.ChildFormMenu.UpdateDisplayUser(this.ParentForm.CurrentSystemStatus.CurrentUser);
                }
                else
                    this.buttonUser.ButtonUp();
            }
            else
            {
                this.buttonUser.ButtonUp();
            }
        }
        public void Logout()
        {
            this.ParentForm.CurrentSystemStatus.CurrentUser.Group = Define.E_UserGroup.LogOut;
            this.buttonUser.ButtonUp();
            this.buttonUser.ButtonText = "Login";
            this.ChangeID = "";

            // Part 11
            this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.Logout, "");

            this.DisplayRefresh();
        }
        private void PasswordExpirationCheck(UserItem user)
        {
            int expiryDay = 0;

            // 만료일 -10 일때 메시지 띄우기
            expiryDay = user.GetPasswordExpiryDday();
            if (expiryDay >= -10)
            {
                //Console.WriteLine("password : " + expiryDay.ToString());
                if (expiryDay < 0)
                    expiryDay *= -1;

                DialogFormYesNo myDlg = new DialogFormYesNo(this.ParentForm.SystemConfig.LANGUAGE, 2, expiryDay.ToString());
                if (myDlg.ShowDialog() == DialogResult.Yes)
                {
                    // 비밀 번호 변경 띄우기
                    DialogFormLogOn logOn = new DialogFormLogOn(this.ParentForm, true, true);
                    if (logOn.ShowDialog() == DialogResult.OK)
                    {

                    }
                }
            }
        }
        public void Part11AutomaticLogoutReset()
        {
            //UserManager.UserManager_AutoLogoutTimeoutReset();
        }
        public string DisplayExpireOfPassword(Define.E_UserGroup group)
        {
            string ret = "";

            if (group == Define.E_UserGroup.Admin || group == Define.E_UserGroup.Developer)
                ret = "-";
            else
            {
                //TimeSpan resultTime = DateTime.Now - this.ParentForm.CurrentSystemStatus.CurrentUser.DateExpireRegister;
                TimeSpan dayDiff = DateTime.Now.Date - this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordExpire.Date;
                ret = dayDiff.Days.ToString();
            }

            return ret;
        }

        public void CallBackUserListModifyInfoData(UserManager.UserMgr_user_info_t user)
        {
            this.ParentForm.CurrentSystemStatus.CurrentUser.DatePasswordExpire = DateTime.Now.AddDays(this.ParentForm.CurrentSystemStatus.CurrentUser.ExpirePassword - 1);
            this.DisplayExpireOfPassword(this.ParentForm.CurrentSystemStatus.CurrentUser.Group);
        }
        public void CallBackUserListLoginTimeoutDataEvent(UserManager.UserMgr_login_timeout_t user)
        {
            string code = "", message1 = "", message2 = "";
            int warningTime = 0;

            if (user.remainder_time != 0)
            {
                switch (this.ParentForm.SystemConfig.LANGUAGE)
                {
                    case Define.E_LanguageID.Korean:
                        code = "로그인";
                        message1 = "잠시 후에 로그아웃 됩니다";
                        message2 = "";
                        break;
                    case Define.E_LanguageID.English:
                        code = "Login";
                        message1 = "You will be logged out after a while";
                        message2 = "";
                        break;
                    default:
                        break;
                }

                warningTime = this.ParentForm.FlagAutomaticLogoutWarningTime - 2;

                this.UI_Invoke(delegate
                {
                    DialogFormMessage msg = new DialogFormMessage(Define.E_MessageBoxIcon.Asterisk, code, message1, message2, warningTime);
                    msg.ShowDialog();
                });
            }
            else
            {
                switch (this.ParentForm.SystemConfig.LANGUAGE)
                {
                    case Define.E_LanguageID.Korean:
                        code = "Login";
                        message1 = "자동 로그아웃 되었습니다";
                        message2 = "";
                        break;
                    case Define.E_LanguageID.English:
                        code = "Login";
                        message1 = "automatically logged out";
                        message2 = "";
                        break;
                    default:
                        break;
                }

                // User Logout
                UserManager.UserManager_UserLogout();

                this.UI_Invoke(delegate
                {
                    this.Logout();
                });

                this.UI_Invoke(delegate
                {
                    DialogFormMessage msg = new DialogFormMessage(Define.E_MessageBoxIcon.Asterisk, code, message1, message2, 0);
                    msg.ShowDialog();
                });
            }
        }

        private void GetJudgmentResult(Define.E_JudgmentStatus judg, SmartLabel label)
        {
            string value = "";

            switch (judg)
            {
                case Define.E_JudgmentStatus.None:
                    value = "-";
                    label.BackGroundColor = this.ColorResultNone;
                    break;
                case Define.E_JudgmentStatus.Pass:
                    value = "Pass";
                    label.BackGroundColor = this.ColorResultPass;
                    break;
                case Define.E_JudgmentStatus.Ng:
                    value = "Leak";
                    label.BackGroundColor = this.ColorResultNG;
                    break;
                case Define.E_JudgmentStatus.Error:
                    value = "Empty";
                    label.BackGroundColor = this.ColorResultNone;
                    break;
                default:
                    break;
            }

            if (label.Text != value)
                label.Text = value;
        }
        private void ProgressBarSetting(Define.E_ProcessStatus status)
        {
            switch (status)
            {
                case Define.E_ProcessStatus._6_VacuumStart:
                    this.smartTimerProgressBar.Start();
                    break;
                case Define.E_ProcessStatus._7_VacuumHold:
                    this.progressBar1.Value = 30;
                    break;
                case Define.E_ProcessStatus._8_Judgment:
                    this.progressBar1.Value = 60;
                    break;
                case Define.E_ProcessStatus._9_VacuumBreak:
                    this.progressBar1.Value = this.progressBar1.Maximum;
                    this.smartTimerProgressBar.Stop();
                    break;
                default:
                    break;
            }
        }

        public void InitialEthernetIcon()
        {
            // 이더넷
            if (this.ParentForm.SystemConfig.IsEthernetEnable == true)
            {
                this.pictureBoxEthernetDisable.Visible = false;
                this.pictureBoxEthernetDisconnection.Visible = true;
                this.pictureBoxEthernetConnection.Visible = false;
            }
            else
            {
                this.pictureBoxEthernetDisable.Visible = true;
                this.pictureBoxEthernetDisconnection.Visible = false;
                this.pictureBoxEthernetConnection.Visible = false;
            }
        }
        public void UpdateEthernetStatusDisplay(bool status)
        {
            //Console.Write("\n" + string.Format("UpdateEthernetStatusDisplay {0:yyyy-MM-dd HH:mm:ss}: {1}", DateTime.Now, status.ToString()));

            if (this.BeforeEthernetStatus == status)
                return;
            else
                this.BeforeEthernetStatus = status;

            if (status == true)
            {
                this.pictureBoxEthernetConnection.Visible = true;
                this.pictureBoxEthernetDisconnection.Visible = false;
            }
            else
            {
                this.pictureBoxEthernetConnection.Visible = false;
                this.pictureBoxEthernetDisconnection.Visible = true;
            }
        }
        public void TimerServer(bool value)
        {
            if (value == false)
            {
                if (this.timerServer.IsStart == true)
                    this.timerServer.Stop();
            }
            else
            {
                if (this.timerServer.IsStart == false)
                    this.timerServer.Start();
            }
        }
        public void MainButtonModbusAdd(bool bValue)
        {
            this.buttonModbus.Visible = bValue;
        }

        private void UpdateDisplayDotGraphDiff(SmartDraw draw, DiffData diff)
        {
            int iValue = 0;
            double dValue = 0.0;

            // 값 표시 범위
            // 15.000 ~ -2.000  (17.000 ~ 0)
            // 그래프 영역 높이 102
            // 17000 / 102 = 166.666666~
            //dValue = (int.Parse(data.CurrentValueSign + data.CurrentValue) + 2000) / 166.66666;

            if (dValue > 110)
                dValue = 110;
            if (dValue < 1)
                dValue = 1;

            iValue = int.Parse(string.Format("{0:f0}", dValue));

            draw.Chart.PutData(iValue);
        }
        private void UpdateDisplayDotGraphDisp(SmartDraw draw, DispData disp)
        {
            int iValue = 0;
            double dValue = 0.0;

            // 값 표시 범위
            // 15.000 ~ -2.000  (17.000 ~ 0)
            // 그래프 영역 높이 102
            // 17000 / 102 = 166.666666~
            //dValue = (int.Parse(data.CurrentValueSign + data.CurrentValue) + 2000) / 166.66666;

            if (dValue > 110)
                dValue = 110;
            if (dValue < 1)
                dValue = 1;

            iValue = int.Parse(string.Format("{0:f0}", dValue));

            draw.Chart.PutData(iValue);
        }
        public void UpdateEquipmentStatusDisplay(Define.E_EquipmentStatus status)
        {
            if (status == Define.E_EquipmentStatus.Start)
            {
                #region Start
                this.labelStart.Visible = true;
                this.labelStop.Visible = false;
                #endregion
            }
            else
            {
                #region Stop
                this.labelStart.Visible = false;
                this.labelStop.Visible = true;

                this.InitializeData();
                #endregion
            }
        }
        public void UpdateDisplayAlarmView(AlarmList alarm)
        {
            string value = "";

            // ServoEmergencyStop
            if (alarm.IsServoEmergencyStop == true)
                value = "a1_Servo emergency stop     ";
            // Servo1Alarm
            if (alarm.IsServo1Alarm == true)
                value += "a2_Servo1     ";
            // Servo2Alarm
            if (alarm.IsServo2Alarm == true)
                value += "a3_Servo2     ";
            // ServoTorque1AlarmTorque 
            if (alarm.IsServoTorque1AlarmTorque == true)
                value += "a4_Servo1 Torque     ";
            // ServoTorque2AlarmTorque 
            if (alarm.IsServoTorque2AlarmTorque == true)
                value += "a5_Servo2 Torque     ";
            // PressureError
            if (alarm.IsPressureError == true)
                value += "a6_Pressure     ";

            // SB Alarm
            this.CollectionLabelSbAlarm[0].Visible = alarm.CollectionIsSensorBoardError[0];
            this.CollectionLabelSbAlarm[1].Visible = alarm.CollectionIsSensorBoardError[1];
            this.CollectionLabelSbAlarm[2].Visible = alarm.CollectionIsSensorBoardError[2];
            this.CollectionLabelSbAlarm[3].Visible = alarm.CollectionIsSensorBoardError[3];
            this.CollectionLabelSbAlarm[4].Visible = alarm.CollectionIsSensorBoardError[4];
            this.CollectionLabelSbAlarm[5].Visible = alarm.CollectionIsSensorBoardError[5];
            this.CollectionLabelSbAlarm[6].Visible = alarm.CollectionIsSensorBoardError[6];
            this.CollectionLabelSbAlarm[7].Visible = alarm.CollectionIsSensorBoardError[7];
            this.CollectionLabelSbAlarm[8].Visible = alarm.CollectionIsSensorBoardError[8];
            this.CollectionLabelSbAlarm[9].Visible = alarm.CollectionIsSensorBoardError[9];

            value = value.Trim();
            this.labelAlarm.Size = new Size(value.Length * 9, 30);
            this.labelAlarm.Text = value;

            if (this.labelAlarm.Width > 400)
            {
                if (this.labelAlarm.Text != "")
                    this.smartTimerAlarm.Start();
            }
            else
            {
                this.smartTimerAlarm.Stop();
                this.labelAlarm.Location = new Point(3, 26);
            }
        }


        private void ProcessStatusPicturBox(Define.E_ProcessStatus status)
        {
            switch (status)
            {
                case Define.E_ProcessStatus._0_None:
                    break;
                case Define.E_ProcessStatus._1_Ready:
                    this.pictureBoxProgress0_1.Visible = true;
                    this.pictureBoxProgress0_1.BringToFront();
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._2_ProductEntry:
                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = true;
                    this.pictureBoxProgress0_2.BringToFront();
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._3_MoveToLeak:
                case Define.E_ProcessStatus._4_MoveToCheck:
                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = true;
                    this.pictureBoxProgress1_34.BringToFront();
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._5_ChamberMerge:
                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = true;
                    this.pictureBoxProgress2_5.BringToFront();
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._6_VacuumStart:
                case Define.E_ProcessStatus._7_VacuumHold:
                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = true;
                    this.pictureBoxProgress2_67.BringToFront();
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._8_Judgment:
                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = true;
                    this.pictureBoxProgress2_8.BringToFront();
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._9_VacuumBreak:
                case Define.E_ProcessStatus._10_ChamberRelease:
                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = true;
                    this.pictureBoxProgress2_910.BringToFront();
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._11_MoveToReady:
                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = true;
                    this.pictureBoxProgress3_11.BringToFront();
                    break;
                default:
                    break;
            }
        }
        // 진행상태 데이터
        private void ProcessStatusStep1(Define.E_ProcessStatus status)
        {
            this.smartTimerProgressBar.Stop();
            this.progressBar1.Value = this.progressBar1.Minimum;
            
            this.SetLabelRoundRectFillColor(this.labelProgress0, this.ColorProgressOn);
            this.SetLabelRoundRectFillColor(this.labelProgress1, this.ColorProgressOff);
            this.SetLabelRoundRectFillColor(this.labelProgress2, this.ColorProgressOff);
            this.SetLabelRoundRectFillColor(this.labelProgress3, this.ColorProgressOff);

            this.SetLabelBackGroundColor(this.labelProgress0_1, this.ColorProgressOn);
            this.SetLabelBackGroundColor(this.labelProgress1_1, this.ColorProgressOff);
            this.SetLabelBackGroundColor(this.labelProgress2_1, this.ColorProgressOff);
            this.SetLabelBackGroundColor(this.labelProgress3_1, this.ColorProgressOff);

            this.SetLabelTextColor(this.labelProgress0_1, this.ColorProgressTextOn);
            this.SetLabelTextColor(this.labelProgress1_1, this.ColorProgressTextOff);
            this.SetLabelTextColor(this.labelProgress2_1, this.ColorProgressTextOff);
            this.SetLabelTextColor(this.labelProgress3_1, this.ColorProgressTextOff);
        }
        private void ProcessStatusStep2(Define.E_ProcessStatus status)
        {
            this.smartTimerProgressBar.Stop();
            this.progressBar1.Value = this.progressBar1.Minimum;

            this.SetLabelRoundRectFillColor(this.labelProgress0, this.ColorProgressOff);
            this.SetLabelRoundRectFillColor(this.labelProgress1, this.ColorProgressOn);
            this.SetLabelRoundRectFillColor(this.labelProgress2, this.ColorProgressOff);
            this.SetLabelRoundRectFillColor(this.labelProgress3, this.ColorProgressOff);

            this.SetLabelBackGroundColor(this.labelProgress0_1, this.ColorProgressOff);
            this.SetLabelBackGroundColor(this.labelProgress1_1, this.ColorProgressOn);
            this.SetLabelBackGroundColor(this.labelProgress2_1, this.ColorProgressOff);
            this.SetLabelBackGroundColor(this.labelProgress3_1, this.ColorProgressOff);

            this.SetLabelTextColor(this.labelProgress0_1, this.ColorProgressTextOff);
            this.SetLabelTextColor(this.labelProgress1_1, this.ColorProgressTextOn);
            this.SetLabelTextColor(this.labelProgress2_1, this.ColorProgressTextOff);
            this.SetLabelTextColor(this.labelProgress3_1, this.ColorProgressTextOff);
        }
        private void ProcessStatusStep3(Define.E_ProcessStatus status)
        {
            this.SetLabelRoundRectFillColor(this.labelProgress0, this.ColorProgressOff);
            this.SetLabelRoundRectFillColor(this.labelProgress1, this.ColorProgressOff);
            this.SetLabelRoundRectFillColor(this.labelProgress2, this.ColorProgressOn);
            this.SetLabelRoundRectFillColor(this.labelProgress3, this.ColorProgressOff);

            this.SetLabelBackGroundColor(this.labelProgress0_1, this.ColorProgressOff);
            this.SetLabelBackGroundColor(this.labelProgress1_1, this.ColorProgressOff);
            this.SetLabelBackGroundColor(this.labelProgress2_1, this.ColorProgressOn);
            this.SetLabelBackGroundColor(this.labelProgress3_1, this.ColorProgressOff);

            this.SetLabelTextColor(this.labelProgress0_1, this.ColorProgressTextOff);
            this.SetLabelTextColor(this.labelProgress1_1, this.ColorProgressTextOff);
            this.SetLabelTextColor(this.labelProgress2_1, this.ColorProgressTextOn);
            this.SetLabelTextColor(this.labelProgress3_1, this.ColorProgressTextOff);

            this.ProgressBarSetting(status);
        }
        private void ProcessStatusStep4(Define.E_ProcessStatus status)
        {
            this.smartTimerProgressBar.Stop();
            this.progressBar1.Value = this.progressBar1.Minimum;

            this.SetLabelRoundRectFillColor(this.labelProgress0, this.ColorProgressOff);
            this.SetLabelRoundRectFillColor(this.labelProgress1, this.ColorProgressOff);
            this.SetLabelRoundRectFillColor(this.labelProgress2, this.ColorProgressOff);
            this.SetLabelRoundRectFillColor(this.labelProgress3, this.ColorProgressOn);

            this.SetLabelBackGroundColor(this.labelProgress0_1, this.ColorProgressOff);
            this.SetLabelBackGroundColor(this.labelProgress1_1, this.ColorProgressOff);
            this.SetLabelBackGroundColor(this.labelProgress2_1, this.ColorProgressOff);
            this.SetLabelBackGroundColor(this.labelProgress3_1, this.ColorProgressOn);

            this.SetLabelTextColor(this.labelProgress0_1, this.ColorProgressTextOff);
            this.SetLabelTextColor(this.labelProgress1_1, this.ColorProgressTextOff);
            this.SetLabelTextColor(this.labelProgress2_1, this.ColorProgressTextOff);
            this.SetLabelTextColor(this.labelProgress3_1, this.ColorProgressTextOn);
        }
        public void UpdateDisplayProcessStatus(Define.E_ProcessStatus status)
        {
            this.CurrentProcessStatus = status;

            switch (status)
            {
                case Define.E_ProcessStatus._0_None:
                    break;
                case Define.E_ProcessStatus._1_Ready:
                    this.ProcessStatusStep1(status);

                    this.pictureBoxProgress0_1.Visible = true;
                    this.pictureBoxProgress0_1.BringToFront();
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._2_ProductEntry:
                    this.InitializeData();
                    this.ProcessStatusStep1(status);

                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = true;
                    this.pictureBoxProgress0_2.BringToFront();
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._3_MoveToLeak:
                case Define.E_ProcessStatus._4_MoveToCheck:
                    this.ProcessStatusStep2(status);

                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = true;
                    this.pictureBoxProgress1_34.BringToFront();
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._5_ChamberMerge:
                    this.ProcessStatusStep3(status);

                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = true;
                    this.pictureBoxProgress2_5.BringToFront();
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._6_VacuumStart:
                case Define.E_ProcessStatus._7_VacuumHold:
                    this.ProcessStatusStep3(status);

                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = true;
                    this.pictureBoxProgress2_67.BringToFront();
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._8_Judgment:
                    this.ProcessStatusStep3(status);

                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = true;
                    this.pictureBoxProgress2_8.BringToFront();
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._9_VacuumBreak:
                case Define.E_ProcessStatus._10_ChamberRelease:
                    this.ProcessStatusStep3(status);

                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = true;
                    this.pictureBoxProgress2_910.BringToFront();
                    this.pictureBoxProgress3_11.Visible = false;
                    break;
                case Define.E_ProcessStatus._11_MoveToReady:
                    this.ProcessStatusStep4(status);

                    this.pictureBoxProgress0_1.Visible = false;
                    this.pictureBoxProgress0_2.Visible = false;
                    this.pictureBoxProgress1_34.Visible = false;
                    this.pictureBoxProgress2_5.Visible = false;
                    this.pictureBoxProgress2_67.Visible = false;
                    this.pictureBoxProgress2_8.Visible = false;
                    this.pictureBoxProgress2_910.Visible = false;
                    this.pictureBoxProgress3_11.Visible = true;
                    this.pictureBoxProgress3_11.BringToFront();
                    break;
                default:
                    break;
            }
        }
        public void UpdateDisplayProcessStatus1(Define.E_ProcessStatus status)
        {
            this.SetLabelNumberColor(8, this.ColorNumberUnSelected);
            this.SetLabelNumberColor(9, this.ColorNumberUnSelected);

            this.SetLabelNumberColor(0, this.ColorNumberSelected);
            this.SetLabelNumberColor(1, this.ColorNumberSelected);
        }
        public void UpdateDisplayProcessStatus2(Define.E_ProcessStatus status)
        {
        }
        public void UpdateDisplayProcessStatus3(Define.E_ProcessStatus status)
        {
            this.SetLabelNumberColor(0, this.ColorNumberUnSelected);
            this.SetLabelNumberColor(1, this.ColorNumberUnSelected);

            this.SetLabelNumberColor(2, this.ColorNumberSelected);
            this.SetLabelNumberColor(3, this.ColorNumberSelected);
        }
        public void UpdateDisplayProcessStatus4(Define.E_ProcessStatus status)
        {
        }
        public void UpdateDisplayProcessStatus5(Define.E_ProcessStatus status)
        {
            this.SetLabelNumberColor(2, this.ColorNumberUnSelected);
            this.SetLabelNumberColor(3, this.ColorNumberUnSelected);

            this.SetLabelNumberColor(4, this.ColorNumberSelected);
            this.SetLabelNumberColor(5, this.ColorNumberSelected);
        }
        public void UpdateDisplayProcessStatus6(Define.E_ProcessStatus status)
        {
        }
        public void UpdateDisplayProcessStatus7(Define.E_ProcessStatus status)
        {
            this.SetLabelNumberColor(4, this.ColorNumberUnSelected);
            this.SetLabelNumberColor(5, this.ColorNumberUnSelected);

            this.SetLabelNumberColor(6, this.ColorNumberSelected);
            this.SetLabelNumberColor(7, this.ColorNumberSelected);
        }
        public void UpdateDisplayProcessStatus8(Define.E_ProcessStatus status)
        {
        }
        public void UpdateDisplayProcessStatus9(Define.E_ProcessStatus status)
        {
            if (status == Define.E_ProcessStatus._4_MoveToCheck || status == Define.E_ProcessStatus._5_ChamberMerge)
            {
                this.SetLabelNumberColor(6, this.ColorNumberUnSelected);
                this.SetLabelNumberColor(7, this.ColorNumberUnSelected);

                this.SetLabelNumberColor(8, this.ColorNumberSelected);
                this.SetLabelNumberColor(9, this.ColorNumberSelected);
            }
        }
        public void UpdateDisplayProcessStatus10(Define.E_ProcessStatus status)
        {
        }

        // 차압센서 데이터
        public void UpdateDisplayDiffData(Collection<DiffData> datas)
        {
            for (int i = 0; i < this.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
                this.CollectionLabelLeakRatePerSec[i].Text = datas[i].SecBufDiff;
        }
        public void UpdateDisplayDiffData1(LeakData1 data)
        {
            this.CollectionLabelLeakRatePerSec[0].Text = data.DiffData.SecBufDiff;
        }
        public void UpdateDisplayDiffData2(LeakData1 data)
        {
            this.CollectionLabelLeakRatePerSec[1].Text = data.DiffData.SecBufDiff;
        }
        public void UpdateDisplayDiffData3(LeakData1 data)
        {
            this.CollectionLabelLeakRatePerSec[2].Text = data.DiffData.SecBufDiff;
        }
        public void UpdateDisplayDiffData4(LeakData1 data)
        {
            this.CollectionLabelLeakRatePerSec[3].Text = data.DiffData.SecBufDiff;
        }
        public void UpdateDisplayDiffData5(LeakData1 data)
        {
            this.CollectionLabelLeakRatePerSec[4].Text = data.DiffData.SecBufDiff;
        }
        public void UpdateDisplayDiffData6(LeakData1 data)
        {
            this.CollectionLabelLeakRatePerSec[5].Text = data.DiffData.SecBufDiff;
        }
        public void UpdateDisplayDiffData7(LeakData1 data)
        {
            this.CollectionLabelLeakRatePerSec[6].Text = data.DiffData.SecBufDiff;
        }
        public void UpdateDisplayDiffData8(LeakData1 data)
        {
            this.CollectionLabelLeakRatePerSec[7].Text = data.DiffData.SecBufDiff;
        }
        public void UpdateDisplayDiffData9(LeakData1 data)
        {
            this.CollectionLabelLeakRatePerSec[8].Text = data.DiffData.SecBufDiff;
        }
        public void UpdateDisplayDiffData10(LeakData1 data)
        {
            this.CollectionLabelLeakRatePerSec[9].Text = data.DiffData.SecBufDiff;
        }

        // 변위센서 데이터
        public void UpdateDisplayDispData(Collection<DispData> datas)
        {

        }
        public void UpdateDisplayDispData1(LeakData1 data)
        {

        }
        public void UpdateDisplayDispData2(LeakData1 data)
        {

        }
        public void UpdateDisplayDispData3(LeakData1 data)
        {

        }
        public void UpdateDisplayDispData4(LeakData1 data)
        {

        }
        public void UpdateDisplayDispData5(LeakData1 data)
        {

        }
        public void UpdateDisplayDispData6(LeakData1 data)
        {

        }
        public void UpdateDisplayDispData7(LeakData1 data)
        {

        }
        public void UpdateDisplayDispData8(LeakData1 data)
        {

        }
        public void UpdateDisplayDispData9(LeakData1 data)
        {

        }
        public void UpdateDisplayDispData10(LeakData1 data)
        {

        }

        // 압력센서 데이터
        public void UpdateDisplayPresData(Collection<PressureData> datas)
        {
            for (int i = 0; i < this.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
            {
                this.CollectionLabelPressureWorking[i].Text = datas[i].WorkingChamber.Trim();
                this.CollectionLabelPressureMaster[i].Text = datas[i].MasterChamber.Trim();
            }
        }
        public void UpdateDisplayPresData1(LeakData1 data)
        {
            this.CollectionLabelPressureWorking[0].Text = data.PresData.WorkingChamber.Trim();
            this.CollectionLabelPressureMaster[0].Text = data.PresData.MasterChamber.Trim();
        }
        public void UpdateDisplayPresData2(LeakData1 data)
        {
            this.CollectionLabelPressureWorking[1].Text = data.PresData.WorkingChamber.Trim();
            this.CollectionLabelPressureMaster[1].Text = data.PresData.MasterChamber.Trim();
        }
        public void UpdateDisplayPresData3(LeakData1 data)
        {
            this.CollectionLabelPressureWorking[2].Text = data.PresData.WorkingChamber.Trim();
            this.CollectionLabelPressureMaster[2].Text = data.PresData.MasterChamber.Trim();
        }
        public void UpdateDisplayPresData4(LeakData1 data)
        {
            this.CollectionLabelPressureWorking[3].Text = data.PresData.WorkingChamber.Trim();
            this.CollectionLabelPressureMaster[3].Text = data.PresData.MasterChamber.Trim();
        }
        public void UpdateDisplayPresData5(LeakData1 data)
        {
            this.CollectionLabelPressureWorking[4].Text = data.PresData.WorkingChamber.Trim();
            this.CollectionLabelPressureMaster[4].Text = data.PresData.MasterChamber.Trim();
        }
        public void UpdateDisplayPresData6(LeakData1 data)
        {
            this.CollectionLabelPressureWorking[5].Text = data.PresData.WorkingChamber.Trim();
            this.CollectionLabelPressureMaster[5].Text = data.PresData.MasterChamber.Trim();
        }
        public void UpdateDisplayPresData7(LeakData1 data)
        {
            this.CollectionLabelPressureWorking[6].Text = data.PresData.WorkingChamber.Trim();
            this.CollectionLabelPressureMaster[6].Text = data.PresData.MasterChamber.Trim();
        }
        public void UpdateDisplayPresData8(LeakData1 data)
        {
            this.CollectionLabelPressureWorking[7].Text = data.PresData.WorkingChamber.Trim();
            this.CollectionLabelPressureMaster[7].Text = data.PresData.MasterChamber.Trim();
        }
        public void UpdateDisplayPresData9(LeakData1 data)
        {
            this.CollectionLabelPressureWorking[8].Text = data.PresData.WorkingChamber.Trim();
            this.CollectionLabelPressureMaster[8].Text = data.PresData.MasterChamber.Trim();
        }
        public void UpdateDisplayPresData10(LeakData1 data)
        {
            this.CollectionLabelPressureWorking[9].Text = data.PresData.WorkingChamber.Trim();
            this.CollectionLabelPressureMaster[9].Text = data.PresData.MasterChamber.Trim();
        }
        
        // 판정결과
        public void UpdateDisplayJudgmentData(LeakData datas)
        {
            for (int i = 0; i < this.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
            {
                this.GetJudgmentResult(datas.CollJudgment[i], this.CollectionLabelResult[i]);
                this.CollectionLabelResult[i].Visible = true;
            }

            this.ParentForm.TrackingInspectionData(datas);
            this.ChildControl.UpdateStartLeakDataDisplay(datas);
        }
        public void UpdateDisplayJudgmentData1(LeakData1 data)
        {
            if (this.IsTestMode == false)
            {
                this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[0]);
                this.CollectionLabelResult[0].Visible = true;

                this.ChildControl.UpdateStartLeakDataDisplay1(data);
            }
            else
            {
                this.GetJudgmentResult(Define.E_JudgmentStatus.Ng, this.CollectionLabelResult[0]);
                this.CollectionLabelResult[0].Visible = true;
            }
        }
        public void UpdateDisplayJudgmentData2(LeakData1 data)
        {
            if (this.IsTestMode == false)
            {
                this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[1]);
                this.CollectionLabelResult[1].Visible = true;

                this.ChildControl.UpdateStartLeakDataDisplay2(data);
            }
            else
            {
                this.GetJudgmentResult(Define.E_JudgmentStatus.Pass, this.CollectionLabelResult[1]);
                this.CollectionLabelResult[1].Visible = true;
            }
        }
        public void UpdateDisplayJudgmentData3(LeakData1 data)
        {
            if (this.IsTestMode == false)
            {
                this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[2]);
                this.CollectionLabelResult[2].Visible = true;

                this.ChildControl.UpdateStartLeakDataDisplay3(data);
            }
            else
            {
                this.GetJudgmentResult(Define.E_JudgmentStatus.Pass, this.CollectionLabelResult[2]);
                this.CollectionLabelResult[2].Visible = true;
            }
        }
        public void UpdateDisplayJudgmentData4(LeakData1 data)
        {
            if (this.IsTestMode == false)
            {
                this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[3]);
                this.CollectionLabelResult[3].Visible = true;

                this.ChildControl.UpdateStartLeakDataDisplay4(data);
            }
            else
            {
                this.GetJudgmentResult(Define.E_JudgmentStatus.Ng, this.CollectionLabelResult[3]);
                this.CollectionLabelResult[3].Visible = true;
            }
        }
        public void UpdateDisplayJudgmentData5(LeakData1 data)
        {
            if (this.IsTestMode == false)
            {
                this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[4]);
                this.CollectionLabelResult[4].Visible = true;

                this.ChildControl.UpdateStartLeakDataDisplay5(data);
            }
            else
            {
                this.GetJudgmentResult(Define.E_JudgmentStatus.Pass, this.CollectionLabelResult[4]);
                this.CollectionLabelResult[4].Visible = true;
            }
        }
        public void UpdateDisplayJudgmentData6(LeakData1 data)
        {
            if (this.IsTestMode == false)
            {
                this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[5]);
                this.CollectionLabelResult[5].Visible = true;

                this.ChildControl.UpdateStartLeakDataDisplay6(data);
            }
            else
            {
                this.GetJudgmentResult(Define.E_JudgmentStatus.Pass, this.CollectionLabelResult[5]);
                this.CollectionLabelResult[5].Visible = true;
            }
        }
        public void UpdateDisplayJudgmentData7(LeakData1 data)
        {
            if (this.IsTestMode == false)
            {
                this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[6]);
                this.CollectionLabelResult[6].Visible = true;

                this.ChildControl.UpdateStartLeakDataDisplay7(data);
            }
            else
            {
                this.GetJudgmentResult(Define.E_JudgmentStatus.Pass, this.CollectionLabelResult[6]);
                this.CollectionLabelResult[6].Visible = true;
            }
        }
        public void UpdateDisplayJudgmentData8(LeakData1 data)
        {
            if (this.IsTestMode == false)
            {
                this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[7]);
                this.CollectionLabelResult[7].Visible = true;

                this.ChildControl.UpdateStartLeakDataDisplay8(data);
            }
            else
            {
                this.GetJudgmentResult(Define.E_JudgmentStatus.Ng, this.CollectionLabelResult[7]);
                this.CollectionLabelResult[7].Visible = true;
            }
        }
        public void UpdateDisplayJudgmentData9(LeakData1 data)
        {
            if (this.IsTestMode == false)
            {
                this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[8]);
                this.CollectionLabelResult[8].Visible = true;

                this.ChildControl.UpdateStartLeakDataDisplay9(data);
                this.SetLabelNumberColor(8, this.ColorNumberUnSelected);
            }
            else
            {
                this.GetJudgmentResult(Define.E_JudgmentStatus.Pass, this.CollectionLabelResult[8]);
                this.CollectionLabelResult[8].Visible = true;
            }
        }
        public void UpdateDisplayJudgmentData10(LeakData1 data)
        {
            if (this.IsTestMode == false)
            {
                this.GetJudgmentResult(data.Judgment, this.CollectionLabelResult[9]);
                this.CollectionLabelResult[9].Visible = true;

                this.ChildControl.UpdateStartLeakDataDisplay10(data);
                this.SetLabelNumberColor(9, this.ColorNumberUnSelected);
            }
            else
            {
                this.GetJudgmentResult(Define.E_JudgmentStatus.Pass, this.CollectionLabelResult[9]);
                this.CollectionLabelResult[9].Visible = true;
            }
        }

        public void UpdateDisplayRecipeData(Recipe data)
        {
            this.buttonRecipeNo.ButtonText = data.NUMBER.ToString();
        }
        public void UpdateDisplayTime(DateTime time)
        {
            this.labelTime.Text = time.ToString("yyyy-MM-dd HH:mm:ss");
        }

        public void DisplayRefresh()
        {
            this.ParentForm.CurrentSystemStatus.CurrentForm = Define.E_FormStore.FormMainDisplay;
            this.ParentForm.CurrentSystemStatus.CurrentDisplayMode = Define.E_DisplayModeStore.MainDisplay;
            this.ParentForm.SetDisplayMode(Define.E_EquipmentMode.Normal);

            this.buttonRecipeNo.ButtonText = this.ParentForm.CurrentRecipe.NUMBER.ToString();
            this.InitializeProcessStatus();

            this.ChildModbus.Visible = false;

            this.UpdateDisplayUser(this.ParentForm.CurrentSystemStatus.CurrentUser);
        }
        #endregion

        #region Override Member
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.smartTimerLogin.Start();
        }
        #endregion

        #region Event Handler
        private void labelStop_Click(object sender, EventArgs e)
        {
            this.ParentForm.TransferData(CommunicationCommand.Start, CommunicationID.MainBoard);

            this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.EquipmentStart, "");
        }
        private void labelStart_Click(object sender, EventArgs e)
        {
            this.ParentForm.TransferData(CommunicationCommand.Stop, CommunicationID.MainBoard);

            this.ParentForm.SetTrackingHistoryData(Define.E_TrackingOperation.EquipmentStop, "");
        }

        private void buttonProductNo_Click(object sender, EventArgs e)
        {
            string before = "", after = "";

            this.Part11AutomaticLogoutReset();

            before = this.buttonRecipeNo.ButtonText;
            DialogFormNumKeyPad myKeypad = new DialogFormNumKeyPad("NUMBER", this.buttonRecipeNo.ButtonText, 4, 0, false);

            if (myKeypad.ShowDialog() == DialogResult.OK)
            {
                if (myKeypad.IntValue < 1 || myKeypad.IntValue > 1000)
                {
                    this.MessageBoxRange = "1 ~ 1000";
                    this.buttonRecipeNo.ButtonText = before;
                    this.smartTimerMessageShow.Start();
                    return;
                }

                this.buttonRecipeNo.ButtonText = "**";
                this.ParentForm.TransferRecipeParameter9043(myKeypad.IntValue);
                after = myKeypad.StringValue;

                this.ParentForm.SetTrackingHistoryData(Define.E_TrackingParameter.RecipeNumber, "", before, after);
            }
        }
        private void buttonInspection_Click(object sender, EventArgs e)
        {
            this.Part11AutomaticLogoutReset();

            this.ParentForm.TransferData(CommunicationCommand.CutInpupt, CommunicationID.MainBoard);

            //this.InitializeData();
            this.ChildControl.ClearAllData();
        }
        private void buttonUser_Click(object sender, EventArgs e)
        {
            this.Part11AutomaticLogoutReset();

            if (this.ParentForm.CurrentSystemStatus.CurrentUser.Group == Define.E_UserGroup.LogOut)
            {
                this.Login();
            }
            else
            {
                DialogFormYesNo msg = new DialogFormYesNo(this.ParentForm.SystemConfig.LANGUAGE, 12);
                if (msg.ShowDialog() == DialogResult.Yes)
                {
                    this.Logout();
                }
            }
            this.InitializeProcessStatus();
        }
        private void buttonMenu_Click(object sender, EventArgs e)
        {
            this.Part11AutomaticLogoutReset();

            if (this.ParentForm.CurrentSystemStatus.EquipmentStatus == Define.E_EquipmentStatus.Stop)
            {
                UserManager.UserManager_AutoLogoutTimeoutPause();

                this.ParentForm.ChildFormMenu.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                this.ParentForm.FormChange((int)Define.E_FormStore.FormMenu);
            }
        }
        private void buttonModbus_Click(object sender, EventArgs e)
        {
            this.Part11AutomaticLogoutReset();

            if (this.ChildModbus.Visible == true)
            {
                this.ChildModbus.Visible = false;
            }
            else
            {
                this.ChildModbus.DisplayRefresh();
                this.ChildModbus.BringToFront();
                this.ChildModbus.Visible = true;
            }
        }

        private void smartDraw1_Click(object sender, EventArgs e)
        {
            this.ChildControl.DisplayRefresh(1);
            this.ChildControl.Visible = true;
        }
        private void smartDraw2_Click(object sender, EventArgs e)
        {
            this.ChildControl.DisplayRefresh(2);
            this.ChildControl.Visible = true;
        }
        private void smartDraw3_Click(object sender, EventArgs e)
        {
            this.ChildControl.DisplayRefresh(3);
            this.ChildControl.Visible = true;
        }
        private void smartDraw4_Click(object sender, EventArgs e)
        {
            this.ChildControl.DisplayRefresh(4);
            this.ChildControl.Visible = true;
        }
        private void smartDraw5_Click(object sender, EventArgs e)
        {
            this.ChildControl.DisplayRefresh(5);
            this.ChildControl.Visible = true;
        }
        private void smartDraw6_Click(object sender, EventArgs e)
        {
            this.ChildControl.DisplayRefresh(6);
            this.ChildControl.Visible = true;
        }
        private void smartDraw7_Click(object sender, EventArgs e)
        {
            this.ChildControl.DisplayRefresh(7);
            this.ChildControl.Visible = true;
        }
        private void smartDraw8_Click(object sender, EventArgs e)
        {
            this.ChildControl.DisplayRefresh(8);
            this.ChildControl.Visible = true;
        }
        private void smartDraw9_Click(object sender, EventArgs e)
        {
            this.ChildControl.DisplayRefresh(9);
            this.ChildControl.Visible = true;
        }
        private void smartDraw10_Click(object sender, EventArgs e)
        {
            this.ChildControl.DisplayRefresh(10);
            this.ChildControl.Visible = true;
        }
        private void buttonClear_Click(object sender, EventArgs e)
        {
            this.InitializeData();
            this.ChildControl.ClearAllData();
        }

        private void buttonExit_Click(object sender, EventArgs e)
        {
            this.ParentForm.CloseSmartUartLink();
            this.ParentForm.Dispose();
            this.ParentForm.Close();
        }

        private void smartTimerAlarm_Tick(object sender, EventArgs e)
        {
            this.labelAlarm.Left = this.labelAlarm.Left - 5;
            if (this.labelAlarm.Left < 0 - this.labelAlarm.Width - 20)
                this.labelAlarm.Left = this.smartGroupBox1.Width - 10;
        }
        private void smartTimerMessageShow_Tick(object sender, EventArgs e)
        {
            this.smartTimerMessageShow.Stop();

            DialogFormMessage msg = new DialogFormMessage(1, this.ParentForm.SystemConfig.LANGUAGE, this.MessageBoxRange);
            msg.ShowDialog();
        }
        private void smartTimerLogin_Tick(object sender, EventArgs e)
        {
            this.smartTimerLogin.Stop();

            //this.Login();
        }
        private void smartTimerProgressBar_Tick(object sender, EventArgs e)
        {
            if (this.CurrentProcessStatus == Define.E_ProcessStatus._6_VacuumStart)
            {
                if (this.progressBar1.Value < 30)
                    this.progressBar1.Value++;
            }
            else if (this.CurrentProcessStatus == Define.E_ProcessStatus._7_VacuumHold)
            {
                if (this.progressBar1.Value < 60)
                    this.progressBar1.Value++;
            }
            else if (this.CurrentProcessStatus == Define.E_ProcessStatus._8_Judgment)
            {
                if (this.progressBar1.Value == this.progressBar1.Maximum)
                    this.smartTimerProgressBar.Stop();
                else
                    this.progressBar1.Value++;
            }
        }
        private void timerServer_Tick(object sender, EventArgs e)
        {
            if (this.ParentForm.smartTCPMultiServer.IsStart == true)
            {
                if (this.ParentForm.smartTCPMultiServer.ClientInfoList == null)
                    this.UpdateEthernetStatusDisplay(false);
                else
                    this.UpdateEthernetStatusDisplay(true);
            }
        }

        private void buttonTest_Click(object sender, EventArgs e)
        {
            if (this.buttonTest.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
            {
                //this.InitializeData();
                this.ParentForm.TransferData(CommunicationCommand.CutInpupt, CommunicationID.MainBoard);
                this.smartTimerTest.Start();
                this.IsTestMode = true;
            }
            else
            {
                this.smartTimerTest.Stop();
                this.IsTestMode = false;
            }
        }
        private void smartTimerTest_Tick(object sender, EventArgs e)
        {
            //this.InitializeData();
            this.ParentForm.TransferData(CommunicationCommand.CutInpupt, CommunicationID.MainBoard);
        }
        #endregion

        private void smartButton4_Click(object sender, EventArgs e)
        {
            string value = "";

            this.smartTimerAlarm.Stop();

            value = "a1_Servo emergency stop     ";
            value += "a2_Servo1     ";
            value += "a3_Servo2     ";
            value += "a4_Servo1 Torque     ";
            value += "a5_Servo2 Torque     ";
            //value += "a6_Pressure     ";

            value = value.Trim();
            this.labelAlarm.Size = new Size(value.Length * 8, 20);
            this.labelAlarm.Text = value;

            if (this.labelAlarm.Width > 400)
            {
                if (this.labelAlarm.Text != "")
                    this.smartTimerAlarm.Start();
            }
            else
            {
                this.smartTimerAlarm.Stop();
                this.labelAlarm.Location = new Point(3, 26);
            }
        }
        private void smartButton5_Click(object sender, EventArgs e)
        {
            switch (this.testIndex)
            {
                case 0:
                    this.UpdateDisplayProcessStatus(Define.E_ProcessStatus._1_Ready);
                    break;
                case 1:
                    this.UpdateDisplayProcessStatus(Define.E_ProcessStatus._2_ProductEntry);
                    break;
                case 2:
                    this.UpdateDisplayProcessStatus(Define.E_ProcessStatus._3_MoveToLeak);
                    break;
                case 3:
                    this.UpdateDisplayProcessStatus(Define.E_ProcessStatus._4_MoveToCheck);
                    break;
                case 4:
                    this.UpdateDisplayProcessStatus(Define.E_ProcessStatus._5_ChamberMerge);
                    break;
                case 5:
                    this.UpdateDisplayProcessStatus(Define.E_ProcessStatus._6_VacuumStart);
                    break;
                case 6:
                    this.UpdateDisplayProcessStatus(Define.E_ProcessStatus._7_VacuumHold);
                    break;
                case 7:
                    this.UpdateDisplayProcessStatus(Define.E_ProcessStatus._8_Judgment);
                    break;
                case 8:
                    this.UpdateDisplayProcessStatus(Define.E_ProcessStatus._9_VacuumBreak);
                    break;
                case 9:
                    this.UpdateDisplayProcessStatus(Define.E_ProcessStatus._10_ChamberRelease);
                    break;
                case 10:
                    this.UpdateDisplayProcessStatus(Define.E_ProcessStatus._11_MoveToReady);
                    break;
                default:
                    break;
            }

            if (this.testIndex >= 10)
                this.testIndex = 0;
            else
                this.testIndex++;
        }
    }
}