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

using SmartX;
using ITC81DB_2.Controls;
using ITC81DB_2.DialogForms;
using ITC81DB_2_ImageDll;

namespace ITC81DB_2.Forms
{
    public partial class FormMenu : Form
    {
        #region Field
        private FormMain m_ParentForm;

        private Define.E_MenuSide SelectedSideMenu;
        private Collection<SmartButton> CollectionButtonMenu;

        // 기본설정
        public ControlCenterBasicDataBackup CenterBasicDataBackup;
        public ControlCenterBasicDataStatistics CenterBasicDataStatistics;
        public ControlCenterBasicHelp CenterBasicHelp;
        public ControlCenterBasicProduct CenterBasicProduct;
        public ControlCenterBasicTime CenterBasicTime;
        // 환경설정
        public ControlCenterConfiCommunication CenterConfiCommunication;
        public ControlCenterConfiHelp CenterConfiHelp;
        public ControlCenterConfiOptionBoard CenterConfiOptionBoard;
        public ControlCenterConfiSerial CenterConfiSerial;
        public ControlCenterConfiEthernet CenterConfiEthernet;
        // 장비설정
        public ControlCenterEquipHelp CenterEquipHelp;
        public ControlCenterEquipInitialize CenterEquipInitialize;
        public ControlCenterEquipUpdate CenterEquipUpdate;
        public ControlCenterEquipFunctionSetting CenterEquipFunctionSetting;
        public ControlCenterEquipUser CenterEquipUser;
        public ControlCenterEquipEngineer CenterEquipEngineer;
        // 시스템설정
        public ControlCenterSystemAutoZero CenterSystemAutoZero;
        public ControlCenterSystemCalibration CenterSystemCalibration;
        public ControlCenterSystemHelp CenterSystemHelp;
        public ControlCenterSystemIOTest CenterSystemIOTest;
        public ControlCenterSystemJudgmentSetting CenterSystemJudgmentSetting;
        public ControlCenterSystemSorterSetting CenterSystemSorterSetting;
        // 시스템 정보
        public ControlCenterInforHelp CenterInforHelp;
        public ControlCenterInforSystem CenterInforSystemInformation;
        public ControlCenterInforAS CenterInforAS;

        // Bottom Menu
        public ControlBottomBasic BottomBasic;
        public ControlBottomConfiguration BottomConfiguration;
        public ControlBottomEquipment BottomEquipment;
        public ControlBottomInformation BottomInformation;
        public ControlBottomSystem BottomSystem;
        #endregion

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

            this.ParentForm = parent;

            this.DefaultSetting();
            this.InitializeDesign();
        }
        #endregion

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

