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

using SmartX;
using INT63DC_2C.Forms;

namespace INT63DC_2C.Controls
{
    public partial class ControlMainDisplay3 : UserControl
    {
        #region Field
        private FormMainDisplay m_ParentForm;

        private Color WeightOverColor = Color.Red;
        private Color WeightStandardColor = Color.Black;
        private Color WeightUnderColor = Color.Red;
        private Color WeightSamplingDataColor = Color.Blue;

        // Bar
        private Collection<PictureBox> CollectionPictureBoxZero;
        private Collection<SmartLabel> CollectionLabelWeightValue;
        private Collection<SmartProgressBar> CollectionProgressBar;
        private Collection<PictureBox> CollectionPictureBoxBypass;
        // Table
        private Collection<SmartLabel> CollectionLabelWeightValue1;
        private Collection<SmartLabel> CollectionLabelWeightValue2;
        private Collection<SmartLabel> CollectionLabelWeightValue3;
        private Collection<WeightStorageItem> CollectionWeightStorageItem;
        #endregion

        #region Constructor
        public ControlMainDisplay3(FormMainDisplay parent)
        {
            InitializeComponent();

            this.ParentForm = parent;

            this.CreateCollection();
            this.InitializeControl();
        }
        #endregion

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

        #region Method
        private void CreateCollection()
        {
            // PictureBoxZero
            this.CollectionPictureBoxZero = new Collection<PictureBox>();
            this.CollectionPictureBoxZero.Clear();
            this.CollectionPictureBoxZero.Add(this.pictureBox1);
            this.CollectionPictureBoxZero.Add(this.pictureBox2);
            this.CollectionPictureBoxZero.Add(this.pictureBox3);

            // LabelWeightValue
            this.CollectionLabelWeightValue = new Collection<SmartLabel>();
            this.CollectionLabelWeightValue.Clear();
            this.CollectionLabelWeightValue.Add(this.labelWeightValue1);
            this.CollectionLabelWeightValue.Add(this.labelWeightValue2);
            this.CollectionLabelWeightValue.Add(this.labelWeightValue3);

            // ProgressBar
            this.CollectionProgressBar = new Collection<SmartProgressBar>();
            this.CollectionProgressBar.Clear();
            this.CollectionProgressBar.Add(this.progressBar1);
            this.CollectionProgressBar.Add(this.progressBar2);
            this.CollectionProgressBar.Add(this.progressBar3);

            // PictureBoxBypass
            this.CollectionPictureBoxBypass = new Collection<PictureBox>();
            this.CollectionPictureBoxBypass.Clear();
            this.CollectionPictureBoxBypass.Add(this.pictureBoxBypass1);
            this.CollectionPictureBoxBypass.Add(this.pictureBoxBypass2);
            this.CollectionPictureBoxBypass.Add(this.pictureBoxBypass3);

            // WeightStorage
            this.CollectionWeightStorageItem = new Collection<WeightStorageItem>();
            this.CollectionWeightStorageItem.Clear();
            for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EquipmentColumns; i++)
                this.CollectionWeightStorageItem.Add(new WeightStorageItem());

            #region Add Label
            this.CollectionLabelWeightValue1 = new Collection<SmartLabel>();
            this.CollectionLabelWeightValue1.Clear();
            this.CollectionLabelWeightValue1.Add(this.label1Col1Row);
            this.CollectionLabelWeightValue1.Add(this.label1Col2Row);
            this.CollectionLabelWeightValue1.Add(this.label1Col3Row);
            this.CollectionLabelWeightValue1.Add(this.label1Col4Row);
            this.CollectionLabelWeightValue1.Add(this.label1Col5Row);
            this.CollectionLabelWeightValue1.Add(this.label1Col6Row);
            this.CollectionLabelWeightValue1.Add(this.label1Col7Row);
            this.CollectionLabelWeightValue1.Add(this.label1Col8Row);
            this.CollectionLabelWeightValue1.Add(this.label1Col9Row);
            this.CollectionLabelWeightValue1.Add(this.label1Col10Row);
            this.CollectionLabelWeightValue1.Add(this.label1Col5Avg);
            this.CollectionLabelWeightValue1.Add(this.label1AllAvg);

