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

using SmartX;
using INT_LKD_2.Forms;
using INT_LKD_2.DataStore;

namespace INT_LKD_2.Controls
{
    public partial class ControlMenuSystemStatus : UserControl
    {
        #region Field
        private FormMenu m_ParentForm;

        private Collection<SmartLabel> CollectionLabelProgress;

        private Collection<SmartLabel> CollectionLabelResult;
        private Collection<SmartLabel> CollectionLabelResultDiff;
        private Collection<SmartLabel> CollectionLabelResultDisp;

        private Collection<SmartLabel> CollectionDispRData;
        private Collection<SmartLabel> CollectionDispMData;
        private Collection<SmartLabel> CollectionDispMDataDiff;
        private Collection<SmartLabel> CollectionDispMDataMax;

        private Collection<SmartLabel> CollectionDiffMadc;
        private Collection<SmartLabel> CollectionDiffSecDiff;
        private Collection<SmartLabel> CollectionDiffSecSum;
        private Collection<SmartLabel> CollectionDiffSecMax;

        private Collection<SmartLabel> CollectionPressureWork;
        private Collection<SmartLabel> CollectionPressureMaster;
        #endregion

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

            this.ParentForm = parent;
            this.Initialize();
            this.InitializeData();
        }
        #endregion

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

