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

using SmartX;
using INT63DC_2C.DialogForms;
using INT63DC_ImageDll;
using INT63DC_2C.SerialManger;

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

        private Collection<SmartLabel> CollectionZeroParameterRangeLabel;
        private Collection<SmartLabel> CollectionZeroParameterTimeLabel;
        private Collection<SmartLabel> CollectionZeroParameterVariateLabel;
        private Collection<SmartLabel> CollectionMaxWeightLabel;
        private Collection<SmartLabel> CollectionBalanceWeightLabel;
        private Collection<SmartLabel> CollectionDigitLabel;
        private Collection<SmartLabel> CollectionFilterLabel;
        private Collection<SmartLabel> CollectionBypassLabel;
        private Collection<SmartButton> CollectionBypassButton;
        #endregion

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

            this.ParentForm = parent;

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

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

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

            switch (this.ParentForm.SystemConfig.Language)
            {
                case DataStore.E_LanguageID.Korean:
                    break;
                case DataStore.E_LanguageID.English:
                    #region English
                    this.labelTitle.Text = "Configuration";

                    this.groupBoxAutoZero.Text = "Auto zero";
                    this.labelStaticTime.Text = "Time";
                    this.labelStaticRange.Text = "Range";
                    this.labelStaticVariable.Text = "Variable";
                    this.labelStaticMode.Text = "Mode";

                    this.groupBoxOption.Text = "Option";
                    this.labelStaticEmptyWeight.Text = "Empty weight Set";
                    this.labelStaticChattering.Text = "Chattering";
                    this.labelStaticDecimalPoint.Text = "Decimal point";
                    this.labelStaticBuzzerOnTime.Text = "Buzzer ON time";
                    this.labelStaticRelayOnTime.Text = "Relay ON time";
                    this.labelStaticBypass.Text = "Bypass";
                    this.labelStaticTurnDelayTime.Text = "EXT DelayTime";
                    this.labelStaticTurnRunTime.Text = "EXT RunTime";

                    this.buttonScreen.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engScreenDisable));
                    this.buttonScreen.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engScreenDown));
                    this.buttonScreen.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engScreenUp));
                    this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engBackDisable));
                    this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engBackDown));
                    this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.engBackUp)); 
                    #endregion
                    break;
                case DataStore.E_LanguageID.Chinese:
                    #region Chinese
                    this.labelTitle.Text = "选项";

                    this.groupBoxAutoZero.Text = "自动零点跟踪";
                    this.labelStaticTime.Text = "时间";
                    this.labelStaticRange.Text = "范围";
                    this.labelStaticVariable.Text = "变化";
                    this.labelStaticMode.Text = "模式";

                    this.groupBoxOption.Text = "等等";
                    this.labelStaticEmptyWeight.Text = "空重设置";
                    this.labelStaticChattering.Text = "颤振";
                    this.labelStaticBuzzerOnTime.Text = "蜂鸣器开启时间";
                    this.labelStaticRelayOnTime.Text = "继电器接通时间";
                    this.labelStaticDecimalPoint.Text = "小数点";
                    this.labelStaticBypass.Text = "旁路";
                    this.labelStaticTurnDelayTime.Text = "外部输出延迟时间";
                    this.labelStaticTurnRunTime.Text = "外部输出运转时间";

                    this.groupBoxBypass.Text = "旁路";
                    this.buttonSaveBypass.Text = "保存";

                    this.labelTitleLine1.Text = "列1";
                    this.labelTitleLine2.Text = "列2";
                    this.labelTitleLine3.Text = "列3";
                    this.labelTitleLine4.Text = "列4";
                    this.labelTitleLine5.Text = "列5";
                    this.labelTitleLine6.Text = "列6";
                    this.labelTitleLine7.Text = "列7";
                    this.labelTitleLine8.Text = "列8";
                    this.labelTitleLine9.Text = "列9";
                    this.labelTitleLine10.Text = "列10";
                    this.labelTitleLine11.Text = "列11";
                    this.labelTitleLine12.Text = "列12";
                    this.labelTitleLine13.Text = "列13";
                    this.labelTitleLine14.Text = "列14";
                    this.labelTitleLine15.Text = "列15";
                    this.labelTitleLine16.Text = "列16";

                    this.buttonBypassLane1.DownImage = this.buttonBypassLane2.DownImage = this.buttonBypassLane3.DownImage =
                    this.buttonBypassLane4.DownImage = this.buttonBypassLane5.DownImage = this.buttonBypassLane6.DownImage =
                    this.buttonBypassLane7.DownImage = this.buttonBypassLane8.DownImage = this.buttonBypassLane9.DownImage =
                    this.buttonBypassLane10.DownImage = this.buttonBypassLane11.DownImage = this.buttonBypassLane12.DownImage =
                    this.buttonBypassMode.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnEnable));

                    this.buttonBypassLane1.UpImage = this.buttonBypassLane2.UpImage = this.buttonBypassLane3.UpImage =
                    this.buttonBypassLane4.UpImage = this.buttonBypassLane5.UpImage = this.buttonBypassLane6.UpImage =
                    this.buttonBypassLane7.UpImage = this.buttonBypassLane8.UpImage = this.buttonBypassLane9.UpImage =
                    this.buttonBypassLane10.UpImage = this.buttonBypassLane11.UpImage = this.buttonBypassLane12.UpImage =
                    this.buttonBypassMode.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnDisable));

                    this.buttonScreen.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnScreenDisable));
                    this.buttonScreen.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnScreenDown));
                    this.buttonScreen.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnScreenUp));
                    this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnBackDisable));
                    this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnBackDown));
                    this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.chnBackUp)); 
                    #endregion
                    break;
                case DataStore.E_LanguageID.Czech:
                    #region Czech
                    this.labelTitle.Text = "Předvolby";

                    this.groupBoxAutoZero.Text = "Automatické nulování";
                    this.labelStaticTime.Text = "Čas";
                    this.labelStaticRange.Text = "Rozsah";
                    this.labelStaticVariable.Text = "Rozdíl";
                    this.labelStaticMode.Text = "Režim";

                    this.groupBoxOption.Text = "Možnosti";
                    this.labelStaticEmptyWeight.Text = "Nastavení prázdné hmotnosti";
                    this.labelStaticChattering.Text = "Uklidnění tenzometru";
                    this.labelStaticDecimalPoint.Text = "Počet desettiných míst";
                    this.labelStaticBuzzerOnTime.Text = "Zvukový signál - čas";
                    this.labelStaticRelayOnTime.Text = "Relé - čas";
                    this.labelStaticBypass.Text = "Vše";
                    this.labelStaticTurnDelayTime.Text = "zpoždění externího výstupu";
                    this.labelStaticTurnRunTime.Text = "provozu externího výstupu";

                    this.labelTitleLine1.Text = "Řada 1";
                    this.labelTitleLine2.Text = "Řada 2";
                    this.labelTitleLine3.Text = "Řada 3";
                    this.labelTitleLine4.Text = "Řada 4";
                    this.labelTitleLine5.Text = "Řada 5";
                    this.labelTitleLine6.Text = "Řada 6";
                    this.labelTitleLine7.Text = "Řada 7";
                    this.labelTitleLine8.Text = "Řada 8";
                    this.labelTitleLine9.Text = "Řada 9";
                    this.labelTitleLine10.Text = "Řada 10";
                    this.labelTitleLine11.Text = "Řada 11";
                    this.labelTitleLine12.Text = "Řada 12";
                    this.labelTitleLine13.Text = "Řada 13";
                    this.labelTitleLine14.Text = "Řada 14";
                    this.labelTitleLine15.Text = "Řada 15";
                    this.labelTitleLine16.Text = "Řada 16";

                    this.labelStaticBypass.Text = "Bypass vše";
                    this.buttonSaveBypass.Text = "Uložit";

                    this.buttonScreen.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeScreenDisable));
                    this.buttonScreen.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeScreenDown));
                    this.buttonScreen.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeScreenUp));
                    this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeBackDisable));
                    this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeBackDown));
                    this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeBackUp));

                    this.buttonBypassLane1.DownImage = this.buttonBypassLane2.DownImage = this.buttonBypassLane3.DownImage =
                    this.buttonBypassLane4.DownImage = this.buttonBypassLane5.DownImage = this.buttonBypassLane6.DownImage =
                    this.buttonBypassLane7.DownImage = this.buttonBypassLane8.DownImage = this.buttonBypassLane9.DownImage =
                    this.buttonBypassLane10.DownImage = this.buttonBypassLane11.DownImage = this.buttonBypassLane12.DownImage =
                    this.buttonBypassMode.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeEnable));

                    this.buttonBypassLane1.UpImage = this.buttonBypassLane2.UpImage = this.buttonBypassLane3.UpImage =
                    this.buttonBypassLane4.UpImage = this.buttonBypassLane5.UpImage = this.buttonBypassLane6.UpImage =
                    this.buttonBypassLane7.UpImage = this.buttonBypassLane8.UpImage = this.buttonBypassLane9.UpImage =
                    this.buttonBypassLane10.UpImage = this.buttonBypassLane11.UpImage = this.buttonBypassLane12.UpImage =
                    this.buttonBypassMode.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.czeDisable)); 
                    #endregion
                    break;
                case DataStore.E_LanguageID.German:
                    #region German
                    this.labelTitle.Text = "Konfiguration";

                    this.groupBoxAutoZero.Text = "automatische Nullung";
                    this.labelStaticTime.Text = "Zeit";
                    this.labelStaticRange.Text = "Bereich";
                    this.labelStaticVariable.Text = "Unterschied";
                    this.labelStaticMode.Text = "Modus";

                    this.groupBoxOption.Text = "Möglichkeit";
                    this.labelStaticEmptyWeight.Text = "Leergewichtseinstellung";
                    this.labelStaticChattering.Font = font;
                    this.labelStaticChattering.Text = "Beruhigung des Dehnungsmessers";
                    this.labelStaticDecimalPoint.Text = "Dezimalpunkt";
                    this.labelStaticBuzzerOnTime.Text = "Summer-Einschaltzeit";
                    this.labelStaticRelayOnTime.Text = "Relais-Einschaltzeit";
                    this.labelStaticBypass.Text = "Bypass-Modus";
                    this.labelStaticTurnDelayTime.Font = font;
                    this.labelStaticTurnDelayTime.Text = "Externe Ausgangsverzögerungszeit";
                    this.labelStaticTurnRunTime.Font = font;
                    this.labelStaticTurnRunTime.Text = "Betriebszeit der externen Ausgabe";

                    this.labelTitleLine1.Text = "Reihe 1";
                    this.labelTitleLine2.Text = "Reihe 2";
                    this.labelTitleLine3.Text = "Reihe 3";
                    this.labelTitleLine4.Text = "Reihe 4";
                    this.labelTitleLine5.Text = "Reihe 5";
                    this.labelTitleLine6.Text = "Reihe 6";
                    this.labelTitleLine7.Text = "Reihe 7";
                    this.labelTitleLine8.Text = "Reihe 8";
                    this.labelTitleLine9.Text = "Reihe 9";
                    this.labelTitleLine10.Text = "Reihe 10";
                    this.labelTitleLine11.Text = "Reihe 11";
                    this.labelTitleLine12.Text = "Reihe 12";
                    this.labelTitleLine13.Text = "Reihe 13";
                    this.labelTitleLine14.Text = "Reihe 14";
                    this.labelTitleLine15.Text = "Reihe 15";
                    this.labelTitleLine16.Text = "Reihe 16";

                    this.labelStaticBypass.Text = "Bypass Alles";
                    this.tabPage1.Text = "Automatische Nullung";
                    this.tabPage2.Text = "Kalibrierung";
                    this.tabPage3.Text = "Tascheneinstellung";
                    this.buttonZeroRange.Text = "Bereich Z";
                    this.buttonZeroTime.Text = "Zeit Z";
                    this.buttonZeroVariate.Text = "Unterschied Z";
                    this.buttonBalanceWeight.Text = "Waage G.";
                    this.buttonMaxWeight.Text = "Maximalgewicht";
                    this.buttonDigit.Text = "Ziffer";
                    this.buttonSaveBypass.Text = "Speichern";

                    this.buttonScreen.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerScreenDisable));
                    this.buttonScreen.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerScreenDown));
                    this.buttonScreen.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerScreenUp));
                    this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerBackDisable));
                    this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerBackDown));
                    this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerBackUp));

                    this.buttonBypassLane1.DownImage = this.buttonBypassLane2.DownImage = this.buttonBypassLane3.DownImage =
                    this.buttonBypassLane4.DownImage = this.buttonBypassLane5.DownImage = this.buttonBypassLane6.DownImage =
                    this.buttonBypassLane7.DownImage = this.buttonBypassLane8.DownImage = this.buttonBypassLane9.DownImage =
                    this.buttonBypassLane10.DownImage = this.buttonBypassLane11.DownImage = this.buttonBypassLane12.DownImage =
                    this.buttonBypassMode.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerEnable));

                    this.buttonBypassLane1.UpImage = this.buttonBypassLane2.UpImage = this.buttonBypassLane3.UpImage =
                    this.buttonBypassLane4.UpImage = this.buttonBypassLane5.UpImage = this.buttonBypassLane6.UpImage =
                    this.buttonBypassLane7.UpImage = this.buttonBypassLane8.UpImage = this.buttonBypassLane9.UpImage =
                    this.buttonBypassLane10.UpImage = this.buttonBypassLane11.UpImage = this.buttonBypassLane12.UpImage =
                    this.buttonBypassMode.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.gerDisable)); 
                    #endregion
                    break;
                case DataStore.E_LanguageID.Japanese:
                    this.labelTitle.Text = "構成";

                    this.groupBoxAutoZero.Text = "オㅡトゼロ";
                    this.labelStaticTime.Text = "時間";
                    this.labelStaticRange.Text = "範囲";
                    this.labelStaticVariable.Text = "変化";
                    this.labelStaticMode.Text = "モㅡド";

                    this.groupBoxOption.Text = "オプション設定";
                    this.labelStaticEmptyWeight.Text = "空重量セット";
                    this.labelStaticChattering.Text = "チャタリング";
                    this.labelStaticDecimalPoint.Text = "小数点";
                    this.labelStaticBuzzerOnTime.Text = "ブザㅡON時間";
                    this.labelStaticRelayOnTime.Text = "リレㅡON時間";
                    this.labelStaticBypass.Text = "バイパスモㅡド";
                    this.labelStaticTurnDelayTime.Text = "外部出力遅延時間";
                    this.labelStaticTurnRunTime.Text = "外部出力 運転時間";

                    this.labelTitleLine1.Text = "レㅡン 1";
                    this.labelTitleLine2.Text = "レㅡン 2";
                    this.labelTitleLine3.Text = "レㅡン 3";
                    this.labelTitleLine4.Text = "レㅡン 4";
                    this.labelTitleLine5.Text = "レㅡン 5";
                    this.labelTitleLine6.Text = "レㅡン 6";
                    this.labelTitleLine7.Text = "レㅡン 7";
                    this.labelTitleLine8.Text = "レㅡン 8";
                    this.labelTitleLine9.Text = "レㅡン 9";
                    this.labelTitleLine10.Text = "レㅡン 10";
                    this.labelTitleLine11.Text = "レㅡン 11";
                    this.labelTitleLine12.Text = "レㅡン 12";
                    this.labelTitleLine13.Text = "レㅡン 13";
                    this.labelTitleLine14.Text = "レㅡン 14";
                    this.labelTitleLine15.Text = "レㅡン 15";
                    this.labelTitleLine16.Text = "レㅡン 16";

                    this.labelStaticBypass.Text = "バイパスモㅡド";
                    this.buttonSaveBypass.Text = "保存";

                    this.buttonScreen.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnScreenDisable));
                    this.buttonScreen.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnScreenDown));
                    this.buttonScreen.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnScreenUp));
                    this.buttonBack.DisableImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnBackDisable));
                    this.buttonBack.DownImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnBackDown));
                    this.buttonBack.UpImage = new Bitmap(images.GetImage(ImageDll.ButtonImages.jpnBackUp));
                    break;
                default:
                    break;
            }
        }
        private void InitializeControl()
        {
            this.panelSpecialMenu.Location = new Point(0, 80);
            this.panelSpecialMenu.Visible = false;

            this.labelZeroParameterTime.Text = "-";
            this.labelZeroParameterRange.Text = "-";
            this.labelChattering.Text = "-";
            this.labelBuzzerOnTime.Text = "-";
            this.labelRelayOnTime.Text = "-";

            this.comboBoxZeroParameterVariate.Items.Clear();
            this.comboBoxZeroParameterVariate.SelectedIndexChanged -= new EventHandler(this.comboBoxZeroParameterVariate_SelectedIndexChanged);
            this.comboBoxZeroParameterVariate.Items.Add("0.05");
            this.comboBoxZeroParameterVariate.Items.Add("0.1");
            this.comboBoxZeroParameterVariate.Items.Add("0.2");
            this.comboBoxZeroParameterVariate.Items.Add("0.5");
            this.comboBoxZeroParameterVariate.Items.Add("1.0");
            this.comboBoxZeroParameterVariate.Items.Add("1.2");
            this.comboBoxZeroParameterVariate.SelectedIndex = 0;
            this.comboBoxZeroParameterVariate.SelectedIndexChanged += new EventHandler(this.comboBoxZeroParameterVariate_SelectedIndexChanged);

            this.comboBoxZeroParameterMode.Items.Clear();
            this.comboBoxZeroParameterMode.SelectedIndexChanged -= new EventHandler(this.comboBoxZeroParameterMode_SelectedIndexChanged);
            switch (this.ParentForm.SystemConfig.Language)
            {
                case DataStore.E_LanguageID.Korean:
                case DataStore.E_LanguageID.English:
                    this.comboBoxZeroParameterMode.Items.Add("Mode1");
                    this.comboBoxZeroParameterMode.Items.Add("Mode2");
                    break;
                case DataStore.E_LanguageID.Chinese:
                    this.comboBoxZeroParameterMode.Items.Add("模式1");
                    this.comboBoxZeroParameterMode.Items.Add("模式2");
                    break;
                case DataStore.E_LanguageID.Czech:
                    this.comboBoxZeroParameterMode.Items.Add("Režim1");
                    this.comboBoxZeroParameterMode.Items.Add("Režim2");
                    break;
                case DataStore.E_LanguageID.German:
                    this.comboBoxZeroParameterMode.Items.Add("Modus1");
                    this.comboBoxZeroParameterMode.Items.Add("Modus2");
                    break;
                case DataStore.E_LanguageID.Japanese:
                    this.comboBoxZeroParameterMode.Items.Add("モㅡド1");
                    this.comboBoxZeroParameterMode.Items.Add("モㅡド2");
                    break;
                default:
                    break;
            }
            this.comboBoxZeroParameterMode.SelectedIndex = 0;
            this.comboBoxZeroParameterMode.SelectedIndexChanged += new EventHandler(this.comboBoxZeroParameterMode_SelectedIndexChanged);

            this.comboBoxDecimalPlaces.Items.Clear();
            this.comboBoxDecimalPlaces.SelectedIndexChanged -= new EventHandler(this.comboBoxDecimalPlaces_SelectedIndexChanged);
            this.comboBoxDecimalPlaces.Items.Add("0");
            this.comboBoxDecimalPlaces.Items.Add("0.0");
            this.comboBoxDecimalPlaces.Items.Add("0.00");
            this.comboBoxDecimalPlaces.Items.Add("0.000");
            this.comboBoxDecimalPlaces.SelectedIndex = 0;
            this.comboBoxDecimalPlaces.SelectedIndexChanged += new EventHandler(this.comboBoxDecimalPlaces_SelectedIndexChanged);
        }
        private void DefaultSetting()
        {
            string value = "";

            this.CollectionZeroParameterRangeLabel = new Collection<SmartLabel>();
            this.CollectionZeroParameterTimeLabel = new Collection<SmartLabel>();
            this.CollectionZeroParameterVariateLabel = new Collection<SmartLabel>();
            this.CollectionMaxWeightLabel = new Collection<SmartLabel>();
            this.CollectionBalanceWeightLabel = new Collection<SmartLabel>();
            this.CollectionDigitLabel = new Collection<SmartLabel>();
            this.CollectionFilterLabel = new Collection<SmartLabel>();
            this.CollectionBypassLabel = new Collection<SmartLabel>();
            this.CollectionBypassButton = new Collection<SmartButton>();

            for (int i = 1; i <= 16; i++)
            {
                this.CollectionZeroParameterRangeLabel.Add(FindByNameUtil.SmartLabel("labelZeroRange" + i, this));
                this.CollectionZeroParameterTimeLabel.Add(FindByNameUtil.SmartLabel("labelZeroTime" + i, this));
                this.CollectionZeroParameterVariateLabel.Add(FindByNameUtil.SmartLabel("labelZeroVariate" + i, this));
                this.CollectionMaxWeightLabel.Add(FindByNameUtil.SmartLabel("labelMaxWeight" + i, this));
                this.CollectionBalanceWeightLabel.Add(FindByNameUtil.SmartLabel("labelBalanceWeight" + i, this));
                this.CollectionDigitLabel.Add(FindByNameUtil.SmartLabel("labelDigit" + i, this));
                this.CollectionFilterLabel.Add(FindByNameUtil.SmartLabel("labelFilter" + i, this));
                this.CollectionBypassLabel.Add(FindByNameUtil.SmartLabel("labelTitleLine" + i, this));
                this.CollectionBypassButton.Add(FindByNameUtil.SmartButton("buttonBypassLane" + i, this));
            }

            for (int i = 0; i < 16; i++)
            {
                this.CollectionZeroParameterRangeLabel[i].Text = "";
                this.CollectionZeroParameterTimeLabel[i].Text = "";
                this.CollectionZeroParameterVariateLabel[i].Text = "";
                this.CollectionMaxWeightLabel[i].Text = "";
                this.CollectionBalanceWeightLabel[i].Text = "";
                this.CollectionDigitLabel[i].Text = "";
                this.CollectionFilterLabel[i].Text = "";
            }

            for (int i = this.ParentForm.SystemConfig.EquipmentColumns; i < 16; i++)
            {
                this.CollectionZeroParameterRangeLabel[i].Visible = false;
                this.CollectionZeroParameterTimeLabel[i].Visible = false;
                this.CollectionZeroParameterVariateLabel[i].Visible = false;
                this.CollectionMaxWeightLabel[i].Visible = false;
                this.CollectionBalanceWeightLabel[i].Visible = false;
                this.CollectionDigitLabel[i].Visible = false;
                this.CollectionFilterLabel[i].Visible = false;
                this.CollectionBypassLabel[i].Visible = false;
                this.CollectionBypassButton[i].Visible = false;
            }

            this.comboBoxDecimalPlaces.SelectedIndexChanged -= new EventHandler(this.comboBoxDecimalPlaces_SelectedIndexChanged);
            this.comboBoxDecimalPlaces.SelectedIndex = this.ParentForm.SystemConfig.DecimalPlaces;
            this.comboBoxDecimalPlaces.SelectedIndexChanged += new EventHandler(this.comboBoxDecimalPlaces_SelectedIndexChanged);

            // Empty중량설정
            if (this.ParentForm.SystemConfig.EmptyWeight == "")
                value = "0";
            else
                value = this.ParentForm.SystemConfig.EmptyWeight;

            this.labelEmptyWeight.Text = Helper.StringToDecimalPlaces(value, this.ParentForm.SystemConfig.DecimalPlaces);
        }

        public void UpdateZeroParameterRangeDisplay(DataStore.EquipmentStatus status, Collection<string> values)
        {
            if (values == null || values.Count == 0)
                return;

            for (int i = 0; i < values.Count; i++)
                this.CollectionZeroParameterRangeLabel[i].Text = values[i];
        }
        public void UpdateZeroParameterTimeDisplay(DataStore.EquipmentStatus status, Collection<string> values)
        {
            if (values == null || values.Count == 0)
                return;

            for (int i = 0; i < values.Count; i++)
                this.CollectionZeroParameterTimeLabel[i].Text = values[i];
        }
        public void UpdateZeroParameterVariateDisplay(DataStore.EquipmentStatus status, Collection<string> values)
        {
            if (values == null || values.Count == 0)
                return;

            for (int i = 0; i < values.Count; i++)
            {
                if (values[i].Trim() == "0")
                    this.CollectionZeroParameterVariateLabel[i].Text = "0.05";
                else if (values[i].Trim() == "1")
                    this.CollectionZeroParameterVariateLabel[i].Text = "0.1";
                else if (values[i].Trim() == "2")
                    this.CollectionZeroParameterVariateLabel[i].Text = "0.2";
                else if (values[i].Trim() == "3")
                    this.CollectionZeroParameterVariateLabel[i].Text = "0.5";
                else if (values[i].Trim() == "4")
                    this.CollectionZeroParameterVariateLabel[i].Text = "1";
            }
        }
        public void UpdateZeroParameterDisplay(DataStore.EquipmentStatus status, ZeroParameterItem item)
        {
            int iValue = 0;
            string sValue = "";

            sValue = item.Time.Trim();
            if (this.labelZeroParameterTime.Text != sValue)
                this.labelZeroParameterTime.Text = sValue;

            sValue = item.Range.Trim();
            if (this.labelZeroParameterRange.Text != sValue)
                this.labelZeroParameterRange.Text = sValue;

            iValue = int.Parse(item.Variate.Trim());
            this.comboBoxZeroParameterVariate.SelectedIndexChanged -= new EventHandler(this.comboBoxZeroParameterVariate_SelectedIndexChanged);
            this.comboBoxZeroParameterVariate.SelectedIndex = iValue;
            this.comboBoxZeroParameterVariate.SelectedIndexChanged += new EventHandler(this.comboBoxZeroParameterVariate_SelectedIndexChanged);
        }
        public void UpdateOptionParameterDisplay(DataStore.EquipmentStatus status, OptionParameterItem item)
        {
            string value = "";

            value = item.Chattering.Trim();
            if (this.labelChattering.Text != value)
                this.labelChattering.Text = value;

            value = item.BuzzerOnTime.Trim();
            if (this.labelBuzzerOnTime.Text != value)
                this.labelBuzzerOnTime.Text = value;

            value = item.RelayOnTime.Trim();
            if (this.labelRelayOnTime.Text != value)
                this.labelRelayOnTime.Text = value;
        }
        public void UpdateBalanceWeightDisplay(DataStore.EquipmentStatus status, Collection<string> values)
        {
            if (values == null || values.Count == 0)
                return;

            for (int i = 0; i < values.Count; i++)
                this.CollectionBalanceWeightLabel[i].Text = values[i];
        }
        public void UpdateMaxWeightDisplay(DataStore.EquipmentStatus status, Collection<string> values)
        {
            if (values == null || values.Count == 0)
                return;

            for (int i = 0; i < values.Count; i++)
                this.CollectionMaxWeightLabel[i].Text = values[i];
        }
        public void UpdateDigitDisplay(DataStore.EquipmentStatus status, Collection<string> values)
        {
            if (values == null || values.Count == 0)
                return;

            for (int i = 0; i < values.Count; i++)
                this.CollectionDigitLabel[i].Text = values[i];
        }
        public void UpdateFilterDisplay(DataStore.EquipmentStatus status, Collection<string> values)
        {
            if (values == null || values.Count == 0)
                return;

            for (int i = 0; i < values.Count; i++)
                this.CollectionFilterLabel[i].Text = values[i];
        }

        public void DisplayRefresh()
        {
            string value = "";

            this.ParentForm.SystemConfig.CurrentForm = DataStore.FormStore.FormConfiguration;
            this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoard1, CommunicationAddress._4901_ParameterRead4901, "");
            this.timerInterval.Enabled = true;
            this.buttonSaveBypass.Enabled = false;

            this.comboBoxDecimalPlaces.SelectedIndexChanged -= new EventHandler(this.comboBoxDecimalPlaces_SelectedIndexChanged);
            this.comboBoxDecimalPlaces.SelectedIndex = this.ParentForm.SystemConfig.DecimalPlaces;
            this.comboBoxDecimalPlaces.SelectedIndexChanged += new EventHandler(this.comboBoxDecimalPlaces_SelectedIndexChanged);

            this.labelTurnDelayTime.Text = this.ParentForm.SystemConfig.EXT1_DelayTime.ToString();
            this.labelTurnRunTime.Text = this.ParentForm.SystemConfig.EXT1_RunTime.ToString();
            
            // Bypass
            for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
            {
                if (this.ParentForm.CollectionWeightData[i].IsBypassMode == true)
                    this.CollectionBypassButton[i].ButtonDown();
                else
                    this.CollectionBypassButton[i].ButtonUp();
            }

            // Empty중량설정
            if (this.ParentForm.SystemConfig.EmptyWeight == "")
                value = "0";
            else
                value = this.ParentForm.SystemConfig.EmptyWeight;

            this.labelEmptyWeight.Text = Helper.StringToDecimalPlaces(value, this.ParentForm.SystemConfig.DecimalPlaces);
        }
        #endregion

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

            this.InitializeDesign();
        }
        #endregion

        #region Event Handler
        private void buttonBack_Click(object sender, EventArgs e)
        {
            if (this.panelSpecialMenu.Visible == true)
                this.panelSpecialMenu.Visible = false;

            this.ParentForm.ChildFormMenu.DisplayRefresh();
            ((FormMain)(Owner)).smartForm.Show((int)DataStore.FormStore.FormMenu);
        }

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

            before = this.labelZeroParameterTime.Text;

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelZeroParameterTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);

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

                    value = Helper.StringZeroFillDigits4(this.labelZeroParameterTime.Text);
                    this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._4001_ZeroTime, value);

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

            before = this.labelZeroParameterRange.Text;

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelZeroParameterRange.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);

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

                    value = Helper.StringZeroFillDigits4(this.labelZeroParameterRange.Text);
                    this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._4002_ZeroRange, value);

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

            before = this.labelChattering.Text;

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelChattering.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);

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

                    value = Helper.StringZeroFillDigits4(this.labelChattering.Text);
                    this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._6006_Chattering, value);

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

            before = this.labelBuzzerOnTime.Text;

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelBuzzerOnTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);

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

                    value = Helper.StringZeroFillDigits4(this.labelBuzzerOnTime.Text);
                    this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._6001_BuzzerOnTime, value);

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

            before = this.labelRelayOnTime.Text;

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelRelayOnTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);

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

                    value = Helper.StringZeroFillDigits4(this.labelRelayOnTime.Text);
                    this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._6002_RelayOperatingTime, value);

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

            before = this.labelTurnDelayTime.Text;

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelTurnDelayTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);

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

                    value = Helper.StringZeroFillDigits4(this.labelTurnDelayTime.Text);
                    this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5202_EXT1DelayTime, value);
                    this.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.SystemConfig);

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

            before = this.labelTurnRunTime.Text;

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelTurnRunTime.Text, 4, 0, false, this.ParentForm.SystemConfig.Language);

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

                    value = Helper.StringZeroFillDigits4(this.labelTurnRunTime.Text);
                    this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._5203_EXT1RunTime, value);
                    this.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.SystemConfig);

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

            before = this.labelEmptyWeight.Text;

            DialogFormNumKeyPad myKeyPad = new DialogFormNumKeyPad(this.labelEmptyWeight.Text, 4, this.ParentForm.SystemConfig.DecimalPlaces, false, this.ParentForm.SystemConfig.Language);

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

                    value = Helper.StringZeroFillDigits4(this.ParentForm.SystemConfig.EmptyWeight);
                    this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.MainBoard, CommunicationAddress._1021_EmptyWeight, value);
                    this.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.SystemConfig);

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

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

            if (this.ParentForm.CurrentZeroParameterItem.Variate == "0")
                before = "0.05";
            else if (this.ParentForm.CurrentZeroParameterItem.Variate == "1")
                before = "0.1";
            else if (this.ParentForm.CurrentZeroParameterItem.Variate == "2")
                before = "0.2";
            else if (this.ParentForm.CurrentZeroParameterItem.Variate == "3")
                before = "0.5";
            else if (this.ParentForm.CurrentZeroParameterItem.Variate == "4")
                before = "1";
            else if (this.ParentForm.CurrentZeroParameterItem.Variate == "5")
                before = "1.2";
            else
                before = "0.05";

            this.ParentForm.CurrentZeroParameterItem.Variate = this.comboBoxZeroParameterVariate.SelectedIndex.ToString();
            after = this.comboBoxZeroParameterVariate.SelectedItem.ToString();

            value = Helper.StringZeroFillDigits4(this.ParentForm.CurrentZeroParameterItem.Variate);
            this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._4003_ZeroVariate, value);

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

        }
        private void comboBoxDecimalPlaces_SelectedIndexChanged(object sender, EventArgs e)
        {
            string before = "", after = "";

            // Before
            if (this.ParentForm.SystemConfig.DecimalPlaces == 0)
                before = "0";
            else if (this.ParentForm.SystemConfig.DecimalPlaces == 1)
                before = "0.0";
            else if (this.ParentForm.SystemConfig.DecimalPlaces == 2)
                before = "0.00";
            else
                before = "0";

            // After
            if (this.comboBoxDecimalPlaces.SelectedIndex == 0)
                after = "0";
            else if (this.comboBoxDecimalPlaces.SelectedIndex == 1)
                after = "0.0";
            else if (this.comboBoxDecimalPlaces.SelectedIndex == 2)
                after = "0.00";
            else
                after = "0";

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

            this.ParentForm.SystemConfig.DecimalPlaces = this.comboBoxDecimalPlaces.SelectedIndex;
            this.ParentForm.SaveSystemConfigurationFile1(this.ParentForm.SystemConfig);
        }

        private void timerInterval_Tick(object sender, EventArgs e)
        {
            this.timerInterval.Enabled = false;
            this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.MainBoard, CommunicationAddress._6901_ParameterRead6901, "");
        }

        private void buttonBypassLane_Click(object sender, EventArgs e)
        {
            int iTemp = 0;

            for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
            {
                if (this.CollectionBypassButton[i].ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                {
                    iTemp++;
                }
            }

            if (iTemp == this.ParentForm.SystemConfig.EquipmentColumns)
                this.buttonBypassMode.ButtonDown();
            else
                this.buttonBypassMode.ButtonUp();

            this.buttonSaveBypass.Enabled = true;
        }
        private void buttonSaveBypass_Click(object sender, EventArgs e)
        {
            string before = "", after = "", lane = "";
            StringBuilder sb = new StringBuilder();

            if (this.ParentForm.SystemConfig.IsWeightViewForward == true)
            {
                for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
                {
                    if (this.CollectionBypassButton[i].ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                        sb.Append("1");
                    else
                        sb.Append("0");
                }
            }
            else
            {
                for (int i = 1; i <= this.ParentForm.SystemConfig.EquipmentColumns; i++)
                {
                    if (this.CollectionBypassButton[this.ParentForm.SystemConfig.EquipmentColumns - i].ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                        sb.Append("1");
                    else
                        sb.Append("0");
                }
            }

            #region Lane 1
            if (this.buttonBypassLane1.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
            {
                if (this.ParentForm.CollectionWeightData[0].IsBypassMode != true)
                {
                    this.ParentForm.CollectionWeightData[0].IsBypassMode = true;

                    before = "OFF";
                    after = "ON";
                    lane = "1";

                    // Part11
                    if (this.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                }
            }
            else
            {
                if (this.ParentForm.CollectionWeightData[0].IsBypassMode != false)
                {
                    this.ParentForm.CollectionWeightData[0].IsBypassMode = false;

                    before = "ON";
                    after = "OFF";
                    lane = "1";

                    // Part11
                    if (this.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                }
            }
            #endregion
            #region Lane 2
            // Lane 2
            if (this.buttonBypassLane2.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
            {
                if (this.ParentForm.CollectionWeightData[1].IsBypassMode != true)
                {
                    this.ParentForm.CollectionWeightData[1].IsBypassMode = true;

                    before = "OFF";
                    after = "ON";
                    lane = "2";

                    // Part11
                    if (this.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                }
            }
            else
            {
                if (this.ParentForm.CollectionWeightData[1].IsBypassMode != false)
                {
                    this.ParentForm.CollectionWeightData[1].IsBypassMode = false;

                    before = "ON";
                    after = "OFF";
                    lane = "2";

                    // Part11
                    if (this.ParentForm.SystemConfig.IsPart11 == true)
                        this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                }
            }
            #endregion

            switch (this.ParentForm.SystemConfig.EquipmentColumns)
            {
                case 3:
                    #region Lane 3
                    // Lane 3
                    if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    break;
                case 4:
                    #region Lane 3
                    // Lane 3
                    if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 4
                    // Lane 4
                    if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    break;
                case 5:
                    #region Lane 3
                    // Lane 3
                    if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 4
                    // Lane 4
                    if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 5
                    // Lane 5
                    if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    break;
                case 6:
                    #region Lane 3
                    // Lane 3
                    if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 4
                    // Lane 4
                    if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 5
                    // Lane 5
                    if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 6
                    // Lane 6
                    if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    break;
                case 7:
                    #region Lane 3
                    // Lane 3
                    if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 4
                    // Lane 4
                    if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 5
                    // Lane 5
                    if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 6
                    // Lane 6
                    if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 7
                    // Lane 7
                    if (this.buttonBypassLane7.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[6].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[6].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "7";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[6].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[6].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "7";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    break;
                case 8:
                    #region Lane 3
                    // Lane 3
                    if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 4
                    // Lane 4
                    if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 5
                    // Lane 5
                    if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 6
                    // Lane 6
                    if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 7
                    // Lane 7
                    if (this.buttonBypassLane7.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[6].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[6].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "7";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[6].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[6].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "7";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 8
                    // Lane 7
                    if (this.buttonBypassLane8.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[7].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[7].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "8";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[7].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[7].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "8";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    break;
                case 10:
                    #region Lane 3
                    // Lane 3
                    if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 4
                    // Lane 4
                    if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 5
                    // Lane 5
                    if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 6
                    // Lane 6
                    if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 7
                    // Lane 7
                    if (this.buttonBypassLane7.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[6].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[6].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "7";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[6].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[6].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "7";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 8
                    // Lane 8
                    if (this.buttonBypassLane8.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[7].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[7].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "8";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[7].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[7].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "8";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 9
                    // Lane 9
                    if (this.buttonBypassLane9.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[8].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[8].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "9";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[8].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[8].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "9";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 10
                    // Lane 10
                    if (this.buttonBypassLane10.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[9].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[9].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "10";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[9].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[9].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "10";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    break;
                case 12:
                    #region Lane 3
                    // Lane 3
                    if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 4
                    // Lane 4
                    if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 5
                    // Lane 5
                    if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 6
                    // Lane 6
                    if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 7
                    // Lane 7
                    if (this.buttonBypassLane7.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[6].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[6].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "7";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[6].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[6].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "7";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 8
                    // Lane 8
                    if (this.buttonBypassLane8.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[7].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[7].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "8";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[7].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[7].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "8";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 9
                    // Lane 9
                    if (this.buttonBypassLane9.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[8].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[8].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "9";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[8].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[8].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "9";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 10
                    // Lane 10
                    if (this.buttonBypassLane10.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[9].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[9].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "10";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[9].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[9].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "10";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 11
                    // Lane 11
                    if (this.buttonBypassLane11.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[10].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[10].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "11";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[10].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[10].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "11";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 12
                    // Lane 12
                    if (this.buttonBypassLane12.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[11].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[11].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "12";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[11].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[11].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "12";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    break;
                case 15:
                    #region Lane 3
                    // Lane 3
                    if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 4
                    // Lane 4
                    if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 5
                    // Lane 5
                    if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 6
                    // Lane 6
                    if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 7
                    // Lane 7
                    if (this.buttonBypassLane7.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[6].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[6].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "7";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[6].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[6].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "7";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 8
                    // Lane 8
                    if (this.buttonBypassLane8.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[7].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[7].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "8";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[7].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[7].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "8";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 9
                    // Lane 9
                    if (this.buttonBypassLane9.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[8].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[8].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "9";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[8].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[8].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "9";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 10
                    // Lane 10
                    if (this.buttonBypassLane10.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[9].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[9].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "10";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[9].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[9].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "10";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 11
                    // Lane 11
                    if (this.buttonBypassLane11.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[10].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[10].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "11";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[10].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[10].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "11";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 12
                    // Lane 12
                    if (this.buttonBypassLane12.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[11].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[11].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "12";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[11].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[11].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "12";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 13
                    // Lane 13
                    if (this.buttonBypassLane13.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[12].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[12].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "13";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[12].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[12].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "13";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 14
                    // Lane 14
                    if (this.buttonBypassLane14.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[13].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[13].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "14";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[13].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[13].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "14";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 15
                    // Lane 15
                    if (this.buttonBypassLane15.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[14].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[14].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "15";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[14].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[14].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "15";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    break;
                case 16:
                    #region Lane 3
                    // Lane 3
                    if (this.buttonBypassLane3.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[2].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[2].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "3";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 4
                    // Lane 4
                    if (this.buttonBypassLane4.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[3].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[3].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "4";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 5
                    // Lane 5
                    if (this.buttonBypassLane5.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[4].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[4].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "5";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 6
                    // Lane 6
                    if (this.buttonBypassLane6.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[5].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[5].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "6";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 7
                    // Lane 7
                    if (this.buttonBypassLane7.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[6].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[6].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "7";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[6].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[6].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "7";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 8
                    // Lane 8
                    if (this.buttonBypassLane8.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[7].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[7].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "8";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[7].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[7].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "8";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 9
                    // Lane 9
                    if (this.buttonBypassLane9.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[8].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[8].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "9";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[8].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[8].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "9";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 10
                    // Lane 10
                    if (this.buttonBypassLane10.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[9].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[9].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "10";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[9].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[9].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "10";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 11
                    // Lane 11
                    if (this.buttonBypassLane11.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[10].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[10].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "11";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[10].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[10].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "11";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 12
                    // Lane 12
                    if (this.buttonBypassLane12.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[11].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[11].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "12";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[11].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[11].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "12";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 13
                    // Lane 13
                    if (this.buttonBypassLane13.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[12].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[12].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "13";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[12].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[12].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "13";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 14
                    // Lane 14
                    if (this.buttonBypassLane14.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[13].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[13].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "14";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[13].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[13].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "14";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 15
                    // Lane 15
                    if (this.buttonBypassLane15.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[14].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[14].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "15";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[14].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[14].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "15";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    #region Lane 16
                    // Lane 16
                    if (this.buttonBypassLane16.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
                    {
                        if (this.ParentForm.CollectionWeightData[15].IsBypassMode != true)
                        {
                            this.ParentForm.CollectionWeightData[15].IsBypassMode = true;

                            before = "OFF";
                            after = "ON";
                            lane = "16";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    else
                    {
                        if (this.ParentForm.CollectionWeightData[15].IsBypassMode != false)
                        {
                            this.ParentForm.CollectionWeightData[15].IsBypassMode = false;

                            before = "ON";
                            after = "OFF";
                            lane = "16";

                            // Part11
                            if (this.ParentForm.SystemConfig.IsPart11 == true)
                                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_Individual, lane, before, after);
                        }
                    }
                    #endregion
                    break;
                default:
                    break;
            }

            this.ParentForm.SystemConfig.IsBypassMode = false;
            for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
            {
                if (this.ParentForm.CollectionWeightData[i].IsBypassMode == true)
                {
                    this.ParentForm.SystemConfig.IsBypassMode = true;
                    break;
                }
            }

            this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._1201_Bypass, sb.ToString());
            this.buttonSaveBypass.Enabled = false;
        }
        private void buttonBypassMode_Click(object sender, EventArgs e)
        {
            string before = "", after = "";

            StringBuilder sb = new StringBuilder();

            if (this.buttonBypassMode.ButtonStatus == SmartButton.BUTSTATUS.DOWN)
            {
                for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
                {
                    sb.Append("1");
                    this.CollectionBypassButton[i].ButtonDown();
                }
                this.ParentForm.SystemConfig.IsBypassMode = true;

                for (int i = 0; i < this.ParentForm.CollectionWeightData.Count; i++)
                    this.ParentForm.CollectionWeightData[i].IsBypassMode = true;

                this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._1201_Bypass, sb.ToString());

                before = "OFF";
                after = "ON";
            }
            else
            {
                for (int i = 0; i < this.ParentForm.SystemConfig.EquipmentColumns; i++)
                {
                    sb.Append("0");
                    this.CollectionBypassButton[i].ButtonUp();
                }
                this.ParentForm.SystemConfig.IsBypassMode = false;

                for (int i = 0; i < this.ParentForm.CollectionWeightData.Count; i++)
                    this.ParentForm.CollectionWeightData[i].IsBypassMode = false;

                this.ParentForm.TransferDataStream(CommunicationCommand.Write, CommunicationID.SubBoardAll, CommunicationAddress._1201_Bypass, sb.ToString());

                before = "ON";
                after = "OFF";
            }

            // Part11
            if (this.ParentForm.SystemConfig.IsPart11 == true)
                this.ParentForm.SetTrackingHistoryData(DataStore.TrackingParameter.BP_All, "", before, after);
        }
        private void buttonScreen_Click(object sender, EventArgs e)
        {
            if (this.panelSpecialMenu.Visible == false)
            {
                this.panelSpecialMenu.Visible = true;
                this.panelSpecialMenu.BringToFront();
            }
            else
                this.panelSpecialMenu.Visible = false;
        }
        #endregion

        #region SpecialFunction Menu
        private void buttonZeroRange_Click(object sender, EventArgs e)
        {
            this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._4002_ZeroRange, "");
        }
        private void buttonZeroVariate_Click(object sender, EventArgs e)
        {
            this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._4003_ZeroVariate, "");
        }
        private void buttonZeroTime_Click(object sender, EventArgs e)
        {
            this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._4001_ZeroTime, "");
        }
        private void buttonDigit_Click(object sender, EventArgs e)
        {
            this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._3003_Digit, "");
        }
        private void buttonMaxWeight_Click(object sender, EventArgs e)
        {
            this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._3001_MaxWeight, "");
        }
        private void buttonBalanceWeight_Click(object sender, EventArgs e)
        {
            this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._3002_BalanceWeight, "");
        }
        private void buttonFilter_Click(object sender, EventArgs e)
        {
            this.ParentForm.TransferDataStream(CommunicationCommand.Read, CommunicationID.SubBoardAll, CommunicationAddress._5001_Filter, "");
        }
        #endregion
    }
}