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 INT63DC_2C.Forms;
using INT63DC_2C.DialogForms;
using INT63DC_ImageDll;

namespace INT63DC_2C.Controls
{
    public partial class ControlDynamicSetting : UserControl
    {
        #region Field
        private FormSystemSetting m_ParentForm;
        #endregion

        #region Constructor
        public ControlDynamicSetting(FormSystemSetting parent)
        {
            InitializeComponent();

            this.ParentForm = parent;

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

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

        #region Method
        private void InitializeDesign()
        {
            ImageDll images = new ImageDll();
            Font font = new Font("New Gulim", 8F, FontStyle.Regular);

            if (this.ParentForm.ParentForm.SystemConfig.Language == DataStore.E_LanguageID.Korean)
            {

            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == DataStore.E_LanguageID.English)
            {
                #region English
                this.smartGroupBox1.Text = "DynamicCorrection";
                this.labelStaticForcedZeroDelayTime.Text = "Forced zero delay";
                this.labelStaticEntryGateDelayTime.Text = "Entry gate delay";
                this.labelStaticEntryGateRunTime.Text = "Entry gate run";
                this.labelStaticDischargeStopperDelayTime.Text = "Discharge stopper delay";
                this.labelStaticDischargeStopperRunTime.Text = "Discharge stopper run";
                this.labelStaticSorter4DelayTime.Text = "Sorter4 Delay";
                this.labelStaticSorter4RunTime.Text = "Sorter4 Run";
                this.labelStaticStopper2DelayTime.Text = "Stopper2 Delay";
                this.labelStaticStopper2RunTime.Text = "Stopper2 Run";
                #endregion
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == DataStore.E_LanguageID.Chinese)
            {
                #region Chinese
                this.smartGroupBox1.Text = "动态校正";
                this.labelStaticForcedZeroDelayTime.Text = "零延迟时间";

                this.labelStaticEntryGateDelayTime.Text = "料门延迟时间";
                this.labelStaticEntryGateRunTime.Text = "料门动作时间";
                this.labelStaticDischargeStopperDelayTime.Text = "出料限位器延迟时间";
                this.labelStaticDischargeStopperRunTime.Text = "出料限位器动作时间";
                this.labelStaticSorter4DelayTime.Text = "分类机4 延迟时间";
                this.labelStaticSorter4RunTime.Text = "分类机4 运行时间";
                this.labelStaticStopper2DelayTime.Text = "限位2 器延迟时间";
                this.labelStaticStopper2RunTime.Text = "限位2 器动作时间";

                this.label1.Text = "列 1";
                this.label2.Text = "列 2";
                this.label3.Text = "列 3";
                this.label4.Text = "列 4";
                this.label5.Text = "列 5";
                this.label6.Text = "列 6";
                this.label7.Text = "列 7";
                this.label8.Text = "列 8";
                this.label9.Text = "列 9";
                this.label10.Text = "列 10";
                this.label11.Text = "列 11";
                this.label12.Text = "列 12";
                this.label13.Text = "列 13";
                this.label14.Text = "列 14";
                this.label15.Text = "列 15";
                this.label16.Text = "列 16"; 
                #endregion
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == DataStore.E_LanguageID.Czech)
            {
                #region Czech
                this.smartGroupBox1.Text = "Dynamická korekce";
                this.labelStaticForcedZeroDelayTime.Font = font;
                this.labelStaticForcedZeroDelayTime.Text = "Vynucená nulového zpoždění";

                this.labelStaticEntryGateDelayTime.Text = "zpoždění vstupní brány";
                this.labelStaticEntryGateRunTime.Text = "Provozní vjezdové brány";
                this.labelStaticDischargeStopperDelayTime.Text = "zpoždění vybíjecí zátky";
                this.labelStaticDischargeStopperRunTime.Text = "provozu vypouštěcí zátky";
                this.labelStaticSorter4DelayTime.Text = "Vyřazovač4 Zpoždění";
                this.labelStaticSorter4RunTime.Text = "Vyřazovač4 Čas chodu";
                this.labelStaticStopper2DelayTime.Text = "Zastavování2 Zpoždění";
                this.labelStaticStopper2RunTime.Text = "Zastavování2 Čas chodu";

                this.label1.Text = "Linka 1";
                this.label2.Text = "Linka 2";
                this.label3.Text = "Linka 3";
                this.label4.Text = "Linka 4";
                this.label5.Text = "Linka 5";
                this.label6.Text = "Linka 6";
                this.label7.Text = "Linka 7";
                this.label8.Text = "Linka 8";
                this.label9.Text = "Linka 9";
                this.label10.Text = "Linka 10";
                this.label11.Text = "Linka 11";
                this.label12.Text = "Linka 12";
                this.label13.Text = "Linka 13";
                this.label14.Text = "Linka 14";
                this.label15.Text = "Linka 15";
                this.label16.Text = "Linka 16"; 
                #endregion
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == DataStore.E_LanguageID.German)
            {
                #region German
                this.smartGroupBox1.Text = "Dynamische Konstante";
                this.labelStaticForcedZeroDelayTime.Font = font;
                this.labelStaticForcedZeroDelayTime.Text = "Erzwungene Null-Verzögerungszeit";

                this.labelStaticEntryGateDelayTime.Font = font;
                this.labelStaticEntryGateDelayTime.Text = "Verzögerungszeit Eingangstors";
                this.labelStaticEntryGateRunTime.Font = font;
                this.labelStaticEntryGateRunTime.Text = "Einfahrtstor Betriebszeit";
                this.labelStaticDischargeStopperDelayTime.Font = font;
                this.labelStaticDischargeStopperDelayTime.Text = "Verzögerungszeit Entladestoppers";
                this.labelStaticDischargeStopperRunTime.Font = font;
                this.labelStaticDischargeStopperRunTime.Text = "Betriebszeit Entladungsstoppers";
                this.labelStaticSorter4DelayTime.Text = "Sortierer4 Vezögerung";
                this.labelStaticSorter4RunTime.Text = "Sortierer4 Laufzeit";
                this.labelStaticStopper2DelayTime.Text = "Stoppen2 Vezögerung";
                this.labelStaticStopper2RunTime.Text = "Stoppen2 Laufzeit";

                this.label1.Text = "Reihe 1";
                this.label2.Text = "Reihe 2";
                this.label3.Text = "Reihe 3";
                this.label4.Text = "Reihe 4";
                this.label5.Text = "Reihe 5";
                this.label6.Text = "Reihe 6";
                this.label7.Text = "Reihe 7";
                this.label8.Text = "Reihe 8";
                this.label9.Text = "Reihe 9";
                this.label10.Text = "Reihe 10";
                this.label11.Text = "Reihe 11";
                this.label12.Text = "Reihe 12";
                this.label13.Text = "Reihe 13";
                this.label14.Text = "Reihe 14";
                this.label15.Text = "Reihe 15";
                this.label16.Text = "Reihe 16"; 
                #endregion
            }
            else if (this.ParentForm.ParentForm.SystemConfig.Language == DataStore.E_LanguageID.Japanese)
            {
                #region Japanese
                this.smartGroupBox1.Text = "動的定数";
                this.labelStaticForcedZeroDelayTime.Text = "強制ゼロ遅延時間";
                this.labelStaticEntryGateDelayTime.Text = "エントリㅡゲㅡトの遅延時間";
                this.labelStaticEntryGateRunTime.Text = "エントリㅡゲㅡトの運転時間";
                this.labelStaticDischargeStopperDelayTime.Text = "排出ストッパㅡの遅延時間";
                this.labelStaticDischargeStopperRunTime.Text = "排出ストッパㅡの運転時間";
                this.labelStaticSorter4DelayTime.Text = "ソㅡタㅡ4 遅延時間";
                this.labelStaticSorter4RunTime.Text = "ソㅡタㅡ4 運転時間";
                this.labelStaticStopper2DelayTime.Text = "ストッパー2 遅延時間";
                this.labelStaticStopper2RunTime.Text = "ストッパー2 運転時間";
                #endregion
            }
            else
            {

            }
        }
        private void DefaultSetting()
        {
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 2)
            {
                this.label1.Visible = true;
                this.label2.Visible = true;
                this.labelDynamicCorrection1.Visible = true;
                this.labelDynamicCorrection2.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 3)
            {
                this.label3.Visible = true;
                this.labelDynamicCorrection3.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 4)
            {
                this.label4.Visible = true;
                this.labelDynamicCorrection4.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 5)
            {
                this.label5.Visible = true;
                this.labelDynamicCorrection5.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 6)
            {
                this.label6.Visible = true;
                this.labelDynamicCorrection6.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 7)
            {
                this.label7.Visible = true;
                this.labelDynamicCorrection7.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 8)
            {
                this.label8.Visible = true;
                this.labelDynamicCorrection8.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 9)
            {
                this.label9.Visible = true;
                this.labelDynamicCorrection9.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 10)
            {
                this.label10.Visible = true;
                this.labelDynamicCorrection10.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 11)
            {
                this.label11.Visible = true;
                this.labelDynamicCorrection11.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 12)
            {
                this.label12.Visible = true;
                this.labelDynamicCorrection12.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 13)
            {
                this.label13.Visible = true;
                this.labelDynamicCorrection13.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 14)
            {
                this.label14.Visible = true;
                this.labelDynamicCorrection14.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 15)
            {
                this.label15.Visible = true;
                this.labelDynamicCorrection15.Visible = true;
            }
            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns >= 16)
            {
                this.label16.Visible = true;
                this.labelDynamicCorrection16.Visible = true;
            }