        #region Method
        private void Initialize()
        {
            this.smartGroupBox1.Text = "System > Equipment";

            this.CollectionLabelProgress = new Collection<SmartLabel>();
            this.CollectionLabelProgress.Clear();
            this.CollectionLabelProgress.Add(this.labelProgress1);
            this.CollectionLabelProgress.Add(this.labelProgress2);
            this.CollectionLabelProgress.Add(this.labelProgress3);
            this.CollectionLabelProgress.Add(this.labelProgress5);
            this.CollectionLabelProgress.Add(this.labelProgress6);
            this.CollectionLabelProgress.Add(this.labelProgress7);
            this.CollectionLabelProgress.Add(this.labelProgress8);
            this.CollectionLabelProgress.Add(this.labelProgress9);
            this.CollectionLabelProgress.Add(this.labelProgress10);

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

            this.CollectionLabelResultDiff = new Collection<SmartLabel>();
            this.CollectionLabelResultDiff.Add(this.labelResultDiff1);
            this.CollectionLabelResultDiff.Add(this.labelResultDiff2);
            this.CollectionLabelResultDiff.Add(this.labelResultDiff3);
            this.CollectionLabelResultDiff.Add(this.labelResultDiff4);
            this.CollectionLabelResultDiff.Add(this.labelResultDiff5);
            this.CollectionLabelResultDiff.Add(this.labelResultDiff6);
            this.CollectionLabelResultDiff.Add(this.labelResultDiff7);
            this.CollectionLabelResultDiff.Add(this.labelResultDiff8);
            this.CollectionLabelResultDiff.Add(this.labelResultDiff9);
            this.CollectionLabelResultDiff.Add(this.labelResultDiff10);
            this.CollectionLabelResultDiff.Add(this.labelResultDiff11);
            this.CollectionLabelResultDiff.Add(this.labelResultDiff12);

            this.CollectionLabelResultDisp = new Collection<SmartLabel>();
            this.CollectionLabelResultDisp.Add(this.labelResultDisp1);
            this.CollectionLabelResultDisp.Add(this.labelResultDisp2);
            this.CollectionLabelResultDisp.Add(this.labelResultDisp3);
            this.CollectionLabelResultDisp.Add(this.labelResultDisp4);
            this.CollectionLabelResultDisp.Add(this.labelResultDisp5);
            this.CollectionLabelResultDisp.Add(this.labelResultDisp6);
            this.CollectionLabelResultDisp.Add(this.labelResultDisp7);
            this.CollectionLabelResultDisp.Add(this.labelResultDisp8);
            this.CollectionLabelResultDisp.Add(this.labelResultDisp9);
            this.CollectionLabelResultDisp.Add(this.labelResultDisp10);
            this.CollectionLabelResultDisp.Add(this.labelResultDisp11);
            this.CollectionLabelResultDisp.Add(this.labelResultDisp12);

            this.CollectionDispRData = new Collection<SmartLabel>();
            this.CollectionDispRData.Add(this.labelDispRData1);
            this.CollectionDispRData.Add(this.labelDispRData2);
            this.CollectionDispRData.Add(this.labelDispRData3);
            this.CollectionDispRData.Add(this.labelDispRData4);
            this.CollectionDispRData.Add(this.labelDispRData5);
            this.CollectionDispRData.Add(this.labelDispRData6);
            this.CollectionDispRData.Add(this.labelDispRData7);
            this.CollectionDispRData.Add(this.labelDispRData8);
            this.CollectionDispRData.Add(this.labelDispRData9);
            this.CollectionDispRData.Add(this.labelDispRData10);
            this.CollectionDispRData.Add(this.labelDispRData11);
            this.CollectionDispRData.Add(this.labelDispRData12);

            this.CollectionDispMData = new Collection<SmartLabel>();
            this.CollectionDispMData.Add(this.labelDispMData1);
            this.CollectionDispMData.Add(this.labelDispMData2);
            this.CollectionDispMData.Add(this.labelDispMData3);
            this.CollectionDispMData.Add(this.labelDispMData4);
            this.CollectionDispMData.Add(this.labelDispMData5);
            this.CollectionDispMData.Add(this.labelDispMData6);
            this.CollectionDispMData.Add(this.labelDispMData7);
            this.CollectionDispMData.Add(this.labelDispMData8);
            this.CollectionDispMData.Add(this.labelDispMData9);
            this.CollectionDispMData.Add(this.labelDispMData10);
            this.CollectionDispMData.Add(this.labelDispMData11);
            this.CollectionDispMData.Add(this.labelDispMData12);

            this.CollectionDispMDataDiff = new Collection<SmartLabel>();
            this.CollectionDispMDataDiff.Add(this.labelDispMDataDiff1);
            this.CollectionDispMDataDiff.Add(this.labelDispMDataDiff2);
            this.CollectionDispMDataDiff.Add(this.labelDispMDataDiff3);
            this.CollectionDispMDataDiff.Add(this.labelDispMDataDiff4);
            this.CollectionDispMDataDiff.Add(this.labelDispMDataDiff5);
            this.CollectionDispMDataDiff.Add(this.labelDispMDataDiff6);
            this.CollectionDispMDataDiff.Add(this.labelDispMDataDiff7);
            this.CollectionDispMDataDiff.Add(this.labelDispMDataDiff8);
            this.CollectionDispMDataDiff.Add(this.labelDispMDataDiff9);
            this.CollectionDispMDataDiff.Add(this.labelDispMDataDiff10);
            this.CollectionDispMDataDiff.Add(this.labelDispMDataDiff11);
            this.CollectionDispMDataDiff.Add(this.labelDispMDataDiff12);

            this.CollectionDispMDataMax = new Collection<SmartLabel>();
            this.CollectionDispMDataMax.Add(this.labelDispMDataMax1);
            this.CollectionDispMDataMax.Add(this.labelDispMDataMax2);
            this.CollectionDispMDataMax.Add(this.labelDispMDataMax3);
            this.CollectionDispMDataMax.Add(this.labelDispMDataMax4);
            this.CollectionDispMDataMax.Add(this.labelDispMDataMax5);
            this.CollectionDispMDataMax.Add(this.labelDispMDataMax6);
            this.CollectionDispMDataMax.Add(this.labelDispMDataMax7);
            this.CollectionDispMDataMax.Add(this.labelDispMDataMax8);
            this.CollectionDispMDataMax.Add(this.labelDispMDataMax9);
            this.CollectionDispMDataMax.Add(this.labelDispMDataMax10);
            this.CollectionDispMDataMax.Add(this.labelDispMDataMax11);
            this.CollectionDispMDataMax.Add(this.labelDispMDataMax12);

            this.CollectionDiffMadc = new Collection<SmartLabel>();
            this.CollectionDiffMadc.Add(this.labelDiffMadc1);
            this.CollectionDiffMadc.Add(this.labelDiffMadc2);
            this.CollectionDiffMadc.Add(this.labelDiffMadc3);
            this.CollectionDiffMadc.Add(this.labelDiffMadc4);
            this.CollectionDiffMadc.Add(this.labelDiffMadc5);
            this.CollectionDiffMadc.Add(this.labelDiffMadc6);
            this.CollectionDiffMadc.Add(this.labelDiffMadc7);
            this.CollectionDiffMadc.Add(this.labelDiffMadc8);
            this.CollectionDiffMadc.Add(this.labelDiffMadc9);
            this.CollectionDiffMadc.Add(this.labelDiffMadc10);
            this.CollectionDiffMadc.Add(this.labelDiffMadc11);
            this.CollectionDiffMadc.Add(this.labelDiffMadc12);

            this.CollectionDiffSecDiff = new Collection<SmartLabel>();
            this.CollectionDiffSecDiff.Add(this.labelDiffSecDiff1);
            this.CollectionDiffSecDiff.Add(this.labelDiffSecDiff2);
            this.CollectionDiffSecDiff.Add(this.labelDiffSecDiff3);
            this.CollectionDiffSecDiff.Add(this.labelDiffSecDiff4);
            this.CollectionDiffSecDiff.Add(this.labelDiffSecDiff5);
            this.CollectionDiffSecDiff.Add(this.labelDiffSecDiff6);
            this.CollectionDiffSecDiff.Add(this.labelDiffSecDiff7);
            this.CollectionDiffSecDiff.Add(this.labelDiffSecDiff8);
            this.CollectionDiffSecDiff.Add(this.labelDiffSecDiff9);
            this.CollectionDiffSecDiff.Add(this.labelDiffSecDiff10);
            this.CollectionDiffSecDiff.Add(this.labelDiffSecDiff11);
            this.CollectionDiffSecDiff.Add(this.labelDiffSecDiff12);

            this.CollectionDiffSecSum = new Collection<SmartLabel>();
            this.CollectionDiffSecSum.Add(this.labelDiffSecSum1);
            this.CollectionDiffSecSum.Add(this.labelDiffSecSum2);
            this.CollectionDiffSecSum.Add(this.labelDiffSecSum3);
            this.CollectionDiffSecSum.Add(this.labelDiffSecSum4);
            this.CollectionDiffSecSum.Add(this.labelDiffSecSum5);
            this.CollectionDiffSecSum.Add(this.labelDiffSecSum6);
            this.CollectionDiffSecSum.Add(this.labelDiffSecSum7);
            this.CollectionDiffSecSum.Add(this.labelDiffSecSum8);
            this.CollectionDiffSecSum.Add(this.labelDiffSecSum9);
            this.CollectionDiffSecSum.Add(this.labelDiffSecSum10);
            this.CollectionDiffSecSum.Add(this.labelDiffSecSum11);
            this.CollectionDiffSecSum.Add(this.labelDiffSecSum12);

            this.CollectionDiffSecMax = new Collection<SmartLabel>();
            this.CollectionDiffSecMax.Add(this.labelDiffSecMax1);
            this.CollectionDiffSecMax.Add(this.labelDiffSecMax2);
            this.CollectionDiffSecMax.Add(this.labelDiffSecMax3);
            this.CollectionDiffSecMax.Add(this.labelDiffSecMax4);
            this.CollectionDiffSecMax.Add(this.labelDiffSecMax5);
            this.CollectionDiffSecMax.Add(this.labelDiffSecMax6);
            this.CollectionDiffSecMax.Add(this.labelDiffSecMax7);
            this.CollectionDiffSecMax.Add(this.labelDiffSecMax8);
            this.CollectionDiffSecMax.Add(this.labelDiffSecMax9);
            this.CollectionDiffSecMax.Add(this.labelDiffSecMax10);
            this.CollectionDiffSecMax.Add(this.labelDiffSecMax11);
            this.CollectionDiffSecMax.Add(this.labelDiffSecMax12);

            this.CollectionPressureWork = new Collection<SmartLabel>();
            this.CollectionPressureWork.Add(this.labelPressureWork1);
            this.CollectionPressureWork.Add(this.labelPressureWork2);
            this.CollectionPressureWork.Add(this.labelPressureWork3);
            this.CollectionPressureWork.Add(this.labelPressureWork4);
            this.CollectionPressureWork.Add(this.labelPressureWork5);
            this.CollectionPressureWork.Add(this.labelPressureWork6);
            this.CollectionPressureWork.Add(this.labelPressureWork7);
            this.CollectionPressureWork.Add(this.labelPressureWork8);
            this.CollectionPressureWork.Add(this.labelPressureWork9);
            this.CollectionPressureWork.Add(this.labelPressureWork10);
            this.CollectionPressureWork.Add(this.labelPressureWork11);
            this.CollectionPressureWork.Add(this.labelPressureWork12);

            this.CollectionPressureMaster = new Collection<SmartLabel>();
            this.CollectionPressureMaster.Add(this.labelPressureMaster1);
            this.CollectionPressureMaster.Add(this.labelPressureMaster2);
            this.CollectionPressureMaster.Add(this.labelPressureMaster3);
            this.CollectionPressureMaster.Add(this.labelPressureMaster4);
            this.CollectionPressureMaster.Add(this.labelPressureMaster5);
            this.CollectionPressureMaster.Add(this.labelPressureMaster6);
            this.CollectionPressureMaster.Add(this.labelPressureMaster7);
            this.CollectionPressureMaster.Add(this.labelPressureMaster8);
            this.CollectionPressureMaster.Add(this.labelPressureMaster9);
            this.CollectionPressureMaster.Add(this.labelPressureMaster10);
            this.CollectionPressureMaster.Add(this.labelPressureMaster11);
            this.CollectionPressureMaster.Add(this.labelPressureMaster12);
        }
        public void InitializeData()
        {
            for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
            {
                this.CollectionLabelResult[i].Text = "-";
                this.CollectionLabelResult[i].TextColor = Define.ColorTextResultNone;
                this.CollectionLabelResultDiff[i].TextColor = Define.ColorTextResultNone;
                this.CollectionLabelResultDiff[i].Visible = false;
                this.CollectionLabelResultDisp[i].TextColor = Define.ColorTextResultNone;
                this.CollectionLabelResultDisp[i].Visible = false;

                this.CollectionDispRData[i].Text = "0.00";
                this.CollectionDispMData[i].Text = "0.00";
                this.CollectionDispMDataDiff[i].Text = "0.00";
                this.CollectionDispMDataMax[i].Text = "0.00";
                this.CollectionDiffMadc[i].Text = "0.00";
                this.CollectionDiffSecDiff[i].Text = "0.00";
                this.CollectionDiffSecSum[i].Text = "0.00";
                this.CollectionDiffSecMax[i].Text = "0.00";
                this.CollectionPressureWork[i].Text = "0.0";
                this.CollectionPressureMaster[i].Text = "0.0";
            }
        }

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

            switch (judg)
            {
                case Define.E_JudgmentStatus.None:
                    value = "-";
                    label2.TextColor = Define.ColorTextResultNone;
                    label2.Font = new Font("New Gulim", 20, FontStyle.Bold);
                    break;
                case Define.E_JudgmentStatus.Pass:
                    value = "Pass";
                    label2.TextColor = Define.ColorTextResultPass;
                    label2.Font = new Font("New Gulim", 20, FontStyle.Bold);
                    break;
                case Define.E_JudgmentStatus.Ng:
                    value = "Leak";
                    label2.TextColor = Define.ColorTextResultNG;
                    label2.Font = new Font("New Gulim", 20, FontStyle.Bold);
                    break;
                case Define.E_JudgmentStatus.Empty:
                    value = "Empty";
                    label2.TextColor = Define.ColorTextResultNone;
                    label2.Font = new Font("New Gulim", 20, FontStyle.Bold);
                    break;
                case Define.E_JudgmentStatus.Error:
                    value = "Error";
                    label2.TextColor = Define.ColorTextResultNone;
                    label2.Font = new Font("New Gulim", 20, FontStyle.Bold);
                    break;
                default:
                    break;
            }

