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

using ITC81DB_2.Forms;
using ITC81DB_2_ImageDll;
using ITC81DB_2.DialogForms;

namespace ITC81DB_2.Controls
{
    public partial class ControlCenterSystemSorterSetting : UserControl
    {
        #region Field
        private FormMenu m_ParentForm;
        #endregion

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

            this.ParentForm = parent;

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

        #region Property
        public FormMenu 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.ParentForm.SystemConfig.Language == Define.E_LanguageID.English)
            {
                #region English
                this.labelTitleSorter1.Text = "Sorter 1";
                this.labelTitleExOutput1.Text = "Ex-Output 1";
                this.labelTitleExOutput2.Text = "Ex-Output 2";
                this.labelTitleExOutput9.Font = new Font("새굴림", 11, FontStyle.Bold);
                this.labelTitleExOutput9.Text = "Ex-Output 9(220V)";
                this.labelTitleSorter2.Text = "Sorter 2";
                this.labelTitleExOutput3.Text = "Ex-Output 3";
                this.labelTitleExOutput4.Text = "Ex-Output 4";
                this.labelTitleExOutput10.Font = new Font("새굴림", 11, FontStyle.Bold);
                this.labelTitleExOutput10.Text = "Ex-Output 10(220V)";
                this.labelTitleDoubleExInput.Font = new Font("새굴림", 10, FontStyle.Bold);
                this.labelTitleDoubleExInput.Text = "Double/Ex-Input";
                this.labelTitleMode.Text = "Mode";
                this.labelTitleDelayTime.Font = new Font("새굴림", 10, FontStyle.Bold);
                this.labelTitleDelayTime.Text = "Delay time";
                this.labelTitleRunTime.Font = new Font("새굴림", 10, FontStyle.Bold);
                this.labelTitleRunTime.Text = "Run time";

                this.radioButtonDoubleEntryDsable.Text = "Disable";
                this.radioButtonDoubleEntryEnable.Text = "Enable";

                this.comboBoxSorter1Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxSorter1Mode_SelectedIndexChanged);
                this.comboBoxSorter1Mode.Items.Clear();
                this.comboBoxSorter1Mode.Items.Add("None");
                this.comboBoxSorter1Mode.Items.Add("Over");
                this.comboBoxSorter1Mode.Items.Add("Under");
                this.comboBoxSorter1Mode.Items.Add("NG");
                this.comboBoxSorter1Mode.SelectedIndex = 1;
                this.comboBoxSorter1Mode.SelectedIndexChanged += new EventHandler(this.comboBoxSorter1Mode_SelectedIndexChanged);