            if (this.ParentForm.ParentForm.SystemConfig.Sorter4Location == 0)
            {
                this.labelStaticSorter4DelayTime.Visible = false;
                this.labelStaticSorter4RunTime.Visible = false;
                this.labelSorter4DelayTime.Visible = false;
                this.labelSorter4RunTime.Visible = false;

                this.labelStaticStopper2DelayTime.Visible = false;
                this.labelStaticStopper2RunTime.Visible = false;
                this.labelStopper2DelayTime.Visible = false;
                this.labelStopper2RunTime.Visible = false;
            }
        }

        private void UpdateDisplayDynamicCorrection(JudgmentSetItem item)
        {
            string sValue = "";

            if (item == null)
                return;

            // 강제영점 지연시간
            sValue = item.ForcedZeroDelayTime.ToString();
            if (this.labelForcedZeroDelayTime.Text != sValue)
                this.labelForcedZeroDelayTime.Text = sValue;

            // 진입게이트 지연시간
            sValue = item.EntryGateDelayTime.ToString();
            if (this.labelEntryGateDelayTime.Text != sValue)
                this.labelEntryGateDelayTime.Text = sValue;

            // 진입게이트 동작시간
            sValue = item.EntryGateRunTime.ToString();
            if (this.labelEntryGateRunTime.Text != sValue)
                this.labelEntryGateRunTime.Text = sValue;

            // 배출스토퍼 지연시간
            sValue = item.DischargeStopperDelayTime.ToString();
            if (this.labelDischargeStopperDelayTime.Text != sValue)
                this.labelDischargeStopperDelayTime.Text = sValue;

            // 배출스토퍼 동작시간
            sValue = item.DischargeStopperRunTime.ToString();
            if (this.labelDischargeStopperRunTime.Text != sValue)
                this.labelDischargeStopperRunTime.Text = sValue;

            // 선별기4 지연시간
            sValue = item.Sorter4DelayTime;
            if (this.labelSorter4DelayTime.Text != sValue)
                this.labelSorter4DelayTime.Text = sValue;
           
            // 선별기4 동작시간
            sValue = item.Sorter4RunTime;
            if (this.labelSorter4RunTime.Text != sValue)
                this.labelSorter4RunTime.Text = sValue;

            // 스토퍼1 지연시간
            sValue = item.Stopper2DelayTime.ToString();
            if (this.labelStopper2DelayTime.Text != sValue)
                this.labelStopper2DelayTime.Text = sValue;

            // 스토퍼1 동작시간
            sValue = item.Stopper2RunTime.ToString();
            if (this.labelStopper2RunTime.Text != sValue)
                this.labelStopper2RunTime.Text = sValue;

            this.labelDynamicCorrection1.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection1));
            this.labelDynamicCorrection2.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection2));
            this.labelDynamicCorrection3.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection3));
            this.labelDynamicCorrection4.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection4));
            this.labelDynamicCorrection5.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection5));
            this.labelDynamicCorrection6.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection6));
            this.labelDynamicCorrection7.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection7));
            this.labelDynamicCorrection8.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection8));
            this.labelDynamicCorrection9.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection9));
            this.labelDynamicCorrection10.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection10));
            this.labelDynamicCorrection11.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection11));
            this.labelDynamicCorrection12.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection12));
            this.labelDynamicCorrection13.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection13));
            this.labelDynamicCorrection14.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection14));
            this.labelDynamicCorrection15.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection15));
            this.labelDynamicCorrection16.Text = string.Format(string.Format("{0:f6}", item.DynamicCorrection16));
        }

        public void DisplayRefresh(JudgmentSetItem item)
        {
            this.UpdateDisplayDynamicCorrection(item);
        }
        #endregion
      
        #region Event Handler
        private void labelForcedZeroDelayTime_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelForcedZeroDelayTime.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelForcedZeroDelayTime.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.labelForcedZeroDelayTime.Text = myKeyPad.StringValue;
                    this.ParentForm.SelectedJudgmentSetItem.ForcedZeroDelayTime = myKeyPad.IntValue;
                    after = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(this.labelForcedZeroDelayTime.Text);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._4501_ForcedZeroDelayTime, value);
                    this.ParentForm.ParentForm.SaveJudgmentSetFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.ForcedZeroDelayTime, number, before, after);
                }
            }
        }

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

            before = this.labelDynamicCorrection1.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection1.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection1.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard1, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection1, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection2_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection2.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection2.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection2.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard2, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection2, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection3_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection3.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection3.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection3.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard3, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection3, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection4_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection4.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection4.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection4.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard4, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection4, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection5_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection5.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection5.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection5.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard5, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection5, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection6_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection6.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection6.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection6.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard6, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection6, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection7_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection7.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection7.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection7.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard7, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection7, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection8_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection8.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection8.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection8.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard8, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection8, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection9_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection9.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection9.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection9.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard9, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection9, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection10_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection10.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection10.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection10.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard10, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection10, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection11_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection11.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection11.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection11.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard11, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection11, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection12_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection12.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection12.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection12.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard12, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection12, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection13_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection13.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection13.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection13.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard13, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection13, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection14_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection14.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection14.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection14.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard14, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection14, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection15_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection15.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection15.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection15.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard15, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection15, number, before, after);
                }
            }
        }
        private void labelDynamicCorrection16_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDynamicCorrection16.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDynamicCorrection16.Text, 7, 6, false, this.ParentForm.ParentForm.SystemConfig.Language);

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

                    value = string.Format("{0:f6}", this.labelDynamicCorrection16.Text);
                    value = value.Remove(1, 1);
                    value = Helper.StringZeroFillDigits7(value);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoard16, CommunicationAddress._5006_DynamicCorrection, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DynamicCorrection16, number, before, after);
                }
            }
        }

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

            before = this.labelEntryGateDelayTime.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelEntryGateDelayTime.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.labelEntryGateDelayTime.Text = myKeyPad.StringValue;
                    this.ParentForm.SelectedJudgmentSetItem.EntryGateDelayTime = myKeyPad.IntValue;
                    after = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(this.labelEntryGateDelayTime.Text);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5032_EntryGateDelayTime, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.EntryGateDelayTime, number, before, after);
                }
            }
        }
        private void labelEntryGateRunTime_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelEntryGateRunTime.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelEntryGateRunTime.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.labelEntryGateRunTime.Text = myKeyPad.StringValue;
                    this.ParentForm.SelectedJudgmentSetItem.EntryGateRunTime = myKeyPad.IntValue;
                    after = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(this.labelEntryGateRunTime.Text);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5033_EntryGateRunTime, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.EntryGateRunTime, number, before, after);
                }
            }
        }
        private void labelDischargeStopperDelayTime_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDischargeStopperDelayTime.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDischargeStopperDelayTime.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.labelDischargeStopperDelayTime.Text = myKeyPad.StringValue;
                    this.ParentForm.SelectedJudgmentSetItem.DischargeStopperDelayTime = myKeyPad.IntValue;
                    after = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(this.labelDischargeStopperDelayTime.Text);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5034_DischargeStopperDelayTime, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DischargeStopperDelayTime, number, before, after);
                }
            }
        }
        private void labelDischargeStopperRunTime_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelDischargeStopperRunTime.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelDischargeStopperRunTime.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.labelDischargeStopperRunTime.Text = myKeyPad.StringValue;
                    this.ParentForm.SelectedJudgmentSetItem.DischargeStopperRunTime = myKeyPad.IntValue;
                    after = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(this.labelDischargeStopperRunTime.Text);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5034_DischargeStopperRunTime, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.DischargeStopperRunTime, number, before, after);
                }
            }
        }
        private void labelSorter4DelayTime_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelSorter4DelayTime.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelSorter4DelayTime.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.labelSorter4DelayTime.Text = myKeyPad.StringValue;
                    this.ParentForm.SelectedJudgmentSetItem.Sorter4DelayTime = myKeyPad.StringValue;
                    after = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(this.labelSorter4DelayTime.Text);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5111_Sorter4DelayTime, value);
                    this.ParentForm.ParentForm.SaveJudgmentSetFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.Sorter4DelayTime, number, before, after);
                }
            }
        }
        private void labelSorter4RunTime_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelSorter4RunTime.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelSorter4RunTime.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.labelSorter4RunTime.Text = myKeyPad.StringValue;
                    this.ParentForm.SelectedJudgmentSetItem.Sorter4RunTime = myKeyPad.StringValue;
                    after = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(this.labelSorter4RunTime.Text);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5112_Sorter4RunTime, value);
                    this.ParentForm.ParentForm.SaveJudgmentSetFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.SelectedProductNo - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.Sorter4RunTime, number, before, after);
                }
            }
        }
        private void labelStopper2DelayTime_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelStopper2DelayTime.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelStopper2DelayTime.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.labelStopper2DelayTime.Text = myKeyPad.StringValue;
                    this.ParentForm.SelectedJudgmentSetItem.Stopper2DelayTime = myKeyPad.IntValue;
                    after = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(this.labelStopper2DelayTime.Text);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5036_Stopper2DelayTime, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.ParentForm.SystemConfig.ProductNumber - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.Stopper2DelayTime, number, before, after);
                }
            }
        }
        private void labelStopper2RunTime_Click(object sender, EventArgs e)
        {
            string value = "", before = "", after = "", number = "";

            before = this.labelStopper2RunTime.Text;
            number = this.ParentForm.SelectedProductNo.ToString();

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelStopper2RunTime.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.labelStopper2RunTime.Text = myKeyPad.StringValue;
                    this.ParentForm.SelectedJudgmentSetItem.Stopper2RunTime = myKeyPad.IntValue;
                    after = myKeyPad.StringValue;

                    value = Helper.StringZeroFillDigits4(this.labelStopper2RunTime.Text);
                    this.ParentForm.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5037_Stopper2RunTime, value);
                    this.ParentForm.ParentForm.SaveDynamicCorrectionFile(this.ParentForm.SelectedJudgmentSetItem, this.ParentForm.ParentForm.SystemConfig.ProductNumber - 1);

                    // Part 11
                    if (this.ParentForm.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.Stopper2RunTime, number, before, after);
                }
            }
        }
        #endregion    
    }
}