        #region Method
        public void InitializeDesign()
        {
            Class1 images = new Class1();

            if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.English)
            {
                this.buttonBasic.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuDefaultDisable));
                this.buttonBasic.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuDefaultDown));
                this.buttonBasic.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuDefaultUp));
                this.buttonConfiguration.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuConfigDisable));
                this.buttonConfiguration.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuConfigDown));
                this.buttonConfiguration.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuConfigUp));
                this.buttonSystem.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuSystemDisable));
                this.buttonSystem.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuSystemDown));
                this.buttonSystem.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuSystemUp));
                this.buttonEquipment.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuEquipmentDisable));
                this.buttonEquipment.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuEquipmentDown));
                this.buttonEquipment.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuEquipmentUp));
                this.buttonInformation.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuInformationDisable));
                this.buttonInformation.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuInformationDown));
                this.buttonInformation.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engFormMenuInformationUp));
            }
            else if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Chinese)
            {
                this.buttonBasic.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuDefaultDisable));
                this.buttonBasic.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuDefaultDown));
                this.buttonBasic.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuDefaultUp));
                this.buttonConfiguration.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuConfigDisable));
                this.buttonConfiguration.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuConfigDown));
                this.buttonConfiguration.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuConfigUp));
                this.buttonSystem.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuSystemDisable));
                this.buttonSystem.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuSystemDown));
                this.buttonSystem.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuSystemUp));
                this.buttonEquipment.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuEquipmentDisable));
                this.buttonEquipment.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuEquipmentDown));
                this.buttonEquipment.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuEquipmentUp));
                this.buttonInformation.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuInformationDisable));
                this.buttonInformation.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuInformationDown));
                this.buttonInformation.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnFormMenuInformationUp));
            }
            else if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Spanish)
            {
                this.buttonBasic.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuDefaultDisable));
                this.buttonBasic.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuDefaultDown));
                this.buttonBasic.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuDefaultUp));
                this.buttonConfiguration.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuConfigDisable));
                this.buttonConfiguration.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuConfigDown));
                this.buttonConfiguration.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuConfigUp));
                this.buttonSystem.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuSystemDisable));
                this.buttonSystem.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuSystemDown));
                this.buttonSystem.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuSystemUp));
                this.buttonEquipment.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuEquipmentDisable));
                this.buttonEquipment.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuEquipmentDown));
                this.buttonEquipment.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuEquipmentUp));
                this.buttonInformation.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuInformationDisable));
                this.buttonInformation.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuInformationDown));
                this.buttonInformation.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.spnFormMenuInformationUp));
            }
            else
            {
                this.buttonBasic.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuDefaultDisable));
                this.buttonBasic.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuDefaultDown));
                this.buttonBasic.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuDefaultUp));
                this.buttonConfiguration.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuConfigDisable));
                this.buttonConfiguration.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuConfigDown));
                this.buttonConfiguration.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuConfigUp));
                this.buttonSystem.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuSystemDisable));
                this.buttonSystem.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuSystemDown));
                this.buttonSystem.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuSystemUp));
                this.buttonEquipment.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuEquipmentDisable));
                this.buttonEquipment.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuEquipmentDown));
                this.buttonEquipment.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuEquipmentUp));
                this.buttonInformation.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuInformationDisable));
                this.buttonInformation.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuInformationDown));
                this.buttonInformation.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korFormMenuInformationUp));
            }
        }
        private void DefaultSetting()
        {
            this.SelectedSideMenu = Define.E_MenuSide.Basic;

            this.CollectionButtonMenu = new Collection<SmartButton>();
            this.CollectionButtonMenu.Clear();
            this.CollectionButtonMenu.Add(this.buttonBasic);
            this.CollectionButtonMenu.Add(this.buttonSystem);
            this.CollectionButtonMenu.Add(this.buttonEquipment);
            this.CollectionButtonMenu.Add(this.buttonInformation);
            this.CollectionButtonMenu.Add(this.buttonMain);

            this.InitializeControl();
        }
        private void InitializeControl()
        {
            this.CreateCenterBasicControl();
            this.CreateCenterConfigurationControl();
            this.CreateCenterEquipmentControl();
            this.CreateCenterSystemControl();
            this.CreateCenterInformationControl();

            #region new
            // Bottom Menu
            this.BottomBasic = new ControlBottomBasic(this);
            this.BottomConfiguration = new ControlBottomConfiguration(this);
            this.BottomEquipment = new ControlBottomEquipment(this);
            this.BottomInformation = new ControlBottomInformation(this);
            this.BottomSystem = new ControlBottomSystem(this);
            #endregion

            #region Location
            // Bottom Menu
            this.BottomBasic.Location = new Point(0, 535);
            this.BottomConfiguration.Location = new Point(0, 535);
            this.BottomEquipment.Location = new Point(0, 535);
            this.BottomInformation.Location = new Point(0, 535);
            this.BottomSystem.Location = new Point(0, 535);
            #endregion

            #region Add
            // Bottom Menu
            this.Controls.Add(this.BottomBasic);
            this.Controls.Add(this.BottomConfiguration);
            this.Controls.Add(this.BottomEquipment);
            this.Controls.Add(this.BottomInformation);
            this.Controls.Add(this.BottomSystem);
            #endregion
        }
        private void CreateCenterBasicControl()
        {
            this.CenterBasicDataBackup = new ControlCenterBasicDataBackup(this);
            this.CenterBasicDataStatistics = new ControlCenterBasicDataStatistics(this);
            this.CenterBasicHelp = new ControlCenterBasicHelp(this);
            this.CenterBasicProduct = new ControlCenterBasicProduct(this);
            this.CenterBasicTime = new ControlCenterBasicTime(this);

            this.CenterBasicDataBackup.Location = new Point(0, 65);
            this.CenterBasicDataStatistics.Location = new Point(0, 65);
            this.CenterBasicHelp.Location = new Point(0, 65);
            this.CenterBasicProduct.Location = new Point(0, 65);
            this.CenterBasicTime.Location = new Point(0, 65);

            this.Controls.Add(this.CenterBasicDataBackup);
            this.Controls.Add(this.CenterBasicDataStatistics);
            this.Controls.Add(this.CenterBasicHelp);
            this.Controls.Add(this.CenterBasicProduct);
            this.Controls.Add(this.CenterBasicTime);
        }
        private void CreateCenterConfigurationControl()
        {
            this.CenterConfiCommunication = new ControlCenterConfiCommunication(this);
            this.CenterConfiHelp = new ControlCenterConfiHelp(this);
            this.CenterConfiOptionBoard = new ControlCenterConfiOptionBoard(this);
            this.CenterConfiSerial = new ControlCenterConfiSerial(this);
            this.CenterConfiEthernet = new ControlCenterConfiEthernet(this);

            this.CenterConfiCommunication.Location = new Point(0, 65);
            this.CenterConfiHelp.Location = new Point(0, 65);
            this.CenterConfiOptionBoard.Location = new Point(0, 65);
            this.CenterConfiSerial.Location = new Point(0, 65);
            this.CenterConfiEthernet.Location = new Point(0, 65);

            this.Controls.Add(this.CenterConfiCommunication);
            this.Controls.Add(this.CenterConfiHelp);
            this.Controls.Add(this.CenterConfiOptionBoard);
            this.Controls.Add(this.CenterConfiSerial);
            this.Controls.Add(this.CenterConfiEthernet);
        }
        private void CreateCenterEquipmentControl()
        {
            this.CenterEquipHelp = new ControlCenterEquipHelp(this);
            this.CenterEquipInitialize = new ControlCenterEquipInitialize(this);
            this.CenterEquipUpdate = new ControlCenterEquipUpdate(this);
            this.CenterEquipFunctionSetting = new ControlCenterEquipFunctionSetting(this);
            this.CenterEquipUser = new ControlCenterEquipUser(this);
            this.CenterEquipEngineer = new ControlCenterEquipEngineer(this);

            this.CenterEquipHelp.Location = new Point(0, 65);
            this.CenterEquipInitialize.Location = new Point(0, 65);
            this.CenterEquipUpdate.Location = new Point(0, 65);
            this.CenterEquipFunctionSetting.Location = new Point(0, 65);
            this.CenterEquipUser.Location = new Point(0, 65);
            this.CenterEquipEngineer.Location = new Point(0, 65);

            this.Controls.Add(this.CenterEquipHelp);
            this.Controls.Add(this.CenterEquipInitialize);
            this.Controls.Add(this.CenterEquipUpdate);
            this.Controls.Add(this.CenterEquipFunctionSetting);
            this.Controls.Add(this.CenterEquipUser);
            this.Controls.Add(this.CenterEquipEngineer);
        }
        private void CreateCenterSystemControl()
        {
            this.CenterSystemCalibration = new ControlCenterSystemCalibration(this);
            this.CenterSystemJudgmentSetting = new ControlCenterSystemJudgmentSetting(this);
            this.CenterSystemHelp = new ControlCenterSystemHelp(this);
            this.CenterSystemIOTest = new ControlCenterSystemIOTest(this);
            this.CenterSystemSorterSetting = new ControlCenterSystemSorterSetting(this);
            this.CenterSystemAutoZero = new ControlCenterSystemAutoZero(this);

            this.CenterSystemCalibration.Location = new Point(0, 65);
            this.CenterSystemJudgmentSetting.Location = new Point(0, 65);
            this.CenterSystemHelp.Location = new Point(0, 65);
            this.CenterSystemIOTest.Location = new Point(0, 65);
            this.CenterSystemSorterSetting.Location = new Point(0, 65);
            this.CenterSystemAutoZero.Location = new Point(0, 65);

            this.Controls.Add(this.CenterSystemCalibration);
            this.Controls.Add(this.CenterSystemJudgmentSetting);
            this.Controls.Add(this.CenterSystemHelp);
            this.Controls.Add(this.CenterSystemIOTest);
            this.Controls.Add(this.CenterSystemSorterSetting);
            this.Controls.Add(this.CenterSystemAutoZero);
        }
        private void CreateCenterInformationControl()
        {
            this.CenterInforHelp = new ControlCenterInforHelp(this);
            this.CenterInforSystemInformation = new ControlCenterInforSystem(this);
            this.CenterInforAS = new ControlCenterInforAS(this);

            this.CenterInforHelp.Location = new Point(0, 65);
            this.CenterInforSystemInformation.Location = new Point(0, 65);
            this.CenterInforAS.Location = new Point(0, 65);

            this.Controls.Add(this.CenterInforHelp);
            this.Controls.Add(this.CenterInforSystemInformation);
            this.Controls.Add(this.CenterInforAS);
        }

        public void CurrentControlEnable(bool enable)
        {
            foreach (SmartButton button in this.CollectionButtonMenu)
                button.Enabled = enable;

            switch (this.SelectedSideMenu)
            {
                case Define.E_MenuSide.Basic:
                    this.BottomBasic.CurrentControlEnable(enable);
                    break;
                case Define.E_MenuSide.Configuration:
                    this.BottomConfiguration.CurrentControlEnable(enable);
                    break;
                case Define.E_MenuSide.System:
                    this.BottomSystem.CurrentControlEnable(enable);
                    break;
                case Define.E_MenuSide.Equipment:
                    this.BottomEquipment.CurrentControlEnable(enable);
                    break;
                case Define.E_MenuSide.Information:
                    this.BottomInformation.CurrentControlEnable(enable);
                    break;
                default:
                    break;
            }
        }
        private void UpdateDisplayUser(UserItem user)
        {
            string id = "", group = "";

            switch (user.Group)
            {
                case Define.E_UserGroup.LogOut:
                    id = "";
                    if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Chinese)
                        group = "关闭";
                    else if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Spanish)
                        group = "Apagado";
                    else
                        group = "Off";

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

                    this.buttonBasic.Enabled = true;
                    this.buttonConfiguration.Enabled = false;
                    this.buttonSystem.Enabled = false;
                    this.buttonEquipment.Enabled = false;
                    this.buttonInformation.Enabled = true;
                    break;
                case Define.E_UserGroup.Level1:
                    id = user.ID;
                    if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Chinese)
                        group = "级别1";
                    else if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Spanish)
                        group = "Nivel 1";
                    else
                        group = "Level1";

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

                    this.buttonBasic.Enabled = true;
                    this.buttonConfiguration.Enabled = false;
                    this.buttonSystem.Enabled = false;
                    this.buttonEquipment.Enabled = false;
                    this.buttonInformation.Enabled = true;
                    break;
                case Define.E_UserGroup.Level2:
                    id = user.ID;
                    if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Chinese)
                        group = "级别2";
                    else if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Spanish)
                        group = "Nivel 2";
                    else
                        group = "Level2";

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

                    this.buttonBasic.Enabled = true;
                    this.buttonConfiguration.Enabled = true;
                    this.buttonSystem.Enabled = true;
                    this.buttonEquipment.Enabled = false;
                    this.buttonInformation.Enabled = true;
                    break;
                case Define.E_UserGroup.Level3:
                    id = user.ID;
                    if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Chinese)
                        group = "级别3";
                    else if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Spanish)
                        group = "Nivel 3";
                    else
                        group = "Level3";

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

                    this.buttonBasic.Enabled = true;
                    this.buttonConfiguration.Enabled = true;
                    this.buttonSystem.Enabled = true;
                    this.buttonEquipment.Enabled = true;
                    this.buttonInformation.Enabled = true;
                    break;
                case Define.E_UserGroup.Developer:
                    id = user.ID;
                    if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Chinese)
                        group = "级别4";
                    else if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Spanish)
                        group = "Nivel 4";
                    else
                        group = "Level4";

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

                    this.buttonBasic.Enabled = true;
                    this.buttonConfiguration.Enabled = true;
                    this.buttonSystem.Enabled = true;
                    this.buttonEquipment.Enabled = true;
                    this.buttonInformation.Enabled = true;
                    break;
                default:
                    id = "";
                    if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Chinese)
                        group = "关闭";
                    else if (this.ParentForm.SystemConfig.Language == Define.E_LanguageID.Spanish)
                        group = "Apagado";
                    else
                        group = "Off";

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

                    this.buttonBasic.Enabled = false;
                    this.buttonConfiguration.Enabled = false;
                    this.buttonSystem.Enabled = false;
                    this.buttonEquipment.Enabled = false;
                    this.buttonInformation.Enabled = true;
                    break;
            }

            if (this.labelUserLevel.Text != group)
                this.labelUserLevel.Text = group;
            if (this.labelUserID.Text != id)
                this.labelUserID.Text = id;
        }
        private bool EquipmentRun(Define.E_DisplayStore currentDisplay)
        {
            if (currentDisplay == Define.E_DisplayStore.SystemJudgmentSetting
                || currentDisplay == Define.E_DisplayStore.SystemSorterSetting)
                return true;
            else
                return false;
        }

        public Define.E_MenuBottomConfiguration CurrentConfigurationMenu()
        {
            return this.BottomConfiguration.CurrentMenu;
        }

        private void DisplaySideMenu(Define.E_MenuSide menu)
        {
            switch (menu)
            {
                case Define.E_MenuSide.Basic:
                    this.BottomBasic.Visible = true;
                    this.BottomConfiguration.Visible = false;
                    this.BottomSystem.Visible = false;
                    this.BottomEquipment.Visible = false;
                    this.BottomInformation.Visible = false;

                    this.BottomBasic.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    break;
                case Define.E_MenuSide.Configuration:
                    this.BottomBasic.Visible = false;
                    this.BottomConfiguration.Visible = true;
                    this.BottomSystem.Visible = false;
                    this.BottomEquipment.Visible = false;
                    this.BottomInformation.Visible = false;

                    this.BottomConfiguration.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    break;
                case Define.E_MenuSide.System:
                    this.BottomBasic.Visible = false;
                    this.BottomConfiguration.Visible = false;
                    this.BottomSystem.Visible = true;
                    this.BottomEquipment.Visible = false;
                    this.BottomInformation.Visible = false;

                    this.BottomSystem.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    break;
                case Define.E_MenuSide.Equipment:
                    this.BottomBasic.Visible = false;
                    this.BottomConfiguration.Visible = false;
                    this.BottomSystem.Visible = false;
                    this.BottomEquipment.Visible = true;
                    this.BottomInformation.Visible = false;

                    this.BottomEquipment.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    break;
                case Define.E_MenuSide.Information:
                    this.BottomBasic.Visible = false;
                    this.BottomConfiguration.Visible = false;
                    this.BottomSystem.Visible = false;
                    this.BottomEquipment.Visible = false;
                    this.BottomInformation.Visible = true;

                    this.BottomInformation.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    break;
                default:
                    break;
            }
        }
        public void DisplayHiddenMenu(Define.E_DisplayStore menu, SystemConfigurationItem systemConfig)
        {
            switch (menu)
            {
                case Define.E_DisplayStore.EquipHelp:
                    this.CenterEquipHelp.DisplayHiddenMenu(true);
                    this.BottomEquipment.DisplayHiddenMenu(true);
                    break;
                default:
                    break;
            }
        }
        public void DisplayBottomBasic(Define.E_MenuBottomBasic menu)
        {
            switch (menu)
            {
                case Define.E_MenuBottomBasic.DataBackup:
                    this.CenterBasicDataBackup.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterBasicDataBackup.BringToFront();
                    break;
                case Define.E_MenuBottomBasic.DataStatistics:
                    this.CenterBasicDataStatistics.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterBasicDataStatistics.BringToFront();
                    break;
                case Define.E_MenuBottomBasic.Help:
                    this.CenterBasicHelp.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterBasicHelp.BringToFront();
                    break;
                case Define.E_MenuBottomBasic.Product:
                    this.CenterBasicProduct.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterBasicProduct.BringToFront();
                    break;
                case Define.E_MenuBottomBasic.Time:
                    this.CenterBasicTime.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterBasicTime.BringToFront();
                    break;
                default:
                    break;
            }

            this.BottomBasic.UpdateDisplayMenuButton(menu);
        }
        public void DisplayBottomConfiguration(Define.E_MenuBottomConfiguration menu)
        {
            switch (menu)
            {
                case Define.E_MenuBottomConfiguration.SerialCOM1:
                    this.BottomConfiguration.CurrentMenu = Define.E_MenuBottomConfiguration.SerialCOM1;
                    this.CenterConfiSerial.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterConfiSerial.BringToFront();
                    break;
                case Define.E_MenuBottomConfiguration.SerialCOM3:
                    this.BottomConfiguration.CurrentMenu = Define.E_MenuBottomConfiguration.SerialCOM3;
                    this.CenterConfiSerial.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterConfiSerial.BringToFront();
                    break;
                case Define.E_MenuBottomConfiguration.SerialCOM4:
                    this.BottomConfiguration.CurrentMenu = Define.E_MenuBottomConfiguration.SerialCOM4;
                    this.CenterConfiSerial.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterConfiSerial.BringToFront();
                    break;
                case Define.E_MenuBottomConfiguration.Ethernet:
                    this.BottomConfiguration.CurrentMenu = Define.E_MenuBottomConfiguration.Ethernet;
                    this.CenterConfiEthernet.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterConfiEthernet.BringToFront();
                    break;
                case Define.E_MenuBottomConfiguration.Help:
                    this.CenterConfiHelp.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterConfiHelp.BringToFront();
                    break;
                case Define.E_MenuBottomConfiguration.OptionBoard:
                    this.CenterConfiOptionBoard.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterConfiOptionBoard.BringToFront();
                    break;
                default:
                    break;
            }

            this.BottomConfiguration.UpdateDisplayMenuButton(menu);
        }
        public void DisplayBottomSystem(Define.E_MenuBottomSystem menu)
        {
            switch (menu)
            {
                case Define.E_MenuBottomSystem.Calibration:
                    this.CenterSystemCalibration.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterSystemCalibration.BringToFront();
                    break;
                case Define.E_MenuBottomSystem.AutoZero:
                    this.CenterSystemAutoZero.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterSystemAutoZero.BringToFront();
                    break;
                case Define.E_MenuBottomSystem.Help:
                    this.CenterSystemHelp.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterSystemHelp.BringToFront();
                    break;
                case Define.E_MenuBottomSystem.IOTest:
                    this.CenterSystemIOTest.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterSystemIOTest.BringToFront();
                    break;
                case Define.E_MenuBottomSystem.JudgmentSetting:
                    this.CenterSystemJudgmentSetting.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterSystemJudgmentSetting.BringToFront();
                    break;
                case Define.E_MenuBottomSystem.SorterSetting:
                    this.CenterSystemSorterSetting.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterSystemSorterSetting.BringToFront();
                    break;
                default:
                    break;
            }

            this.BottomSystem.UpdateDisplayMenuButton(menu);
        }
        public void DisplayBottomEquipment(Define.E_MenuBottomEquipment menu)
        {
            this.BottomEquipment.DisplayHiddenMenu(false);

            switch (menu)
            {
                case Define.E_MenuBottomEquipment.Help:
                    this.CenterEquipHelp.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterEquipHelp.BringToFront();
                    break;
                case Define.E_MenuBottomEquipment.Initialize:
                    this.Refresh();
                    this.CenterEquipInitialize.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterEquipInitialize.BringToFront();
                    break;
                case Define.E_MenuBottomEquipment.Update:
                    this.CenterEquipUpdate.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterEquipUpdate.BringToFront();
                    break;
                case Define.E_MenuBottomEquipment.FunctionSetting:
                    this.CenterEquipFunctionSetting.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterEquipFunctionSetting.BringToFront();
                    break;
                case Define.E_MenuBottomEquipment.User:
                    this.CenterEquipUser.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterEquipUser.BringToFront();
                    break;
                case Define.E_MenuBottomEquipment.Engineer:
                    this.BottomEquipment.DisplayHiddenMenu(true);
                    this.CenterEquipEngineer.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterEquipEngineer.BringToFront();
                    break;
                default:
                    break;
            }

            this.BottomEquipment.UpdateDisplayMenuButton(menu);
        }
        public void DisplayBottomInformation(Define.E_MenuBottomInformation menu)
        {
            switch (menu)
            {
                case Define.E_MenuBottomInformation.Help:
                    this.CenterInforHelp.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterInforHelp.BringToFront();
                    break;
                case Define.E_MenuBottomInformation.SystemInformation:
                    this.CenterInforSystemInformation.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterInforSystemInformation.BringToFront();
                    break;
                case Define.E_MenuBottomInformation.AS:
                    this.CenterInforAS.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
                    this.CenterInforAS.BringToFront();
                    break;
                default:
                    break;
            }
            this.BottomInformation.UpdateDisplayMenuButton(menu);
        }
        public void UpdateEquipmentStatusDisplay(Define.E_EquipmentStatus status)
        {
            if (status == Define.E_EquipmentStatus.Start)
            {
                this.buttonBasic.Enabled = false;
                this.buttonConfiguration.Enabled = false;
                this.buttonSystem.Enabled = false;
                this.buttonEquipment.Enabled = false;
                this.buttonInformation.Enabled = false;
                this.buttonMain.Enabled = false;

                this.BottomBasic.Enabled = false;
                this.BottomConfiguration.Enabled = false;
                this.BottomEquipment.Enabled = false;
                this.BottomInformation.Enabled = false;
                this.BottomSystem.Enabled = false;

                this.pictureBoxStart.Visible = true;
                this.pictureBoxStop.Visible = false;

                if (this.ParentForm.CurrentSystemStatus.CurrentDisplay == Define.E_DisplayStore.SystemJudgmentSetting)
                    this.CenterSystemJudgmentSetting.UpdateEquipmentStatusDisplay(status);
                else if (this.ParentForm.CurrentSystemStatus.CurrentDisplay == Define.E_DisplayStore.SystemSorterSetting)
                    this.CenterSystemSorterSetting.UpdateEquipmentStatusDisplay(status);
            }
            else
            {
                this.buttonBasic.Enabled = true;
                this.buttonConfiguration.Enabled = true;
                this.buttonSystem.Enabled = true;
                this.buttonEquipment.Enabled = true;
                this.buttonInformation.Enabled = true;
                this.buttonMain.Enabled = true;

                this.BottomBasic.Enabled = true;
                this.BottomConfiguration.Enabled = true;
                this.BottomEquipment.Enabled = true;
                this.BottomInformation.Enabled = true;
                this.BottomSystem.Enabled = true;

                this.pictureBoxStart.Visible = false;
                this.pictureBoxStop.Visible = true;

                if (this.ParentForm.CurrentSystemStatus.CurrentDisplay == Define.E_DisplayStore.SystemJudgmentSetting)
                    this.CenterSystemJudgmentSetting.UpdateEquipmentStatusDisplay(status);
                else if (this.ParentForm.CurrentSystemStatus.CurrentDisplay == Define.E_DisplayStore.SystemSorterSetting)
                    this.CenterSystemSorterSetting.UpdateEquipmentStatusDisplay(status);
            }
        }

        public void UpdateMenuExceptBarcodeDisplay(bool bValue)
        {
            this.buttonBasic.Enabled = bValue;
            this.buttonConfiguration.Enabled = bValue;
            this.buttonSystem.Enabled = bValue;
            this.buttonEquipment.Enabled = bValue;
            this.buttonInformation.Enabled = bValue;
            this.buttonMain.Enabled = bValue;

            this.BottomBasic.Enabled = bValue;
            this.BottomConfiguration.Enabled = bValue;
            this.BottomEquipment.Enabled = bValue;
            this.BottomInformation.Enabled = bValue;
            this.BottomSystem.Enabled = bValue;
        }

        public void DisplayTitleRoot(SystemStatus status)
        {
            switch (this.ParentForm.SystemConfig.Language)
            {
                case Define.E_LanguageID.English:
                    #region 영문
                    switch (status.CurrentDisplay)
                    {
                        case Define.E_DisplayStore.BasicDataBackup:
                            this.labelTitleRoot.Text = "Basic > Data backup";
                            break;
                        case Define.E_DisplayStore.BasicDataStatistics:
                            this.labelTitleRoot.Text = "Basic > Data statistics";
                            break;
                        case Define.E_DisplayStore.BasicHelp:
                            this.labelTitleRoot.Text = "Basic > Help";
                            break;
                        case Define.E_DisplayStore.BasicProduct:
                            this.labelTitleRoot.Text = "Basic > Product settings";
                            break;
                        case Define.E_DisplayStore.BasicTime:
                            this.labelTitleRoot.Text = "Basic > Time setting";
                            break;
                        case Define.E_DisplayStore.ConfiCommunication:
                            this.labelTitleRoot.Text = "Configuration > Serial";
                            break;
                        case Define.E_DisplayStore.ConfiHelp:
                            this.labelTitleRoot.Text = "Configuration > Help";
                            break;
                        case Define.E_DisplayStore.ConfiOptionBoard:
                            this.labelTitleRoot.Text = "Configuration > Option board";
                            break;
                        case Define.E_DisplayStore.ConfiSerial:
                            if (this.CurrentConfigurationMenu() == Define.E_MenuBottomConfiguration.SerialCOM1)
                                this.labelTitleRoot.Text = "Configuration > Serial(COM1)";
                            else if (this.CurrentConfigurationMenu() == Define.E_MenuBottomConfiguration.SerialCOM3)
                                this.labelTitleRoot.Text = "Configuration > Serial(COM3)";
                            else if (this.CurrentConfigurationMenu() == Define.E_MenuBottomConfiguration.SerialCOM4)
                                this.labelTitleRoot.Text = "Configuration > Serial(COM4)";
                            break;
                        case Define.E_DisplayStore.ConfiEthernet:
                            this.labelTitleRoot.Text = "Configuration > Ethernet";
                            break;
                        case Define.E_DisplayStore.EquipFuctionSetting:
                            this.labelTitleRoot.Text = "Equipment > Feature Settings";
                            break;
                        case Define.E_DisplayStore.EquipHelp:
                            this.labelTitleRoot.Text = "Equipment > Help";
                            break;
                        case Define.E_DisplayStore.EquipInitialize:
                            this.labelTitleRoot.Text = "Equipment > Initialization";
                            break;
                        case Define.E_DisplayStore.EquipUpdate:
                            this.labelTitleRoot.Text = "Equipment > Update";
                            break;
                        case Define.E_DisplayStore.EquipUser:
                            this.labelTitleRoot.Text = "Equipment > User Settings";
                            break;
                        case Define.E_DisplayStore.EquipEngineer:
                            this.labelTitleRoot.Text = "Equipment > Engineer Settings";
                            break;
                        case Define.E_DisplayStore.InforAS:
                            this.labelTitleRoot.Text = "Information > A/S";
                            break;
                        case Define.E_DisplayStore.InforHelp:
                            this.labelTitleRoot.Text = "Information > Help";
                            break;
                        case Define.E_DisplayStore.InforSystem:
                            this.labelTitleRoot.Text = "Information > Information";
                            break;
                        case Define.E_DisplayStore.SystemAutoZero:
                            this.labelTitleRoot.Text = "System > Auto zero";
                            break;
                        case Define.E_DisplayStore.SystemCalibration:
                            this.labelTitleRoot.Text = "System > Calibration";
                            break;
                        case Define.E_DisplayStore.SystemHelp:
                            this.labelTitleRoot.Text = "System > Help";
                            break;
                        case Define.E_DisplayStore.SystemIOTest:
                            this.labelTitleRoot.Text = "System > I/O test";
                            break;
                        case Define.E_DisplayStore.SystemJudgmentSetting:
                            this.labelTitleRoot.Text = "System > Judgment";
                            break;
                        case Define.E_DisplayStore.SystemSorterSetting:
                            this.labelTitleRoot.Text = "System > Sorter settings";
                            break;
                        default:
                            break;
                    }
                    #endregion
                    break;
                case Define.E_LanguageID.Chinese:
                    #region 중문
                    switch (status.CurrentDisplay)
                    {
                        case Define.E_DisplayStore.BasicDataBackup:
                            this.labelTitleRoot.Text = "基本 > 数据备份";
                            break;
                        case Define.E_DisplayStore.BasicDataStatistics:
                            this.labelTitleRoot.Text = "基本 > 数据统计";
                            break;
                        case Define.E_DisplayStore.BasicHelp:
                            this.labelTitleRoot.Text = "基本 > 帮助";
                            break;
                        case Define.E_DisplayStore.BasicProduct:
                            this.labelTitleRoot.Text = "基本 > 产品设置";
                            break;
                        case Define.E_DisplayStore.BasicTime:
                            this.labelTitleRoot.Text = "基本 > 时间设定";
                            break;
                        case Define.E_DisplayStore.ConfiCommunication:
                            this.labelTitleRoot.Text = "选项 > 串行端口";
                            break;
                        case Define.E_DisplayStore.ConfiHelp:
                            this.labelTitleRoot.Text = "选项 > 帮助";
                            break;
                        case Define.E_DisplayStore.ConfiOptionBoard:
                            this.labelTitleRoot.Text = "选项 > 选项板";
                            break;
                        case Define.E_DisplayStore.ConfiSerial:
                            if (this.CurrentConfigurationMenu() == Define.E_MenuBottomConfiguration.SerialCOM1)
                                this.labelTitleRoot.Text = "选项 > 串行端口(COM1)";
                            else if (this.CurrentConfigurationMenu() == Define.E_MenuBottomConfiguration.SerialCOM3)
                                this.labelTitleRoot.Text = "选项 > 串行端口(COM3)";
                            else if (this.CurrentConfigurationMenu() == Define.E_MenuBottomConfiguration.SerialCOM4)
                                this.labelTitleRoot.Text = "选项 > 串行端口(COM4)";
                            break;
                        case Define.E_DisplayStore.ConfiEthernet:
                            this.labelTitleRoot.Text = "选项 > 以太网";
                            break;
                        case Define.E_DisplayStore.EquipFuctionSetting:
                            this.labelTitleRoot.Text = "设备 > 功能设定";
                            break;
                        case Define.E_DisplayStore.EquipHelp:
                            this.labelTitleRoot.Text = "设备 > 帮助";
                            break;
                        case Define.E_DisplayStore.EquipInitialize:
                            this.labelTitleRoot.Text = "设备 > 工厂初期化";
                            break;
                        case Define.E_DisplayStore.EquipUpdate:
                            this.labelTitleRoot.Text = "设备 > 更新";
                            break;
                        case Define.E_DisplayStore.EquipUser:
                            this.labelTitleRoot.Text = "设备 > 用户设置";
                            break;
                        case Define.E_DisplayStore.EquipEngineer:
                            this.labelTitleRoot.Text = "设备 > 工程师设置";
                            break;
                        case Define.E_DisplayStore.InforAS:
                            this.labelTitleRoot.Text = "信息 > A/S";
                            break;
                        case Define.E_DisplayStore.InforHelp:
                            this.labelTitleRoot.Text = "信息 > 帮助";
                            break;
                        case Define.E_DisplayStore.InforSystem:
                            this.labelTitleRoot.Text = "信息 > 系统信息";
                            break;
                        case Define.E_DisplayStore.SystemAutoZero:
                            this.labelTitleRoot.Text = "系统 > 自动零点跟踪";
                            break;
                        case Define.E_DisplayStore.SystemCalibration:
                            this.labelTitleRoot.Text = "系统 > 校准";
                            break;
                        case Define.E_DisplayStore.SystemHelp:
                            this.labelTitleRoot.Text = "系统 > 帮助";
                            break;
                        case Define.E_DisplayStore.SystemIOTest:
                            this.labelTitleRoot.Text = "系统 > I/O测试";
                            break;
                        case Define.E_DisplayStore.SystemSorterSetting:
                            this.labelTitleRoot.Text = "系统 > 筛选设定";
                            break;
                        default:
                            break;
                    }
                    #endregion
                    break;
                case Define.E_LanguageID.Spanish:
                    #region 스페인어
                    switch (status.CurrentDisplay)
                    {
                        case Define.E_DisplayStore.BasicDataBackup:
                            this.labelTitleRoot.Text = "Básico > Copia de seguridad";
                            break;
                        case Define.E_DisplayStore.BasicDataStatistics:
                            this.labelTitleRoot.Text = "Básico > Estadistica de datos";
                            break;
                        case Define.E_DisplayStore.BasicHelp:
                            this.labelTitleRoot.Text = "Básico > Ayudar";
                            break;
                        case Define.E_DisplayStore.BasicProduct:
                            this.labelTitleRoot.Text = "Básico > Ajuste de producto";
                            break;
                        case Define.E_DisplayStore.BasicTime:
                            this.labelTitleRoot.Text = "Básico > Ajuste de tiempo";
                            break;
                        case Define.E_DisplayStore.ConfiCommunication:
                            this.labelTitleRoot.Text = "Configuración > Serial";
                            break;
                        case Define.E_DisplayStore.ConfiHelp:
                            this.labelTitleRoot.Text = "Configuración > Ayudar";
                            break;
                        case Define.E_DisplayStore.ConfiOptionBoard:
                            this.labelTitleRoot.Text = "Configuración > Tablero opcional";
                            break;
                        case Define.E_DisplayStore.ConfiSerial:
                            if (this.CurrentConfigurationMenu() == Define.E_MenuBottomConfiguration.SerialCOM1)
                                this.labelTitleRoot.Text = "Configuración > Puesto serial(COM1)";
                            else if (this.CurrentConfigurationMenu() == Define.E_MenuBottomConfiguration.SerialCOM3)
                                this.labelTitleRoot.Text = "Configuración > Puesto serial(COM3)";
                            else if (this.CurrentConfigurationMenu() == Define.E_MenuBottomConfiguration.SerialCOM4)
                                this.labelTitleRoot.Text = "Configuración > Puesto serial(COM4)";
                            break;
                        case Define.E_DisplayStore.ConfiEthernet:
                            this.labelTitleRoot.Text = "Configuración > Ethernet";
                            break;
                        case Define.E_DisplayStore.EquipFuctionSetting:
                            this.labelTitleRoot.Text = "Equipos > Funciones";
                            break;
                        case Define.E_DisplayStore.EquipHelp:
                            this.labelTitleRoot.Text = "Equipos > Ayudar";
                            break;
                        case Define.E_DisplayStore.EquipInitialize:
                            this.labelTitleRoot.Text = "Equipos > Inicializar";
                            break;
                        case Define.E_DisplayStore.EquipUpdate:
                            this.labelTitleRoot.Text = "Equipos > Actualizar";
                            break;
                        case Define.E_DisplayStore.EquipUser:
                            this.labelTitleRoot.Text = "Equipos > Usuario";
                            break;
                        case Define.E_DisplayStore.EquipEngineer:
                            this.labelTitleRoot.Text = "Equipos > Ingeniería";
                            break;
                        case Define.E_DisplayStore.InforAS:
                            this.labelTitleRoot.Text = "Información > Servicio al Cliente";
                            break;
                        case Define.E_DisplayStore.InforHelp:
                            this.labelTitleRoot.Text = "Información > Ayudar";
                            break;
                        case Define.E_DisplayStore.InforSystem:
                            this.labelTitleRoot.Text = "Información > Información";
                            break;
                        case Define.E_DisplayStore.SystemAutoZero:
                            this.labelTitleRoot.Text = "Sistema > Seguimiento de cero";
                            break;
                        case Define.E_DisplayStore.SystemCalibration:
                            this.labelTitleRoot.Text = "Sistema > Calibración";
                            break;
                        case Define.E_DisplayStore.SystemHelp:
                            this.labelTitleRoot.Text = "Sistema > Ayudar";
                            break;
                        case Define.E_DisplayStore.SystemIOTest:
                            this.labelTitleRoot.Text = "Sistema > Test I/O";
                            break;
                        case Define.E_DisplayStore.SystemJudgmentSetting:
                            this.labelTitleRoot.Text = "Sistema > Dictar sentencia";
                            break;
                        case Define.E_DisplayStore.SystemSorterSetting:
                            this.labelTitleRoot.Text = "Sistema > Clasificador";
                            break;
                        default:
                            break;
                    }
                    #endregion
                    break;
                default:
                    #region 한글
                    switch (status.CurrentDisplay)
                    {
                        case Define.E_DisplayStore.BasicDataBackup:
                            this.labelTitleRoot.Text = "기본설정 > 데이터백업";
                            break;
                        case Define.E_DisplayStore.BasicDataStatistics:
                            this.labelTitleRoot.Text = "기본설정 > 데이터집계";
                            break;
                        case Define.E_DisplayStore.BasicHelp:
                            this.labelTitleRoot.Text = "기본설정 > 도움말";
                            break;
                        case Define.E_DisplayStore.BasicProduct:
                            this.labelTitleRoot.Text = "기본설정 > 품목설정";
                            break;
                        case Define.E_DisplayStore.BasicTime:
                            this.labelTitleRoot.Text = "기본설정 > 시간설정";
                            break;
                        case Define.E_DisplayStore.ConfiCommunication:
                            this.labelTitleRoot.Text = "환경설정 > 시리얼통신";
                            break;
                        case Define.E_DisplayStore.ConfiHelp:
                            this.labelTitleRoot.Text = "환경설정 > 도움말";
                            break;      
                        case Define.E_DisplayStore.ConfiOptionBoard:
                            this.labelTitleRoot.Text = "환경설정 > 옵션보드설정";
                            break;
                        case Define.E_DisplayStore.ConfiSerial:
                            if (this.CurrentConfigurationMenu() == Define.E_MenuBottomConfiguration.SerialCOM1)
                                this.labelTitleRoot.Text = "환경설정 > 시리얼통신(COM1)";
                            else if (this.CurrentConfigurationMenu() == Define.E_MenuBottomConfiguration.SerialCOM3)
                                this.labelTitleRoot.Text = "환경설정 > 시리얼통신(COM3)";
                            else if (this.CurrentConfigurationMenu() == Define.E_MenuBottomConfiguration.SerialCOM4)
                                this.labelTitleRoot.Text = "환경설정 > 시리얼통신(COM4)";
                            break;
                        case Define.E_DisplayStore.ConfiEthernet:
                            this.labelTitleRoot.Text = "환경설정 > 이더넷통신";
                            break;
                        case Define.E_DisplayStore.EquipFuctionSetting:
                            this.labelTitleRoot.Text = "장비설정 > 기능설정";
                            break;
                        case Define.E_DisplayStore.EquipHelp:
                            this.labelTitleRoot.Text = "장비설정 > 도움말";
                            break;
                        case Define.E_DisplayStore.EquipInitialize:
                            this.labelTitleRoot.Text = "장비설정 > 공장초기화";
                            break;
                         case Define.E_DisplayStore.EquipUpdate:
                            this.labelTitleRoot.Text = "장비설정 > 업데이트";
                            break;
                        case Define.E_DisplayStore.EquipUser:
                            this.labelTitleRoot.Text = "장비설정 > 유저설정";
                            break;
                        case Define.E_DisplayStore.EquipEngineer:
                            this.labelTitleRoot.Text = "장비설정 > 엔지니어설정";
                            break;
                        case Define.E_DisplayStore.InforAS:
                            this.labelTitleRoot.Text = "정보 > A/S";
                            break;
                        case Define.E_DisplayStore.InforHelp:
                            this.labelTitleRoot.Text = "정보 > 도움말";
                            break;
                        case Define.E_DisplayStore.InforSystem:
                            this.labelTitleRoot.Text = "정보 > 시스템정보";
                            break;
                        case Define.E_DisplayStore.SystemAutoZero:
                            this.labelTitleRoot.Text = "시스템설정 > 자동영점";
                            break;
                        case Define.E_DisplayStore.SystemCalibration:
                            this.labelTitleRoot.Text = "시스템설정 > 중량조정";
                            break;
                        case Define.E_DisplayStore.SystemHelp:
                            this.labelTitleRoot.Text = "시스템설정 > 도움말";
                            break;
                        case Define.E_DisplayStore.SystemIOTest:
                            this.labelTitleRoot.Text = "시스템설정 > I/O테스트";
                            break;
                        case Define.E_DisplayStore.SystemJudgmentSetting:
                            this.labelTitleRoot.Text = "시스템설정 > 판정설정";
                            break;
                        case Define.E_DisplayStore.SystemSorterSetting:
                            this.labelTitleRoot.Text = "시스템설정 > 선별기설정";
                            break;
                        default:
                            break;
                    }
                    #endregion
                    break;
            }
        }
        public void DisplayRefresh(SystemStatus status)
        {
            this.UpdateDisplayUser(status.CurrentUser);
            if (this.ParentForm.SystemConfig.IsLogin == false)
            {
                this.labelUserID.Visible = false;
                this.labelUserLevel.Visible = false;
            }
            else
            {
                this.labelUserID.Visible = true;
                this.labelUserLevel.Visible = true;
            }

            this.buttonBasic.ButtonDown();
            this.buttonConfiguration.ButtonUp();
            this.buttonSystem.ButtonUp();
            this.buttonEquipment.ButtonUp();
            this.buttonInformation.ButtonUp();

            this.SelectedSideMenu = Define.E_MenuSide.Basic;

            this.DisplaySideMenu(this.SelectedSideMenu);
        }
        #endregion

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

        #region Event Handler
        private void buttonBasic_Click(object sender, EventArgs e)
        {
            this.SelectedSideMenu = Define.E_MenuSide.Basic;
            this.DisplaySideMenu(this.SelectedSideMenu);
        }
        private void buttonConfiguration_Click(object sender, EventArgs e)
        {
            this.SelectedSideMenu = Define.E_MenuSide.Configuration;
            this.DisplaySideMenu(this.SelectedSideMenu);
        }
        private void buttonSystem_Click(object sender, EventArgs e)
        {
            this.SelectedSideMenu = Define.E_MenuSide.System;
            this.DisplaySideMenu(this.SelectedSideMenu);
        }
        private void buttonEquipment_Click(object sender, EventArgs e)
        {
            this.SelectedSideMenu = Define.E_MenuSide.Equipment;
            this.DisplaySideMenu(this.SelectedSideMenu);
        }
        private void buttonInformation_Click(object sender, EventArgs e)
        {
            this.SelectedSideMenu = Define.E_MenuSide.Information;
            this.DisplaySideMenu(this.SelectedSideMenu);
        }

        private void buttonHiddenMenu_Click(object sender, EventArgs e)
        {
            if (this.ParentForm.SystemConfig.IsLogin == false)
            {
                this.DisplayHiddenMenu(this.ParentForm.CurrentSystemStatus.CurrentDisplay, this.ParentForm.SystemConfig);
            }
        }
        private void buttonMain_Click(object sender, EventArgs e)
        {
            this.ParentForm.ChildFormMainDisplay.DisplayRefresh(this.ParentForm.CurrentSystemStatus);
            ((FormMain)(Owner)).smartForm.Show((int)Define.E_FormStore.FormMainDisplay);
        }

        private void pictureBoxStop_Click(object sender, EventArgs e)
        {
            if (this.EquipmentRun(this.ParentForm.CurrentSystemStatus.CurrentDisplay) == true)
                this.ParentForm.TransferData(CommunicationCommand.Start, CommunicationID.MainBoard);
        }
        private void pictureBoxStart_Click(object sender, EventArgs e)
        {
            if (this.EquipmentRun(this.ParentForm.CurrentSystemStatus.CurrentDisplay) == true)
                this.ParentForm.TransferData(CommunicationCommand.Stop, CommunicationID.MainBoard);
        }
        #endregion
    }
}