using CCDCount.DLL;
using System;
using System.Drawing;
using System.Globalization;
using System.Security.Cryptography.X509Certificates;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;

namespace CCDCountWpf.WpfPage
{
    /// <summary>
    /// PlcSettingPage.xaml 的交互逻辑
    /// </summary>
    public partial class PlcSettingPage : Page
    {
        public PlcSettingPage()
        {
            InitializeComponent();
            this.Width = Double.NaN;
            this.Height = Double.NaN;
            DataContext = PlcSettingMessageBus.PlcMessageShowBindage;
        }

        private void ScrewJogSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.ScrewJogSpeed, out float result))
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ScrewJogSpeed = (result + 0.5f).ToString();
            }
        }

        private void ScrewJogSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.ScrewJogSpeed, out float result))
            {
                if((result - 0.5f)>=0)
                {
                    PlcSettingMessageBus.PlcMessageShowBindage.ScrewJogSpeed = (result - 0.5f).ToString();
                }
            }
        }

        private void BottValueSetUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet + 1) > 
                PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet += 1;
            }
        }

        private void BottValueSetDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet -= 1;
            }
        }

        private void FillingValveOpenSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenSpeed, out float result))
            {
                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenSpeed = (result + 0.5f).ToString();
            }
        }

        private void FillingValveOpenSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenSpeed, out float result))
            {
                if((result - 0.5f)>=0)
                {
                    PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenSpeed = (result - 0.5f).ToString();
                }
            }
        }


        private void CacheShutdownValueUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue + 1) > 
                PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue += 1;
            }
        }

        private void CacheShutdownValueDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue - 1) < 
                PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue -= 1;
            }
        }

        private void ShakeTable1H_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed + 1) > 
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed += 1;
            }
        }

        private void ShakeTable1H_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed - 1) < 
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed -= 1;
            }
        }

        private void ShakeTable2H_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed + 1) > 
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed)
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed += 1;
        }

        private void ShakeTable2H_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed -= 1;
            }
        }

        private void ShakeTable3H_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed+1)>
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed += 1;
            }
        }

        private void ShakeTable3H_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed - 1)<
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed -= 1;
            }
        }

        private void ShakeTable1M_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed +1)>
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed += 1;
            }
        }

        private void ShakeTable1M_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed - 1)<
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed -= 1;
            }
        }

        private void ShakeTable2M_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed + 1)>
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed += 1;
            }
        }

        private void ShakeTable2M_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed - 1) < 
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed -= 1;
            }
        }

        private void ShakeTable3M_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed + 1)>
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed += 1;
            }
        }

        private void ShakeTable3M_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed -= 1;
            }
        }


        private void ShakeTable1L_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_FillingSpeed + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_FillingSpeed += 1;
            }
        }

        private void ShakeTable1L_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_FillingSpeed - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_FillingSpeed -= 1;
            }
        }

        private void ShakeTable2L_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed += 1;
            }
        }

        private void ShakeTable2L_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed -= 1;
            }
        }

        private void ShakeTable3L_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed += 1;
            }
        }

        private void ShakeTable3L_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed -= 1;
            }
        }

        private void ShakeTable1H_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed + 1)>
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed += 1;
            }
        }

        private void ShakeTable1H_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed -= 1;
            }
        }

        private void ShakeTable2H_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed + 1)>
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed += 1;
            }
        }

        private void ShakeTable2H_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed - 1)<
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed -= 1;
            }
        }

        private void ShakeTable3H_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed + 1)>
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed += 1;
            }
        }

        private void ShakeTable3H_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed - 1)<
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed -= 1;
            }
        }

        private void ShakeTable1M_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed + 1)>
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed += 1;
            }
        }

        private void ShakeTable1M_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed -= 1;
            }
        }

        private void ShakeTable2M_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_CacheSpeed + 1)>
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_CacheSpeed)
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_CacheSpeed += 1;
        }

        private void ShakeTable2M_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_CacheSpeed - 1)<
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_CacheSpeed -= 1;
            }
        }

        private void ShakeTable3M_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_CacheSpeed + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_CacheSpeed)
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_CacheSpeed += 1;
        }

        private void ShakeTable3M_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_CacheSpeed - 1)<
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_CacheSpeed -= 1;
            }
        }

        private void ShakeTable1L_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed += 1;
            }
        }

        private void ShakeTable1L_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed -= 1;
            }
        }

        private void ShakeTable2L_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_CacheSpeed + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_CacheSpeed)
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_CacheSpeed += 1;
        }

        private void ShakeTable2L_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_CacheSpeed - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_CacheSpeed -= 1;
            }
        }

        private void ShakeTable3L_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_CacheSpeed + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_CacheSpeed)
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_CacheSpeed += 1;
        }

        private void ShakeTable3L_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_CacheSpeed - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_CacheSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_CacheSpeed -= 1;
            }
        }

        private void FillingValveCloseSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCloseSpeed, out float value))
            {
                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCloseSpeed = (value + 0.5).ToString();
            }
        }

        private void FillingValveCloseSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCloseSpeed, out float value))
            {
                if(value - 0.5 < 0) return;
                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCloseSpeed = (value - 0.5).ToString();
            }
        }

        private void FillingValveOpenPositionUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenPosition, out float value))
            {
                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenPosition = (value + 0.5).ToString();
            }
        }

        private void FillingValveOpenPositionDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenPosition, out float value))
            {
                if(value - 0.5 < 0) return;
                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenPosition = (value - 0.5).ToString();
            }
        }

        private void FillingValveClosePositionUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveClosePosition, out float value))
            {
                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveClosePosition = (value + 0.5).ToString();
            }    
        }

        private void FillingValveClosePositionDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveClosePosition, out float value))
            {
                if(value - 0.5 < 0) return;
                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveClosePosition = (value - 0.5).ToString();
            }
        }

        private void ValveDelytimeUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime += 1;
            }
        }

        private void ValveDelytimeDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime &&
                PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime -= 1;
            }
        }

        private void TextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                TextBox textBox = sender as TextBox;
                if (textBox != null)
                {
                    // 强制更新源数据
                    BindingExpression bindingExpression = textBox.GetBindingExpression(TextBox.TextProperty);
                    bindingExpression.UpdateSource();
                }
            }
        }

        private void FillingH_SpeedRatioUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio += 1;
            }
        }

        private void FillingH_SpeedRatioDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio&& 
                PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio-1>0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio -= 1;
            }
        }

        private void FillingM_SpeedRatioUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio += 1;
            }
        }

        private void FillingM_SpeedRatioDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio &&
                PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio -= 1;
            }
        }

        private void FillingL_SpeedRatioUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio += 1;
            }
        }

        private void FillingL_SpeedRatioDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio &&
                PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio -= 1;
            }
        }

        private void CacheH_SpeedRatioUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio += 1;
            }
        }

        private void CacheH_SpeedRatioDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio &&
                PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio -= 1;
            }
        }

        private void CacheM_SpeedRatioUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio += 1;
            }
        }

        private void CacheM_SpeedRatioDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio &&
                PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio -= 1;
            }
        }

        private void CacheL_SpeedRatioUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio += 1;
            }
        }

        private void CacheL_SpeedRatioDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio &&
                PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio -= 1;
            }
        }

        private void InBottleSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.InBottleSpeed, out float value))
            {
                PlcSettingMessageBus.PlcMessageShowBindage.InBottleSpeed = (value + 0.5).ToString();
            }
        }

        private void InBottleSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.InBottleSpeed, out float value))
            {
                if (value - 0.5 < 0) return;
                PlcSettingMessageBus.PlcMessageShowBindage.InBottleSpeed = (value - 0.5).ToString();
            }
        }

        private void FillingValueJogSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveJogSpeed, out float value))
            {
                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveJogSpeed = (value + 0.5).ToString();
            }
        }

        private void FillingValueJogSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveJogSpeed, out float value))
            {
                if (value - 0.5 < 0) return;
                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveJogSpeed = (value - 0.5).ToString();
            }
        }

        private void MachineDelayFunneDownTimeUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime += 1;
            }
        }

        private void MachineDelayFunneDownTimeDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime &&
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime -= 1;
            }
        }

        private void MachineDelayFunneUpTimeUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime += 1;
            }
        }

        private void MachineDelayFunneUpTimeDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime &&
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime -= 1;
            }
        }

        private void MachineDelayFillingValveOpenTimeUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveOpenTime + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveOpenTime)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveOpenTime += 1;
            }
        }

        private void MachineDelayFillingValveOpenTimeDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveOpenTime - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveOpenTime &&
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveOpenTime - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveOpenTime -= 1;
            } 
        }

        private void MachineDelayFillingValveCloseTimeUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime += 1;
            }
        }

        private void MachineDelayFillingValveCloseTimeDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime &&
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime -= 1;
            }
        }

        private void MachineDelayInBottleTimeUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime += 1;
            }
        }

        private void MachineDelayInBottleTimeDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime &&
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime -= 1;
            }
        }

        private void FillingValveCacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCacheSpeed, out float value))
            {
                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCacheSpeed = (value + 0.5).ToString();
            }
        }

        private void FillingValveCacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCacheSpeed, out float value))
            {
                if (value - 0.5 < 0) return;
                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCacheSpeed = (value - 0.5).ToString();
            }
        }

        private void FillingValveCachePositionUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCachePosition, out float value))
            {
                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCachePosition = (value + 0.5).ToString();
            }
        }

        private void FillingValveCachePositionDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCachePosition, out float value))
            {
                if (value - 0.5 < 0) return;
                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCachePosition = (value - 0.5).ToString();
            }
        }

        private void BottlePosPositionUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottlePosPosition, out float value))
            {
                PlcSettingMessageBus.PlcMessageShowBindage.BottlePosPosition = (value + 0.5).ToString();
            }
        }

        private void BottlePosPositionDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottlePosPosition, out float value))
            {
                if (value - 0.5 < 0) return;
                PlcSettingMessageBus.PlcMessageShowBindage.BottlePosPosition = (value - 0.5).ToString();
            }
        }

        private void BottlePosSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottlePosSpeed, out float value))
            {
                PlcSettingMessageBus.PlcMessageShowBindage.BottlePosSpeed = (value + 0.5).ToString();
            }
        }

        private void BottlePosSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottlePosSpeed, out float value))
            {
                if (value - 0.5 < 0) return;
                PlcSettingMessageBus.PlcMessageShowBindage.BottlePosSpeed = (value - 0.5).ToString();
            }
        }

        private void ShakeTable1_TestSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1_TestSpeed + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1_TestSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1_TestSpeed += 1;
            }
        }

        private void ShakeTable1_TestSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1_TestSpeed - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1_TestSpeed &&
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1_TestSpeed - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1_TestSpeed -= 1;
            }
        }

        private void ShakeTable2_TestSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2_TestSpeed + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2_TestSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2_TestSpeed += 1;
            }
        }

        private void ShakeTable2_TestSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2_TestSpeed - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2_TestSpeed &&
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2_TestSpeed - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2_TestSpeed -= 1;
            }
        }

        private void ShakeTable3_TestSpeedUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3_TestSpeed + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3_TestSpeed)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3_TestSpeed += 1;
            }
        }

        private void ShakeTable3_TestSpeedDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3_TestSpeed - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3_TestSpeed &&
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3_TestSpeed - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3_TestSpeed -= 1;
            }
        }

        private void MissingDelaytimeUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MissingDelaytime + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.MissingDelaytime)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.MissingDelaytime += 1;
            }
        }

        private void MissingDelaytimeDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MissingDelaytime - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.MissingDelaytime &&
                PlcSettingMessageBus.PlcMessageShowBindage.MissingDelaytime - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.MissingDelaytime -= 1;
            }
        }

        private void BottleJamDelaytimeUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottleJamDelaytime + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.BottleJamDelaytime)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.BottleJamDelaytime += 1;
            }
        }

        private void BottleJamDelaytimeDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottleJamDelaytime - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.BottleJamDelaytime &&
                PlcSettingMessageBus.PlcMessageShowBindage.BottleJamDelaytime - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.BottleJamDelaytime -= 1;
            }
        }

        private void EliminateCylinderDelayTimeUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderDelayTime + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderDelayTime)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderDelayTime += 1;
            }
        }

        private void EliminateCylinderDelayTimeDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderDelayTime - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderDelayTime &&
                PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderDelayTime - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderDelayTime -= 1;
            }
        }

        private void EliminateCylinderHoldingTimeUpBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderHoldingTime + 1) >
                PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderHoldingTime)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderHoldingTime += 1;
            }
        }

        private void EliminateCylinderHoldingTimeDownBtn_Click(object sender, RoutedEventArgs e)
        {
            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderHoldingTime - 1) <
                PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderHoldingTime &&
                PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderHoldingTime - 1 > 0)
            {
                PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderHoldingTime -= 1;
            }
        }

        private void ReloadBtn_Click(object sender, RoutedEventArgs e)
        {
            UpdatePlcPara();
        }
        private void UpdatePlcPara()
        {
            var ParaValue = PlcSettingMessageBus.pLCManagement.ReadAllPara();
            if (ParaValue == null) return;
            PlcSettingMessageBus.PlcMessageShowBindage.FillingModel =
                ParaValue.FillingMode;
            PlcSettingMessageBus.PlcMessageShowBindage.BeltsSpeed =
                ParaValue.BeltsSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed =
                ParaValue.ShakeTable1H_FillingSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed =
                ParaValue.ShakeTable2H_FillingSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed =
                ParaValue.ShakeTable3H_FillingSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed =
                ParaValue.ShakeTable1M_FillingSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed =
                ParaValue.ShakeTable2M_FillingSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed =
                ParaValue.ShakeTable3M_FillingSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_FillingSpeed =
                ParaValue.ShakeTable1L_FillingSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed =
                ParaValue.ShakeTable2L_FillingSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed =
                ParaValue.ShakeTable3L_FillingSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed =
                ParaValue.ShakeTable1H_CacheSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed =
                ParaValue.ShakeTable2H_CacheSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed =
                ParaValue.ShakeTable3H_CacheSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed =
                ParaValue.ShakeTable1M_CacheSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_CacheSpeed =
                ParaValue.ShakeTable2M_CacheSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_CacheSpeed =
                ParaValue.ShakeTable3M_CacheSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed =
                ParaValue.ShakeTable1L_CacheSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_CacheSpeed =
                ParaValue.ShakeTable2L_CacheSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_CacheSpeed =
                ParaValue.ShakeTable3L_CacheSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio =
                ParaValue.FillingH_SpeedRatio;
            PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio =
                ParaValue.FillingM_SpeedRatio;
            PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio =
                ParaValue.FillingL_SpeedRatio;
            PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio =
                ParaValue.CacheH_SpeedRatio;
            PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio =
                ParaValue.CacheM_SpeedRatio;
            PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio =
                ParaValue.CacheL_SpeedRatio;
            PlcSettingMessageBus.PlcMessageShowBindage.ScrewJogSpeed =
                ParaValue.ScrewJogSpeed.ToString();
            PlcSettingMessageBus.PlcMessageShowBindage.InBottleSpeed =
                ParaValue.InBottleSpeed.ToString();
            PlcSettingMessageBus.PlcMessageShowBindage.BottlePosSpeed =
                ParaValue.BottlePosSpeed.ToString();
            PlcSettingMessageBus.PlcMessageShowBindage.BottlePosPosition =
                ParaValue.BottlePosPosition.ToString();
            PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenSpeed =
                ParaValue.FillingValveOpenSpeed.ToString();
            PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenPosition =
                ParaValue.FillingValveOpenPosition.ToString();
            PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCloseSpeed =
                ParaValue.FillingValveCloseSpeed.ToString();
            PlcSettingMessageBus.PlcMessageShowBindage.FillingValveClosePosition =
                ParaValue.FillingValveClosePosition.ToString();
            PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCacheSpeed =
                ParaValue.FillingValveCacheSpeed.ToString();
            PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCachePosition =
                ParaValue.FillingValueCachePosition.ToString();
            PlcSettingMessageBus.PlcMessageShowBindage.FillingValveJogSpeed =
                ParaValue.FillingValueJogSpeed.ToString();
            PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime =
                ParaValue.MachineDelayFunneDownTime;
            PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime =
                ParaValue.MachineDelayFunneUpTime;
            PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveOpenTime =
                ParaValue.MachineDelayFillingValveOpenTime;
            PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime =
                ParaValue.MachineDelayFillingValveCloseTime;
            PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime =
                ParaValue.MachineDelayInBottleTime;
            PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet =
                ParaValue.BottValueSet;
            PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime =
                ParaValue.ValveDelytime;
            PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue =
                ParaValue.CacheShutdownValue;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1_TestSpeed =
                ParaValue.ShakeTable1_TestSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2_TestSpeed =
                ParaValue.ShakeTable2_TestSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3_TestSpeed =
                ParaValue.ShakeTable3_TestSpeed;
            PlcSettingMessageBus.PlcMessageShowBindage.MissingDelaytime =
                ParaValue.MissingDelaytime;
            PlcSettingMessageBus.PlcMessageShowBindage.BottleJamDelaytime =
                ParaValue.BottleJamDelaytime;
            PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderDelayTime =
                ParaValue.EliminateCylinderDelayTime;
            PlcSettingMessageBus.PlcMessageShowBindage.EliminateCylinderHoldingTime =
                ParaValue.EliminateCylinderHoldingTime;
        }
    }
}