            this.CollectionLabelWeightValue2 = new Collection<SmartLabel>();
            this.CollectionLabelWeightValue2.Clear();
            this.CollectionLabelWeightValue2.Add(this.label2Col1Row);
            this.CollectionLabelWeightValue2.Add(this.label2Col2Row);
            this.CollectionLabelWeightValue2.Add(this.label2Col3Row);
            this.CollectionLabelWeightValue2.Add(this.label2Col4Row);
            this.CollectionLabelWeightValue2.Add(this.label2Col5Row);
            this.CollectionLabelWeightValue2.Add(this.label2Col6Row);
            this.CollectionLabelWeightValue2.Add(this.label2Col7Row);
            this.CollectionLabelWeightValue2.Add(this.label2Col8Row);
            this.CollectionLabelWeightValue2.Add(this.label2Col9Row);
            this.CollectionLabelWeightValue2.Add(this.label2Col10Row);
            this.CollectionLabelWeightValue2.Add(this.label2Col5Avg);
            this.CollectionLabelWeightValue2.Add(this.label2AllAvg);

            this.CollectionLabelWeightValue3 = new Collection<SmartLabel>();
            this.CollectionLabelWeightValue3.Clear();
            this.CollectionLabelWeightValue3.Add(this.label3Col1Row);
            this.CollectionLabelWeightValue3.Add(this.label3Col2Row);
            this.CollectionLabelWeightValue3.Add(this.label3Col3Row);
            this.CollectionLabelWeightValue3.Add(this.label3Col4Row);
            this.CollectionLabelWeightValue3.Add(this.label3Col5Row);
            this.CollectionLabelWeightValue3.Add(this.label3Col6Row);
            this.CollectionLabelWeightValue3.Add(this.label3Col7Row);
            this.CollectionLabelWeightValue3.Add(this.label3Col8Row);
            this.CollectionLabelWeightValue3.Add(this.label3Col9Row);
            this.CollectionLabelWeightValue3.Add(this.label3Col10Row);
            this.CollectionLabelWeightValue3.Add(this.label3Col5Avg);
            this.CollectionLabelWeightValue3.Add(this.label3AllAvg);
            #endregion
        }
        private void InitializeControl()
        {
            foreach (PictureBox picture in this.CollectionPictureBoxZero)
                picture.Visible = false;

            foreach (SmartLabel label in this.CollectionLabelWeightValue)
                label.Text = Helper.StringToDecimalPlaces("0", this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);

            foreach (SmartProgressBar bar in this.CollectionProgressBar)
                bar.Value = bar.Minimum;

            foreach (PictureBox picture in this.CollectionPictureBoxBypass)
                picture.Visible = false;

            this.SetCount(this.ParentForm.ParentForm.CollectionWeightData);

            for (int i = 0; i < 12; i++)
            {
                Helper.SetTableLabelProperty(this.CollectionLabelWeightValue1[i]);
                Helper.SetTableLabelProperty(this.CollectionLabelWeightValue2[i]);
                Helper.SetTableLabelProperty(this.CollectionLabelWeightValue3[i]);
            }
            this.UpdateLabelDisplay();
        }
        private void SetCount(Collection<WeightData> weightdatas)
        {
            string value = "";

            #region Lane 1
            value = weightdatas[0].TotalNGCount.ToString();
            if (this.labelNGCount1.Text != value)
                this.labelNGCount1.Text = value;

            value = weightdatas[0].PassCount.ToString();
            if (this.labelPassCount1.Text != value)
                this.labelPassCount1.Text = value;
            #endregion

            #region Lane 2
            value = weightdatas[1].TotalNGCount.ToString();
            if (this.labelNGCount2.Text != value)
                this.labelNGCount2.Text = value;

            value = weightdatas[1].PassCount.ToString();
            if (this.labelPassCount2.Text != value)
                this.labelPassCount2.Text = value;
            #endregion

            #region Lane 3
            value = weightdatas[2].TotalNGCount.ToString();
            if (this.labelNGCount3.Text != value)
                this.labelNGCount3.Text = value;

            value = weightdatas[2].PassCount.ToString();
            if (this.labelPassCount3.Text != value)
                this.labelPassCount3.Text = value;
            #endregion

            this.ParentForm.SetTotalCount();
        }