            if (label2.Text != value)
                label2.Text = value;
        }
        private void GetJudgmentResultDiff(Define.E_JudgmentStatus judg, SmartLabel label)
        {
            string value = "Diff";

            switch (judg)
            {
                case Define.E_JudgmentStatus.None:
                    label.TextColor = Define.ColorTextResultNone;
                    break;
                case Define.E_JudgmentStatus.Pass:
                    label.TextColor = Define.ColorTextResultPass;
                    break;
                case Define.E_JudgmentStatus.Ng:
                    label.TextColor = Define.ColorTextResultNG;
                    break;
                case Define.E_JudgmentStatus.Empty:
                    label.TextColor = Define.ColorTextResultNone;
                    break;
                case Define.E_JudgmentStatus.Error:
                    label.TextColor = Define.ColorTextResultNone;
                    break;
                default:
                    break;
            }

            if (label.Text != value)
                label.Text = value;
            
            label.Visible = true;
        }
        private void GetJudgmentResultDisp(Define.E_JudgmentStatus judg, SmartLabel label)
        {
            string value = "Disp";

            switch (judg)
            {
                case Define.E_JudgmentStatus.None:
                    label.TextColor = Define.ColorTextResultNone;
                    break;
                case Define.E_JudgmentStatus.Pass:
                    label.TextColor = Define.ColorTextResultPass;
                    break;
                case Define.E_JudgmentStatus.Ng:
                    label.TextColor = Define.ColorTextResultNG;
                    break;
                case Define.E_JudgmentStatus.Empty:
                    label.TextColor = Define.ColorTextResultNone;
                    break;
                case Define.E_JudgmentStatus.Error:
                    label.TextColor = Define.ColorTextResultNone;
                    break;
                default:
                    break;
            }

            if (label.Text != value)
                label.Text = value;

            label.Visible = true;
        }

        private void SelectProcessLabelRefresh(int index)
        {
            this.CollectionLabelProgress[index].BackGroundColor = Define.ColorProgressOn;
        }
        private void UnselectProcessLabelRefresh(int index)
        {
            this.CollectionLabelProgress[index].BackGroundColor = Define.ColorProgressOff;
        }

        public void UpdateDisplayProcessStatus(Define.E_ProcessStatus status)
        {
            switch (status)
            {
                case Define.E_ProcessStatus._0_None:
                    break;
                case Define.E_ProcessStatus._1_Ready:
                    if (this.labelProgress1.BackGroundColor != Define.ColorProgressOn) this.labelProgress1.BackGroundColor = Define.ColorProgressOn;
                    if (this.labelProgress2.BackGroundColor != Define.ColorProgressOff) this.labelProgress2.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress3.BackGroundColor != Define.ColorProgressOff) this.labelProgress3.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress4.BackGroundColor != Define.ColorProgressOff) this.labelProgress4.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress5.BackGroundColor != Define.ColorProgressOff) this.labelProgress5.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress6.BackGroundColor != Define.ColorProgressOff) this.labelProgress6.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress7.BackGroundColor != Define.ColorProgressOff) this.labelProgress7.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress8.BackGroundColor != Define.ColorProgressOff) this.labelProgress8.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress9.BackGroundColor != Define.ColorProgressOff) this.labelProgress9.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress10.BackGroundColor != Define.ColorProgressOff) this.labelProgress10.BackGroundColor = Define.ColorProgressOff;
                    break;
                case Define.E_ProcessStatus._2_ProductEntry:
                    if (this.labelProgress1.BackGroundColor != Define.ColorProgressOff) this.labelProgress1.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress2.BackGroundColor != Define.ColorProgressOn) this.labelProgress2.BackGroundColor = Define.ColorProgressOn;
                    if (this.labelProgress3.BackGroundColor != Define.ColorProgressOff) this.labelProgress3.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress4.BackGroundColor != Define.ColorProgressOff) this.labelProgress4.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress5.BackGroundColor != Define.ColorProgressOff) this.labelProgress5.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress6.BackGroundColor != Define.ColorProgressOff) this.labelProgress6.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress7.BackGroundColor != Define.ColorProgressOff) this.labelProgress7.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress8.BackGroundColor != Define.ColorProgressOff) this.labelProgress8.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress9.BackGroundColor != Define.ColorProgressOff) this.labelProgress9.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress10.BackGroundColor != Define.ColorProgressOff) this.labelProgress10.BackGroundColor = Define.ColorProgressOff;

                    this.InitializeData();
                    break;
                case Define.E_ProcessStatus._3_MoveToLeak:
                    if (this.labelProgress1.BackGroundColor != Define.ColorProgressOff) this.labelProgress1.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress2.BackGroundColor != Define.ColorProgressOff) this.labelProgress2.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress3.BackGroundColor != Define.ColorProgressOn) this.labelProgress3.BackGroundColor = Define.ColorProgressOn;
                    if (this.labelProgress4.BackGroundColor != Define.ColorProgressOff) this.labelProgress4.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress5.BackGroundColor != Define.ColorProgressOff) this.labelProgress5.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress6.BackGroundColor != Define.ColorProgressOff) this.labelProgress6.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress7.BackGroundColor != Define.ColorProgressOff) this.labelProgress7.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress8.BackGroundColor != Define.ColorProgressOff) this.labelProgress8.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress9.BackGroundColor != Define.ColorProgressOff) this.labelProgress9.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress10.BackGroundColor != Define.ColorProgressOff) this.labelProgress10.BackGroundColor = Define.ColorProgressOff;
                    break;
                case Define.E_ProcessStatus._4_MoveToCheck:
                    if (this.labelProgress1.BackGroundColor != Define.ColorProgressOff) this.labelProgress1.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress2.BackGroundColor != Define.ColorProgressOff) this.labelProgress2.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress3.BackGroundColor != Define.ColorProgressOn) this.labelProgress3.BackGroundColor = Define.ColorProgressOn;
                    if (this.labelProgress4.BackGroundColor != Define.ColorProgressOff) this.labelProgress4.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress5.BackGroundColor != Define.ColorProgressOff) this.labelProgress5.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress6.BackGroundColor != Define.ColorProgressOff) this.labelProgress6.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress7.BackGroundColor != Define.ColorProgressOff) this.labelProgress7.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress8.BackGroundColor != Define.ColorProgressOff) this.labelProgress8.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress9.BackGroundColor != Define.ColorProgressOff) this.labelProgress9.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress10.BackGroundColor != Define.ColorProgressOff) this.labelProgress10.BackGroundColor = Define.ColorProgressOff;
                    break;
                case Define.E_ProcessStatus._5_ChamberMerge:
                    if (this.labelProgress1.BackGroundColor != Define.ColorProgressOff) this.labelProgress1.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress2.BackGroundColor != Define.ColorProgressOff) this.labelProgress2.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress3.BackGroundColor != Define.ColorProgressOff) this.labelProgress3.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress4.BackGroundColor != Define.ColorProgressOn) this.labelProgress4.BackGroundColor = Define.ColorProgressOn;
                    if (this.labelProgress5.BackGroundColor != Define.ColorProgressOff) this.labelProgress5.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress6.BackGroundColor != Define.ColorProgressOff) this.labelProgress6.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress7.BackGroundColor != Define.ColorProgressOff) this.labelProgress7.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress8.BackGroundColor != Define.ColorProgressOff) this.labelProgress8.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress9.BackGroundColor != Define.ColorProgressOff) this.labelProgress9.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress10.BackGroundColor != Define.ColorProgressOff) this.labelProgress10.BackGroundColor = Define.ColorProgressOff;
                    break;
                case Define.E_ProcessStatus._6_VacuumStart:
                    if (this.labelProgress1.BackGroundColor != Define.ColorProgressOff) this.labelProgress1.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress2.BackGroundColor != Define.ColorProgressOff) this.labelProgress2.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress3.BackGroundColor != Define.ColorProgressOff) this.labelProgress3.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress4.BackGroundColor != Define.ColorProgressOff) this.labelProgress4.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress5.BackGroundColor != Define.ColorProgressOn) this.labelProgress5.BackGroundColor = Define.ColorProgressOn;
                    if (this.labelProgress6.BackGroundColor != Define.ColorProgressOff) this.labelProgress6.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress7.BackGroundColor != Define.ColorProgressOff) this.labelProgress7.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress8.BackGroundColor != Define.ColorProgressOff) this.labelProgress8.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress9.BackGroundColor != Define.ColorProgressOff) this.labelProgress9.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress10.BackGroundColor != Define.ColorProgressOff) this.labelProgress10.BackGroundColor = Define.ColorProgressOff;
                    break;
                case Define.E_ProcessStatus._7_VacuumHold:
                    if (this.labelProgress1.BackGroundColor != Define.ColorProgressOff) this.labelProgress1.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress2.BackGroundColor != Define.ColorProgressOff) this.labelProgress2.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress3.BackGroundColor != Define.ColorProgressOff) this.labelProgress3.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress4.BackGroundColor != Define.ColorProgressOff) this.labelProgress4.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress5.BackGroundColor != Define.ColorProgressOff) this.labelProgress5.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress6.BackGroundColor != Define.ColorProgressOn) this.labelProgress6.BackGroundColor = Define.ColorProgressOn;
                    if (this.labelProgress7.BackGroundColor != Define.ColorProgressOff) this.labelProgress7.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress8.BackGroundColor != Define.ColorProgressOff) this.labelProgress8.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress9.BackGroundColor != Define.ColorProgressOff) this.labelProgress9.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress10.BackGroundColor != Define.ColorProgressOff) this.labelProgress10.BackGroundColor = Define.ColorProgressOff;
                    break;
                case Define.E_ProcessStatus._8_Judgment:
                    if (this.labelProgress1.BackGroundColor != Define.ColorProgressOff) this.labelProgress1.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress2.BackGroundColor != Define.ColorProgressOff) this.labelProgress2.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress3.BackGroundColor != Define.ColorProgressOff) this.labelProgress3.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress4.BackGroundColor != Define.ColorProgressOff) this.labelProgress4.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress5.BackGroundColor != Define.ColorProgressOff) this.labelProgress5.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress6.BackGroundColor != Define.ColorProgressOff) this.labelProgress6.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress7.BackGroundColor != Define.ColorProgressOn) this.labelProgress7.BackGroundColor = Define.ColorProgressOn;
                    if (this.labelProgress8.BackGroundColor != Define.ColorProgressOff) this.labelProgress8.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress9.BackGroundColor != Define.ColorProgressOff) this.labelProgress9.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress10.BackGroundColor != Define.ColorProgressOff) this.labelProgress10.BackGroundColor = Define.ColorProgressOff;
                    break;
                case Define.E_ProcessStatus._9_VacuumBreak:
                    if (this.labelProgress1.BackGroundColor != Define.ColorProgressOff) this.labelProgress1.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress2.BackGroundColor != Define.ColorProgressOff) this.labelProgress2.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress3.BackGroundColor != Define.ColorProgressOff) this.labelProgress3.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress4.BackGroundColor != Define.ColorProgressOff) this.labelProgress4.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress5.BackGroundColor != Define.ColorProgressOff) this.labelProgress5.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress6.BackGroundColor != Define.ColorProgressOff) this.labelProgress6.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress7.BackGroundColor != Define.ColorProgressOff) this.labelProgress7.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress8.BackGroundColor != Define.ColorProgressOn) this.labelProgress8.BackGroundColor = Define.ColorProgressOn;
                    if (this.labelProgress9.BackGroundColor != Define.ColorProgressOff) this.labelProgress9.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress10.BackGroundColor != Define.ColorProgressOff) this.labelProgress10.BackGroundColor = Define.ColorProgressOff;
                    break;
                case Define.E_ProcessStatus._10_ChamberRelease:
                    if (this.labelProgress1.BackGroundColor != Define.ColorProgressOff) this.labelProgress1.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress2.BackGroundColor != Define.ColorProgressOff) this.labelProgress2.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress3.BackGroundColor != Define.ColorProgressOff) this.labelProgress3.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress4.BackGroundColor != Define.ColorProgressOff) this.labelProgress4.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress5.BackGroundColor != Define.ColorProgressOff) this.labelProgress5.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress6.BackGroundColor != Define.ColorProgressOff) this.labelProgress6.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress7.BackGroundColor != Define.ColorProgressOff) this.labelProgress7.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress8.BackGroundColor != Define.ColorProgressOff) this.labelProgress8.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress9.BackGroundColor != Define.ColorProgressOn) this.labelProgress9.BackGroundColor = Define.ColorProgressOn;
                    if (this.labelProgress10.BackGroundColor != Define.ColorProgressOff) this.labelProgress10.BackGroundColor = Define.ColorProgressOff;
                    break;
                case Define.E_ProcessStatus._11_MoveToReady:
                    if (this.labelProgress1.BackGroundColor != Define.ColorProgressOff) this.labelProgress1.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress2.BackGroundColor != Define.ColorProgressOff) this.labelProgress2.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress3.BackGroundColor != Define.ColorProgressOff) this.labelProgress3.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress4.BackGroundColor != Define.ColorProgressOff) this.labelProgress4.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress5.BackGroundColor != Define.ColorProgressOff) this.labelProgress5.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress6.BackGroundColor != Define.ColorProgressOff) this.labelProgress6.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress7.BackGroundColor != Define.ColorProgressOff) this.labelProgress7.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress8.BackGroundColor != Define.ColorProgressOff) this.labelProgress8.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress9.BackGroundColor != Define.ColorProgressOff) this.labelProgress9.BackGroundColor = Define.ColorProgressOff;
                    if (this.labelProgress10.BackGroundColor != Define.ColorProgressOn) this.labelProgress10.BackGroundColor = Define.ColorProgressOn;
                    break;
                default:
                    break;
            }
        }
        private void UpdateDisplayDotGraphDiff(SmartDraw draw, DiffData diff)
        {
            int iValue = 0;
            double dValue = 0.0;

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

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

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

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

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

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

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

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

        }

        // 차압센서 데이터
        public void UpdateDisplayDiffData(Collection<DiffData> datas)
        {
            string value = "";

            for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
            {
                value = datas[i].MAdc;
                if (this.CollectionDiffMadc[i].Text != value)
                    this.CollectionDiffMadc[i].Text = value;

                value = datas[i].SecBuf;
                if (this.CollectionDiffSecDiff[i].Text != value)
                    this.CollectionDiffSecDiff[i].Text = value;

                value = datas[i].SecBufSum;
                if (this.CollectionDiffSecSum[i].Text != value)
                    this.CollectionDiffSecSum[i].Text = value;

                value = datas[i].SecBufMax;
                if (this.CollectionDiffSecMax[i].Text != value)
                    this.CollectionDiffSecMax[i].Text = value;
            }
        }
        public void UpdateDisplayDiffData1(LeakData1 data)
        {
            string value = "";

            value = data.DiffData.MAdc;
            if (this.CollectionDiffMadc[0].Text != value)
                this.CollectionDiffMadc[0].Text = value;

            value = data.DiffData.SecBuf;
            if (this.CollectionDiffSecDiff[0].Text != value)
                this.CollectionDiffSecDiff[0].Text = value;

            value = data.DiffData.SecBufSum;
            if (this.CollectionDiffSecSum[0].Text != value)
                this.CollectionDiffSecSum[0].Text = value;

            value = data.DiffData.SecBufMax;
            if (this.CollectionDiffSecMax[0].Text != value)
                this.CollectionDiffSecMax[0].Text = value;
        }
        public void UpdateDisplayDiffData2(LeakData1 data)
        {
            string value = "";

            value = data.DiffData.MAdc;
            if (this.CollectionDiffMadc[1].Text != value)
                this.CollectionDiffMadc[1].Text = value;

            value = data.DiffData.SecBuf;
            if (this.CollectionDiffSecDiff[1].Text != value)
                this.CollectionDiffSecDiff[1].Text = value;

            value = data.DiffData.SecBufSum;
            if (this.CollectionDiffSecSum[1].Text != value)
                this.CollectionDiffSecSum[1].Text = value;

            value = data.DiffData.SecBufMax;
            if (this.CollectionDiffSecMax[1].Text != value)
                this.CollectionDiffSecMax[1].Text = value;
        }
        public void UpdateDisplayDiffData3(LeakData1 data)
        {
            string value = "";

            value = data.DiffData.MAdc;
            if (this.CollectionDiffMadc[2].Text != value)
                this.CollectionDiffMadc[2].Text = value;

            value = data.DiffData.SecBuf;
            if (this.CollectionDiffSecDiff[2].Text != value)
                this.CollectionDiffSecDiff[2].Text = value;

            value = data.DiffData.SecBufSum;
            if (this.CollectionDiffSecSum[2].Text != value)
                this.CollectionDiffSecSum[2].Text = value;

            value = data.DiffData.SecBufMax;
            if (this.CollectionDiffSecMax[2].Text != value)
                this.CollectionDiffSecMax[2].Text = value;
        }
        public void UpdateDisplayDiffData4(LeakData1 data)
        {
            string value = "";

            value = data.DiffData.MAdc;
            if (this.CollectionDiffMadc[3].Text != value)
                this.CollectionDiffMadc[3].Text = value;

            value = data.DiffData.SecBuf;
            if (this.CollectionDiffSecDiff[3].Text != value)
                this.CollectionDiffSecDiff[3].Text = value;

            value = data.DiffData.SecBufSum;
            if (this.CollectionDiffSecSum[3].Text != value)
                this.CollectionDiffSecSum[3].Text = value;

            value = data.DiffData.SecBufMax;
            if (this.CollectionDiffSecMax[3].Text != value)
                this.CollectionDiffSecMax[3].Text = value;
        }
        public void UpdateDisplayDiffData5(LeakData1 data)
        {
            string value = "";

            value = data.DiffData.MAdc;
            if (this.CollectionDiffMadc[4].Text != value)
                this.CollectionDiffMadc[4].Text = value;

            value = data.DiffData.SecBuf;
            if (this.CollectionDiffSecDiff[4].Text != value)
                this.CollectionDiffSecDiff[4].Text = value;

            value = data.DiffData.SecBufSum;
            if (this.CollectionDiffSecSum[4].Text != value)
                this.CollectionDiffSecSum[4].Text = value;

            value = data.DiffData.SecBufMax;
            if (this.CollectionDiffSecMax[4].Text != value)
                this.CollectionDiffSecMax[4].Text = value;
        }
        public void UpdateDisplayDiffData6(LeakData1 data)
        {
            string value = "";

            value = data.DiffData.MAdc;
            if (this.CollectionDiffMadc[5].Text != value)
                this.CollectionDiffMadc[5].Text = value;

            value = data.DiffData.SecBuf;
            if (this.CollectionDiffSecDiff[5].Text != value)
                this.CollectionDiffSecDiff[5].Text = value;

            value = data.DiffData.SecBufSum;
            if (this.CollectionDiffSecSum[5].Text != value)
                this.CollectionDiffSecSum[5].Text = value;

            value = data.DiffData.SecBufMax;
            if (this.CollectionDiffSecMax[5].Text != value)
                this.CollectionDiffSecMax[5].Text = value;
        }
        public void UpdateDisplayDiffData7(LeakData1 data)
        {
            string value = "";

            value = data.DiffData.MAdc;
            if (this.CollectionDiffMadc[6].Text != value)
                this.CollectionDiffMadc[6].Text = value;

            value = data.DiffData.SecBuf;
            if (this.CollectionDiffSecDiff[6].Text != value)
                this.CollectionDiffSecDiff[6].Text = value;

            value = data.DiffData.SecBufSum;
            if (this.CollectionDiffSecSum[6].Text != value)
                this.CollectionDiffSecSum[6].Text = value;

            value = data.DiffData.SecBufMax;
            if (this.CollectionDiffSecMax[6].Text != value)
                this.CollectionDiffSecMax[6].Text = value;
        }
        public void UpdateDisplayDiffData8(LeakData1 data)
        {
            string value = "";

            value = data.DiffData.MAdc;
            if (this.CollectionDiffMadc[7].Text != value)
                this.CollectionDiffMadc[7].Text = value;

            value = data.DiffData.SecBuf;
            if (this.CollectionDiffSecDiff[7].Text != value)
                this.CollectionDiffSecDiff[7].Text = value;

            value = data.DiffData.SecBufSum;
            if (this.CollectionDiffSecSum[7].Text != value)
                this.CollectionDiffSecSum[7].Text = value;

            value = data.DiffData.SecBufMax;
            if (this.CollectionDiffSecMax[7].Text != value)
                this.CollectionDiffSecMax[7].Text = value;
        }
        public void UpdateDisplayDiffData9(LeakData1 data)
        {
            string value = "";

            value = data.DiffData.MAdc;
            if (this.CollectionDiffMadc[8].Text != value)
                this.CollectionDiffMadc[8].Text = value;

            value = data.DiffData.SecBuf;
            if (this.CollectionDiffSecDiff[8].Text != value)
                this.CollectionDiffSecDiff[8].Text = value;

            value = data.DiffData.SecBufSum;
            if (this.CollectionDiffSecSum[8].Text != value)
                this.CollectionDiffSecSum[8].Text = value;

            value = data.DiffData.SecBufMax;
            if (this.CollectionDiffSecMax[8].Text != value)
                this.CollectionDiffSecMax[8].Text = value;
        }
        public void UpdateDisplayDiffData10(LeakData1 data)
        {
            string value = "";

            value = data.DiffData.MAdc;
            if (this.CollectionDiffMadc[9].Text != value)
                this.CollectionDiffMadc[9].Text = value;

            value = data.DiffData.SecBuf;
            if (this.CollectionDiffSecDiff[9].Text != value)
                this.CollectionDiffSecDiff[9].Text = value;

            value = data.DiffData.SecBufSum;
            if (this.CollectionDiffSecSum[9].Text != value)
                this.CollectionDiffSecSum[9].Text = value;

            value = data.DiffData.SecBufMax;
            if (this.CollectionDiffSecMax[9].Text != value)
                this.CollectionDiffSecMax[9].Text = value;
        }
        public void UpdateDisplayDiffData11(LeakData1 data)
        {
            string value = "";

            value = data.DiffData.MAdc;
            if (this.CollectionDiffMadc[10].Text != value)
                this.CollectionDiffMadc[10].Text = value;

            value = data.DiffData.SecBuf;
            if (this.CollectionDiffSecDiff[10].Text != value)
                this.CollectionDiffSecDiff[10].Text = value;

            value = data.DiffData.SecBufSum;
            if (this.CollectionDiffSecSum[10].Text != value)
                this.CollectionDiffSecSum[10].Text = value;

            value = data.DiffData.SecBufMax;
            if (this.CollectionDiffSecMax[10].Text != value)
                this.CollectionDiffSecMax[10].Text = value;
        }
        public void UpdateDisplayDiffData12(LeakData1 data)
        {
            string value = "";

            value = data.DiffData.MAdc;
            if (this.CollectionDiffMadc[11].Text != value)
                this.CollectionDiffMadc[11].Text = value;

            value = data.DiffData.SecBuf;
            if (this.CollectionDiffSecDiff[11].Text != value)
                this.CollectionDiffSecDiff[11].Text = value;

            value = data.DiffData.SecBufSum;
            if (this.CollectionDiffSecSum[11].Text != value)
                this.CollectionDiffSecSum[11].Text = value;

            value = data.DiffData.SecBufMax;
            if (this.CollectionDiffSecMax[11].Text != value)
                this.CollectionDiffSecMax[11].Text = value;
        }

        // 변위센서 데이터
        public void UpdateDisplayDispData(Collection<DispData> datas)
        {
            string value = "";

            for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
            {
                value = datas[i].RData;
                if (this.CollectionDispRData[i].Text != value)
                    this.CollectionDispRData[i].Text = value;

                value = datas[i].MData;
                if (this.CollectionDispMData[i].Text != value)
                    this.CollectionDispMData[i].Text = value;

                value = datas[i].MDataDiff;
                if (this.CollectionDispMDataDiff[i].Text != value)
                    this.CollectionDispMDataDiff[i].Text = value;

                value = datas[i].MDataMax;
                if (this.CollectionDispMDataMax[i].Text != value)
                    this.CollectionDispMDataMax[i].Text = value;
            }
        }
        public void UpdateDisplayDispData1(LeakData1 data)
        {
            string value = "";

            value = data.DispData.RData;
            if (this.CollectionDispRData[0].Text != value)
                this.CollectionDispRData[0].Text = value;

            value = data.DispData.MData;
            if (this.CollectionDispMData[0].Text != value)
                this.CollectionDispMData[0].Text = value;

            value = data.DispData.MDataDiff;
            if (this.CollectionDispMDataDiff[0].Text != value)
                this.CollectionDispMDataDiff[0].Text = value;

            value = data.DispData.MDataMax;
            if (this.CollectionDispMDataMax[0].Text != value)
                this.CollectionDispMDataMax[0].Text = value;
        }
        public void UpdateDisplayDispData2(LeakData1 data)
        {
            string value = "";

            value = data.DispData.RData;
            if (this.CollectionDispRData[1].Text != value)
                this.CollectionDispRData[1].Text = value;

            value = data.DispData.MData;
            if (this.CollectionDispMData[1].Text != value)
                this.CollectionDispMData[1].Text = value;

            value = data.DispData.MDataDiff;
            if (this.CollectionDispMDataDiff[1].Text != value)
                this.CollectionDispMDataDiff[1].Text = value;

            value = data.DispData.MDataMax;
            if (this.CollectionDispMDataMax[1].Text != value)
                this.CollectionDispMDataMax[1].Text = value;
        }
        public void UpdateDisplayDispData3(LeakData1 data)
        {
            string value = "";

            value = data.DispData.RData;
            if (this.CollectionDispRData[2].Text != value)
                this.CollectionDispRData[2].Text = value;

            value = data.DispData.MData;
            if (this.CollectionDispMData[2].Text != value)
                this.CollectionDispMData[2].Text = value;

            value = data.DispData.MDataDiff;
            if (this.CollectionDispMDataDiff[2].Text != value)
                this.CollectionDispMDataDiff[2].Text = value;

            value = data.DispData.MDataMax;
            if (this.CollectionDispMDataMax[2].Text != value)
                this.CollectionDispMDataMax[2].Text = value;
        }
        public void UpdateDisplayDispData4(LeakData1 data)
        {
            string value = "";

            value = data.DispData.RData;
            if (this.CollectionDispRData[3].Text != value)
                this.CollectionDispRData[3].Text = value;

            value = data.DispData.MData;
            if (this.CollectionDispMData[3].Text != value)
                this.CollectionDispMData[3].Text = value;

            value = data.DispData.MDataDiff;
            if (this.CollectionDispMDataDiff[3].Text != value)
                this.CollectionDispMDataDiff[3].Text = value;

            value = data.DispData.MDataMax;
            if (this.CollectionDispMDataMax[3].Text != value)
                this.CollectionDispMDataMax[3].Text = value;
        }
        public void UpdateDisplayDispData5(LeakData1 data)
        {
            string value = "";

            value = data.DispData.RData;
            if (this.CollectionDispRData[4].Text != value)
                this.CollectionDispRData[4].Text = value;

            value = data.DispData.MData;
            if (this.CollectionDispMData[4].Text != value)
                this.CollectionDispMData[4].Text = value;

            value = data.DispData.MDataDiff;
            if (this.CollectionDispMDataDiff[4].Text != value)
                this.CollectionDispMDataDiff[4].Text = value;

            value = data.DispData.MDataMax;
            if (this.CollectionDispMDataMax[4].Text != value)
                this.CollectionDispMDataMax[4].Text = value;
        }
        public void UpdateDisplayDispData6(LeakData1 data)
        {
            string value = "";

            value = data.DispData.RData;
            if (this.CollectionDispRData[5].Text != value)
                this.CollectionDispRData[5].Text = value;

            value = data.DispData.MData;
            if (this.CollectionDispMData[5].Text != value)
                this.CollectionDispMData[5].Text = value;

            value = data.DispData.MDataDiff;
            if (this.CollectionDispMDataDiff[5].Text != value)
                this.CollectionDispMDataDiff[5].Text = value;

            value = data.DispData.MDataMax;
            if (this.CollectionDispMDataMax[5].Text != value)
                this.CollectionDispMDataMax[5].Text = value;
        }
        public void UpdateDisplayDispData7(LeakData1 data)
        {
            string value = "";

            value = data.DispData.RData;
            if (this.CollectionDispRData[6].Text != value)
                this.CollectionDispRData[6].Text = value;

            value = data.DispData.MData;
            if (this.CollectionDispMData[6].Text != value)
                this.CollectionDispMData[6].Text = value;

            value = data.DispData.MDataDiff;
            if (this.CollectionDispMDataDiff[6].Text != value)
                this.CollectionDispMDataDiff[6].Text = value;

            value = data.DispData.MDataMax;
            if (this.CollectionDispMDataMax[6].Text != value)
                this.CollectionDispMDataMax[6].Text = value;
        }
        public void UpdateDisplayDispData8(LeakData1 data)
        {
            string value = "";

            value = data.DispData.RData;
            if (this.CollectionDispRData[7].Text != value)
                this.CollectionDispRData[7].Text = value;

            value = data.DispData.MData;
            if (this.CollectionDispMData[7].Text != value)
                this.CollectionDispMData[7].Text = value;

            value = data.DispData.MDataDiff;
            if (this.CollectionDispMDataDiff[7].Text != value)
                this.CollectionDispMDataDiff[7].Text = value;

            value = data.DispData.MDataMax;
            if (this.CollectionDispMDataMax[7].Text != value)
                this.CollectionDispMDataMax[7].Text = value;
        }
        public void UpdateDisplayDispData9(LeakData1 data)
        {
            string value = "";

            value = data.DispData.RData;
            if (this.CollectionDispRData[8].Text != value)
                this.CollectionDispRData[8].Text = value;

            value = data.DispData.MData;
            if (this.CollectionDispMData[8].Text != value)
                this.CollectionDispMData[8].Text = value;

            value = data.DispData.MDataDiff;
            if (this.CollectionDispMDataDiff[8].Text != value)
                this.CollectionDispMDataDiff[8].Text = value;

            value = data.DispData.MDataMax;
            if (this.CollectionDispMDataMax[8].Text != value)
                this.CollectionDispMDataMax[8].Text = value;
        }
        public void UpdateDisplayDispData10(LeakData1 data)
        {
            string value = "";

            value = data.DispData.RData;
            if (this.CollectionDispRData[9].Text != value)
                this.CollectionDispRData[9].Text = value;

            value = data.DispData.MData;
            if (this.CollectionDispMData[9].Text != value)
                this.CollectionDispMData[9].Text = value;

            value = data.DispData.MDataDiff;
            if (this.CollectionDispMDataDiff[9].Text != value)
                this.CollectionDispMDataDiff[9].Text = value;

            value = data.DispData.MDataMax;
            if (this.CollectionDispMDataMax[9].Text != value)
                this.CollectionDispMDataMax[9].Text = value;
        }
        public void UpdateDisplayDispData11(LeakData1 data)
        {
            string value = "";

            value = data.DispData.RData;
            if (this.CollectionDispRData[10].Text != value)
                this.CollectionDispRData[10].Text = value;

            value = data.DispData.MData;
            if (this.CollectionDispMData[10].Text != value)
                this.CollectionDispMData[10].Text = value;

            value = data.DispData.MDataDiff;
            if (this.CollectionDispMDataDiff[10].Text != value)
                this.CollectionDispMDataDiff[10].Text = value;

            value = data.DispData.MDataMax;
            if (this.CollectionDispMDataMax[10].Text != value)
                this.CollectionDispMDataMax[10].Text = value;
        }
        public void UpdateDisplayDispData12(LeakData1 data)
        {
            string value = "";

            value = data.DispData.RData;
            if (this.CollectionDispRData[11].Text != value)
                this.CollectionDispRData[11].Text = value;

            value = data.DispData.MData;
            if (this.CollectionDispMData[11].Text != value)
                this.CollectionDispMData[11].Text = value;

            value = data.DispData.MDataDiff;
            if (this.CollectionDispMDataDiff[11].Text != value)
                this.CollectionDispMDataDiff[11].Text = value;

            value = data.DispData.MDataMax;
            if (this.CollectionDispMDataMax[11].Text != value)
                this.CollectionDispMDataMax[11].Text = value;
        }

        // 압력센서 데이터
        public void UpdateDisplayPresData(Collection<PressureData> datas)
        {
            string value = "";

            for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EQUIPMENT_LANE; i++)
            {
                value = datas[i].WorkingChamber;
                if (this.CollectionPressureWork[i].Text != value)
                    this.CollectionPressureWork[i].Text = value;

                value = datas[i].MasterChamber;
                if (this.CollectionPressureMaster[i].Text != value)
                    this.CollectionPressureMaster[i].Text = value;
            }
        }
        public void UpdateDisplayPresData1(LeakData1 data)
        {
            string value = "";

            value = data.PresData.WorkingChamber;
            if (this.CollectionPressureWork[0].Text != value)
                this.CollectionPressureWork[0].Text = value;

            value = data.PresData.MasterChamber;
            if (this.CollectionPressureMaster[0].Text != value)
                this.CollectionPressureMaster[0].Text = value;
        }
        public void UpdateDisplayPresData2(LeakData1 data)
        {
            string value = "";

            value = data.PresData.WorkingChamber;
            if (this.CollectionPressureWork[1].Text != value)
                this.CollectionPressureWork[1].Text = value;

            value = data.PresData.MasterChamber;
            if (this.CollectionPressureMaster[1].Text != value)
                this.CollectionPressureMaster[1].Text = value;
        }
        public void UpdateDisplayPresData3(LeakData1 data)
        {
            string value = "";

            value = data.PresData.WorkingChamber;
            if (this.CollectionPressureWork[2].Text != value)
                this.CollectionPressureWork[2].Text = value;

            value = data.PresData.MasterChamber;
            if (this.CollectionPressureMaster[2].Text != value)
                this.CollectionPressureMaster[2].Text = value;
        }
        public void UpdateDisplayPresData4(LeakData1 data)
        {
            string value = "";

            value = data.PresData.WorkingChamber;
            if (this.CollectionPressureWork[3].Text != value)
                this.CollectionPressureWork[3].Text = value;

            value = data.PresData.MasterChamber;
            if (this.CollectionPressureMaster[3].Text != value)
                this.CollectionPressureMaster[3].Text = value;
        }
        public void UpdateDisplayPresData5(LeakData1 data)
        {
            string value = "";

            value = data.PresData.WorkingChamber;
            if (this.CollectionPressureWork[4].Text != value)
                this.CollectionPressureWork[4].Text = value;

            value = data.PresData.MasterChamber;
            if (this.CollectionPressureMaster[4].Text != value)
                this.CollectionPressureMaster[4].Text = value;
        }
        public void UpdateDisplayPresData6(LeakData1 data)
        {
            string value = "";

            value = data.PresData.WorkingChamber;
            if (this.CollectionPressureWork[5].Text != value)
                this.CollectionPressureWork[5].Text = value;

            value = data.PresData.MasterChamber;
            if (this.CollectionPressureMaster[5].Text != value)
                this.CollectionPressureMaster[5].Text = value;
        }
        public void UpdateDisplayPresData7(LeakData1 data)
        {
            string value = "";

            value = data.PresData.WorkingChamber;
            if (this.CollectionPressureWork[6].Text != value)
                this.CollectionPressureWork[6].Text = value;

            value = data.PresData.MasterChamber;
            if (this.CollectionPressureMaster[6].Text != value)
                this.CollectionPressureMaster[6].Text = value;
        }
        public void UpdateDisplayPresData8(LeakData1 data)
        {
            string value = "";

            value = data.PresData.WorkingChamber;
            if (this.CollectionPressureWork[7].Text != value)
                this.CollectionPressureWork[7].Text = value;

            value = data.PresData.MasterChamber;
            if (this.CollectionPressureMaster[7].Text != value)
                this.CollectionPressureMaster[7].Text = value;
        }
        public void UpdateDisplayPresData9(LeakData1 data)
        {
            string value = "";

            value = data.PresData.WorkingChamber;
            if (this.CollectionPressureWork[8].Text != value)
                this.CollectionPressureWork[8].Text = value;

            value = data.PresData.MasterChamber;
            if (this.CollectionPressureMaster[8].Text != value)
                this.CollectionPressureMaster[8].Text = value;
        }
        public void UpdateDisplayPresData10(LeakData1 data)
        {
            string value = "";

            value = data.PresData.WorkingChamber;
            if (this.CollectionPressureWork[9].Text != value)
                this.CollectionPressureWork[9].Text = value;

            value = data.PresData.MasterChamber;
            if (this.CollectionPressureMaster[9].Text != value)
                this.CollectionPressureMaster[9].Text = value;
        }
        public void UpdateDisplayPresData11(LeakData1 data)
        {
            string value = "";

            value = data.PresData.WorkingChamber;
            if (this.CollectionPressureWork[10].Text != value)
                this.CollectionPressureWork[10].Text = value;

            value = data.PresData.MasterChamber;
            if (this.CollectionPressureMaster[10].Text != value)
                this.CollectionPressureMaster[10].Text = value;
        }
        public void UpdateDisplayPresData12(LeakData1 data)
        {
            string value = "";

            value = data.PresData.WorkingChamber;
            if (this.CollectionPressureWork[11].Text != value)
                this.CollectionPressureWork[11].Text = value;

            value = data.PresData.MasterChamber;
            if (this.CollectionPressureMaster[11].Text != value)
                this.CollectionPressureMaster[11].Text = value;
        }

        // 판정결과
        public void UpdateDisplayJudgmentData1(LeakData1 data)
        {
            this.GetJudgmentResult(data.Judgment.Result, this.CollectionLabelResult[0]);

            if (data.Judgment.Result == Define.E_JudgmentStatus.Empty || data.Judgment.Result == Define.E_JudgmentStatus.Error)
            {
                this.GetJudgmentResultDiff(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDiff[0]);
                this.GetJudgmentResultDisp(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDisp[0]);
            }
            else
            {
                this.GetJudgmentResultDiff(data.Judgment.DIFF_Result, this.CollectionLabelResultDiff[0]);
                this.GetJudgmentResultDisp(data.Judgment.DISP_Result, this.CollectionLabelResultDisp[0]);
            }
        }
        public void UpdateDisplayJudgmentData2(LeakData1 data)
        {
            this.GetJudgmentResult(data.Judgment.Result, this.CollectionLabelResult[1]);

            if (data.Judgment.Result == Define.E_JudgmentStatus.Empty || data.Judgment.Result == Define.E_JudgmentStatus.Error)
            {
                this.GetJudgmentResultDiff(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDiff[1]);
                this.GetJudgmentResultDisp(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDisp[1]);
            }
            else
            {
                this.GetJudgmentResultDiff(data.Judgment.DIFF_Result, this.CollectionLabelResultDiff[1]);
                this.GetJudgmentResultDisp(data.Judgment.DISP_Result, this.CollectionLabelResultDisp[1]);
            }
        }
        public void UpdateDisplayJudgmentData3(LeakData1 data)
        {
            this.GetJudgmentResult(data.Judgment.Result, this.CollectionLabelResult[2]);

            if (data.Judgment.Result == Define.E_JudgmentStatus.Empty || data.Judgment.Result == Define.E_JudgmentStatus.Error)
            {
                this.GetJudgmentResultDiff(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDiff[2]);
                this.GetJudgmentResultDisp(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDisp[2]);
            }
            else
            {
                this.GetJudgmentResultDiff(data.Judgment.DIFF_Result, this.CollectionLabelResultDiff[2]);
                this.GetJudgmentResultDisp(data.Judgment.DISP_Result, this.CollectionLabelResultDisp[2]);
            }
        }
        public void UpdateDisplayJudgmentData4(LeakData1 data)
        {
            this.GetJudgmentResult(data.Judgment.Result, this.CollectionLabelResult[3]);

            if (data.Judgment.Result == Define.E_JudgmentStatus.Empty || data.Judgment.Result == Define.E_JudgmentStatus.Error)
            {
                this.GetJudgmentResultDiff(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDiff[3]);
                this.GetJudgmentResultDisp(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDisp[3]);
            }
            else
            {
                this.GetJudgmentResultDiff(data.Judgment.DIFF_Result, this.CollectionLabelResultDiff[3]);
                this.GetJudgmentResultDisp(data.Judgment.DISP_Result, this.CollectionLabelResultDisp[3]);
            }
        }
        public void UpdateDisplayJudgmentData5(LeakData1 data)
        {
            this.GetJudgmentResult(data.Judgment.Result, this.CollectionLabelResult[4]);

            if (data.Judgment.Result == Define.E_JudgmentStatus.Empty || data.Judgment.Result == Define.E_JudgmentStatus.Error)
            {
                this.GetJudgmentResultDiff(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDiff[4]);
                this.GetJudgmentResultDisp(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDisp[4]);
            }
            else
            {
                this.GetJudgmentResultDiff(data.Judgment.DIFF_Result, this.CollectionLabelResultDiff[4]);
                this.GetJudgmentResultDisp(data.Judgment.DISP_Result, this.CollectionLabelResultDisp[4]);
            }
        }
        public void UpdateDisplayJudgmentData6(LeakData1 data)
        {
            this.GetJudgmentResult(data.Judgment.Result, this.CollectionLabelResult[5]);

            if (data.Judgment.Result == Define.E_JudgmentStatus.Empty || data.Judgment.Result == Define.E_JudgmentStatus.Error)
            {
                this.GetJudgmentResultDiff(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDiff[5]);
                this.GetJudgmentResultDisp(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDisp[5]);
            }
            else
            {
                this.GetJudgmentResultDiff(data.Judgment.DIFF_Result, this.CollectionLabelResultDiff[5]);
                this.GetJudgmentResultDisp(data.Judgment.DISP_Result, this.CollectionLabelResultDisp[5]);
            }
        }
        public void UpdateDisplayJudgmentData7(LeakData1 data)
        {
            this.GetJudgmentResult(data.Judgment.Result, this.CollectionLabelResult[6]);

            if (data.Judgment.Result == Define.E_JudgmentStatus.Empty || data.Judgment.Result == Define.E_JudgmentStatus.Error)
            {
                this.GetJudgmentResultDiff(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDiff[6]);
                this.GetJudgmentResultDisp(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDisp[6]);
            }
            else
            {
                this.GetJudgmentResultDiff(data.Judgment.DIFF_Result, this.CollectionLabelResultDiff[6]);
                this.GetJudgmentResultDisp(data.Judgment.DISP_Result, this.CollectionLabelResultDisp[6]);
            }
        }
        public void UpdateDisplayJudgmentData8(LeakData1 data)
        {
            this.GetJudgmentResult(data.Judgment.Result, this.CollectionLabelResult[7]);

            if (data.Judgment.Result == Define.E_JudgmentStatus.Empty || data.Judgment.Result == Define.E_JudgmentStatus.Error)
            {
                this.GetJudgmentResultDiff(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDiff[7]);
                this.GetJudgmentResultDisp(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDisp[7]);
            }
            else
            {
                this.GetJudgmentResultDiff(data.Judgment.DIFF_Result, this.CollectionLabelResultDiff[7]);
                this.GetJudgmentResultDisp(data.Judgment.DISP_Result, this.CollectionLabelResultDisp[7]);
            }
        }
        public void UpdateDisplayJudgmentData9(LeakData1 data)
        {
            this.GetJudgmentResult(data.Judgment.Result, this.CollectionLabelResult[8]);

            if (data.Judgment.Result == Define.E_JudgmentStatus.Empty || data.Judgment.Result == Define.E_JudgmentStatus.Error)
            {
                this.GetJudgmentResultDiff(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDiff[8]);
                this.GetJudgmentResultDisp(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDisp[8]);
            }
            else
            {
                this.GetJudgmentResultDiff(data.Judgment.DIFF_Result, this.CollectionLabelResultDiff[8]);
                this.GetJudgmentResultDisp(data.Judgment.DISP_Result, this.CollectionLabelResultDisp[8]);
            }
        }
        public void UpdateDisplayJudgmentData10(LeakData1 data)
        {
            this.GetJudgmentResult(data.Judgment.Result, this.CollectionLabelResult[9]);

            if (data.Judgment.Result == Define.E_JudgmentStatus.Empty || data.Judgment.Result == Define.E_JudgmentStatus.Error)
            {
                this.GetJudgmentResultDiff(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDiff[9]);
                this.GetJudgmentResultDisp(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDisp[9]);
            }
            else
            {
                this.GetJudgmentResultDiff(data.Judgment.DIFF_Result, this.CollectionLabelResultDiff[9]);
                this.GetJudgmentResultDisp(data.Judgment.DISP_Result, this.CollectionLabelResultDisp[9]);
            }
        }
        public void UpdateDisplayJudgmentData11(LeakData1 data)
        {
            this.GetJudgmentResult(data.Judgment.Result, this.CollectionLabelResult[10]);

            if (data.Judgment.Result == Define.E_JudgmentStatus.Empty || data.Judgment.Result == Define.E_JudgmentStatus.Error)
            {
                this.GetJudgmentResultDiff(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDiff[10]);
                this.GetJudgmentResultDisp(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDisp[10]);
            }
            else
            {
                this.GetJudgmentResultDiff(data.Judgment.DIFF_Result, this.CollectionLabelResultDiff[10]);
                this.GetJudgmentResultDisp(data.Judgment.DISP_Result, this.CollectionLabelResultDisp[10]);
            }
        }
        public void UpdateDisplayJudgmentData12(LeakData1 data)
        {
            this.GetJudgmentResult(data.Judgment.Result, this.CollectionLabelResult[11]);

            if (data.Judgment.Result == Define.E_JudgmentStatus.Empty || data.Judgment.Result == Define.E_JudgmentStatus.Error)
            {
                this.GetJudgmentResultDiff(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDiff[11]);
                this.GetJudgmentResultDisp(Define.E_JudgmentStatus.Empty, this.CollectionLabelResultDisp[11]);
            }
            else
            {
                this.GetJudgmentResultDiff(data.Judgment.DIFF_Result, this.CollectionLabelResultDiff[11]);
                this.GetJudgmentResultDisp(data.Judgment.DISP_Result, this.CollectionLabelResultDisp[11]);
            }
        }

        public void DisplayRefresh()
        {
            this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplayMode = Define.E_DisplayModeStore.Equipment;
            this.ParentForm.ParentForm.SetDisplayMode(Define.E_EquipmentMode.Normal);
        }
        #endregion

        #region Event Handler
        private void buttonInspection_Click(object sender, EventArgs e)
        {
            this.InitializeData();
            this.ParentForm.Child_System_Equipment10.InitializeData();
            this.ParentForm.ParentForm.TransferData_Master(CommunicationCommand.CutInpupt, CommunicationID.MainBoardMaster);
        }
        private void buttonDisplay_Click(object sender, EventArgs e)
        {
            this.ParentForm.UpdateDisplayEquipmentTest();
        }
        #endregion
    }
}