                this.comboBoxSorter2Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxSorter2Mode_SelectedIndexChanged);
                this.comboBoxSorter2Mode.Items.Clear();
                this.comboBoxSorter2Mode.Items.Add("None");
                this.comboBoxSorter2Mode.Items.Add("Over");
                this.comboBoxSorter2Mode.Items.Add("Under");
                this.comboBoxSorter2Mode.Items.Add("NG");
                this.comboBoxSorter2Mode.SelectedIndex = 2;
                this.comboBoxSorter2Mode.SelectedIndexChanged += new EventHandler(this.comboBoxSorter2Mode_SelectedIndexChanged);

                this.comboBoxOut1Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut1Mode_SelectedIndexChanged);
                this.comboBoxOut1Mode.Items.Clear();
                this.comboBoxOut1Mode.Items.Add("None");
                this.comboBoxOut1Mode.Items.Add("Over");
                this.comboBoxOut1Mode.Items.Add("Under");
                this.comboBoxOut1Mode.Items.Add("NG");
                this.comboBoxOut1Mode.Items.Add("Pass");
                this.comboBoxOut1Mode.Items.Add("Run");
                this.comboBoxOut1Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut1Mode_SelectedIndexChanged);

                this.comboBoxOut2Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut2Mode_SelectedIndexChanged);
                this.comboBoxOut2Mode.Items.Clear();
                this.comboBoxOut2Mode.Items.Add("None");
                this.comboBoxOut2Mode.Items.Add("Over");
                this.comboBoxOut2Mode.Items.Add("Under");
                this.comboBoxOut2Mode.Items.Add("NG");
                this.comboBoxOut2Mode.Items.Add("Pass");
                this.comboBoxOut2Mode.Items.Add("Run");
                this.comboBoxOut2Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut2Mode_SelectedIndexChanged);

                this.comboBoxOut3Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut3Mode_SelectedIndexChanged);
                this.comboBoxOut3Mode.Items.Clear();
                this.comboBoxOut3Mode.Items.Add("None");
                this.comboBoxOut3Mode.Items.Add("Over");
                this.comboBoxOut3Mode.Items.Add("Under");
                this.comboBoxOut3Mode.Items.Add("NG");
                this.comboBoxOut3Mode.Items.Add("Pass");
                this.comboBoxOut3Mode.Items.Add("Run");
                this.comboBoxOut3Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut3Mode_SelectedIndexChanged);

                this.comboBoxOut4Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut4Mode_SelectedIndexChanged);
                this.comboBoxOut4Mode.Items.Clear();
                this.comboBoxOut4Mode.Items.Add("None");
                this.comboBoxOut4Mode.Items.Add("Over");
                this.comboBoxOut4Mode.Items.Add("Under");
                this.comboBoxOut4Mode.Items.Add("NG");
                this.comboBoxOut4Mode.Items.Add("Pass");
                this.comboBoxOut4Mode.Items.Add("Run");
                this.comboBoxOut4Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut4Mode_SelectedIndexChanged);

                this.comboBoxOut9Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut9Mode_SelectedIndexChanged);
                this.comboBoxOut9Mode.Items.Clear();
                this.comboBoxOut9Mode.Items.Add("None");
                this.comboBoxOut9Mode.Items.Add("Over");
                this.comboBoxOut9Mode.Items.Add("Under");
                this.comboBoxOut9Mode.Items.Add("NG");
                this.comboBoxOut9Mode.Items.Add("Pass");
                this.comboBoxOut9Mode.Items.Add("Run");
                this.comboBoxOut9Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut9Mode_SelectedIndexChanged);

                this.comboBoxOut10Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut10Mode_SelectedIndexChanged);
                this.comboBoxOut10Mode.Items.Clear();
                this.comboBoxOut10Mode.Items.Add("None");
                this.comboBoxOut10Mode.Items.Add("Over");
                this.comboBoxOut10Mode.Items.Add("Under");
                this.comboBoxOut10Mode.Items.Add("NG");
                this.comboBoxOut10Mode.Items.Add("Pass");
                this.comboBoxOut10Mode.Items.Add("Run");
                this.comboBoxOut10Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut10Mode_SelectedIndexChanged);
                #endregion
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == Define.E_LanguageID.Chinese)
            {
                #region Chinese
                this.labelTitleSorter1.Text = "选别部 1";
                this.labelTitleExOutput1.Text = "外部输出 1";
                this.labelTitleExOutput2.Text = "外部输出 2";
                this.labelTitleExOutput9.Font = new Font("새굴림", 13, FontStyle.Bold);
                this.labelTitleExOutput9.Text = "外部输出 9(220V)";
                this.labelTitleSorter2.Text = "选别部 2";
                this.labelTitleExOutput3.Text = "外部输出 3";
                this.labelTitleExOutput4.Text = "外部输出 4";
                this.labelTitleExOutput10.Font = new Font("새굴림", 13, FontStyle.Bold);
                this.labelTitleExOutput10.Text = "外部输出 10(220V)";
                this.labelTitleDoubleExInput.Font = new Font("새굴림", 13, FontStyle.Bold);
                this.labelTitleDoubleExInput.Text = "Double/Ex-Input";
                this.labelTitleMode.Text = "模式";
                this.labelTitleDelayTime.Font = new Font("새굴림", 13, FontStyle.Bold);
                this.labelTitleDelayTime.Text = "延迟时间";
                this.labelTitleRunTime.Font = new Font("새굴림", 13, FontStyle.Bold);
                this.labelTitleRunTime.Text = "运行时间";

                this.radioButtonDoubleEntryDsable.Text = "禁用";
                this.radioButtonDoubleEntryEnable.Text = "启用";

                this.comboBoxSorter1Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxSorter1Mode_SelectedIndexChanged);
                this.comboBoxSorter1Mode.Items.Clear();
                this.comboBoxSorter1Mode.Items.Add("不使用");
                this.comboBoxSorter1Mode.Items.Add("上限");
                this.comboBoxSorter1Mode.Items.Add("下限");
                this.comboBoxSorter1Mode.Items.Add("剔除");
                this.comboBoxSorter1Mode.SelectedIndex = 1;
                this.comboBoxSorter1Mode.SelectedIndexChanged += new EventHandler(this.comboBoxSorter1Mode_SelectedIndexChanged);

                this.comboBoxSorter2Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxSorter2Mode_SelectedIndexChanged);
                this.comboBoxSorter2Mode.Items.Clear();
                this.comboBoxSorter2Mode.Items.Add("不使用");
                this.comboBoxSorter2Mode.Items.Add("上限");
                this.comboBoxSorter2Mode.Items.Add("下限");
                this.comboBoxSorter2Mode.Items.Add("剔除");
                this.comboBoxSorter2Mode.SelectedIndex = 2;
                this.comboBoxSorter2Mode.SelectedIndexChanged += new EventHandler(this.comboBoxSorter2Mode_SelectedIndexChanged);

                this.comboBoxOut1Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut1Mode_SelectedIndexChanged);
                this.comboBoxOut1Mode.Items.Clear();
                this.comboBoxOut1Mode.Items.Add("不使用");
                this.comboBoxOut1Mode.Items.Add("上限");
                this.comboBoxOut1Mode.Items.Add("下限");
                this.comboBoxOut1Mode.Items.Add("剔除");
                this.comboBoxOut1Mode.Items.Add("通过");
                this.comboBoxOut1Mode.Items.Add("运行");
                this.comboBoxOut1Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut1Mode_SelectedIndexChanged);

                this.comboBoxOut2Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut2Mode_SelectedIndexChanged);
                this.comboBoxOut2Mode.Items.Clear();
                this.comboBoxOut2Mode.Items.Add("不使用");
                this.comboBoxOut2Mode.Items.Add("上限");
                this.comboBoxOut2Mode.Items.Add("下限");
                this.comboBoxOut2Mode.Items.Add("剔除");
                this.comboBoxOut2Mode.Items.Add("通过");
                this.comboBoxOut2Mode.Items.Add("运行");
                this.comboBoxOut2Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut2Mode_SelectedIndexChanged);

                this.comboBoxOut3Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut3Mode_SelectedIndexChanged);
                this.comboBoxOut3Mode.Items.Clear();
                this.comboBoxOut3Mode.Items.Add("不使用");
                this.comboBoxOut3Mode.Items.Add("上限");
                this.comboBoxOut3Mode.Items.Add("下限");
                this.comboBoxOut3Mode.Items.Add("剔除");
                this.comboBoxOut3Mode.Items.Add("通过");
                this.comboBoxOut3Mode.Items.Add("运行");
                this.comboBoxOut3Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut3Mode_SelectedIndexChanged);

                this.comboBoxOut4Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut4Mode_SelectedIndexChanged);
                this.comboBoxOut4Mode.Items.Clear();
                this.comboBoxOut4Mode.Items.Add("不使用");
                this.comboBoxOut4Mode.Items.Add("上限");
                this.comboBoxOut4Mode.Items.Add("下限");
                this.comboBoxOut4Mode.Items.Add("剔除");
                this.comboBoxOut4Mode.Items.Add("通过");
                this.comboBoxOut4Mode.Items.Add("运行");
                this.comboBoxOut4Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut4Mode_SelectedIndexChanged);

                this.comboBoxOut9Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut9Mode_SelectedIndexChanged);
                this.comboBoxOut9Mode.Items.Clear();
                this.comboBoxOut9Mode.Items.Add("不使用");
                this.comboBoxOut9Mode.Items.Add("上限");
                this.comboBoxOut9Mode.Items.Add("下限");
                this.comboBoxOut9Mode.Items.Add("剔除");
                this.comboBoxOut9Mode.Items.Add("通过");
                this.comboBoxOut9Mode.Items.Add("运行");
                this.comboBoxOut9Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut9Mode_SelectedIndexChanged);

                this.comboBoxOut10Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut10Mode_SelectedIndexChanged);
                this.comboBoxOut10Mode.Items.Clear();
                this.comboBoxOut10Mode.Items.Add("不使用");
                this.comboBoxOut10Mode.Items.Add("上限");
                this.comboBoxOut10Mode.Items.Add("下限");
                this.comboBoxOut10Mode.Items.Add("剔除");
                this.comboBoxOut10Mode.Items.Add("通过");
                this.comboBoxOut10Mode.Items.Add("运行");
                this.comboBoxOut10Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut10Mode_SelectedIndexChanged);
                #endregion
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == Define.E_LanguageID.Czech)
            {
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == Define.E_LanguageID.Spanish)
            {
                #region Spanish
                this.labelTitleSorter1.Text = "Clasificador1";
                this.labelTitleExOutput1.Text = "Salida externa1";
                this.labelTitleExOutput2.Text = "Salida externa2";
                this.labelTitleExOutput9.Font = new Font("새굴림", 11, FontStyle.Bold);
                this.labelTitleExOutput9.Text = "Salida externa9(220V)";
                this.labelTitleSorter2.Text = "Clasificador2";
                this.labelTitleExOutput3.Text = "Salida externa3";
                this.labelTitleExOutput4.Text = "Salida externa4";
                this.labelTitleExOutput10.Font = new Font("새굴림", 11, FontStyle.Bold);
                this.labelTitleExOutput10.Text = "Salida externa10(220V)";
                this.labelTitleDoubleExInput.Font = new Font("새굴림", 13, FontStyle.Bold);
                this.labelTitleDoubleExInput.Text = "Doble";
                this.labelTitleMode.Text = "Modo";
                this.labelTitleDelayTime.Font = new Font("새굴림", 9, FontStyle.Bold);
                this.labelTitleDelayTime.Text = "Tiempo de retardo";
                this.labelTitleRunTime.Font = new Font("새굴림", 9, FontStyle.Bold);
                this.labelTitleRunTime.Text = "Tiempo de ejecución";

                this.radioButtonDoubleEntryDsable.Text = "Desactivar";
                this.radioButtonDoubleEntryEnable.Text = "Activar";

                this.comboBoxSorter1Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxSorter1Mode_SelectedIndexChanged);
                this.comboBoxSorter1Mode.Items.Clear();
                this.comboBoxSorter1Mode.Items.Add("Ninguna");
                this.comboBoxSorter1Mode.Items.Add("Sobrepeso");
                this.comboBoxSorter1Mode.Items.Add("Ligero");
                this.comboBoxSorter1Mode.Items.Add("Rechazo");
                this.comboBoxSorter1Mode.SelectedIndex = 1;
                this.comboBoxSorter1Mode.SelectedIndexChanged += new EventHandler(this.comboBoxSorter1Mode_SelectedIndexChanged);

                this.comboBoxSorter2Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxSorter2Mode_SelectedIndexChanged);
                this.comboBoxSorter2Mode.Items.Clear();
                this.comboBoxSorter2Mode.Items.Add("Ninguna");
                this.comboBoxSorter2Mode.Items.Add("Sobrepeso");
                this.comboBoxSorter2Mode.Items.Add("Ligero");
                this.comboBoxSorter2Mode.Items.Add("Rechazo");
                this.comboBoxSorter2Mode.SelectedIndex = 2;
                this.comboBoxSorter2Mode.SelectedIndexChanged += new EventHandler(this.comboBoxSorter2Mode_SelectedIndexChanged);

                this.comboBoxOut1Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut1Mode_SelectedIndexChanged);
                this.comboBoxOut1Mode.Items.Clear();
                this.comboBoxOut1Mode.Items.Add("Ninguna");
                this.comboBoxOut1Mode.Items.Add("Sobrepeso");
                this.comboBoxOut1Mode.Items.Add("Ligero");
                this.comboBoxOut1Mode.Items.Add("Rechazo");
                this.comboBoxOut1Mode.Items.Add("Aprobar");
                this.comboBoxOut1Mode.Items.Add("Correr");
                this.comboBoxOut1Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut1Mode_SelectedIndexChanged);

                this.comboBoxOut2Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut2Mode_SelectedIndexChanged);
                this.comboBoxOut2Mode.Items.Clear();
                this.comboBoxOut2Mode.Items.Add("Ninguna");
                this.comboBoxOut2Mode.Items.Add("Sobrepeso");
                this.comboBoxOut2Mode.Items.Add("Ligero");
                this.comboBoxOut2Mode.Items.Add("Rechazo");
                this.comboBoxOut2Mode.Items.Add("Aprobar");
                this.comboBoxOut2Mode.Items.Add("Correr");
                this.comboBoxOut2Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut2Mode_SelectedIndexChanged);

                this.comboBoxOut3Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut3Mode_SelectedIndexChanged);
                this.comboBoxOut3Mode.Items.Clear();
                this.comboBoxOut3Mode.Items.Add("Ninguna");
                this.comboBoxOut3Mode.Items.Add("Sobrepeso");
                this.comboBoxOut3Mode.Items.Add("Ligero");
                this.comboBoxOut3Mode.Items.Add("Rechazo");
                this.comboBoxOut3Mode.Items.Add("Aprobar");
                this.comboBoxOut3Mode.Items.Add("Correr");
                this.comboBoxOut3Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut3Mode_SelectedIndexChanged);

                this.comboBoxOut4Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut4Mode_SelectedIndexChanged);
                this.comboBoxOut4Mode.Items.Clear();
                this.comboBoxOut4Mode.Items.Add("Ninguna");
                this.comboBoxOut4Mode.Items.Add("Sobrepeso");
                this.comboBoxOut4Mode.Items.Add("Ligero");
                this.comboBoxOut4Mode.Items.Add("Rechazo");
                this.comboBoxOut4Mode.Items.Add("Aprobar");
                this.comboBoxOut4Mode.Items.Add("Correr");
                this.comboBoxOut4Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut4Mode_SelectedIndexChanged);

                this.comboBoxOut9Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut9Mode_SelectedIndexChanged);
                this.comboBoxOut9Mode.Items.Clear();
                this.comboBoxOut9Mode.Items.Add("Ninguna");
                this.comboBoxOut9Mode.Items.Add("Sobrepeso");
                this.comboBoxOut9Mode.Items.Add("Ligero");
                this.comboBoxOut9Mode.Items.Add("Rechazo");
                this.comboBoxOut9Mode.Items.Add("Aprobar");
                this.comboBoxOut9Mode.Items.Add("Correr");
                this.comboBoxOut9Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut9Mode_SelectedIndexChanged);

                this.comboBoxOut10Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut10Mode_SelectedIndexChanged);
                this.comboBoxOut10Mode.Items.Clear();
                this.comboBoxOut10Mode.Items.Add("Ninguna");
                this.comboBoxOut10Mode.Items.Add("Sobrepeso");
                this.comboBoxOut10Mode.Items.Add("Ligero");
                this.comboBoxOut10Mode.Items.Add("Rechazo");
                this.comboBoxOut10Mode.Items.Add("Aprobar");
                this.comboBoxOut10Mode.Items.Add("Correr");
                this.comboBoxOut10Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut10Mode_SelectedIndexChanged);
                #endregion
            }
            else
            {
                #region Korean
                this.labelTitleSorter1.Text = "선별기1";
                this.labelTitleExOutput1.Text = "외부출력1";
                this.labelTitleExOutput2.Text = "외부출력2";
                this.labelTitleExOutput9.Font = new Font("새굴림", 13, FontStyle.Bold);
                this.labelTitleExOutput9.Text = "외부출력9(220V)";
                this.labelTitleSorter2.Text = "선별기2";
                this.labelTitleExOutput3.Text = "외부출력3";
                this.labelTitleExOutput4.Text = "외부출력4";
                this.labelTitleExOutput9.Font = new Font("새굴림", 13, FontStyle.Bold);
                this.labelTitleExOutput10.Text = "외부출력10(220V)";
                this.labelTitleExOutput9.Font = new Font("새굴림", 13, FontStyle.Bold);
                this.labelTitleDoubleExInput.Text = "이중진입/외부입력";
                this.labelTitleMode.Text = "모드";
                this.labelTitleExOutput9.Font = new Font("새굴림", 13, FontStyle.Bold);
                this.labelTitleDelayTime.Text = "지연시간";
                this.labelTitleExOutput9.Font = new Font("새굴림", 13, FontStyle.Bold);
                this.labelTitleRunTime.Text = "동작시간";

                this.radioButtonDoubleEntryDsable.Text = "사용안함";
                this.radioButtonDoubleEntryEnable.Text = "사용함";

                this.comboBoxSorter1Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxSorter1Mode_SelectedIndexChanged);
                this.comboBoxSorter1Mode.Items.Clear();
                this.comboBoxSorter1Mode.Items.Add("사용안함");
                this.comboBoxSorter1Mode.Items.Add("과량");
                this.comboBoxSorter1Mode.Items.Add("경량");
                this.comboBoxSorter1Mode.Items.Add("NG");
                this.comboBoxSorter1Mode.SelectedIndex = 1;
                this.comboBoxSorter1Mode.SelectedIndexChanged += new EventHandler(this.comboBoxSorter1Mode_SelectedIndexChanged);

                this.comboBoxSorter2Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxSorter2Mode_SelectedIndexChanged);
                this.comboBoxSorter2Mode.Items.Clear();
                this.comboBoxSorter2Mode.Items.Add("사용안함");
                this.comboBoxSorter2Mode.Items.Add("과량");
                this.comboBoxSorter2Mode.Items.Add("경량");
                this.comboBoxSorter2Mode.Items.Add("NG");
                this.comboBoxSorter2Mode.SelectedIndex = 2;
                this.comboBoxSorter2Mode.SelectedIndexChanged += new EventHandler(this.comboBoxSorter2Mode_SelectedIndexChanged);

                this.comboBoxOut1Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut1Mode_SelectedIndexChanged);
                this.comboBoxOut1Mode.Items.Clear();
                this.comboBoxOut1Mode.Items.Add("사용안함");
                this.comboBoxOut1Mode.Items.Add("과량");
                this.comboBoxOut1Mode.Items.Add("경량");
                this.comboBoxOut1Mode.Items.Add("불량");
                this.comboBoxOut1Mode.Items.Add("정량");
                this.comboBoxOut1Mode.Items.Add("운전");
                this.comboBoxOut1Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut1Mode_SelectedIndexChanged);

                this.comboBoxOut2Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut2Mode_SelectedIndexChanged);
                this.comboBoxOut2Mode.Items.Clear();
                this.comboBoxOut2Mode.Items.Add("사용안함");
                this.comboBoxOut2Mode.Items.Add("과량");
                this.comboBoxOut2Mode.Items.Add("경량");
                this.comboBoxOut2Mode.Items.Add("불량");
                this.comboBoxOut2Mode.Items.Add("정량");
                this.comboBoxOut2Mode.Items.Add("운전");
                this.comboBoxOut2Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut2Mode_SelectedIndexChanged);

                this.comboBoxOut3Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut3Mode_SelectedIndexChanged);
                this.comboBoxOut3Mode.Items.Clear();
                this.comboBoxOut3Mode.Items.Add("사용안함");
                this.comboBoxOut3Mode.Items.Add("과량");
                this.comboBoxOut3Mode.Items.Add("경량");
                this.comboBoxOut3Mode.Items.Add("불량");
                this.comboBoxOut3Mode.Items.Add("정량");
                this.comboBoxOut3Mode.Items.Add("운전");
                this.comboBoxOut3Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut3Mode_SelectedIndexChanged);

                this.comboBoxOut4Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut4Mode_SelectedIndexChanged);
                this.comboBoxOut4Mode.Items.Clear();
                this.comboBoxOut4Mode.Items.Add("사용안함");
                this.comboBoxOut4Mode.Items.Add("과량");
                this.comboBoxOut4Mode.Items.Add("경량");
                this.comboBoxOut4Mode.Items.Add("불량");
                this.comboBoxOut4Mode.Items.Add("정량");
                this.comboBoxOut4Mode.Items.Add("운전");
                this.comboBoxOut4Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut4Mode_SelectedIndexChanged);

                this.comboBoxOut9Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut9Mode_SelectedIndexChanged);
                this.comboBoxOut9Mode.Items.Clear();
                this.comboBoxOut9Mode.Items.Add("사용안함");
                this.comboBoxOut9Mode.Items.Add("과량");
                this.comboBoxOut9Mode.Items.Add("경량");
                this.comboBoxOut9Mode.Items.Add("불량");
                this.comboBoxOut9Mode.Items.Add("정량");
                this.comboBoxOut9Mode.Items.Add("운전");
                this.comboBoxOut9Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut9Mode_SelectedIndexChanged);

                this.comboBoxOut10Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut10Mode_SelectedIndexChanged);
                this.comboBoxOut10Mode.Items.Clear();
                this.comboBoxOut10Mode.Items.Add("사용안함");
                this.comboBoxOut10Mode.Items.Add("과량");
                this.comboBoxOut10Mode.Items.Add("경량");
                this.comboBoxOut10Mode.Items.Add("불량");
                this.comboBoxOut10Mode.Items.Add("정량");
                this.comboBoxOut10Mode.Items.Add("운전");
                this.comboBoxOut10Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut10Mode_SelectedIndexChanged);
                #endregion
            }
        }
        private void DefaultSetting()
        {
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentType == 4)
                this.UpdateControlEnable(false);
            else
                this.UpdateControlEnable(true);
        }

        private void UpdateControlsDisplay1(JudgmentSetItem item1,JudgmentSetItem item2, SystemParameter9507 parameter)
        {
            int value = 0;
            string sValue = "";

            sValue = string.Format("No.{0}", this.ParentForm.ParentForm.SystemConfig.ProductNumber);
            if (this.labelProductNumber.Text != sValue)
                this.labelProductNumber.Text = sValue;

            this.comboBoxSorter1Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxSorter1Mode_SelectedIndexChanged);
            this.comboBoxSorter2Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxSorter2Mode_SelectedIndexChanged);

            // 선별기1 모드
            value = item1.Sorter1Mode;
            if (this.comboBoxSorter1Mode.SelectedIndex != value)
                this.comboBoxSorter1Mode.SelectedIndex = value;

            // 선별기1 지연시간
            value = item1.Sorter1DelayTime;
            if (this.labelSorter1DelayTime.Text != value.ToString())
                this.labelSorter1DelayTime.Text = value.ToString();

            // 선별기1 동작시간
            value = item1.Sorter1RunTime;
            if (this.labelSorter1RunTime.Text != value.ToString())
                this.labelSorter1RunTime.Text = value.ToString();

            // 선별기2 모드
            value = item2.Sorter1Mode;
            if (this.comboBoxSorter2Mode.SelectedIndex != value)
                this.comboBoxSorter2Mode.SelectedIndex = value;

            // 선별기2 지연시간
            value = item2.Sorter1DelayTime;
            if (this.labelSorter2DelayTime.Text != value.ToString())
                this.labelSorter2DelayTime.Text = value.ToString();

            // 선별기2 동작시간
            value = item2.Sorter1RunTime;
            if (this.labelSorter2RunTime.Text != value.ToString())
                this.labelSorter2RunTime.Text = value.ToString();

            // 이중진입
            value = int.Parse(parameter.SorterDoubleEntry);
            if (value == 0)
                this.radioButtonDoubleEntryDsable.Checked = true;
            else if (value == 1)
                this.radioButtonDoubleEntryEnable.Checked = true;
            else
                this.radioButtonDoubleEntryDsable.Checked = true;

            this.comboBoxSorter1Mode.SelectedIndexChanged += new EventHandler(this.comboBoxSorter1Mode_SelectedIndexChanged);
            this.comboBoxSorter2Mode.SelectedIndexChanged += new EventHandler(this.comboBoxSorter2Mode_SelectedIndexChanged);
        }
        private void UpdateControlsDisplay2(SystemParameter9509 item)
        {
            string value = "";
            int index = 0;

            #region ExternalOut1
            this.comboBoxOut1Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut1Mode_SelectedIndexChanged);
            index = int.Parse(item.ExternalOut1Mode.Trim());
            if (this.comboBoxOut1Mode.SelectedIndex != index)
                this.comboBoxOut1Mode.SelectedIndex = index;
            this.comboBoxOut1Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut1Mode_SelectedIndexChanged);
            value = item.ExternalOut1DelayTime.Trim();
            if (this.labelOut1DelayTime.Text != value)
                this.labelOut1DelayTime.Text = value;
            value = item.ExternalOut1RunTime.Trim();
            if (this.labelOut1RunTime.Text != value)
                this.labelOut1RunTime.Text = value;
            #endregion

            #region ExternalOut2
            this.comboBoxOut2Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut2Mode_SelectedIndexChanged);
            index = int.Parse(item.ExternalOut2Mode.Trim());
            if (this.comboBoxOut2Mode.SelectedIndex != index)
                this.comboBoxOut2Mode.SelectedIndex = index;
            this.comboBoxOut2Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut2Mode_SelectedIndexChanged);
            value = item.ExternalOut2DelayTime.Trim();
            if (this.labelOut2DelayTime.Text != value)
                this.labelOut2DelayTime.Text = value;
            value = item.ExternalOut2RunTime.Trim();
            if (this.labelOut2RunTime.Text != value)
                this.labelOut2RunTime.Text = value;
            #endregion

            #region ExternalOut3
            this.comboBoxOut3Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut3Mode_SelectedIndexChanged);
            index = int.Parse(item.ExternalOut3Mode.Trim());
            if (this.comboBoxOut3Mode.SelectedIndex != index)
                this.comboBoxOut3Mode.SelectedIndex = index;
            this.comboBoxOut3Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut3Mode_SelectedIndexChanged);
            value = item.ExternalOut3DelayTime.Trim();
            if (this.labelOut3DelayTime.Text != value)
                this.labelOut3DelayTime.Text = value;
            value = item.ExternalOut3RunTime.Trim();
            if (this.labelOut3RunTime.Text != value)
                this.labelOut3RunTime.Text = value;
            #endregion

            #region ExternalOut4
            this.comboBoxOut4Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut4Mode_SelectedIndexChanged);
            index = int.Parse(item.ExternalOut4Mode.Trim());
            if (this.comboBoxOut4Mode.SelectedIndex != index)
                this.comboBoxOut4Mode.SelectedIndex = index;
            this.comboBoxOut4Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut4Mode_SelectedIndexChanged);
            value = item.ExternalOut4DelayTime.Trim();
            if (this.labelOut4DelayTime.Text != value)
                this.labelOut4DelayTime.Text = value;
            value = item.ExternalOut4RunTime.Trim();
            if (this.labelOut4RunTime.Text != value)
                this.labelOut4RunTime.Text = value;
            #endregion

            #region ExternalOut9
            this.comboBoxOut9Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut9Mode_SelectedIndexChanged);
            index = int.Parse(item.ExternalOut9Mode.Trim());
            if (this.comboBoxOut9Mode.SelectedIndex != index)
                this.comboBoxOut9Mode.SelectedIndex = index;
            this.comboBoxOut9Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut9Mode_SelectedIndexChanged);
            value = item.ExternalOut9DelayTime.Trim();
            if (this.labelOut9DelayTime.Text != value)
                this.labelOut9DelayTime.Text = value;
            value = item.ExternalOut9RunTime.Trim();
            if (this.labelOut9RunTime.Text != value)
                this.labelOut9RunTime.Text = value;
            #endregion

            #region ExternalOut10
            this.comboBoxOut10Mode.SelectedIndexChanged -= new EventHandler(this.comboBoxOut10Mode_SelectedIndexChanged);
            index = int.Parse(item.ExternalOut10Mode.Trim());
            if (this.comboBoxOut10Mode.SelectedIndex != index)
                this.comboBoxOut10Mode.SelectedIndex = index;
            this.comboBoxOut10Mode.SelectedIndexChanged += new EventHandler(this.comboBoxOut10Mode_SelectedIndexChanged);
            value = item.ExternalOut10DelayTime.Trim();
            if (this.labelOut10DelayTime.Text != value)
                this.labelOut10DelayTime.Text = value;
            value = item.ExternalOut10RunTime.Trim();
            if (this.labelOut10RunTime.Text != value)
                this.labelOut10RunTime.Text = value;
            #endregion
        }
        public void UpdateEquipmentStatusDisplay(Define.E_EquipmentStatus status)
        {
            if (status == Define.E_EquipmentStatus.Start)
            {
                //this.pictureBoxStart.Visible = true;
                //this.pictureBoxStop.Visible = false;
            }
            else
            {
                //this.pictureBoxStart.Visible = false;
                //this.pictureBoxStop.Visible = true;
            }
        }
        public void UpdateControlEnable(bool enable)
        {
            this.comboBoxOut9Mode.Enabled = enable;
            this.labelOut9DelayTime.Enabled = enable;
            this.labelOut9RunTime.Enabled = enable;

            this.comboBoxOut10Mode.Enabled = enable;
            this.labelOut10DelayTime.Enabled = enable;
            this.labelOut10RunTime.Enabled = enable;
        }

        public void DisplayRefresh(SystemStatus status)
        {
            this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplay = Define.E_DisplayStore.SystemSorterSetting;
            this.ParentForm.ParentForm.SetDisplayMode(Define.E_DisplayMode.Menu);
            this.ParentForm.DisplayTitleRoot(this.ParentForm.ParentForm.CurrentSystemStatus);

            this.ParentForm.ParentForm.LoadJudgmentSetFile1(ref this.ParentForm.ParentForm.CurrentJudgmentSetItem1, this.ParentForm.ParentForm.SystemConfig.ProductNumber - 1);
            this.ParentForm.ParentForm.LoadJudgmentSetFile2(ref this.ParentForm.ParentForm.CurrentJudgmentSetItem2, this.ParentForm.ParentForm.SystemConfig.ProductNumber - 1);
            this.UpdateControlsDisplay1(this.ParentForm.ParentForm.CurrentJudgmentSetItem1, this.ParentForm.ParentForm.CurrentJudgmentSetItem2, this.ParentForm.ParentForm.CurrentSystemParameter9507);
            this.UpdateControlsDisplay2(this.ParentForm.ParentForm.CurrentSystemParameter9509);
            this.Focus();
        }
        #endregion

        #region Event Handler
        private void radioButtonDoubleEntry_Click(object sender, EventArgs e)
        {
            string value = "";

            if (this.radioButtonDoubleEntryDsable.Checked == true)
                value = "0000";
            else if (this.radioButtonDoubleEntryEnable.Checked == true)
                value = "0001";
            else
                value = "0000";

            this.ParentForm.ParentForm.CurrentSystemParameter9507.SorterDoubleEntry = value;
            this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._6005_DoubleEnter, value);
        }

        #region 선별기 1열
        private void comboBoxSorter1Mode_SelectedIndexChanged(object sender, EventArgs e)
        {
            string value = "";

            if (this.comboBoxSorter1Mode.Items.Count == 0)
                return;

            this.ParentForm.ParentForm.CurrentJudgmentSetItem1.Sorter1Mode = this.comboBoxSorter1Mode.SelectedIndex;
            this.ParentForm.ParentForm.SaveJudgmentSetFile1(this.ParentForm.ParentForm.CurrentJudgmentSetItem1, this.ParentForm.ParentForm.SystemConfig.ProductNumber - 1);
            value = Helper.StringZeroFillDigits4(this.ParentForm.ParentForm.CurrentJudgmentSetItem1.Sorter1Mode.ToString());
            this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5101_Sorter1Mode, value);
        }
        private void labelSorter1DelayTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelSorter1DelayTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelSorter1DelayTime.Text = myKeyPad.StringValue;
                    this.ParentForm.ParentForm.CurrentJudgmentSetItem1.Sorter1DelayTime = myKeyPad.IntValue;
                    this.ParentForm.ParentForm.SaveJudgmentSetFile1(this.ParentForm.ParentForm.CurrentJudgmentSetItem1, this.ParentForm.ParentForm.SystemConfig.ProductNumber - 1);
                    value = Helper.StringZeroFillDigits4(this.ParentForm.ParentForm.CurrentJudgmentSetItem1.Sorter1DelayTime.ToString());
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5102_Sorter1DelayTime, value);
                }
            }
        }
        private void labelSorter1RunTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelSorter1RunTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelSorter1RunTime.Text = myKeyPad.StringValue;
                    this.ParentForm.ParentForm.CurrentJudgmentSetItem1.Sorter1RunTime = myKeyPad.IntValue;
                    this.ParentForm.ParentForm.SaveJudgmentSetFile1(this.ParentForm.ParentForm.CurrentJudgmentSetItem1, this.ParentForm.ParentForm.SystemConfig.ProductNumber - 1);
                    value = Helper.StringZeroFillDigits4(this.ParentForm.ParentForm.CurrentJudgmentSetItem1.Sorter1RunTime.ToString());
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5103_Sorter1RunTime, value);
                }
            }
        } 
        #endregion

        #region 선별기 2열
        private void comboBoxSorter2Mode_SelectedIndexChanged(object sender, EventArgs e)
        {
            string value = "";

            if (this.comboBoxSorter2Mode.Items.Count == 0)
                return;

            this.ParentForm.ParentForm.CurrentJudgmentSetItem2.Sorter1Mode = this.comboBoxSorter2Mode.SelectedIndex;
            this.ParentForm.ParentForm.SaveJudgmentSetFile2(this.ParentForm.ParentForm.CurrentJudgmentSetItem2, this.ParentForm.ParentForm.SystemConfig.ProductNumber - 1);
            value = Helper.StringZeroFillDigits4(this.ParentForm.ParentForm.CurrentJudgmentSetItem2.Sorter1Mode.ToString());
            this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5104_Sorter2Mode, value);
        }
        private void labelSorter2DelayTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelSorter2DelayTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelSorter2DelayTime.Text = myKeyPad.StringValue;
                    this.ParentForm.ParentForm.CurrentJudgmentSetItem2.Sorter1DelayTime = myKeyPad.IntValue;
                    this.ParentForm.ParentForm.SaveJudgmentSetFile2(this.ParentForm.ParentForm.CurrentJudgmentSetItem2, this.ParentForm.ParentForm.SystemConfig.ProductNumber - 1);
                    value = Helper.StringZeroFillDigits4(this.ParentForm.ParentForm.CurrentJudgmentSetItem2.Sorter1DelayTime.ToString());
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5105_Sorter2DelayTime, value);
                }
            }
        }
        private void labelSorter2RunTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelSorter2RunTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 0 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelSorter2RunTime.Text = myKeyPad.StringValue;
                    this.ParentForm.ParentForm.CurrentJudgmentSetItem2.Sorter1RunTime = myKeyPad.IntValue;
                    this.ParentForm.ParentForm.SaveJudgmentSetFile2(this.ParentForm.ParentForm.CurrentJudgmentSetItem2, this.ParentForm.ParentForm.SystemConfig.ProductNumber - 1);
                    value = Helper.StringZeroFillDigits4(this.ParentForm.ParentForm.CurrentJudgmentSetItem2.Sorter1RunTime.ToString());
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5106_Sorter2RunTime, value);
                }
            }
        } 
        #endregion

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

            this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut1Mode = this.comboBoxOut1Mode.SelectedIndex.ToString();
            value = Helper.StringZeroFillDigits4(this.comboBoxOut1Mode.SelectedIndex.ToString());
            this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5201_ExternalOut1Mode, value);
        }
        private void labelOut1DelayTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelOut1DelayTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelOut1DelayTime.Text = myKeyPad.StringValue;

                    this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut1DelayTime = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(myKeyPad.StringValue);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5202_ExternalOut1DelayTime, value);
                }
            }
        }
        private void labelOut1RunTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelOut1RunTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelOut1RunTime.Text = myKeyPad.StringValue;

                    this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut1RunTime = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(myKeyPad.StringValue);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5203_ExternalOut1RunTime, value);
                }
            }
        }

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

            this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut2Mode = this.comboBoxOut2Mode.SelectedIndex.ToString();

            value = Helper.StringZeroFillDigits4(this.comboBoxOut2Mode.SelectedIndex.ToString());
            this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5204_ExternalOut2Mode, value);
        }
        private void labelOut2DelayTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelOut2DelayTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelOut2DelayTime.Text = myKeyPad.StringValue;

                    this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut2DelayTime = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(myKeyPad.StringValue);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5205_ExternalOut2DelayTime, value);
                }
            }
        }
        private void labelOut2RunTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelOut2RunTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelOut2RunTime.Text = myKeyPad.StringValue;

                    this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut2RunTime = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(myKeyPad.StringValue);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5206_ExternalOut2RunTime, value);
                }
            }
        }

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

            this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut3Mode = this.comboBoxOut3Mode.SelectedIndex.ToString();

            value = Helper.StringZeroFillDigits4(this.comboBoxOut3Mode.SelectedIndex.ToString());
            this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5207_ExternalOut3Mode, value);
        }
        private void labelOut3DelayTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelOut3DelayTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelOut3DelayTime.Text = myKeyPad.StringValue;

                    this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut3DelayTime = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(myKeyPad.StringValue);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5208_ExternalOut3DelayTime, value);
                }
            }
        }
        private void labelOut3RunTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelOut3RunTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelOut3RunTime.Text = myKeyPad.StringValue;

                    this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut3RunTime = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(myKeyPad.StringValue);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5209_ExternalOut3RunTime, value);
                }
            }
        }

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

            this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut4Mode = this.comboBoxOut4Mode.SelectedIndex.ToString();

            value = Helper.StringZeroFillDigits4(this.comboBoxOut4Mode.SelectedIndex.ToString());
            this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5210_ExternalOut4Mode, value);
        }
        private void labelOut4DelayTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelOut4DelayTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelOut4DelayTime.Text = myKeyPad.StringValue;

                    this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut4DelayTime = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(myKeyPad.StringValue);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5211_ExternalOut4DelayTime, value);
                }
            }
        }
        private void labelOut4RunTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelOut4RunTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelOut4RunTime.Text = myKeyPad.StringValue;

                    this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut4RunTime = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(myKeyPad.StringValue);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5212_ExternalOut4RunTime, value);
                }
            }
        }

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

            this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut9Mode = this.comboBoxOut9Mode.SelectedIndex.ToString();
            this.ParentForm.ParentForm.CurrentSystemParameter3.ExternalOut9Mode = this.comboBoxOut9Mode.SelectedIndex.ToString();
            this.ParentForm.ParentForm.SaveSystemParameter3File(this.ParentForm.ParentForm.CurrentSystemParameter3);

            value = Helper.StringZeroFillDigits4(this.comboBoxOut9Mode.SelectedIndex.ToString());
            this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5225_ExternalOut9Mode, value);
        }
        private void labelOut9DelayTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelOut9DelayTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelOut9DelayTime.Text = myKeyPad.StringValue;

                    this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut9DelayTime = myKeyPad.StringValue;
                    this.ParentForm.ParentForm.CurrentSystemParameter3.ExternalOut9DelayTime = myKeyPad.StringValue;
                    this.ParentForm.ParentForm.SaveSystemParameter3File(this.ParentForm.ParentForm.CurrentSystemParameter3);

                    value = Helper.StringZeroFillDigits4(myKeyPad.StringValue);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5226_ExternalOut9DelayTime, value);
                }
            }
        }
        private void labelOut9RunTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelOut9RunTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelOut9RunTime.Text = myKeyPad.StringValue;

                    this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut9RunTime = myKeyPad.StringValue;
                    this.ParentForm.ParentForm.CurrentSystemParameter3.ExternalOut9RunTime = myKeyPad.StringValue;
                    this.ParentForm.ParentForm.SaveSystemParameter3File(this.ParentForm.ParentForm.CurrentSystemParameter3);

                    value = Helper.StringZeroFillDigits4(myKeyPad.StringValue);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5227_ExternalOut9RunTime, value);
                }
            }
        }

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

            this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut10Mode = this.comboBoxOut10Mode.SelectedIndex.ToString();
            this.ParentForm.ParentForm.CurrentSystemParameter3.ExternalOut10Mode = this.comboBoxOut9Mode.SelectedIndex.ToString();
            this.ParentForm.ParentForm.SaveSystemParameter3File(this.ParentForm.ParentForm.CurrentSystemParameter3);

            value = Helper.StringZeroFillDigits4(this.comboBoxOut10Mode.SelectedIndex.ToString());
            this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5228_ExternalOut10Mode, value);
        }
        private void labelOut10DelayTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelOut10DelayTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelOut10DelayTime.Text = myKeyPad.StringValue;

                    this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut10DelayTime = myKeyPad.StringValue;
                    this.ParentForm.ParentForm.CurrentSystemParameter3.ExternalOut10DelayTime = myKeyPad.StringValue;
                    this.ParentForm.ParentForm.SaveSystemParameter3File(this.ParentForm.ParentForm.CurrentSystemParameter3);

                    value = Helper.StringZeroFillDigits4(myKeyPad.StringValue);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5229_ExternalOut10DelayTime, value);
                }
            }
        }
        private void labelOut10RunTime_Click(object sender, EventArgs e)
        {
            string value = "";
            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelOut10RunTime.Text, 4, 0, false, this.ParentForm.ParentForm.SystemConfig.Language);

            if (myKeyPad.ShowDialog() == DialogResult.OK)
            {
                if (myKeyPad.doubleValue < 1 || myKeyPad.doubleValue > 9999)
                {
                    // 입력범위를 확인하세요
                    DialogFormMessage myMsg = new DialogFormMessage(1, this.ParentForm.ParentForm.SystemConfig.Language);
                    myMsg.ShowDialog();
                }
                else
                {
                    this.labelOut10RunTime.Text = myKeyPad.StringValue;

                    this.ParentForm.ParentForm.CurrentSystemParameter9509.ExternalOut10RunTime = myKeyPad.StringValue;
                    this.ParentForm.ParentForm.CurrentSystemParameter3.ExternalOut10RunTime = myKeyPad.StringValue;
                    this.ParentForm.ParentForm.SaveSystemParameter3File(this.ParentForm.ParentForm.CurrentSystemParameter3);

                    value = Helper.StringZeroFillDigits4(myKeyPad.StringValue);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5230_ExternalOut10RunTime, value);
                }
            }
        }
        #endregion
    }
}