        public void RescaleControl()
        {
            foreach (SmartProgressBar bar in this.CollectionProgressBar)
            {
                Helper.RescaleProgressBar(bar, this.ParentForm.ParentForm.CurrentProductItem.ProgressBarMaximum, this.ParentForm.ParentForm.CurrentProductItem.ProgressBarMinimum);
                bar.Value = bar.Minimum;
            }
        }
        public void Clear()
        {
            foreach (SmartX.SmartLabel label in this.CollectionLabelWeightValue)
            {
                label.Text = Helper.StringToDecimalPlaces("0", this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
                label.ForeColor = Color.Black;
            }

            foreach (SmartX.SmartProgressBar bar in this.CollectionProgressBar)
                bar.Value = bar.Minimum;

            foreach (WeightData data in this.ParentForm.ParentForm.CollectionWeightData)
                data.ClearCount();

            foreach (WeightStorageItem weight in this.CollectionWeightStorageItem)
                weight.AllClear();

            this.SetCount(this.ParentForm.ParentForm.CollectionWeightData);
            this.UpdateLabelDisplay();

            this.ParentForm.ParentForm.SaveCounterFile1(this.ParentForm.ParentForm.CollectionWeightData, this.ParentForm.ParentForm.SystemConfig.ProductNumber - 1);
        }

        private void UpdateLabelDisplay()
        {
            this.UpdateLabelDisplayLane1();
            this.UpdateLabelDisplayLane2();
            this.UpdateLabelDisplayLane3();
        }
        private void UpdateLabelDisplayLane1()
        {
            // Lane 1
            this.CollectionWeightStorageItem[0].SetQueueData();
            Helper.SetTableLabelValue(this.label1Col1Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[0]);
            Helper.SetTableLabelValue(this.label1Col2Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[1]);
            Helper.SetTableLabelValue(this.label1Col3Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[2]);
            Helper.SetTableLabelValue(this.label1Col4Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[3]);
            Helper.SetTableLabelValue(this.label1Col5Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[4]);
            Helper.SetTableLabelValue(this.label1Col6Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[5]);
            Helper.SetTableLabelValue(this.label1Col7Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[6]);
            Helper.SetTableLabelValue(this.label1Col8Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[7]);
            Helper.SetTableLabelValue(this.label1Col9Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[8]);
            Helper.SetTableLabelValue(this.label1Col10Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[0].C_StorageItem[9]);

            Helper.SetTableLabelValue(this.label1Col5Avg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
                this.CollectionWeightStorageItem[0].WeightTenAverage());
            Helper.SetTableLabelValue(this.label1AllAvg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
                this.CollectionWeightStorageItem[0].WeightTotalAverage());
        }
        private void UpdateLabelDisplayLane2()
        {
            // Lane 2
            this.CollectionWeightStorageItem[1].SetQueueData();
            Helper.SetTableLabelValue(this.label2Col1Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[0]);
            Helper.SetTableLabelValue(this.label2Col2Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[1]);
            Helper.SetTableLabelValue(this.label2Col3Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[2]);
            Helper.SetTableLabelValue(this.label2Col4Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[3]);
            Helper.SetTableLabelValue(this.label2Col5Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[4]);
            Helper.SetTableLabelValue(this.label2Col6Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[5]);
            Helper.SetTableLabelValue(this.label2Col7Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[6]);
            Helper.SetTableLabelValue(this.label2Col8Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[7]);
            Helper.SetTableLabelValue(this.label2Col9Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[8]);
            Helper.SetTableLabelValue(this.label2Col10Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[1].C_StorageItem[9]);

            Helper.SetTableLabelValue(this.label2Col5Avg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
                this.CollectionWeightStorageItem[1].WeightTenAverage());
            Helper.SetTableLabelValue(this.label2AllAvg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
                this.CollectionWeightStorageItem[1].WeightTotalAverage());
        }
        private void UpdateLabelDisplayLane3()
        {
            // Lane 3
            this.CollectionWeightStorageItem[2].SetQueueData();
            Helper.SetTableLabelValue(this.label3Col1Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[0]);
            Helper.SetTableLabelValue(this.label3Col2Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[1]);
            Helper.SetTableLabelValue(this.label3Col3Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[2]);
            Helper.SetTableLabelValue(this.label3Col4Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[3]);
            Helper.SetTableLabelValue(this.label3Col5Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[4]);
            Helper.SetTableLabelValue(this.label3Col6Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[5]);
            Helper.SetTableLabelValue(this.label3Col7Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[6]);
            Helper.SetTableLabelValue(this.label3Col8Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[7]);
            Helper.SetTableLabelValue(this.label3Col9Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[8]);
            Helper.SetTableLabelValue(this.label3Col10Row, this.ParentForm.ParentForm.SystemConfig, this.CollectionWeightStorageItem[2].C_StorageItem[9]);

            Helper.SetTableLabelValue(this.label3Col5Avg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
                this.CollectionWeightStorageItem[2].WeightTenAverage());
            Helper.SetTableLabelValue(this.label3AllAvg, this.ParentForm.ParentForm.CurrentProductItem, this.ParentForm.ParentForm.SystemConfig,
                this.CollectionWeightStorageItem[2].WeightTotalAverage());
        }

        public void UpdateEquipmentStatusDisplay(DataStore.EquipmentStatus status)
        {
            string temp = "";

            foreach (SmartX.SmartLabel label in this.CollectionLabelWeightValue)
            {
                temp = Helper.StringToDecimalPlaces("0", this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
                if (label.Text != temp)
                    label.Text = temp;
            }

            foreach (SmartProgressBar bar in this.CollectionProgressBar)
                bar.Value = bar.Minimum;
        }
        public void UpdateCurrentProductDisplay(DataStore.EquipmentStatus status, Collection<WeightData> weightDatas)
        {
            foreach (SmartProgressBar bar in this.CollectionProgressBar)
                bar.Value = bar.Minimum;

            this.SetCount(this.ParentForm.ParentForm.CollectionWeightData);
        }
        public void UpdateBypassDisplay(Collection<WeightData> weightData)
        {
            for (int i = 0; i < this.CollectionPictureBoxBypass.Count; i++)
            {
                if (weightData[i].IsBypassMode == true)
                    this.CollectionPictureBoxBypass[i].Visible = true;
                else
                    this.CollectionPictureBoxBypass[i].Visible = false;
            }
        }
        public void UpdateStopWeightDisplay(DataStore.EquipmentStatus status, Collection<WeightData> weightDatas)
        {
            string value = "";

            if (this.ParentForm.ParentForm.SystemConfig.EquipmentColumns > weightDatas.Count)
                return;

            if (status == DataStore.EquipmentStatus.Stop)
            {
                for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EquipmentColumns; i++)
                {
                    // 중량
                    value = Helper.DoubleToString(weightDatas[i].Weight, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
                    if (this.CollectionLabelWeightValue[i].Text != value)
                        this.CollectionLabelWeightValue[i].Text = value;
                    if (this.CollectionLabelWeightValue[i].ForeColor != Color.Black)
                        this.CollectionLabelWeightValue[i].ForeColor = Color.Black;

                    // 영점표시
                    if (weightDatas[i].Status == DataStore.WeightStatus.WeightZero)
                        this.CollectionPictureBoxZero[i].Visible = true;
                    else
                        this.CollectionPictureBoxZero[i].Visible = false;
                }
            }
            else
            {
                for (int i = 0; i < this.ParentForm.ParentForm.SystemConfig.EquipmentColumns; i++)
                {
                    // 영점표시
                    if (weightDatas[i].Status == DataStore.WeightStatus.WeightZero)
                        this.CollectionPictureBoxZero[i].Visible = true;
                    else
                        this.CollectionPictureBoxZero[i].Visible = false;
                }
            }
        }
        public void UpdateStartWeightDisplay(DataStore.EquipmentStatus status, Collection<WeightData> weightDatas)
        {
            this.UpdateStartWeightDisplay1(status, weightDatas[0]);
            this.UpdateStartWeightDisplay2(status, weightDatas[1]);
            this.UpdateStartWeightDisplay3(status, weightDatas[2]);
        }
        public void UpdateStartWeightDisplay1(DataStore.EquipmentStatus status, WeightData weightData)
        {
            string value = "";
            bool empty = false;

            if (weightData.JudgmentStatus == DataStore.JudgmentStatus.None)
                return;

            if (weightData.JudgmentStatus == DataStore.JudgmentStatus.Empty)
                empty = true;

            #region Bar
            // Weight
            value = Helper.DoubleToString(weightData.Weight, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
            if (this.labelWeightValue1.Text != value)
                this.labelWeightValue1.Text = value;

            if (empty == false)
            {
                this.labelWeightValue1.ForeColor = Color.Black;

                value = weightData.PassCount.ToString();
                if (this.labelPassCount1.Text != value)
                    this.labelPassCount1.Text = value;

                value = weightData.TotalNGCount.ToString();
                if (this.labelNGCount1.Text != value)
                    this.labelNGCount1.Text = value;

                Helper.SetProgressBarValue(this.progressBar1, weightData.Weight, weightData.JudgmentStatus, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
            }
            else
            {
                this.labelWeightValue1.ForeColor = Color.Gray;
                this.progressBar1.Value = this.progressBar1.Minimum;
                this.progressBar1.BarColor1 = Color.Lime;
            }
            #endregion

            #region Table
            this.CollectionWeightStorageItem[0].SetValue(weightData.Weight, weightData.IsSamplingData, empty, weightData.JudgmentStatus);

            this.UpdateLabelDisplayLane1();
            #endregion
        }
        public void UpdateStartWeightDisplay2(DataStore.EquipmentStatus status, WeightData weightData)
        {
            string value = "";
            bool empty = false;

            if (weightData.JudgmentStatus == DataStore.JudgmentStatus.None)
                return;

            if (weightData.JudgmentStatus == DataStore.JudgmentStatus.Empty)
                empty = true;

            #region Bar
            // Weight
            value = Helper.DoubleToString(weightData.Weight, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
            if (this.labelWeightValue2.Text != value)
                this.labelWeightValue2.Text = value;

            if (empty == false)
            {
                this.labelWeightValue2.ForeColor = Color.Black;

                value = weightData.PassCount.ToString();
                if (this.labelPassCount2.Text != value)
                    this.labelPassCount2.Text = value;

                value = weightData.TotalNGCount.ToString();
                if (this.labelNGCount2.Text != value)
                    this.labelNGCount2.Text = value;

                Helper.SetProgressBarValue(this.progressBar2, weightData.Weight, weightData.JudgmentStatus, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
            }
            else
            {
                this.labelWeightValue2.ForeColor = Color.Gray;
                this.progressBar2.Value = this.progressBar2.Minimum;
                this.progressBar2.BarColor1 = Color.Lime;
            }
            #endregion

            #region Table
            this.CollectionWeightStorageItem[1].SetValue(weightData.Weight, weightData.IsSamplingData, empty, weightData.JudgmentStatus);

            this.UpdateLabelDisplayLane2();
            #endregion
        }
        public void UpdateStartWeightDisplay3(DataStore.EquipmentStatus status, WeightData weightData)
        {
            string value = "";
            bool empty = false;

            if (weightData.JudgmentStatus == DataStore.JudgmentStatus.None)
                return;

            if (weightData.JudgmentStatus == DataStore.JudgmentStatus.Empty)
                empty = true;

            #region Bar
            // Weight
            value = Helper.DoubleToString(weightData.Weight, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
            if (this.labelWeightValue3.Text != value)
                this.labelWeightValue3.Text = value;

            if (empty == false)
            {
                this.labelWeightValue3.ForeColor = Color.Black;

                value = weightData.PassCount.ToString();
                if (this.labelPassCount3.Text != value)
                    this.labelPassCount3.Text = value;

                value = weightData.TotalNGCount.ToString();
                if (this.labelNGCount3.Text != value)
                    this.labelNGCount3.Text = value;

                Helper.SetProgressBarValue(this.progressBar3, weightData.Weight, weightData.JudgmentStatus, this.ParentForm.ParentForm.SystemConfig.DecimalPlaces);
            }
            else
            {
                this.labelWeightValue3.ForeColor = Color.Gray;
                this.progressBar3.Value = this.progressBar3.Minimum;
                this.progressBar3.BarColor1 = Color.Lime;
            }
            #endregion

            #region Table
            this.CollectionWeightStorageItem[2].SetValue(weightData.Weight, weightData.IsSamplingData, empty, weightData.JudgmentStatus);

            this.UpdateLabelDisplayLane3();
            #endregion
        }
        #endregion
    }
}
