Преглед изворни кода

20260109001 识别参数自动训练增加了相机XY方向的单像素精度计算,颗粒长度计算从最长长度更改为最小外接矩形的长边,并为最小外接矩形的前置凸包算法添加了内凹度检测,针对新的PLC参数添加了参数和操作的控制逻辑,增加通讯的自动重连(颗粒信息发送),颗粒信息记录增加了内凹度信息记录

向羽 孟 пре 3 месеци
родитељ
комит
6f89e19b71
30 измењених фајлова са 3956 додато и 2670 уклоњено
  1. 1 3
      CCDCountWpf/App.xaml.cs
  2. 631 440
      CCDCountWpf/PlcMessageShowBindingClass.cs
  3. 0 36
      CCDCountWpf/ShowBindingClass.cs
  4. 170 193
      CCDCountWpf/WpfFrom/MainWindow.xaml.cs
  5. 2 2
      CCDCountWpf/WpfPage/HistoryDataPage.xaml.cs
  6. 3 3
      CCDCountWpf/WpfPage/MainPage.xaml
  7. 116 156
      CCDCountWpf/WpfPage/MainPage.xaml.cs
  8. 20 224
      CCDCountWpf/WpfPage/PlcOperationPage.xaml
  9. 86 159
      CCDCountWpf/WpfPage/PlcOperationPage.xaml.cs
  10. 230 150
      CCDCountWpf/WpfPage/PlcSettingPage.xaml
  11. 658 303
      CCDCountWpf/WpfPage/PlcSettingPage.xaml.cs
  12. 13 26
      CCDCountWpf/WpfPage/SettingPage.xaml
  13. 8 65
      CCDCountWpf/WpfPage/SettingPage.xaml.cs
  14. 1 0
      TestWork.DLL/CCDCount.DLL.csproj
  15. 47 35
      TestWork.DLL/FormulationClass.cs
  16. 247 62
      TestWork.DLL/MainThreadClass.cs
  17. 443 403
      TestWork.DLL/PLCManagementClass.cs
  18. 432 141
      TestWork.DLL/ShuLiClass.cs
  19. 9 3
      TestWork.DLL/SqlDataClass/ActionMesSqliteDataClass.cs
  20. 258 0
      TestWork.DLL/Tools/LineScanCameraCalibrator.cs
  21. 242 7
      TestWork.DLL/Tools/ModbusClass.cs
  22. 1 1
      TestWork.MODEL/CCDCount.MODEL.csproj
  23. 113 88
      TestWork.MODEL/ConfigModel/FormulationConfigClass.cs
  24. 8 0
      TestWork.MODEL/ConfigModel/ShuLiConfigClass.cs
  25. 137 90
      TestWork.MODEL/PlcModel/PlcParaModelClass.cs
  26. 0 76
      TestWork.MODEL/PlcModel/PlcStaticModelClass.cs
  27. 25 0
      TestWork.MODEL/ResultModel/ConvexResultClass.cs
  28. 2 0
      TestWork.MODEL/ResultModel/ParaTrainResultClass.cs
  29. 15 0
      TestWork.MODEL/ShuLiModel/ActiveObjectClass.cs
  30. 38 4
      TestWork.MODEL/ShuLiModel/BoundingRectangleMdoel.cs

+ 1 - 3
CCDCountWpf/App.xaml.cs

@@ -15,7 +15,7 @@ namespace CCDCountWpf
 {
     public static class MessageBus
     {
-        public static List<MainThreadClass> MainThreadS = new List<MainThreadClass>();
+        //public static List<MainThreadClass> MainThreadS = new List<MainThreadClass>();
 
         public static MainThreadClass NowSettingLoadMainThread = null;
 
@@ -27,8 +27,6 @@ namespace CCDCountWpf
 
 
         public static string NowLoadCammeraSN = string.Empty;
-        public static int SeetingNowLoadInMaThreadsIndex = -1;
-        public static int NowLoadCameraIndex = -1;
     }
     public static class ShowMessageBus
     {

+ 631 - 440
CCDCountWpf/PlcMessageShowBindingClass.cs

@@ -25,34 +25,6 @@ namespace CCDCountWpf
             }
         }
 
-        /// <summary>
-        /// 归零完成
-        /// </summary>
-        private bool returnToZeroCompletion;
-        public bool ReturnToZeroCompletion
-        {
-            get { return returnToZeroCompletion; }
-            set
-            {
-                returnToZeroCompletion = value;
-                OnPropertyChanged("ReturnToZeroCompletion");
-            }
-        }
-
-        /// <summary>
-        /// 停止完成
-        /// </summary>
-        private bool stopCompletion;
-        public bool StopCompletion
-        {
-            get { return stopCompletion; }
-            set
-            {
-                stopCompletion = value;
-                OnPropertyChanged("StopCompletion");
-            }
-        }
-
         /// <summary>
         /// 速度运行
         /// </summary>
@@ -67,48 +39,6 @@ namespace CCDCountWpf
             }
         }
 
-        /// <summary>
-        /// 回零中
-        /// </summary>
-        private bool returnToZero;
-        public bool ReturnToZero
-        {
-            get { return returnToZero; }
-            set
-            {
-                returnToZero = value;
-                OnPropertyChanged("ReturnToZero");
-            }
-        }
-
-        /// <summary>
-        /// 中转阀开定位完成
-        /// </summary>
-        private bool transferValveOpenCompletion;
-        public bool TransferValveOpenCompletion
-        {
-            get { return transferValveOpenCompletion; }
-            set
-            {
-                transferValveOpenCompletion = value;
-                OnPropertyChanged("TransferValveOpenCompletion");
-            }
-        }
-
-        /// <summary>
-        /// 中转阀关定位完成
-        /// </summary>
-        private bool transferValveCloseCompletion;
-        public bool TransferValveCloseCompletion
-        {
-            get { return transferValveCloseCompletion; }
-            set
-            {
-                transferValveCloseCompletion = value;
-                OnPropertyChanged("TransferValveCloseCompletion");
-            }
-        }
-
         /// <summary>
         /// 允许数据交换
         /// </summary>
@@ -166,814 +96,1075 @@ namespace CCDCountWpf
         }
 
         /// <summary>
-        /// 送瓶轮使能完成
+        /// 罐装模式
         /// </summary>
-        private bool bottleFeedingWheelEnableCompletion;
-        public bool BottleFeedingWheelEnableCompletion
+        private ushort fillingModel;
+        public ushort FillingModel
         {
-            get { return bottleFeedingWheelEnableCompletion; }
+            get { return fillingModel; }
             set
             {
-                bottleFeedingWheelEnableCompletion = value;
-                OnPropertyChanged("BottleFeedingWheelEnableCompletion");
+                ushort oldValue = fillingModel;
+                if (PlcSettingMessageBus.pLCManagement.WriteFillingMode(value))
+                {
+                    fillingModel = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"罐装模式从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("FillingModel");
             }
         }
 
         /// <summary>
-        /// 送瓶轮停止完成
+        /// 传送带速度
         /// </summary>
-        private bool bottleFeedingWheelStopCompletion;
-        public bool BottleFeedingWheelStopCompletion
+        private ushort beltsSpeed;
+        public ushort BeltsSpeed
         {
-            get { return bottleFeedingWheelStopCompletion; }
+            get { return beltsSpeed; }
             set
             {
-                bottleFeedingWheelStopCompletion = value;
-                OnPropertyChanged("BottleFeedingWheelStopCompletion");
+                ushort oldValue = beltsSpeed;
+                if (PlcSettingMessageBus.pLCManagement.WriteBeltsSpeed(value))
+                {
+                    beltsSpeed = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"传送带速度从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("BeltsSpeed");
             }
         }
 
         /// <summary>
-        /// 速度模式运行速度
+        /// 罐装料筒震台高速值
         /// </summary>
-        private float speedModeRunningSpeed;
-        public string SpeedModeRunningSpeed
+        private ushort shakeTable1H_FillingSpeed;
+        public ushort ShakeTable1H_FillingSpeed
         {
-            get { return speedModeRunningSpeed.ToString("F2"); }
+            get { return shakeTable1H_FillingSpeed; }
             set
             {
-                if (float.TryParse(value, out float result))
+                ushort oldValue = shakeTable1H_FillingSpeed;
+                if (PlcSettingMessageBus.pLCManagement.WriteShakeTable1H_FillingSpeed(value))
                 {
-                    float oldValue = speedModeRunningSpeed;
-                    if (PlcSettingMessageBus.pLCManagement.WriteSpeedModeRunningSpeed(result))
-                    {
-                        speedModeRunningSpeed = result;
-                        if (oldValue != result)
-                            FaultLog.RecordValueChangeMessage($"速度模式运行速度从{oldValue}修改为{result}");
-                    }
-                    OnPropertyChanged("SpeedModeRunningSpeed");
+                    shakeTable1H_FillingSpeed = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"罐装料筒震台高速值从{oldValue}修改为{value}");
                 }
+                OnPropertyChanged("ShakeTable1H_FillingSpeed");
             }
         }
 
         /// <summary>
-        /// 点动速度
+        /// 罐装过滤震台高速值
         /// </summary>
-        private float jogSpeed;
-        public string JogSpeed
+        private ushort shakeTable2H_FillingSpeed;
+        public ushort ShakeTable2H_FillingSpeed
         {
-            get { return jogSpeed.ToString("F2"); }
+            get { return shakeTable2H_FillingSpeed; }
             set
             {
-                if (float.TryParse(value, out float result))
+                ushort oldValue = shakeTable2H_FillingSpeed;
+                if (PlcSettingMessageBus.pLCManagement.WriteShakeTable2H_FillingSpeed(value))
                 {
-                    float oldValue = jogSpeed;
-                    if(PlcSettingMessageBus.pLCManagement.WriteJogSpeed(result))
-                    {
-                        jogSpeed = result;
-                        if (oldValue != result)
-                            FaultLog.RecordValueChangeMessage($"点动速度从{oldValue}修改为{result}");
-                    }
-                    OnPropertyChanged("JogSpeed");
+                    shakeTable2H_FillingSpeed = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"罐装过滤震台高速值从{oldValue}修改为{value}");
                 }
+                OnPropertyChanged("ShakeTable2H_FillingSpeed");
             }
         }
 
         /// <summary>
-        /// 瓶装设定
+        /// 罐装计数震台高速
         /// </summary>
-        private ushort bottValueSet;
-        public ushort BottValueSet
+        private ushort shakeTable3H_FillingSpeed;
+        public ushort ShakeTable3H_FillingSpeed
         {
-            get { return bottValueSet; }
+            get { return shakeTable3H_FillingSpeed; }
             set
             {
-                float oldValue = bottValueSet;
-                if(PlcSettingMessageBus.pLCManagement.WriteBottValueSet(value))
+                ushort oldValue = shakeTable3H_FillingSpeed;
+                if(PlcSettingMessageBus.pLCManagement.WriteShakeTable3H_FillingSpeed(value))
                 {
-                    bottValueSet = value;
+                    shakeTable3H_FillingSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"瓶装设定值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"罐装计数震台高速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("BottValueSet");
+                OnPropertyChanged("ShakeTable3H_FillingSpeed");
             }
         }
 
         /// <summary>
-        /// 中转阀打开速度
+        /// 罐装料筒震台减速值
         /// </summary>
-        private float transferValveOpeningSpeed;
-        public string TransferValveOpeningSpeed
+        private ushort shakeTable1M_FillingSpeed;
+        public ushort ShakeTable1M_FillingSpeed
         {
-            get { return transferValveOpeningSpeed.ToString("F2"); }
+            get { return shakeTable1M_FillingSpeed; }
             set
             {
-                if (float.TryParse(value, out float result))
+                ushort oldValue = shakeTable1M_FillingSpeed;
+                if(PlcSettingMessageBus.pLCManagement.WriteShakeTable1M_FillingSpeed(value))
                 {
-                    float oldValue = transferValveOpeningSpeed;
-                    if(PlcSettingMessageBus.pLCManagement.WriteTransferValveOpeningSpeed(result))
-                    {
-                        transferValveOpeningSpeed = result;
-                        if (oldValue != result)
-                            FaultLog.RecordValueChangeMessage($"中转阀打开速度从{oldValue}修改为{result}");
-                    }
-                    OnPropertyChanged("TransferValveOpeningSpeed");
+                    shakeTable1M_FillingSpeed = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"罐装料筒震台减速值从{oldValue}修改为{value}");
                 }
+                OnPropertyChanged("ShakeTable1M_FillingSpeed");
             }
         }
 
         /// <summary>
-        /// 中转阀打开时间
+        /// 罐装过滤震台减速值
         /// </summary>
-        private UInt32 transferValveOpeningTime;
-        public UInt32 TransferValveOpeningTime
+        private ushort shakeTable2M_FillingSpeed;
+        public ushort ShakeTable2M_FillingSpeed
         {
-            get { return transferValveOpeningTime; }
+            get { return shakeTable2M_FillingSpeed; }
             set
             {
-                UInt32 oldValue = transferValveOpeningTime;
-                if (PlcSettingMessageBus.pLCManagement.WriteTransferValveOpeningTime(value))
+                ushort oldValue = shakeTable2M_FillingSpeed;
+                if(PlcSettingMessageBus.pLCManagement.WriteShakeTable2M_FillingSpeed(value))
                 {
-                    transferValveOpeningTime = value;
+                    shakeTable2M_FillingSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"中转阀打开时间从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"罐装过滤震台减速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("TransferValveOpeningTime");
+                OnPropertyChanged("ShakeTable2M_FillingSpeed");
             }
         }
 
         /// <summary>
-        /// 罐装减速值
+        /// 罐装计数震台减速值
         /// </summary>
-        private ushort bottingDecelerationValue;
-        public ushort BottingDecelerationValue
+        private ushort shakeTable3M_FillingSpeed;
+        public ushort ShakeTable3M_FillingSpeed
         {
-            get { return bottingDecelerationValue; }
+            get { return shakeTable3M_FillingSpeed; }
             set
             {
-                ushort oldValue = bottingDecelerationValue;
-                if (PlcSettingMessageBus.pLCManagement.WriteBottingDecelerationValue(value))
+                ushort oldValue = shakeTable3M_FillingSpeed;
+                if(PlcSettingMessageBus.pLCManagement.WriteShakeTable3M_FillingSpeed(value))
                 {
-                    bottingDecelerationValue = value;
+                    shakeTable3M_FillingSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"罐装减速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"罐装计数震台减速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("BottingDecelerationValue");
+                OnPropertyChanged("ShakeTable3M_FillingSpeed");
             }
         }
 
         /// <summary>
-        /// 缓存减速值
+        /// 罐装料筒震台低速值
         /// </summary>
-        private UInt16 cacheDecelerationValue { get; set;}
-        public UInt16 CacheDecelerationValue
+        private ushort shakeTable1L_FillingSpeed;
+        public ushort ShakeTable1L_FillingSpeed
         {
-            get { return cacheDecelerationValue; }
+            get { return shakeTable1L_FillingSpeed; }
             set
             {
-                UInt16 oldValue = cacheDecelerationValue;
-                if (PlcSettingMessageBus.pLCManagement.WriteCacheDecelerationValue(value))
+                ushort oldValue = shakeTable1L_FillingSpeed;
+                if (PlcSettingMessageBus.pLCManagement.WriteShakeTable1L_FillingSpeed(value))
                 {
-                    cacheDecelerationValue = value;
+                    shakeTable1L_FillingSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"缓存减速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"罐装料筒震台低速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("CacheDecelerationValue");
+                OnPropertyChanged("ShakeTable1L_FillingSpeed");
             }
         }
 
         /// <summary>
-        /// 缓存计数延迟时间
+        /// 罐装过滤震台低速值
         /// </summary>
-        private UInt32 cacheCountDelayTiming;
-        public UInt32 CacheCountDelayTiming
+        private ushort shakeTable2L_FillingSpeed;
+        public ushort ShakeTable2L_FillingSpeed
         {
-            get { return cacheCountDelayTiming; }
+            get { return shakeTable2L_FillingSpeed; }
             set
             {
-                UInt32 oldValue = cacheCountDelayTiming;
-                if (PlcSettingMessageBus.pLCManagement.WriteCacheCountDelayTiming(value))
+                ushort oldValue = shakeTable2L_FillingSpeed;
+                if (PlcSettingMessageBus.pLCManagement.WriteShakeTable2L_FillingSpeed(value))
                 {
-                    cacheCountDelayTiming = value;
+                    shakeTable2L_FillingSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"缓存计数延迟时间从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"罐装过滤震台低速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("CacheCountDelayTiming");
+                OnPropertyChanged("ShakeTable2L_FillingSpeed");
             }
         }
 
+        /// <summary>
+        /// 罐装计数震台减速值
+        /// </summary>
+        private ushort shakeTable3L_FillingSpeed;
+        public ushort ShakeTable3L_FillingSpeed
+        {
+            get { return shakeTable3L_FillingSpeed; }
+            set
+            {
+                ushort oldValue = shakeTable3L_FillingSpeed;
+                if (PlcSettingMessageBus.pLCManagement.WriteShakeTable3L_FillingSpeed(value))
+                {
+                    shakeTable3L_FillingSpeed = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"罐装计数震台低速值从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("ShakeTable3L_FillingSpeed");
+            }
+        }
 
         /// <summary>
-        /// 缓存停机值
+        /// 缓存料筒震台高速
         /// </summary>
-        private ushort cacheShutdownValue;
-        public ushort CacheShutdownValue
+        private ushort shakeTable1H_CacheSpeed;
+        public ushort ShakeTable1H_CacheSpeed
         {
-            get { return cacheShutdownValue; }
+            get { return shakeTable1H_CacheSpeed; }
             set
             {
-                ushort oldValue = cacheShutdownValue;
-                if (PlcSettingMessageBus.pLCManagement.WriteCacheShutdownValue(value))
+                ushort oldValue = shakeTable1H_CacheSpeed;
+                if(PlcSettingMessageBus.pLCManagement.WriteShakeTable1H_CacheSpeed(value))
                 {
-                    cacheShutdownValue = value;
+                    shakeTable1H_CacheSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"缓存停机值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"缓存料筒震台高速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("CacheShutdownValue");
+                OnPropertyChanged("ShakeTable1H_CacheSpeed");
             }
         }
 
         /// <summary>
-        /// 罐装料筒震台高速值
+        /// 缓存过滤震台高速值
         /// </summary>
-        private ushort bottingMaterialCylinderVibrationTableHighSpeedValue;
-        public ushort BottingMaterialCylinderVibrationTableHighSpeedValue
+        private ushort shakeTable2H_CacheSpeed;
+        public ushort ShakeTable2H_CacheSpeed
         {
-            get { return bottingMaterialCylinderVibrationTableHighSpeedValue; }
+            get { return shakeTable2H_CacheSpeed; }
             set
             {
-                ushort oldValue = bottingMaterialCylinderVibrationTableHighSpeedValue;
-                if (PlcSettingMessageBus.pLCManagement.WriteBottingMaterialCylinderVibrationTableHighSpeedValue(value))
+                ushort oldValue = shakeTable2H_CacheSpeed;
+                if(PlcSettingMessageBus.pLCManagement.WriteShakeTable2H_CacheSpeed(value))
                 {
-                    bottingMaterialCylinderVibrationTableHighSpeedValue = value;
+                    shakeTable2H_CacheSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"罐装料筒震台高速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"缓存过滤震台高速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("BottingMaterialCylinderVibrationTableHighSpeedValue");
+                OnPropertyChanged("ShakeTable2H_CacheSpeed");
             }
         }
 
         /// <summary>
-        /// 罐装过滤震台高速值
+        /// 缓存计数震台高速值
         /// </summary>
-        private ushort bottingFilterVibrationTableHighSpeedValue;
-        public ushort BottingFilterVibrationTableHighSpeedValue
+        private ushort shakeTable3H_CacheSpeed;
+        public ushort ShakeTable3H_CacheSpeed
         {
-            get { return bottingFilterVibrationTableHighSpeedValue; }
+            get { return shakeTable3H_CacheSpeed; }
             set
             {
-                ushort oldValue = bottingFilterVibrationTableHighSpeedValue;
-                if (PlcSettingMessageBus.pLCManagement.WriteBottingFilterVibrationTableHighSpeedValue(value))
+                ushort oldValue = shakeTable3H_CacheSpeed;
+                if(PlcSettingMessageBus.pLCManagement.WriteShakeTable3H_CacheSpeed(value))
                 {
-                    bottingFilterVibrationTableHighSpeedValue = value;
+                    shakeTable3H_CacheSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"罐装过滤震台高速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"缓存计数震台高速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("BottingFilterVibrationTableHighSpeedValue");
+                OnPropertyChanged("ShakeTable3H_CacheSpeed");
             }
         }
 
         /// <summary>
-        /// 罐装计数震台高速值
+        /// 缓存料筒震台减速值
         /// </summary>
-        private ushort bottingCountVibrationTableHighSpeedValue;
-        public ushort BottingCountVibrationTableHighSpeedValue
+        private ushort shakeTable1M_CacheSpeed;
+        public ushort ShakeTable1M_CacheSpeed
         {
-            get { return bottingCountVibrationTableHighSpeedValue; }
+            get { return shakeTable1M_CacheSpeed; }
             set
             {
-                ushort oldValue = bottingCountVibrationTableHighSpeedValue;
-                if(PlcSettingMessageBus.pLCManagement.WriteBottingCountVibrationTableHighSpeedValue(value))
+                ushort oldValue = shakeTable1M_CacheSpeed;
+                if(PlcSettingMessageBus.pLCManagement.WriteShakeTable1M_CacheSpeed(value))
                 {
-                    bottingCountVibrationTableHighSpeedValue = value;
+                    shakeTable1M_CacheSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"罐装计数震台高速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"缓存料筒震台减速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("BottingCountVibrationTableHighSpeedValue");
+                OnPropertyChanged("ShakeTable1M_CacheSpeed");
             }
         }
 
         /// <summary>
-        /// 罐装料筒震台减速值
+        /// 缓存过滤震台减速值
         /// </summary>
-        private ushort bottingMaterialCylinderVibrationTableDecelerationSpeedValue;
-        public ushort BottingMaterialCylinderVibrationTableDecelerationSpeedValue
+        private ushort shakeTable2M_CacheSpeed;
+        public ushort ShakeTable2M_CacheSpeed
         {
-            get { return bottingMaterialCylinderVibrationTableDecelerationSpeedValue; }
+            get { return shakeTable2M_CacheSpeed; }
             set
             {
-                ushort oldValue = bottingMaterialCylinderVibrationTableDecelerationSpeedValue;
-                if(PlcSettingMessageBus.pLCManagement.WriteBottingMaterialCylinderVibrationTableDecelerationSpeedValue(value))
+                ushort oldValue = shakeTable2M_CacheSpeed;
+                if(PlcSettingMessageBus.pLCManagement.WriteShakeTable2M_CacheSpeed(value))
                 {
-                    bottingMaterialCylinderVibrationTableDecelerationSpeedValue = value;
+                    shakeTable2M_CacheSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"罐装料筒震台减速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"缓存过滤震台减速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("BottingMaterialCylinderVibrationTableDecelerationSpeedValue");
+                OnPropertyChanged("ShakeTable2M_CacheSpeed");
             }
         }
 
         /// <summary>
-        /// 罐装过滤震台减速值
+        /// 缓存计数震台减速值
         /// </summary>
-        private ushort bottingFilterVibrationTableDecelerationSpeedValue;
-        public ushort BottingFilterVibrationTableDecelerationSpeedValue
+        private ushort shakeTable3M_CacheSpeed;
+        public ushort ShakeTable3M_CacheSpeed
         {
-            get { return bottingFilterVibrationTableDecelerationSpeedValue; }
+            get { return shakeTable3M_CacheSpeed; }
             set
             {
-                ushort oldValue = bottingFilterVibrationTableDecelerationSpeedValue;
-                if(PlcSettingMessageBus.pLCManagement.WriteBottingFilterVibrationTableDecelerationSpeedValue(value))
+                ushort oldValue = shakeTable3M_CacheSpeed;
+                if(PlcSettingMessageBus.pLCManagement.WriteShakeTable3M_CacheSpeed(value))
                 {
-                    bottingFilterVibrationTableDecelerationSpeedValue = value;
+                    shakeTable3M_CacheSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"罐装过滤震台减速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"缓存计数震台减速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("BottingFilterVibrationTableDecelerationSpeedValue");
+                OnPropertyChanged("ShakeTable3M_CacheSpeed");
             }
         }
 
         /// <summary>
-        /// 罐装计数震台减速值
+        /// 缓存料筒震台减速值
         /// </summary>
-        private ushort bottingCountVibrationTableDecelerationSpeedValue;
-        public ushort BottingCountVibrationTableDecelerationSpeedValue
+        private ushort shakeTable1L_CacheSpeed;
+        public ushort ShakeTable1L_CacheSpeed
         {
-            get { return bottingCountVibrationTableDecelerationSpeedValue; }
+            get { return shakeTable1L_CacheSpeed; }
             set
             {
-                ushort oldValue = bottingCountVibrationTableDecelerationSpeedValue;
-                if(PlcSettingMessageBus.pLCManagement.WriteBottingCountVibrationTableDecelerationSpeedValue(value))
+                ushort oldValue = shakeTable1L_CacheSpeed;
+                if (PlcSettingMessageBus.pLCManagement.WriteShakeTable1L_CacheSpeed(value))
                 {
-                    bottingCountVibrationTableDecelerationSpeedValue = value;
+                    shakeTable1L_CacheSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"罐装计数震台减速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"缓存料筒震台低速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("BottingCountVibrationTableDecelerationSpeedValue");
+                OnPropertyChanged("ShakeTable1L_CacheSpeed");
             }
         }
 
         /// <summary>
-        /// 缓存料筒震台高速值
+        /// 缓存过滤震台减速值
         /// </summary>
-        private ushort cacheMaterialCylinderVibrationTableHighSpeedValue;
-        public ushort CacheMaterialCylinderVibrationTableHighSpeedValue
+        private ushort shakeTable2L_CacheSpeed;
+        public ushort ShakeTable2L_CacheSpeed
         {
-            get { return cacheMaterialCylinderVibrationTableHighSpeedValue; }
+            get { return shakeTable2L_CacheSpeed; }
             set
             {
-                ushort oldValue = cacheMaterialCylinderVibrationTableHighSpeedValue;
-                if(PlcSettingMessageBus.pLCManagement.WriteCacheMaterialCylinderVibrationTableHighSpeedValue(value))
+                ushort oldValue = shakeTable2L_CacheSpeed;
+                if (PlcSettingMessageBus.pLCManagement.WriteShakeTable2L_CacheSpeed(value))
                 {
-                    cacheMaterialCylinderVibrationTableHighSpeedValue = value;
+                    shakeTable2L_CacheSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"缓存料筒震台高速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"缓存过滤震台低速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("CacheMaterialCylinderVibrationTableHighSpeedValue");
+                OnPropertyChanged("ShakeTable2L_CacheSpeed");
             }
         }
 
         /// <summary>
-        /// 缓存过滤震台高速值
+        /// 缓存计数震台低速值
         /// </summary>
-        private ushort cacheFilterVibrationTableHighSpeedValue;
-        public ushort CacheFilterVibrationTableHighSpeedValue
+        private ushort shakeTable3L_CacheSpeed;
+        public ushort ShakeTable3L_CacheSpeed
         {
-            get { return cacheFilterVibrationTableHighSpeedValue; }
+            get { return shakeTable3L_CacheSpeed; }
             set
             {
-                ushort oldValue = cacheFilterVibrationTableHighSpeedValue;
-                if(PlcSettingMessageBus.pLCManagement.WriteCacheFilterVibrationTableHighSpeedValue(value))
+                ushort oldValue = shakeTable3L_CacheSpeed;
+                if (PlcSettingMessageBus.pLCManagement.WriteShakeTable3L_CacheSpeed(value))
                 {
-                    cacheFilterVibrationTableHighSpeedValue = value;
+                    shakeTable3L_CacheSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"缓存过滤震台高速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"缓存计数震台低速值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("CacheFilterVibrationTableHighSpeedValue");
+                OnPropertyChanged("ShakeTable3L_CacheSpeed");
             }
         }
 
+
         /// <summary>
-        /// 缓存计数震台高速值
+        /// 罐装高速区间
         /// </summary>
-        private ushort cacheCountVibrationTableHighSpeedValue;
-        public ushort CacheCountVibrationTableHighSpeedValue
+        private ushort fillingH_SpeedRatio;
+        public ushort FillingH_SpeedRatio
         {
-            get { return cacheCountVibrationTableHighSpeedValue; }
+            get { return fillingH_SpeedRatio; }
             set
             {
-                ushort oldValue = cacheCountVibrationTableHighSpeedValue;
-                if(PlcSettingMessageBus.pLCManagement.WriteCacheCountVibrationTableHighSpeedValue(value))
+                ushort oldValue = fillingH_SpeedRatio;
+                if (PlcSettingMessageBus.pLCManagement.WriteFillingH_SpeedRatio(value))
                 {
-                    cacheCountVibrationTableHighSpeedValue = value;
+                    fillingH_SpeedRatio = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"缓存计数震台高速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"罐装高速区间值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("CacheCountVibrationTableHighSpeedValue");
+                OnPropertyChanged("FillingH_SpeedRatio");
             }
         }
 
         /// <summary>
-        /// 缓存料筒震台减速值
+        /// 罐装减速区间
         /// </summary>
-        private ushort cacheMaterialCylinderVibrationTableDecelerationSpeedValue;
-        public ushort CacheMaterialCylinderVibrationTableDecelerationSpeedValue
+        private ushort fillingM_SpeedRatio;
+        public ushort FillingM_SpeedRatio
         {
-            get { return cacheMaterialCylinderVibrationTableDecelerationSpeedValue; }
+            get { return fillingM_SpeedRatio; }
             set
             {
-                ushort oldValue = cacheMaterialCylinderVibrationTableDecelerationSpeedValue;
-                if(PlcSettingMessageBus.pLCManagement.WriteCacheMaterialCylinderVibrationTableDecelerationSpeedValue(value))
+                ushort oldValue = fillingM_SpeedRatio;
+                if (PlcSettingMessageBus.pLCManagement.WriteFillingM_SpeedRatio(value))
                 {
-                    cacheMaterialCylinderVibrationTableDecelerationSpeedValue = value;
+                    fillingM_SpeedRatio = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"缓存料筒震台减速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"罐装减速区间值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("CacheMaterialCylinderVibrationTableDecelerationSpeedValue");
+                OnPropertyChanged("FillingM_SpeedRatio");
             }
         }
 
         /// <summary>
-        /// 缓存过滤震台减速值
+        /// 罐装低速区间
         /// </summary>
-        private ushort cacheFilterVibrationTableDecelerationSpeedValue;
-        public ushort CacheFilterVibrationTableDecelerationSpeedValue
+        private ushort fillingL_SpeedRatio;
+        public ushort FillingL_SpeedRatio
         {
-            get { return cacheFilterVibrationTableDecelerationSpeedValue; }
+            get { return fillingL_SpeedRatio; }
             set
             {
-                ushort oldValue = cacheFilterVibrationTableDecelerationSpeedValue;
-                if(PlcSettingMessageBus.pLCManagement.WriteCacheFilterVibrationTableDecelerationSpeedValue(value))
+                ushort oldValue = fillingL_SpeedRatio;
+                if (PlcSettingMessageBus.pLCManagement.WriteFillingL_SpeedRatio(value))
                 {
-                    cacheFilterVibrationTableDecelerationSpeedValue = value;
+                    fillingL_SpeedRatio = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"缓存过滤震台减速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"罐装低速区间值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("CacheFilterVibrationTableDecelerationSpeedValue");
+                OnPropertyChanged("FillingL_SpeedRatio");
             }
         }
 
         /// <summary>
-        /// 缓存计数震台减速值
+        /// 缓存高速区间
         /// </summary>
-        private ushort cacheCountVibrationTableDecelerationSpeedValue;
-        public ushort CacheCountVibrationTableDecelerationSpeedValue
+        private ushort cacheH_SpeedRatio;
+        public ushort CacheH_SpeedRatio
         {
-            get { return cacheCountVibrationTableDecelerationSpeedValue; }
+            get { return cacheH_SpeedRatio; }
             set
             {
-                ushort oldValue = cacheCountVibrationTableDecelerationSpeedValue;
-                if(PlcSettingMessageBus.pLCManagement.WriteCacheCountVibrationTableDecelerationSpeedValue(value))
+                ushort oldValue = cacheH_SpeedRatio;
+                if (PlcSettingMessageBus.pLCManagement.WriteCacheH_SpeedRatio(value))
                 {
-                    cacheCountVibrationTableDecelerationSpeedValue = value;
+                    cacheH_SpeedRatio = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"缓存计数震台减速值从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"缓存高速区间值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("CacheCountVibrationTableDecelerationSpeedValue");
+                OnPropertyChanged("CacheH_SpeedRatio");
             }
         }
 
         /// <summary>
-        /// 阀门打开延时
+        /// 缓存减速区间
         /// </summary>
-        private UInt32 gateOpeningDelay;
-        public UInt32 GateOpeningDelay
+        private ushort cacheM_SpeedRatio;
+        public ushort CacheM_SpeedRatio
         {
-            get { return gateOpeningDelay; }
+            get { return cacheM_SpeedRatio; }
             set
             {
-                UInt32 oldValue = gateOpeningDelay;
-                if(PlcSettingMessageBus.pLCManagement.WriteGateOpeningDelay(value))
+                ushort oldValue = cacheM_SpeedRatio;
+                if (PlcSettingMessageBus.pLCManagement.WriteCacheM_SpeedRatio(value))
                 {
-                    gateOpeningDelay = value;
+                    cacheM_SpeedRatio = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"阀门打开延时从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"缓存减速区间值从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("GateOpeningDelay");
+                OnPropertyChanged("CacheM_SpeedRatio");
             }
         }
 
         /// <summary>
-        /// 回零偏移值
+        /// 缓存低速区间
         /// </summary>
-        private float returnToZeroOffsetValue;
-        public string ReturnToZeroOffsetValue
+        private ushort cacheL_SpeedRatio;
+        public ushort CacheL_SpeedRatio
         {
-            get { return returnToZeroOffsetValue.ToString("F2"); }
+            get { return cacheL_SpeedRatio; }
             set
             {
-                if (value == "-")
+                ushort oldValue = cacheL_SpeedRatio;
+                if (PlcSettingMessageBus.pLCManagement.WriteCacheL_SpeedRatio(value))
                 {
-                    return;
+                    cacheL_SpeedRatio = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"缓存低速区间值从{oldValue}修改为{value}");
                 }
+                OnPropertyChanged("CacheL_SpeedRatio");
+            }
+        }
+
+        /// <summary>
+        /// 传动轴点动速度
+        /// </summary>
+        private double screwJogSpeed;
+        public string ScrewJogSpeed
+        {
+            get { return screwJogSpeed.ToString("F2"); }
+            set
+            {
                 if (float.TryParse(value, out float result))
                 {
-                    float oldValue = returnToZeroOffsetValue;
-                    if (PlcSettingMessageBus.pLCManagement.WriteReturnToZeroOffsetValue(result))
+                    double oldValue = screwJogSpeed;
+                    if (PlcSettingMessageBus.pLCManagement.WriteScrewJogSpeed(result))
                     {
-                        returnToZeroOffsetValue = result;
+                        screwJogSpeed = result;
                         if (oldValue != result)
-                            FaultLog.RecordValueChangeMessage($"回零偏移值从{oldValue}修改为{result}");
+                            FaultLog.RecordValueChangeMessage($"传动轴点动速度从{oldValue}修改为{result}");
                     }
-                    OnPropertyChanged("ReturnToZeroOffsetValue");
+                    OnPropertyChanged("ScrewJogSpeed");
                 }
             }
         }
 
         /// <summary>
-        /// 回零偏移速度
+        /// 进瓶速度
         /// </summary>
-        private float returnToZeroOffsetSpeed;
-        public string ReturnToZeroOffsetSpeed
+        private double inBottleSpeed;
+        public string InBottleSpeed
         {
-            get { return returnToZeroOffsetSpeed.ToString("F2"); }
+            get { return inBottleSpeed.ToString("F2"); }
             set
             {
                 if (float.TryParse(value, out float result))
                 {
-                    float oldValue = returnToZeroOffsetSpeed;
-                    if (PlcSettingMessageBus.pLCManagement.WriteReturnToZeroOffsetSpeed(result))
+                    double oldValue = inBottleSpeed;
+                    if (PlcSettingMessageBus.pLCManagement.WriteInBottleSpeed(result))
                     {
-                        returnToZeroOffsetSpeed = result;
+                        inBottleSpeed = result;
                         if (oldValue != result)
-                            FaultLog.RecordValueChangeMessage($"回零偏移速度从{oldValue}修改为{result}");
+                            FaultLog.RecordValueChangeMessage($"传动轴点动速度从{oldValue}修改为{result}");
                     }
-                    OnPropertyChanged("ReturnToZeroOffsetSpeed");
+                    OnPropertyChanged("InBottleSpeed");
                 }
             }
         }
 
         /// <summary>
-        /// 中转阀关闭速度
+        /// 传动轴绝对定位速度
         /// </summary>
-        private float transferValveClosingSpeed;
-        public string TransferValveClosingSpeed
+        private double bottlePosSpeed;
+        public string BottlePosSpeed
         {
-            get { return transferValveClosingSpeed.ToString("F2"); }
+            get { return bottlePosSpeed.ToString("F2"); }
             set
             {
                 if (float.TryParse(value, out float result))
                 {
-                    float oldValue = transferValveClosingSpeed;
-                    if(PlcSettingMessageBus.pLCManagement.WriteTransferValveClosingSpeed(result))
+                    double oldValue = bottlePosSpeed;
+                    if (PlcSettingMessageBus.pLCManagement.WriteBottlePosSpeed(result))
                     {
-                        transferValveClosingSpeed = result;
+                        bottlePosSpeed = result;
                         if (oldValue != result)
-                            FaultLog.RecordValueChangeMessage($"中转阀关闭速度从{oldValue}修改为{result}");
+                            FaultLog.RecordValueChangeMessage($"传动轴绝对定位速度从{oldValue}修改为{result}");
                     }
-                    OnPropertyChanged("TransferValveClosingSpeed");
+                    OnPropertyChanged("BottlePosSpeed");
                 }
             }
         }
 
         /// <summary>
-        /// 中转阀开位置
+        /// 传动轴绝对定位位置
         /// </summary>
-        private float transferValveOpenPosition;
-        public string TransferValveOpenPosition
+        private double bottlePosPosition;
+        public string BottlePosPosition
         {
-            get { return transferValveOpenPosition.ToString("F2"); }
+            get { return bottlePosPosition.ToString("F2"); }
             set
             {
                 if (float.TryParse(value, out float result))
                 {
-                    float oldValue = transferValveOpenPosition;
-                    if(PlcSettingMessageBus.pLCManagement.WriteTransferValveOpenPosition(result))
+                    double oldValue = bottlePosPosition;
+                    if (PlcSettingMessageBus.pLCManagement.WriteBottlePosPosition(result))
                     {
-                        transferValveOpenPosition = result;
+                        bottlePosPosition = result;
                         if (oldValue != result)
-                            FaultLog.RecordValueChangeMessage($"中转阀开位置从{oldValue}修改为{result}");
+                            FaultLog.RecordValueChangeMessage($"传动轴绝对定位位置从{oldValue}修改为{result}");
                     }
-                    OnPropertyChanged("TransferValveOpenPosition");
+                    OnPropertyChanged("BottlePosPosition");
                 }
             }
         }
 
+
         /// <summary>
-        /// 中转阀关位置
+        /// 中转阀打开速度
         /// </summary>
-        private float transferValveClosePosition;
-        public string TransferValveClosePosition
+        private float fillingValveOpenSpeed;
+        public string FillingValveOpenSpeed
         {
-            get { return transferValveClosePosition.ToString("F2"); }
+            get { return fillingValveOpenSpeed.ToString("F2"); }
             set
             {
                 if (float.TryParse(value, out float result))
                 {
-                    float oldValue = transferValveClosePosition;
-                    if(PlcSettingMessageBus.pLCManagement.WriteTransferValveClosePosition(result))
+                    float oldValue = fillingValveOpenSpeed;
+                    if (PlcSettingMessageBus.pLCManagement.WriteFillingValveOpenSpeed(result))
                     {
-                        transferValveClosePosition = result;
+                        fillingValveOpenSpeed = result;
                         if (oldValue != result)
-                            FaultLog.RecordValueChangeMessage($"中转阀关位置从{oldValue}修改为{result}");
+                            FaultLog.RecordValueChangeMessage($"中转阀打开速度从{oldValue}修改为{result}");
                     }
-                    OnPropertyChanged("TransferValveClosePosition");
+                    OnPropertyChanged("FillingValveOpenSpeed");
                 }
             }
         }
 
         /// <summary>
-        /// 气阀开延时
+        /// 中转阀打开位置
         /// </summary>
-        private UInt32 airValveOpeningDelay;
-        public UInt32 AirValveOpeningDelay
+        private float fillingValveOpenPosition;
+        public string FillingValveOpenPosition
         {
-            get { return airValveOpeningDelay; }
+            get { return fillingValveOpenPosition.ToString("F2"); }
             set
             {
-                UInt32 oldValue = airValveOpeningDelay;
-                if(PlcSettingMessageBus.pLCManagement.WriteAirValveOpeningDelay(value))
+                if (float.TryParse(value, out float result))
                 {
-                    airValveOpeningDelay = value;
-                    if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"气阀开延时从{oldValue}修改为{value}");
+                    float oldValue = fillingValveOpenPosition;
+                    if (PlcSettingMessageBus.pLCManagement.WriteFillingValveOpenPosition(result))
+                    {
+                        fillingValveOpenPosition = result;
+                        if (oldValue != result)
+                            FaultLog.RecordValueChangeMessage($"中转阀打开速度从{oldValue}修改为{result}");
+                    }
+                    OnPropertyChanged("FillingValveOpenPosition");
                 }
-                OnPropertyChanged("AirValveOpeningDelay");
             }
         }
 
         /// <summary>
-        /// 装瓶停机值
+        /// 中转阀关闭速度
         /// </summary>
-        private UInt16 bottlingShutdownValue;
-        public UInt16 BottlingShutdownValue
+        private double fillingValveCloseSpeed;
+        public string FillingValveCloseSpeed
         {
-            get { return bottlingShutdownValue; }
+            get { return fillingValveCloseSpeed.ToString("F2"); }
             set
             {
-                UInt16 oldValue = bottlingShutdownValue;
-                if(PlcSettingMessageBus.pLCManagement.WriteBottlingShutdownValue(value))
+                if (float.TryParse(value, out float result))
                 {
-                    bottlingShutdownValue = value;
-                    if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"装瓶停机值从{oldValue}修改为{value}");
+                    double oldValue = fillingValveCloseSpeed;
+                    if(PlcSettingMessageBus.pLCManagement.WriteFillingValveCloseSpeed(result))
+                    {
+                        fillingValveCloseSpeed = result;
+                        if (oldValue != result)
+                            FaultLog.RecordValueChangeMessage($"中转阀关闭速度从{oldValue}修改为{result}");
+                    }
+                    OnPropertyChanged("FillingValveCloseSpeed");
                 }
-                OnPropertyChanged("BottlingShutdownValue");
             }
         }
 
         /// <summary>
-        /// 装瓶停机时间
+        /// 中转阀关位置
         /// </summary>
-        private UInt32 bottlingShutdownTime;
-        public UInt32 BottlingShutdownTime
+        private double fillingValveClosePosition;
+        public string FillingValveClosePosition
         {
-            get { return bottlingShutdownTime; }
+            get { return fillingValveClosePosition.ToString("F2"); }
             set
             {
-                UInt32 oldValue = bottlingShutdownTime;
-                if(PlcSettingMessageBus.pLCManagement.WriteBottlingShutdownTime(value))
+                if (float.TryParse(value, out float result))
                 {
-                    bottlingShutdownTime = value;
-                    if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"装瓶停机时间从{oldValue}修改为{value}");
+                    double oldValue = fillingValveClosePosition;
+                    if(PlcSettingMessageBus.pLCManagement.WriteFillingValveClosePosition(result))
+                    {
+                        fillingValveClosePosition = result;
+                        if (oldValue != result)
+                            FaultLog.RecordValueChangeMessage($"中转阀关位置从{oldValue}修改为{result}");
+                    }
+                    OnPropertyChanged("FillingValveClosePosition");
                 }
-                OnPropertyChanged("BottlingShutdownTime");
             }
         }
 
         /// <summary>
-        /// 送瓶轮运行速度
+        /// 中转阀缓存速度
         /// </summary>
-        private float bottleFeedingWheelRunningSpeed;
-        public string BottleFeedingWheelRunningSpeed
+        private double fillingValveCacheSpeed;
+        public string FillingValveCacheSpeed
         {
-            get { return bottleFeedingWheelRunningSpeed.ToString("F2"); }
+            get { return fillingValveCacheSpeed.ToString("F2"); }
             set
             {
                 if (float.TryParse(value, out float result))
                 {
-                    float oldValue = bottleFeedingWheelRunningSpeed;
-                    if (PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelRunningSpeed(result))
+                    double oldValue = fillingValveCacheSpeed;
+                    if (PlcSettingMessageBus.pLCManagement.WriteFillingValveCacheSpeed(result))
                     {
-                        bottleFeedingWheelRunningSpeed = result;
+                        fillingValveCacheSpeed = result;
                         if (oldValue != result)
-                            FaultLog.RecordValueChangeMessage($"送瓶轮运行速度从{oldValue}修改为{result}");
+                            FaultLog.RecordValueChangeMessage($"中转阀缓存速度从{oldValue}修改为{result}");
                     }
-                    OnPropertyChanged("BottleFeedingWheelRunningSpeed");
+                    OnPropertyChanged("FillingValveCacheSpeed");
                 }
             }
         }
 
         /// <summary>
-        /// 送瓶轮点动速度
+        /// 中转阀缓存位置
         /// </summary>
-        private float bottleFeedingWheelJogRunningSpeed;
-        public string BottleFeedingWheelJogRunningSpeed
+        private double fillingValveCachePosition;
+        public string FillingValveCachePosition
         {
-            get { return bottleFeedingWheelJogRunningSpeed.ToString("F2"); }
+            get { return fillingValveCachePosition.ToString("F2"); }
             set
             {
                 if (float.TryParse(value, out float result))
                 {
-                    float oldValue = bottleFeedingWheelJogRunningSpeed;
-                    if (PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelJogRunningSpeed(result))
+                    double oldValue = fillingValveCachePosition;
+                    if (PlcSettingMessageBus.pLCManagement.WriteFillingValveCachePosition(result))
                     {
-                        bottleFeedingWheelJogRunningSpeed = result;
+                        fillingValveCachePosition = result;
                         if (oldValue != result)
-                            FaultLog.RecordValueChangeMessage($"送瓶轮点动速度从{oldValue}修改为{result}");
+                            FaultLog.RecordValueChangeMessage($"中转阀缓存位置从{oldValue}修改为{result}");
                     }
-                    OnPropertyChanged("BottleFeedingWheelJogRunningSpeed");
+                    OnPropertyChanged("FillingValveCachePosition");
                 }
             }
         }
 
         /// <summary>
-        /// 送瓶轮回零偏移值
+        /// 中转阀缓存位置
         /// </summary>
-        private float bottleFeedingWheelReturnToZeroOffsetValue;
-        public string BottleFeedingWheelReturnToZeroOffsetValue
+        private double fillingValveJogSpeed;
+        public string FillingValveJogSpeed
         {
-            get { return bottleFeedingWheelReturnToZeroOffsetValue.ToString("F2"); }
+            get { return fillingValveJogSpeed.ToString("F2"); }
             set
             {
                 if (float.TryParse(value, out float result))
                 {
-                    float oldValue = bottleFeedingWheelReturnToZeroOffsetValue;
-                    if (PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelReturnToZeroOffsetValue(result))
+                    double oldValue = fillingValveJogSpeed;
+                    if (PlcSettingMessageBus.pLCManagement.WriteFillingValveJogSpeed(result))
                     {
-                        bottleFeedingWheelReturnToZeroOffsetValue = result;
+                        fillingValveJogSpeed = result;
                         if (oldValue != result)
-                            FaultLog.RecordValueChangeMessage($"送瓶轮回零偏移值从{oldValue}修改为{result}");
+                            FaultLog.RecordValueChangeMessage($"中转阀点动速度从{oldValue}修改为{result}");
                     }
-                    OnPropertyChanged("BottleFeedingWheelReturnToZeroOffsetValue");
+                    OnPropertyChanged("FillingValveJogSpeed");
                 }
             }
         }
+        /// <summary>
+        /// 漏斗下降延时
+        /// </summary>
+        private ushort machineDelayFunneDownTime;
+        public ushort MachineDelayFunneDownTime
+        {
+            get { return machineDelayFunneDownTime; }
+            set
+            {
+                float oldValue = machineDelayFunneDownTime;
+                if (PlcSettingMessageBus.pLCManagement.WriteMachineDelayFunneDownTime(value))
+                {
+                    machineDelayFunneDownTime = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"漏斗下降延时从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("MachineDelayFunneDownTime");
+            }
+        }
 
         /// <summary>
-        /// 送瓶轮回零速度
+        /// 漏斗上升延时
         /// </summary>
-        private float bottleFeedingWheelReturnToZeroSpeed;
-        public string BottleFeedingWheelReturnToZeroSpeed
+        private ushort machineDelayFunneUpTime;
+        public ushort MachineDelayFunneUpTime
         {
-            get { return bottleFeedingWheelReturnToZeroSpeed.ToString("F2"); }
+            get { return machineDelayFunneUpTime; }
             set
             {
-                if (float.TryParse(value, out float result))
+                float oldValue = machineDelayFunneUpTime;
+                if (PlcSettingMessageBus.pLCManagement.WriteMachineDelayFunneUpTime(value))
                 {
-                    float oldValue = bottleFeedingWheelReturnToZeroSpeed;
-                    if (PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelReturnToZeroSpeed(result))
-                    {
-                        bottleFeedingWheelReturnToZeroSpeed = result;
-                        if (oldValue != result)
-                            FaultLog.RecordValueChangeMessage($"送瓶轮回零速度从{oldValue}修改为{result}");
-                    }
-                    OnPropertyChanged("BottleFeedingWheelReturnToZeroSpeed");
+                    machineDelayFunneUpTime = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"漏斗上升延时从{oldValue}修改为{value}");
                 }
+                OnPropertyChanged("MachineDelayFunneUpTime");
             }
         }
 
         /// <summary>
-        /// 送瓶轮定位长度
+        /// 中转阀打开延时
         /// </summary>
-        private float bottleFeedingWheelPositionLength;
-        public string BottleFeedingWheelPositionLength
+        private ushort machineDelayFillingValveOpenTime;
+        public ushort MachineDelayFillingValveOpenTime
         {
-            get { return bottleFeedingWheelPositionLength.ToString("F2"); }
+            get { return machineDelayFillingValveOpenTime; }
             set
             {
-                if (float.TryParse(value, out float result))
+                float oldValue = machineDelayFillingValveOpenTime;
+                if (PlcSettingMessageBus.pLCManagement.WriteMachineDelayFillingValveOpenTime(value))
                 {
-                    float oldValue = bottleFeedingWheelPositionLength;
-                    if (PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelPositionLength(result))
-                    {
-                        bottleFeedingWheelPositionLength = result;
-                        if (oldValue != result)
-                            FaultLog.RecordValueChangeMessage($"送瓶轮定位长度从{oldValue}修改为{result}");
-                    }
-                    OnPropertyChanged("BottleFeedingWheelPositionLength");
+                    machineDelayFillingValveOpenTime = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"中转阀打开延时从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("MachineDelayFillingValveOpenTime");
+            }
+        }
+
+        /// <summary>
+        /// 中转阀打开延时
+        /// </summary>
+        private ushort machineDelayFillingValveCloseTime;
+        public ushort MachineDelayFillingValveCloseTime
+        {
+            get { return machineDelayFillingValveCloseTime; }
+            set
+            {
+                float oldValue = machineDelayFillingValveCloseTime;
+                if (PlcSettingMessageBus.pLCManagement.WriteMachineDelayFillingValveCloseTime(value))
+                {
+                    machineDelayFillingValveCloseTime = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"中转阀关闭延时从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("MachineDelayFillingValveCloseTime");
+            }
+        }
+
+        /// <summary>
+        /// 进瓶延时
+        /// </summary>
+        private ushort machineDelayInBottleTime;
+        public ushort MachineDelayInBottleTime
+        {
+            get { return machineDelayInBottleTime; }
+            set
+            {
+                float oldValue = machineDelayInBottleTime;
+                if (PlcSettingMessageBus.pLCManagement.WriteMachineDelayInBottleTime(value))
+                {
+                    machineDelayInBottleTime = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"进瓶延时从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("MachineDelayInBottleTime");
+            }
+        }
+
+        /// <summary>
+        /// 气阀开延时
+        /// </summary>
+        private ushort valveDelytime;
+        public ushort ValveDelytime
+        {
+            get { return valveDelytime; }
+            set
+            {
+                ushort oldValue = valveDelytime;
+                if (PlcSettingMessageBus.pLCManagement.WriteValveDelytime(value))
+                {
+                    valveDelytime = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"气阀开延时从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("ValveDelytime");
+            }
+        }
+
+        /// <summary>
+        /// 瓶装设定值
+        /// </summary>
+        private ushort bottValueSet;
+        public ushort BottValueSet
+        {
+            get { return bottValueSet; }
+            set
+            {
+                float oldValue = bottValueSet;
+                if (PlcSettingMessageBus.pLCManagement.WriteBottValueSet(value))
+                {
+                    bottValueSet = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"瓶装设定值从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("BottValueSet");
+            }
+        }
+
+        /// <summary>
+        /// 缓存停机值
+        /// </summary>
+        private ushort cacheShutdownValue;
+        public ushort CacheShutdownValue
+        {
+            get { return cacheShutdownValue; }
+            set
+            {
+                ushort oldValue = cacheShutdownValue;
+                if (PlcSettingMessageBus.pLCManagement.WriteCacheShutdownValue(value))
+                {
+                    cacheShutdownValue = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"缓存停机值从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("CacheShutdownValue");
+            }
+        }
+
+        /// <summary>
+        /// 缺瓶检测时间
+        /// </summary>
+        private ushort missingDelaytime;
+        public ushort MissingDelaytime
+        {
+            get { return missingDelaytime; }
+            set
+            {
+                ushort oldValue = missingDelaytime;
+                if (PlcSettingMessageBus.pLCManagement.WriteMissingDelaytime(value))
+                {
+                    missingDelaytime = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"缺瓶检测时间从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("MissingDelaytime");
+            }
+        }
+        /// <summary>
+        /// 堵瓶检测时间
+        /// </summary>
+        private ushort bottleJamDelaytime;
+        public ushort BottleJamDelaytime
+        {
+            get { return bottleJamDelaytime; }
+            set
+            {
+                ushort oldValue = bottleJamDelaytime;
+                if (PlcSettingMessageBus.pLCManagement.WriteBottleJamDelaytime(value))
+                {
+                    bottleJamDelaytime = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"堵瓶检测时间从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("BottleJamDelaytime");
+            }
+        }
+
+        /// <summary>
+        /// 剔废气缸延时时间
+        /// </summary>
+        private ushort eliminateCylinderDelayTime;
+        public ushort EliminateCylinderDelayTime
+        {
+            get { return eliminateCylinderDelayTime; }
+            set
+            {
+                ushort oldValue = eliminateCylinderDelayTime;
+                if (PlcSettingMessageBus.pLCManagement.WriteEliminateCylinderDelayTime(value))
+                {
+                    eliminateCylinderDelayTime = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"剔废气缸延时时间从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("EliminateCylinderDelayTime");
+            }
+        }
+
+        /// <summary>
+        /// 剔废气缸保持时间
+        /// </summary>
+        private ushort eliminateCylinderHoldingTime;
+        public ushort EliminateCylinderHoldingTime
+        {
+            get { return eliminateCylinderHoldingTime; }
+            set
+            {
+                ushort oldValue = eliminateCylinderHoldingTime;
+                if (PlcSettingMessageBus.pLCManagement.WriteEliminateCylinderHoldingTime(value))
+                {
+                    eliminateCylinderHoldingTime = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"剔废气缸保持时间从{oldValue}修改为{value}");
+                }
+                OnPropertyChanged("EliminateCylinderHoldingTime");
+            }
+        }
+
+        /// <summary>
+        /// 料筒震台测试速度
+        /// </summary>
+        private ushort shakeTable1_TestSpeed;
+        public ushort ShakeTable1_TestSpeed
+        {
+            get { return shakeTable1_TestSpeed; }
+            set
+            {
+                ushort oldValue = shakeTable1_TestSpeed;
+                if (PlcSettingMessageBus.pLCManagement.WriteShakeTable1_TestSpeed(value))
+                {
+                    shakeTable1_TestSpeed = value;
+                    if (oldValue != value)
+                        FaultLog.RecordValueChangeMessage($"料筒震台测试速度从{oldValue}修改为{value}");
                 }
+                OnPropertyChanged("ShakeTable1_TestSpeed");
             }
         }
 
         /// <summary>
-        /// 送瓶轮暂停时间
+        /// 缓存震台测试速度
         /// </summary>
-        private UInt32 bottleFeedingWheelPauseTime;
-        public UInt32 BottleFeedingWheelPauseTime
+        private ushort shakeTable2_TestSpeed;
+        public ushort ShakeTable2_TestSpeed
         {
-            get { return bottleFeedingWheelPauseTime; }
+            get { return shakeTable2_TestSpeed; }
             set
             {
-                UInt32 oldValue = bottleFeedingWheelPauseTime;
-                if (PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelPauseTime(value))
+                ushort oldValue = shakeTable2_TestSpeed;
+                if (PlcSettingMessageBus.pLCManagement.WriteShakeTable2_TestSpeed(value))
                 {
-                    bottleFeedingWheelPauseTime = value;
+                    shakeTable2_TestSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"送瓶轮暂停时间从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"缓存震台测试速度从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("BottleFeedingWheelPauseTime");
+                OnPropertyChanged("ShakeTable2_TestSpeed");
             }
         }
 
         /// <summary>
-        /// 下料延时
+        /// 计数震台测试速度
         /// </summary>
-        private UInt32 delayBlanking;
-        public UInt32 DelayBlanking
+        private ushort shakeTable3_TestSpeed;
+        public ushort ShakeTable3_TestSpeed
         {
-            get { return delayBlanking; }
+            get { return shakeTable3_TestSpeed; }
             set
             {
-                UInt32 oldValue = delayBlanking;
-                if (PlcSettingMessageBus.pLCManagement.WriteDelayBlanking(value))
+                ushort oldValue = shakeTable3_TestSpeed;
+                if (PlcSettingMessageBus.pLCManagement.WriteShakeTable3_TestSpeed(value))
                 {
-                    delayBlanking = value;
+                    shakeTable3_TestSpeed = value;
                     if (oldValue != value)
-                        FaultLog.RecordValueChangeMessage($"下料延时从{oldValue}修改为{value}");
+                        FaultLog.RecordValueChangeMessage($"计数震台测试速度从{oldValue}修改为{value}");
                 }
-                OnPropertyChanged("DelayBlanking");
+                OnPropertyChanged("ShakeTable3_TestSpeed");
             }
         }
 

+ 0 - 36
CCDCountWpf/ShowBindingClass.cs

@@ -875,42 +875,6 @@ namespace CCDCountWpf
             }
         }
 
-        /// <summary>
-        /// 合格粒最大面积
-        /// </summary>
-        public string XCoefficient
-        {
-            get
-            {
-                if (MessageBus.NowSettingLoadMainThread != null)
-                {
-                    return MessageBus.NowSettingLoadMainThread.XCoefficient.ToString();
-                }
-                else
-                {
-                    return "";
-                }
-            }
-            set
-            {
-                if (MessageBus.NowSettingLoadMainThread != null)
-                {
-                    try
-                    {
-                        double oldValue = MessageBus.NowSettingLoadMainThread.XCoefficient;
-                        MessageBus.NowSettingLoadMainThread.XCoefficient = double.Parse(value);
-                        if (oldValue != double.Parse(value))
-                            FaultLog.RecordValueChangeMessage($"数粒识别{MessageBus.NowSettingLoadMainThread.XCoefficient}的X轴系数从{oldValue}修改为{value}");
-                        OnPropertyChanged("XCoefficient");
-                    }
-                    catch (Exception)
-                    {
-                        Console.WriteLine("XCoefficient-SetError");
-                    }
-
-                }
-            }
-        }
 
         /// <summary>
         /// 异常粒识别码

+ 170 - 193
CCDCountWpf/WpfFrom/MainWindow.xaml.cs

@@ -31,7 +31,6 @@ namespace CCDCountWpf
         Uri ShowUri = null;
         List<SaveConfigModel> Configs = null;
         bool IsShow = false;
-        bool IsPLCShow = false;
         SystemMonitor monitor = new SystemMonitor();
         Stopwatch SystemRunTime = new Stopwatch();
         long InitRunTime;
@@ -43,21 +42,30 @@ namespace CCDCountWpf
         /// </summary>
         public MainWindow()
         {
+            LOG.log("程序正在加载主界面", 6);
             InitializeComponent();
-            StartSystemRunTime();
-            //SetupFullScreen();
+            LOG.log("正在开启系统运行时间程序", 6);
+            //StartSystemRunTime();
+            SetupFullScreen();
+            LOG.log("绑定界面数据中", 6);
             DataContext = ShowMessageBus.ShowBinding;
+            LOG.log("加载配置参数中", 6);
             if (File.Exists(".\\Config\\CCDCountConfig.xml"))
             {
                 Configs = XmlStorage.DeserializeFromXml<List<SaveConfigModel>>(".\\Config\\CCDCountConfig.xml");
             }
+            LOG.log("初始化引用库", 6);
             SDKSystem.Initialize();
             FaultLog.FaultError += ShowErrorMesPage;
-
+            LOG.log("初始化相机中", 6);
             InitCameraIdentify();
+            LOG.log("启动界面更新线程中", 6);
             StartUpdataShowDataThread();
+            LOG.log("相机列表显示", 6);
             InitCamComboboxValue();
+            LOG.log("初始化PLC参数管理功能", 6);
             InitPlcManger();
+            LOG.log("更新数据界面参数展示", 6);
             UpdatePlcPara();
         }
 
@@ -170,12 +178,9 @@ namespace CCDCountWpf
             StopSystemRunTime();
             SaveConfig();
             SDKSystem.Finalize();
-            if (MessageBus.MainThreadS.Count != 0)
+            if (MessageBus.NowSettingLoadMainThread != null)
             {
-                foreach (var item in MessageBus.MainThreadS)
-                {
-                    item.DisposeCamera();
-                }
+                MessageBus.NowSettingLoadMainThread.DisposeCamera();
             }
             StopUpdataShowDataThread();
             FaultLog.FaultError -= ShowErrorMesPage;
@@ -191,27 +196,18 @@ namespace CCDCountWpf
                 MessageBox.Show("尚未添加相机,请前往配置页面配置相机");
                 return;
             }
-            if (MessageBus.MainThreadS.Count != 0)
+            if (MessageBus.NowSettingLoadMainThread != null)
             {
-                foreach (var item in MessageBus.MainThreadS)
-                {
-                    item.StopMianThread();
-                }
+                MessageBus.NowSettingLoadMainThread.StopMianThread();
             }
-            MessageBus.MainThreadS = new List<MainThreadClass>();
-            for (int i = 0; i < Configs.Count; i++)
-            {
-                MessageBus.MainThreadS.Add(new MainThreadClass(Configs[i].ShuLiConfigClass, Configs[i].CameraConfig));
 
-                MessageBus.MainThreadS[i].FormulationName = Configs[i].ConfigName;
-                MessageBus.MainThreadS[i].IsLoadFormulation = Configs[i].IsFormulation;
-                //MessageBus.MainThreadS[i].ConnectModbus("127.0.0.1");
-                MessageBus.MainThreadS[i].ConnectModbus("192.168.1.88");
-                MessageBus.MainThreadS[i].LoadCamera();
-            }
-            MessageBus.SeetingNowLoadInMaThreadsIndex = 0;
-            MessageBus.NowLoadCameraIndex = 0;
-            MessageBus.NowSettingLoadMainThread = MessageBus.MainThreadS[MessageBus.SeetingNowLoadInMaThreadsIndex];
+            MessageBus.NowSettingLoadMainThread = (new MainThreadClass(Configs[0].ShuLiConfigClass, Configs[0].CameraConfig));
+
+            MessageBus.NowSettingLoadMainThread.FormulationName = Configs[0].ConfigName;
+            MessageBus.NowSettingLoadMainThread.IsLoadFormulation = Configs[0].IsFormulation;
+            //MessageBus.MainThreadS[i].ConnectModbus("127.0.0.1");
+            MessageBus.NowSettingLoadMainThread.ConnectModbus("192.168.0.88");
+            MessageBus.NowSettingLoadMainThread.LoadCamera();
         }
 
         /// <summary>
@@ -223,6 +219,7 @@ namespace CCDCountWpf
             BitmapImage ThumbnailImage1 = null;
             const int targetMsPerFrame = 100; // 20FPS=50ms
             Stopwatch renderSW = new Stopwatch();
+            Stopwatch HeartSW = new Stopwatch();
             Task.Run(async () =>
             {
                 while (IsShow)
@@ -236,15 +233,15 @@ namespace CCDCountWpf
                     });
                     await Application.Current.Dispatcher.InvokeAsync(() =>
                     {
-                        if (MessageBus.MainThreadS.Count == 0)
+                        if (MessageBus.NowSettingLoadMainThread == null)
                         {
                             LOG.log(string.Format("{0}:当前未加载识别流程", "IdentifyCameraForm-StartShowImageThread"));
                             Thread.Sleep(100);
                             return;
                         }
-                        if(MessageBus.MainThreadS.Count>=1)
+                        else
                         {
-                            MessageBus.MainThreadS[0].GetShowImage(1000, out Bitmap image1);
+                            MessageBus.NowSettingLoadMainThread.GetShowImage(1000, out Bitmap image1);
                             if (image1 == null)
                             {
                                 LOG.log(string.Format("{0}:相机一获取图片为空", "IdentifyCameraForm-StartShowImageThread"));
@@ -254,11 +251,11 @@ namespace CCDCountWpf
                             ShowMessageBus.ShowBinding.BitmapImage = ThumbnailImage1;
                         }
 
-                        if (MessageBus.NowLoadCameraIndex != -1)
+                        if (MessageBus.NowSettingLoadMainThread != null)
                         {
-                            if (MessageBus.MainThreadS[MessageBus.NowLoadCameraIndex].IsDebug)
+                            if (MessageBus.NowSettingLoadMainThread.IsDebug)
                             {
-                                Bitmap Splicebitmap = MessageBus.MainThreadS[MessageBus.NowLoadCameraIndex].GetCamImageOnce();
+                                Bitmap Splicebitmap = MessageBus.NowSettingLoadMainThread.GetCamImageOnce();
                                 if (Splicebitmap != null)
                                 {
                                     ShowMessageBus.ShowBinding.DebugImage = ConvertToBitmapImage(Splicebitmap);
@@ -284,6 +281,28 @@ namespace CCDCountWpf
                     //Thread.Sleep(50);
                 }
             });
+            Task.Run(async () =>
+            {
+                while (true)
+                {
+                    HeartSW.Restart();
+                    //if (MessageBus.NowSettingLoadMainThread == null) continue;
+                    //    if (MessageBus.NowSettingLoadMainThread.CameraRunStatic && MessageBus.NowSettingLoadMainThread.CameraSendMessageStatic)
+                    //    {
+                    //        PlcSettingMessageBus.pLCManagement.HeartMessage();
+                    //    }
+                    if(PlcSettingMessageBus.pLCManagement!=null)
+                    {
+                        PlcSettingMessageBus.pLCManagement.HeartMessage();
+                    }
+                    HeartSW.Stop();
+                    int elapsed = (int)HeartSW.ElapsedMilliseconds;
+                    if (elapsed < targetMsPerFrame)
+                    {
+                        await Task.Delay(500 - elapsed);
+                    }
+                }
+            });
         }
 
         /// <summary>
@@ -294,28 +313,19 @@ namespace CCDCountWpf
             IsShow = false;
         }
 
-        /// <summary>
-        /// 停止PLC数据显示线程
-        /// </summary>
-        public void StopPLCUpdateShowDataThread()
-        {
-            IsPLCShow = false;
-        }
-
         /// <summary>
         /// 更新数粒显示数据
         /// </summary>
         private void UpdataShuLiShowData()
         {
-            if (MessageBus.MainThreadS.Count == 0) return;
-            if(MessageBus.NowLoadCameraIndex ==  -1) return;
-            if (MessageBus.MainThreadS[MessageBus.NowLoadCameraIndex].ShuLiState)
+            if (MessageBus.NowSettingLoadMainThread == null) return;
+            if (MessageBus.NowSettingLoadMainThread.ShuLiState)
             {
                 Application.Current.Dispatcher.Invoke(() =>
                 {
-                    ShowMessageBus.ShowBinding.CameraStaticColor = MessageBus.MainThreadS[MessageBus.NowLoadCameraIndex].CameraRunStatic == true
+                    ShowMessageBus.ShowBinding.CameraStaticColor = MessageBus.NowSettingLoadMainThread.CameraRunStatic == true
                         ? System.Windows.Media.Brushes.Green : System.Windows.Media.Brushes.Red;
-                    ShowMessageBus.ShowBinding.CamRunStatic = MessageBus.MainThreadS[MessageBus.NowLoadCameraIndex].CameraRunStatic == true 
+                    ShowMessageBus.ShowBinding.CamRunStatic = MessageBus.NowSettingLoadMainThread.CameraRunStatic == true 
                         ? "运行中" : "未运行";
                 });
             }
@@ -328,10 +338,10 @@ namespace CCDCountWpf
                     ShowMessageBus.ShowBinding.CamRunStatic = "视野遮挡";
                 });
             }
-            ShowMessageBus.ShowBinding.AllActiveNum = MessageBus.MainThreadS[MessageBus.NowLoadCameraIndex].HistoryActiveNum.ToString();
-            ShowMessageBus.ShowBinding.AllOkNum = MessageBus.MainThreadS[MessageBus.NowLoadCameraIndex].OkHistoryNum.ToString();
-            ShowMessageBus.ShowBinding.AllNgNum = MessageBus.MainThreadS[MessageBus.NowLoadCameraIndex].NgHistoryNum.ToString();
-            ShowMessageBus.ShowBinding.ShuLiSpeed = MessageBus.MainThreadS[MessageBus.NowLoadCameraIndex].GetOneSecondActiveNum().ToString();
+            ShowMessageBus.ShowBinding.AllActiveNum = MessageBus.NowSettingLoadMainThread.HistoryActiveNum.ToString();
+            ShowMessageBus.ShowBinding.AllOkNum = MessageBus.NowSettingLoadMainThread.OkHistoryNum.ToString();
+            ShowMessageBus.ShowBinding.AllNgNum = MessageBus.NowSettingLoadMainThread.NgHistoryNum.ToString();
+            ShowMessageBus.ShowBinding.ShuLiSpeed = MessageBus.NowSettingLoadMainThread.GetOneSecondActiveNum().ToString();
             PlcSettingMessageBus.pLCManagement.ReadBottingCount(out ushort BottingCount);
             ShowMessageBus.ShowBinding.BottingCount = BottingCount;
         }
@@ -408,20 +418,17 @@ namespace CCDCountWpf
         private void SaveConfig()
         {
             List<SaveConfigModel> SaveConfig = new List<SaveConfigModel>();
-            if (MessageBus.MainThreadS.Count <= 0)
+            if (MessageBus.NowSettingLoadMainThread == null)
             {
                 return;
             }
-            foreach (var item in MessageBus.MainThreadS)
+            SaveConfig.Add(new SaveConfigModel()
             {
-                SaveConfig.Add(new SaveConfigModel()
-                {
-                    CameraConfig = item.cameraConfig,
-                    ShuLiConfigClass = item.shuLiConfig,
-                    IsFormulation = item.IsLoadFormulation,
-                    ConfigName = item.FormulationName
-                });
-            }
+                CameraConfig = MessageBus.NowSettingLoadMainThread.cameraConfig,
+                ShuLiConfigClass = MessageBus.NowSettingLoadMainThread.shuLiConfig,
+                IsFormulation = MessageBus.NowSettingLoadMainThread.IsLoadFormulation,
+                ConfigName = MessageBus.NowSettingLoadMainThread.FormulationName
+            });
             if (!Directory.Exists(".\\Config\\")) Directory.CreateDirectory(".\\Config\\");
             {
                 XmlStorage.SerializeToXml(SaveConfig, ".\\Config\\CCDCountConfig.xml");
@@ -434,147 +441,117 @@ namespace CCDCountWpf
         public void InitPlcManger()
         {
             //PlcSettingMessageBus.pLCManagement = new PLCManagementClass("127.0.0.1");
-            PlcSettingMessageBus.pLCManagement = new PLCManagementClass("192.168.1.88");
-            if (PlcSettingMessageBus.pLCManagement.IsConnect)
-            {
-                IsPLCShow = true;
-                const int targetMsPerFrame = 100; // 20FPS=50ms
-                Stopwatch renderSW = new Stopwatch();
-                Task.Run(async () =>
-                {
-                    while (IsPLCShow)
-                    {
-                        await Task.Run(() =>
-                        {
-                            UpdatePlcState();
-                        });
-                        //await Application.Current.Dispatcher.InvokeAsync(() =>
-                        //{
-                        //});
-                        //进行精准20帧控制
-                        int elapsed = (int)renderSW.ElapsedMilliseconds;
-                        //Console.WriteLine(elapsed);
-                        if (elapsed < targetMsPerFrame)
-                        {
-                            //Console.WriteLine($"主显示线程休眠,休眠时间:{targetMsPerFrame - elapsed}");
-                            Thread.Sleep(targetMsPerFrame - elapsed);
-                        }
-                        //Thread.Sleep(50);
-                    }
-                });
-            }
-        }
-
-        private void UpdatePlcState()
-        {
-            var plcData = PlcSettingMessageBus.pLCManagement.ReadAllState();
-            if (plcData == null) return;
-            PlcSettingMessageBus.PlcMessageShowBindage.EnableCompletion =
-            plcData.EnableCompletion;
-            PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroCompletion =
-            plcData.ReturnToZeroCompletion;
-            PlcSettingMessageBus.PlcMessageShowBindage.StopCompletion =
-            plcData.StopCompletion;
-            PlcSettingMessageBus.PlcMessageShowBindage.SpeedRunning =
-            plcData.SpeedRunning;
-            PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZero =
-            plcData.ReturnToZero;
-            PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpenCompletion =
-            plcData.TransferValveOpenCompletion;
-            PlcSettingMessageBus.PlcMessageShowBindage.TransferValveCloseCompletion =
-            plcData.TransferValveCloseCompletion;
-            PlcSettingMessageBus.PlcMessageShowBindage.AllowsDataExchange =
-            plcData.AllowsDataExchange;
-            PlcSettingMessageBus.PlcMessageShowBindage.Enable =
-            plcData.Enable;
-            PlcSettingMessageBus.PlcMessageShowBindage.PauseDataExchange =
-            plcData.PauseDataExchange;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheCountDelayed =
-            plcData.CacheCountDelayed;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelEnableCompletion =
-            plcData.BottleFeedingWheelEnableCompletion;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelStopCompletion =
-            plcData.BottleFeedingWheelStopCompletion;
+            PlcSettingMessageBus.pLCManagement = new PLCManagementClass("192.168.0.88");
         }
 
         private void UpdatePlcPara()
         {
             var ParaValue = PlcSettingMessageBus.pLCManagement.ReadAllPara();
             if (ParaValue == null) return;
-            PlcSettingMessageBus.PlcMessageShowBindage.SpeedModeRunningSpeed =
-            ParaValue.SpeedModeRunningSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.JogSpeed =
-            ParaValue.JogSpeed.ToString();
+            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.TransferValveOpeningSpeed =
-            ParaValue.TransferValveOpeningSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningTime =
-            ParaValue.TransferValveOpeningTime;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingDecelerationValue =
-            ParaValue.BottingDecelerationValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheDecelerationValue =
-            ParaValue.CacheDecelerationValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheCountDelayTiming =
-            ParaValue.CacheCountDelayTiming;
+                ParaValue.BottValueSet;
+            PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime = 
+                ParaValue.ValveDelytime;
             PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue =
-            ParaValue.CacheShutdownValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue =
-            ParaValue.BottingMaterialCylinderVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue =
-            ParaValue.BottingFilterVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue =
-            ParaValue.BottingCountVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableDecelerationSpeedValue =
-            ParaValue.BottingMaterialCylinderVibrationTableDecelerationSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableDecelerationSpeedValue =
-            ParaValue.BottingFilterVibrationTableDecelerationSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableDecelerationSpeedValue =
-            ParaValue.BottingCountVibrationTableDecelerationSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableHighSpeedValue =
-            ParaValue.CacheMaterialCylinderVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableHighSpeedValue =
-            ParaValue.CacheFilterVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableHighSpeedValue =
-            ParaValue.CacheCountVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableDecelerationSpeedValue =
-            ParaValue.CacheMaterialCylinderVibrationTableDecelerationSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableHighSpeedValue =
-            ParaValue.CacheMaterialCylinderVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableDecelerationSpeedValue = 
-            ParaValue.CacheCountVibrationTableDecelerationSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.GateOpeningDelay = 
-            ParaValue.GateOpeningDelay;
-            PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetValue = 
-            ParaValue.ReturnToZeroOffsetValue.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetSpeed = 
-            ParaValue.ReturnToZeroOffsetSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosingSpeed = 
-            ParaValue.TransferValveClosingSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpenPosition = 
-            ParaValue.TransferValveOpenPosition.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosePosition = 
-            ParaValue.TransferValveClosePosition.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.AirValveOpeningDelay = 
-            ParaValue.AirValveOpeningDelay;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownValue = 
-            ParaValue.BottlingShutdownValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownTime = 
-            ParaValue.BottlingShutdownTime;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelRunningSpeed = 
-            ParaValue.BottleFeedingWheelRunningSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelJogRunningSpeed = 
-            ParaValue.BottleFeedingWheelJogRunningSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroOffsetValue = 
-            ParaValue.BottleFeedingWheelReturnToZeroOffsetValue.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroSpeed = 
-            ParaValue.BottleFeedingWheelReturnToZeroSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPositionLength = 
-            ParaValue.BottleFeedingWheelPositionLength.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPauseTime = 
-            ParaValue.BottleFeedingWheelPauseTime;
-            PlcSettingMessageBus.PlcMessageShowBindage.DelayBlanking = 
-            ParaValue.DelayBlanking;
+                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;
         }
 
         private void StartSystemRunTime()

+ 2 - 2
CCDCountWpf/WpfPage/HistoryDataPage.xaml.cs

@@ -148,7 +148,7 @@ namespace CCDCountWpf.WpfPage
         /// </summary>
         private void InitBatchItems()
         {
-            string folderPath = $"{AppDomain.CurrentDomain.BaseDirectory}DATA\\ActiveObjectData\\Cam{MessageBus.MainThreadS[0].cameraConfig.CamerNo}";
+            string folderPath = $"{AppDomain.CurrentDomain.BaseDirectory}DATA\\ActiveObjectData\\Cam{MessageBus.NowSettingLoadMainThread.cameraConfig.CamerNo}";
             if (!Directory.Exists(folderPath))
             {
                 // 创建文件夹
@@ -306,7 +306,7 @@ namespace CCDCountWpf.WpfPage
             if (BatchNumComBox.SelectedItem != null && BatchNumComBox.SelectedItem.ToString() != string.Empty)
             {
                 string BatchNumber = BatchNumComBox.SelectedItem.ToString();
-                actionMesSqliteDataClass = new ActionMesSqliteDataClass($"{AppDomain.CurrentDomain.BaseDirectory}DATA\\ActiveObjectData\\Cam{MessageBus.MainThreadS[0].cameraConfig.CamerNo}\\ActiveObjectData_{BatchNumber}.db");
+                actionMesSqliteDataClass = new ActionMesSqliteDataClass($"{AppDomain.CurrentDomain.BaseDirectory}DATA\\ActiveObjectData\\Cam{MessageBus.NowSettingLoadMainThread.cameraConfig.CamerNo}\\ActiveObjectData_{BatchNumber}.db");
                 //actionMesSqliteDataClass = new ActionMesSqliteDataClass($"{AppDomain.CurrentDomain.BaseDirectory}DATA\\ActiveObjectData\\Cam{MessageBus.MainThreadS[0].cameraConfig.CamerNo}\\ActiveObjectData_20250908.db");
                 actionMesSqliteDataClass.GetAllActionMinStartMaxEndLine(out int num, out int StartLine, out int EndLine);
                 ShowMessageBus.ShowBinding.HistoryImageCount = (EndLine - StartLine) / PageHeight;

+ 3 - 3
CCDCountWpf/WpfPage/MainPage.xaml

@@ -262,7 +262,7 @@
                                         </ControlTemplate>
                                     </Button.Template>
                                 </Button>
-                                <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = BottingMaterialCylinderVibrationTableHighSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="79" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White" Background="{x:Null}" KeyDown="TextBox_KeyDown"/>
+                                <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = ShakeTable1H_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="79" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White" Background="{x:Null}" KeyDown="TextBox_KeyDown"/>
                                 <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueDownBtn" Content="-" Width="45" Click="BottingMaterialCylinderVibrationTableHighSpeedValueDownBtn_Click" Background="#FF0123FF" Foreground="White" FontSize="20" Cursor="Hand">
                                     <Button.Template>
                                         <ControlTemplate TargetType="Button">
@@ -314,7 +314,7 @@
                                         </ControlTemplate>
                                     </Button.Template>
                                 </Button>
-                                <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = BottingFilterVibrationTableHighSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White" Background="{x:Null}" KeyDown="TextBox_KeyDown"/>
+                                <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = ShakeTable2H_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White" Background="{x:Null}" KeyDown="TextBox_KeyDown"/>
                                 <Button x:Name="BottingFilterVibrationTableHighSpeedValueDownBtn" Content="-" Width="45" Click="BottingFilterVibrationTableHighSpeedValueDownBtn_Click" Background="#FF0123FF" Foreground="White" FontSize="20" Cursor="Hand">
                                     <Button.Template>
                                         <ControlTemplate TargetType="Button">
@@ -366,7 +366,7 @@
                                         </ControlTemplate>
                                     </Button.Template>
                                 </Button>
-                                <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = BottingCountVibrationTableHighSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="{x:Null}" Foreground="White" KeyDown="TextBox_KeyDown"/>
+                                <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = ShakeTable3H_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="{x:Null}" Foreground="White" KeyDown="TextBox_KeyDown"/>
                                 <Button x:Name="BottingCountVibrationTableHighSpeedValueDownBtn" Content="-" Width="45" Click="BottingCountVibrationTableHighSpeedValueDownBtn_Click" Background="#FF0123FF" Foreground="White" FontSize="20" Cursor="Hand">
                                     <Button.Template>
                                         <ControlTemplate TargetType="Button">

+ 116 - 156
CCDCountWpf/WpfPage/MainPage.xaml.cs

@@ -41,9 +41,10 @@ namespace CCDCountWpf.WpfPage
 
         private void DataClear_Click(object sender, RoutedEventArgs e)
         {
-            if(MessageBus.MainThreadS.Count<MessageBus.NowLoadCameraIndex+1)
+            if(MessageBus.NowSettingLoadMainThread == null)
                 return;
-            MessageBus.MainThreadS[MessageBus.NowLoadCameraIndex].ClearHistoryActive();
+            MessageBus.NowSettingLoadMainThread.ClearHistoryActive();
+            MessageBus.NowSettingLoadMainThread.ClearSendQueue();
         }
 
         private void Page_Loaded(object sender, RoutedEventArgs e)
@@ -54,9 +55,9 @@ namespace CCDCountWpf.WpfPage
             StopIdentifyBtn.IsEnabled = false;
             StopIdentifyBtn.Opacity = 0.5;
 
-            if(MessageBus.NowLoadCameraIndex>=0)
+            if(MessageBus.NowSettingLoadMainThread != null)
             {
-                if (MessageBus.MainThreadS[MessageBus.NowLoadCameraIndex].CameraRunStatic)
+                if (MessageBus.NowSettingLoadMainThread.CameraRunStatic)
                 {
                     StartIdentifyBtn.IsEnabled = false;
                     StartIdentifyBtn.Opacity = 0.5;
@@ -73,54 +74,29 @@ namespace CCDCountWpf.WpfPage
             }
         }
 
-        private void MiniShowImageBox2_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
-        {
-            if(MessageBus.MainThreadS.Count < 2) return;
-            MessageBus.NowLoadCameraIndex = 1;
-        }
-
-        private void MiniShowImageBox1_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
-        {
-            if (MessageBus.MainThreadS.Count < 1) return;
-            MessageBus.NowLoadCameraIndex = 0;
-        }
-
-        private void MiniShowImageBox3_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
-        {
-            if (MessageBus.MainThreadS.Count < 3) return;
-            MessageBus.NowLoadCameraIndex = 2;
-        }
-
-        private void MiniShowImageBox4_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
-        {
-            if (MessageBus.MainThreadS.Count < 4) return;
-            MessageBus.NowLoadCameraIndex = 3;
-        }
-
         /// <summary>
         /// 启动相机识别
         /// </summary>
-        private void RunCameraIdentify()
+        private bool RunCameraIdentify()
         {
-            for (int i = 0; i < MessageBus.MainThreadS.Count; i++)
+            if(MessageBus.NowSettingLoadMainThread != null)
             {
-                MessageBus.MainThreadS[i].BatchNumber = ShowMessageBus.ShowBinding.BatchNumber;
-                if (MessageBus.MainThreadS[i].CameraConfigIsChange)
+                MessageBus.NowSettingLoadMainThread.BatchNumber = ShowMessageBus.ShowBinding.BatchNumber;
+                if (MessageBus.NowSettingLoadMainThread.CameraConfigIsChange)
                 {
-                    MessageBus.MainThreadS[i].ReLoadCameraConfig();
+                    MessageBus.NowSettingLoadMainThread.ReLoadCameraConfig();
                 }
                 //启动单相机实例的全部线程
-                if (!MessageBus.MainThreadS[i].StartMianThread())
+                if (!MessageBus.NowSettingLoadMainThread.StartMianThread())
                 {
-                    FaultLog.RecordErrorMessage(MessageBus.MainThreadS[i].cameraConfig.DeviceName + "_" + MessageBus.MainThreadS[i].cameraConfig.CameraSNNum + "启动失败", "CCDCountWpf:MainPage-RunCameraIdentify");
+                    FaultLog.RecordErrorMessage(MessageBus.NowSettingLoadMainThread.cameraConfig.DeviceName + "_" + MessageBus.NowSettingLoadMainThread.cameraConfig.CameraSNNum + "启动失败", "CCDCountWpf:MainPage-RunCameraIdentify");
                     //LOG.error(MessageBus.MainThreadS[i].cameraConfig.DeviceName + "_" + MessageBus.MainThreadS[i].cameraConfig.CameraSNNum + "启动失败");
-                    MessageBox.Show(MessageBus.MainThreadS[i].cameraConfig.DeviceName + "_" + MessageBus.MainThreadS[i].cameraConfig.CameraSNNum + "启动失败");
-                    continue;
+                    MessageBox.Show(MessageBus.NowSettingLoadMainThread.cameraConfig.DeviceName + "_" + MessageBus.NowSettingLoadMainThread.cameraConfig.CameraSNNum + "启动失败");
+                    return false;
                 }
             }
-            MessageBus.NowLoadCammeraSN = MessageBus.MainThreadS[0].cameraConfig.CameraSNNum;
-            MessageBus.SeetingNowLoadInMaThreadsIndex = 0;
-            MessageBus.NowLoadCameraIndex = 0;
+            MessageBus.NowLoadCammeraSN = MessageBus.NowSettingLoadMainThread.cameraConfig.CameraSNNum;
+            return true;
         }
 
         /// <summary>
@@ -128,14 +104,13 @@ namespace CCDCountWpf.WpfPage
         /// </summary>
         private void StopCameraIdentify()
         {
-            for (int i = 0; i < MessageBus.MainThreadS.Count; i++)
+            if(MessageBus.NowSettingLoadMainThread != null)
             {
                 //启动单相机实例的全部线程
-                if (!MessageBus.MainThreadS[i].StopMianThread())
+                if (!MessageBus.NowSettingLoadMainThread.StopMianThread())
                 {
-                    FaultLog.RecordErrorMessage(MessageBus.MainThreadS[i].cameraConfig.DeviceName + "_" + MessageBus.MainThreadS[i].cameraConfig.CameraSNNum + "关闭失败", "CCDCountWpf:MainPage-StopCameraIdentify");
-                    MessageBox.Show(MessageBus.MainThreadS[i].cameraConfig.DeviceName + "_" + MessageBus.MainThreadS[i].cameraConfig.CameraSNNum + "关闭失败");
-                    continue;
+                    FaultLog.RecordErrorMessage(MessageBus.NowSettingLoadMainThread.cameraConfig.DeviceName + "_" + MessageBus.NowSettingLoadMainThread.cameraConfig.CameraSNNum + "关闭失败", "CCDCountWpf:MainPage-StopCameraIdentify");
+                    MessageBox.Show(MessageBus.NowSettingLoadMainThread.cameraConfig.DeviceName + "_" + MessageBus.NowSettingLoadMainThread.cameraConfig.CameraSNNum + "关闭失败");
                 }
             }
         }
@@ -203,14 +178,17 @@ namespace CCDCountWpf.WpfPage
                 return;
             }
             RunBatchRecord(ShowMessageBus.ShowBinding.BatchNumber);
-            RunCameraIdentify();
+            if(!RunCameraIdentify())
+            {
+                return;
+            }
             StartIdentifyBtn.IsEnabled = false;
             StartIdentifyBtn.Opacity = 0.5;
             StopIdentifyBtn.IsEnabled = true;
             StopIdentifyBtn.Opacity = 1;
             if(PlcSettingMessageBus.pLCManagement.IsConnect)
             {
-                PlcSettingMessageBus.pLCManagement.InitiateToTrue();
+                PlcSettingMessageBus.pLCManagement.MachineRunToTrue();
             }
         }
 
@@ -224,115 +202,115 @@ namespace CCDCountWpf.WpfPage
             StopIdentifyBtn.Opacity = 0.5;
             if (PlcSettingMessageBus.pLCManagement.IsConnect)
             {
-                PlcSettingMessageBus.pLCManagement.StopToTrue();
+                PlcSettingMessageBus.pLCManagement.MachineStopToTrue();
             }
         }
 
         private void BottingMaterialCylinderVibrationTableHighSpeedValueUpUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue + 10) >
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed + 10) >
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue += 10;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed += 10;
             }
         }
 
         private void BottingMaterialCylinderVibrationTableHighSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue + 1) >
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed += 1;
             }
         }
 
         private void BottingMaterialCylinderVibrationTableHighSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue - 1) <
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed -= 1;
             }
         }
 
         private void BottingMaterialCylinderVibrationTableHighSpeedValueDownDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue - 10) <
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed - 10) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue -= 10;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed -= 10;
             }
         }
 
         private void BottingFilterVibrationTableHighSpeedValueUpUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue + 10) >
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed + 10) >
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue += 10;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed += 10;
             }
         }
 
         private void BottingFilterVibrationTableHighSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue + 1) >
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed += 1;
             }
         }
 
         private void BottingFilterVibrationTableHighSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue - 1) <
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed -= 1;
             }
         }
 
         private void BottingFilterVibrationTableHighSpeedValueDownDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue - 10) <
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed - 10) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue -= 10;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed -= 10;
             }
         }
 
         private void BottingCountVibrationTableHighSpeedValueUpUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue + 10) >
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed + 10) >
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue += 10;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed += 10;
             }
         }
 
         private void BottingCountVibrationTableHighSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue + 1) >
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed += 1;
             }
         }
 
         private void BottingCountVibrationTableHighSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue - 1) <
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed -= 1;
             }
         }
 
         private void BottingCountVibrationTableHighSpeedValueDownDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue - 10) <
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed - 10) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue -= 10;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed -= 10;
             }
         }
 
@@ -494,80 +472,62 @@ namespace CCDCountWpf.WpfPage
             ShowMessageBus.ShowBinding.PandingCode = FormulationConfig.PandingCode.ToString();
             ShowMessageBus.ShowBinding.RegionThreshold = FormulationConfig.RegionThreshold.ToString();
 
-            PlcSettingMessageBus.PlcMessageShowBindage.SpeedModeRunningSpeed =
-            FormulationConfig.SpeedModeRunningSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.JogSpeed =
-            FormulationConfig.JogSpeed.ToString();
+            PlcSettingMessageBus.PlcMessageShowBindage.FillingModel =
+                FormulationConfig.FillingMode;
+            PlcSettingMessageBus.PlcMessageShowBindage.BeltsSpeed =
+                FormulationConfig.BeltsSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed =
+                FormulationConfig.ShakeTable1H_FillingSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed =
+                FormulationConfig.ShakeTable2H_FillingSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed =
+                FormulationConfig.ShakeTable3H_FillingSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed =
+                FormulationConfig.ShakeTable1M_FillingSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed =
+                FormulationConfig.ShakeTable2M_FillingSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed =
+                FormulationConfig.ShakeTable3M_FillingSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_FillingSpeed =
+                FormulationConfig.ShakeTable1L_FillingSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed =
+                FormulationConfig.ShakeTable2L_FillingSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed =
+                FormulationConfig.ShakeTable3L_FillingSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed =
+                FormulationConfig.ShakeTable1H_CacheSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed =
+                FormulationConfig.ShakeTable2H_CacheSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed =
+                FormulationConfig.ShakeTable3H_CacheSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed =
+                FormulationConfig.ShakeTable1M_CacheSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_CacheSpeed =
+                FormulationConfig.ShakeTable1M_CacheSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_CacheSpeed =
+                FormulationConfig.ShakeTable3M_CacheSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed =
+                FormulationConfig.ShakeTable1L_CacheSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_CacheSpeed =
+                FormulationConfig.ShakeTable1L_CacheSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_CacheSpeed =
+                FormulationConfig.ShakeTable3L_CacheSpeed;
+            PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCloseSpeed =
+                FormulationConfig.FillingValveCloseSpeed.ToString();
+            PlcSettingMessageBus.PlcMessageShowBindage.FillingValveClosePosition =
+                FormulationConfig.FillingValveClosePosition.ToString();
+            PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime =
+                FormulationConfig.ValveDelytime;
+            PlcSettingMessageBus.PlcMessageShowBindage.ScrewJogSpeed =
+                FormulationConfig.ScrewJogSpeed.ToString();
             PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet =
-            FormulationConfig.BottValueSet;
-            PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningSpeed =
-            FormulationConfig.TransferValveOpeningSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningTime =
-            FormulationConfig.TransferValveOpeningTime;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingDecelerationValue =
-            FormulationConfig.BottingDecelerationValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheDecelerationValue =
-            FormulationConfig.CacheDecelerationValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheCountDelayTiming =
-            FormulationConfig.CacheCountDelayTiming;
+                FormulationConfig.BottValueSet;
+            PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenSpeed =
+                FormulationConfig.FillingValveOpenSpeed.ToString();
+            PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenPosition =
+                FormulationConfig.FillingValveOpenPosition.ToString();
             PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue =
-            FormulationConfig.CacheShutdownValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue =
-            FormulationConfig.BottingMaterialCylinderVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue =
-            FormulationConfig.BottingFilterVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue =
-            FormulationConfig.BottingCountVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableDecelerationSpeedValue =
-            FormulationConfig.BottingMaterialCylinderVibrationTableDecelerationSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableDecelerationSpeedValue =
-            FormulationConfig.BottingFilterVibrationTableDecelerationSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableDecelerationSpeedValue =
-            FormulationConfig.BottingCountVibrationTableDecelerationSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableHighSpeedValue =
-            FormulationConfig.CacheMaterialCylinderVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableHighSpeedValue =
-            FormulationConfig.CacheFilterVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableHighSpeedValue =
-            FormulationConfig.CacheCountVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableDecelerationSpeedValue =
-            FormulationConfig.CacheMaterialCylinderVibrationTableDecelerationSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableHighSpeedValue =
-            FormulationConfig.CacheMaterialCylinderVibrationTableHighSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableDecelerationSpeedValue =
-            FormulationConfig.CacheCountVibrationTableDecelerationSpeedValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.GateOpeningDelay =
-            FormulationConfig.GateOpeningDelay;
-            PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetValue =
-            FormulationConfig.ReturnToZeroOffsetValue.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetSpeed =
-            FormulationConfig.ReturnToZeroOffsetSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosingSpeed =
-            FormulationConfig.TransferValveClosingSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpenPosition =
-            FormulationConfig.TransferValveOpenPosition.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosePosition =
-            FormulationConfig.TransferValveClosePosition.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.AirValveOpeningDelay =
-            FormulationConfig.AirValveOpeningDelay;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownValue =
-            FormulationConfig.BottlingShutdownValue;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownTime =
-            FormulationConfig.BottlingShutdownTime;
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelRunningSpeed =
-            FormulationConfig.BottleFeedingWheelRunningSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelJogRunningSpeed =
-            FormulationConfig.BottleFeedingWheelJogRunningSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroOffsetValue =
-            FormulationConfig.BottleFeedingWheelReturnToZeroOffsetValue.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroSpeed =
-            FormulationConfig.BottleFeedingWheelReturnToZeroSpeed.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPositionLength =
-            FormulationConfig.BottleFeedingWheelPositionLength.ToString();
-            PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPauseTime =
-            FormulationConfig.BottleFeedingWheelPauseTime;
-            PlcSettingMessageBus.PlcMessageShowBindage.DelayBlanking =
-            FormulationConfig.DelayBlanking;
+                FormulationConfig.CacheShutdownValue;
         }
     }
 }

+ 20 - 224
CCDCountWpf/WpfPage/PlcOperationPage.xaml

@@ -9,36 +9,9 @@
     <Grid>
         <Grid x:Name="ShowGrid" Grid.Row="1">
             <Grid x:Name="PLCRuningSetting" Visibility="Visible">
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="*"/>
-                    <ColumnDefinition Width="150"/>
-                </Grid.ColumnDefinitions>
                 <WrapPanel Orientation="Horizontal" Grid.Column="0"
                            ItemHeight="70" ItemWidth="130" HorizontalAlignment="Left"
                            VerticalAlignment="Top">
-                    <Button Content="使能"  Margin="40,0,0,0" Height="40" Width="90" Click="Button_Click"/>
-                    <Button x:Name="InitiateBtn" Content="PLC启动"  Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="InitiateBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="InitiateBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="StopBtn" Content="PLC停止" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="StopBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="StopBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="ReturnToZeroBtn" Content="回零" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="ReturnToZeroBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="ReturnToZeroBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="RepositionBtn" Content="复位" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="RepositionBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="RepositionBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="ForwardRotatingJogBtn" Content="正转点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="ForwardRotatingJogBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="ForwardRotatingJogBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="ReversalReverseJogBtn" Content="反转点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="ReversalReverseJogBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="ReversalReverseJogBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="ShaftStopsBtn" Content="轴停止" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="ShaftStopsBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="ShaftStopsBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="SpeedRunBtn" Content="速度运行" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="SpeedRunBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="SpeedRunBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="EquipmentOperationBtn" Content="设备运行" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="EquipmentOperationBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="EquipmentOperationBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="LevelOneVibrationTableBtn" Content="一级震台启动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" Click="LevelOneVibrationTableBtn_Click"/>
-                    <Button x:Name="LevelTwoVibrationTableBtn" Content="二级震台启动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" Click="LevelTwoVibrationTableBtn_Click"/>
-                    <Button x:Name="LevelThreeVibrationTableBtn" Content="三级震台启动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" Click="LevelThreeVibrationTableBtn_Click"/>
-                    <Button x:Name="DeviceUpBtn" Content="设备上升" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="DeviceUpBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="DeviceUpBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="DeviceDownBtn" Content="设备下降" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="DeviceDownBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="DeviceDownBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="TransferStartBtn" Content="传送带启动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" Click="TransferStartBtn_Click"/>
-                    <Button x:Name="AirValveCloseBtn" Content="气锁关" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" Click="AirValveCloseBtn_Click"/>
-                    <Button x:Name="BottleFeedingWheelResetBtn" Content="送瓶轮复位" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="BottleFeedingWheelResetBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="BottleFeedingWheelResetBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="BottleFeedingWheelReturnToZeroBtn" Content="送瓶轮回零" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="BottleFeedingWheelReturnToZeroBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="BottleFeedingWheelReturnToZeroBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="BottleFeedingWheelShaftStopsBtn" Content="送瓶轮轴停止" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="BottleFeedingWheelShaftStopsBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="BottleFeedingWheelShaftStopsBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="BottleFeedingWheelPositiveRotationJogBtn" Content="送瓶轮正转点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="BottleFeedingWheelPositiveRotationJogBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="BottleFeedingWheelPositiveRotationJogBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="BottleFeedingWheelReverseRotationJogBtn" Content="送瓶轮反转点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="BottleFeedingWheelReverseRotationJogBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="BottleFeedingWheelReverseRotationJogBtn_PreviewMouseLeftButtonUp"/>
-                    <Button x:Name="BottleFeedingWheelEnableBtn" Content="送瓶轮使能" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" Click="BottleFeedingWheelEnableBtn_Click"/>
                     <Button x:Name="Valve1Jog" Content="闸门一点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" Click="Valve1Jog_Click"/>
                     <Button x:Name="Valve2Jog" Content="闸门二点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" Click="Valve2Jog_Click"/>
                     <Button x:Name="Valve3Jog" Content="闸门三点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" Click="Valve3Jog_Click"/>
@@ -47,204 +20,27 @@
                     <Button x:Name="Valve6Jog" Content="闸门六点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" Click="Valve6Jog_Click"/>
                     <Button x:Name="Valve7Jog" Content="闸门七点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" Click="Valve7Jog_Click"/>
                     <Button x:Name="Valve8Jog" Content="闸门八点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" Click="Valve8Jog_Click"/>
+                    <Button x:Name="MachineRunBtn" Content="PLC启动"  Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="InitiateBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="InitiateBtn_PreviewMouseLeftButtonUp"/>
+                    <Button x:Name="MachineStopBtn" Content="PLC停止" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="StopBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="StopBtn_PreviewMouseLeftButtonUp"/>
+                    <Button x:Name="ScrewHomeBtn" Content="传动轴回零" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="ScrewHomeBtn_PreviewMouseLeftButtonDown"/>
+                    <Button x:Name="ScrewJogFwdBtn" Content="传动轴正向点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="ScrewJogFwdBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="ScrewJogFwdBtn_PreviewMouseLeftButtonUp"/>
+                    <Button x:Name="ScrewJogRevBtn" Content="传动轴反向点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="ScrewJogRevBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="ScrewJogRevBtn_PreviewMouseLeftButtonUp"/>
+                    <Button x:Name="FillingValveManualOpenBtn" Content="中转阀开" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="FillingValveManualOpenBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="FillingValveManualOpenBtn_PreviewMouseLeftButtonUp"/>
+                    <Button x:Name="FillingValveManualCloseBtn" Content="中转阀关" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="FillingValveManualCloseBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="FillingValveManualCloseBtn_PreviewMouseLeftButtonUp"/>
+                    <Button x:Name="FillingValveManualCacheBtn" Content="中转阀缓存" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="FillingValveManualCacheBtn_PreviewMouseLeftButtonDown"/>
+                    <Button x:Name="FillingValveJogFwdBtn" Content="中转阀正向点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="FillingValveJogFwdBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="FillingValveJogFwdBtn_PreviewMouseLeftButtonUp"/>
+                    <Button x:Name="FillingValveJogRevBtn" Content="中转阀反向点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="FillingValveJogRevBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="FillingValveJogRevBtn_PreviewMouseLeftButtonUp"/>
+                    <Button x:Name="FillingValveHomeBtn" Content="中转阀回原点" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="FillingValveHomeBtn_PreviewMouseLeftButtonDown" />
+                    <Button x:Name="BeltsJogBtn" Content="传送带点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="BeltsJogBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="BeltsJogBtn_PreviewMouseLeftButtonUp"/>
+                    <Button x:Name="ShakeTableJogBtn" Content="震盘点动" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="ShakeTableJogBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="ShakeTableJogBtn_PreviewMouseLeftButtonUp"/>
+                    <Button x:Name="MachineManualUpBtn" Content="整机上升" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="MachineManualUpBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="MachineManualUpBtn_PreviewMouseLeftButtonUp"/>
+                    <Button x:Name="MachineManualDownBtn" Content="整机下降" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="MachineManualDownBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="MachineManualDownBtn_PreviewMouseLeftButtonUp"/>
+                    <Button x:Name="FunnelValveManualControlBtn" Content="漏斗" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="FunnelValveManualControlBtn_PreviewMouseLeftButtonDown" />
+                    <Button x:Name="MachineManualBeltsBtn" Content="传送带运行状态" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="MachineManualBeltsBtn_PreviewMouseLeftButtonDown" />
+                    <Button x:Name="MachineAirLockValveBtn" Content="气锁" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="MachineAirLockValveBtn_PreviewMouseLeftButtonDown" />
+                    <Button x:Name="ShakeTable_TestBtn" Content="震台调试开关" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="ShakeTable_TestBtn_PreviewMouseLeftButtonDown" />
+                    <Button x:Name="DataResetBtn" Content="数据清零" HorizontalAlignment="Left" Margin="40,0,0,0" Height="40" Width="90" PreviewMouseLeftButtonDown="DataResetBtn_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="DataResetBtn_PreviewMouseLeftButtonUp" />
                 </WrapPanel>
-                <StackPanel Orientation="Vertical" Grid.Column="1">
-                    <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
-                        <Label Content="使能完成:"></Label>
-                        <Ellipse Width="20" Height="20" Margin="48,0,0,0" >
-                            <Ellipse.Style>
-                                <Style TargetType="Ellipse">
-                                    <Setter Property="Fill" Value="Red" />
-                                    <Style.Triggers>
-                                        <DataTrigger Binding="{Binding EnableCompletion}" Value="True">
-                                            <Setter Property="Fill" Value="Green" />
-                                        </DataTrigger>
-                                    </Style.Triggers>
-                                </Style>
-                            </Ellipse.Style>
-                        </Ellipse>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
-                        <Label Content="回零完成:"></Label>
-                        <Ellipse Width="20" Height="20" Margin="48,0,0,0">
-                            <Ellipse.Style>
-                                <Style TargetType="Ellipse">
-                                    <Setter Property="Fill" Value="Red" />
-                                    <Style.Triggers>
-                                        <DataTrigger Binding="{Binding ReturnToZeroCompletion}" Value="True">
-                                            <Setter Property="Fill" Value="Green" />
-                                        </DataTrigger>
-                                    </Style.Triggers>
-                                </Style>
-                            </Ellipse.Style>
-                        </Ellipse>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
-                        <Label Content="停止完成:"></Label>
-                        <Ellipse Width="20" Height="20" Margin="48,0,0,0">
-                            <Ellipse.Style>
-                                <Style TargetType="Ellipse">
-                                    <Setter Property="Fill" Value="Red" />
-                                    <Style.Triggers>
-                                        <DataTrigger Binding="{Binding StopCompletion}" Value="True">
-                                            <Setter Property="Fill" Value="Green" />
-                                        </DataTrigger>
-                                    </Style.Triggers>
-                                </Style>
-                            </Ellipse.Style>
-                        </Ellipse>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
-                        <Label Content="速度运行中:"></Label>
-                        <Ellipse Width="20" Height="20" Margin="36,0,0,0">
-                            <Ellipse.Style>
-                                <Style TargetType="Ellipse">
-                                    <Setter Property="Fill" Value="Red" />
-                                    <Style.Triggers>
-                                        <DataTrigger Binding="{Binding SpeedRunning}" Value="True">
-                                            <Setter Property="Fill" Value="Green" />
-                                        </DataTrigger>
-                                    </Style.Triggers>
-                                </Style>
-                            </Ellipse.Style>
-                        </Ellipse>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
-                        <Label Content="回零中:"></Label>
-                        <Ellipse Width="20" Height="20" Margin="60,0,0,0">
-                            <Ellipse.Style>
-                                <Style TargetType="Ellipse">
-                                    <Setter Property="Fill" Value="Red" />
-                                    <Style.Triggers>
-                                        <DataTrigger Binding="{Binding ReturnToZero}" Value="True">
-                                            <Setter Property="Fill" Value="Green" />
-                                        </DataTrigger>
-                                    </Style.Triggers>
-                                </Style>
-                            </Ellipse.Style>
-                        </Ellipse>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
-                        <Label Content="中转阀开定位完成:"></Label>
-                        <Ellipse Width="20" Height="20">
-                            <Ellipse.Style>
-                                <Style TargetType="Ellipse">
-                                    <Setter Property="Fill" Value="Red" />
-                                    <Style.Triggers>
-                                        <DataTrigger Binding="{Binding TransferValveOpenCompletion}" Value="True">
-                                            <Setter Property="Fill" Value="Green" />
-                                        </DataTrigger>
-                                    </Style.Triggers>
-                                </Style>
-                            </Ellipse.Style>
-                        </Ellipse>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
-                        <Label Content="中转阀关定位完成:"></Label>
-                        <Ellipse Width="20" Height="20">
-                            <Ellipse.Style>
-                                <Style TargetType="Ellipse">
-                                    <Setter Property="Fill" Value="Red" />
-                                    <Style.Triggers>
-                                        <DataTrigger Binding="{Binding TransferValveCloseCompletion}" Value="True">
-                                            <Setter Property="Fill" Value="Green" />
-                                        </DataTrigger>
-                                    </Style.Triggers>
-                                </Style>
-                            </Ellipse.Style>
-                        </Ellipse>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
-                        <Label Content="允许数据交换:"></Label>
-                        <Ellipse Width="20" Height="20" Margin="24,0,0,0">
-                            <Ellipse.Style>
-                                <Style TargetType="Ellipse">
-                                    <Setter Property="Fill" Value="Red" />
-                                    <Style.Triggers>
-                                        <DataTrigger Binding="{Binding AllowsDataExchange}" Value="True">
-                                            <Setter Property="Fill" Value="Green" />
-                                        </DataTrigger>
-                                    </Style.Triggers>
-                                </Style>
-                            </Ellipse.Style>
-                        </Ellipse>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
-                        <Label Content="暂停获取数据:"></Label>
-                        <Ellipse Width="20" Height="20" Margin="24,0,0,0">
-                            <Ellipse.Style>
-                                <Style TargetType="Ellipse">
-                                    <Setter Property="Fill" Value="Red" />
-                                    <Style.Triggers>
-                                        <DataTrigger Binding="{Binding PauseDataExchange}" Value="True">
-                                            <Setter Property="Fill" Value="Green" />
-                                        </DataTrigger>
-                                    </Style.Triggers>
-                                </Style>
-                            </Ellipse.Style>
-                        </Ellipse>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
-                        <Label Content="缓存计数延时完成:"></Label>
-                        <Ellipse Width="20" Height="20">
-                            <Ellipse.Style>
-                                <Style TargetType="Ellipse">
-                                    <Setter Property="Fill" Value="Red" />
-                                    <Style.Triggers>
-                                        <DataTrigger Binding="{Binding CacheCountDelayed}" Value="True">
-                                            <Setter Property="Fill" Value="Green" />
-                                        </DataTrigger>
-                                    </Style.Triggers>
-                                </Style>
-                            </Ellipse.Style>
-                        </Ellipse>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
-                        <Label Content="使能:"></Label>
-                        <Ellipse Width="20" Height="20" Margin="72,0,0,0">
-                            <Ellipse.Style>
-                                <Style TargetType="Ellipse">
-                                    <Setter Property="Fill" Value="Red" />
-                                    <Style.Triggers>
-                                        <DataTrigger Binding="{Binding Enable}" Value="True">
-                                            <Setter Property="Fill" Value="Green" />
-                                        </DataTrigger>
-                                    </Style.Triggers>
-                                </Style>
-                            </Ellipse.Style>
-                        </Ellipse>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
-                        <Label Content="送瓶轮使能完成:"></Label>
-                        <Ellipse Width="20" Height="20" Margin="12,0,0,0">
-                            <Ellipse.Style>
-                                <Style TargetType="Ellipse">
-                                    <Setter Property="Fill" Value="Red" />
-                                    <Style.Triggers>
-                                        <DataTrigger Binding="{Binding BottleFeedingWheelEnableCompletion}" Value="True">
-                                            <Setter Property="Fill" Value="Green" />
-                                        </DataTrigger>
-                                    </Style.Triggers>
-                                </Style>
-                            </Ellipse.Style>
-                        </Ellipse>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
-                        <Label Content="送瓶轮停止完成:"></Label>
-                        <Ellipse Width="20" Height="20" Margin="12,0,0,0">
-                            <Ellipse.Style>
-                                <Style TargetType="Ellipse">
-                                    <Setter Property="Fill" Value="Red" />
-                                    <Style.Triggers>
-                                        <DataTrigger Binding="{Binding BottleFeedingWheelStopCompletion}" Value="True">
-                                            <Setter Property="Fill" Value="Green" />
-                                        </DataTrigger>
-                                    </Style.Triggers>
-                                </Style>
-                            </Ellipse.Style>
-                        </Ellipse>
-                    </StackPanel>
-                </StackPanel>
             </Grid>
         </Grid>
     </Grid>

+ 86 - 159
CCDCountWpf/WpfPage/PlcOperationPage.xaml.cs

@@ -27,294 +27,221 @@ namespace CCDCountWpf.WpfPage
             this.Height = Double.NaN;
             DataContext = PlcSettingMessageBus.PlcMessageShowBindage;
         }
-        /// <summary>
-        /// 归零按钮按下事件
-        /// </summary>
-        private void ReturnToZeroBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
-        {
-            PlcSettingMessageBus.pLCManagement.ReturnToZeroToTrue();
-        }
-
-        /// <summary>
-        /// 归零按钮抬起事件
-        /// </summary>
-        private void ReturnToZeroBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
-        {
-            PlcSettingMessageBus.pLCManagement.ReturnToZeroToFalse();
-        }
-
-        /// <summary>
-        /// 复位按钮按下事件
-        /// </summary>
-        private void RepositionBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
-        {
-            PlcSettingMessageBus.pLCManagement.RepositionToTrue();
-        }
-
-        /// <summary>
-        /// 复位按钮抬起事件
-        /// </summary>
-        private void RepositionBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
-        {
-            PlcSettingMessageBus.pLCManagement.RepositionToFalse();
-        }
-
-        /// <summary>
-        /// 轴停止按钮按下事件
-        /// </summary>
-        private void ShaftStopsBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
-        {
-            PlcSettingMessageBus.pLCManagement.ShaftStopsToTrue();
-        }
 
         /// <summary>
-        /// 轴停止按钮抬起事件
-        /// </summary>
-        private void ShaftStopsBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
-        {
-            PlcSettingMessageBus.pLCManagement.ShaftStopsToFalse();
-        }
-
-        /// <summary>
-        /// 正转点动按钮按下事件
+        /// 开始按钮按下事件
         /// </summary>
-        private void ForwardRotatingJogBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void InitiateBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.ForwardRotatingJogToTrue();
+            PlcSettingMessageBus.pLCManagement.MachineRunToTrue();
         }
 
         /// <summary>
-        /// 正转点动按钮抬起事件
+        /// 开始按钮抬起事件
         /// </summary>
-        private void ForwardRotatingJogBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        private void InitiateBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.ForwardRotatingJogToFalse();
+            //pLCManagement.InitiateToFalse();
         }
 
         /// <summary>
-        /// 反转点动按钮按下事件
+        /// 停止按钮按下事件
         /// </summary>
-        private void ReversalReverseJogBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void StopBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.ReversalReverseJogToTrue();
+            PlcSettingMessageBus.pLCManagement.MachineStopToTrue();
         }
 
         /// <summary>
-        /// 反转点动按钮抬起事件
+        /// 停止按钮抬起事件
         /// </summary>
-        private void ReversalReverseJogBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        private void StopBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.ReversalReverseJogToFalse();
+            //pLCManagement.StopToFalse();
         }
-
-        /// <summary>
-        /// 速度运行按钮按下事件
-        /// </summary>
-        private void SpeedRunBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void Valve1Jog_Click(object sender, RoutedEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SpeedRunToTrue();
+            PlcSettingMessageBus.pLCManagement.SwitchValveManualControl(0);
         }
 
-        /// <summary>
-        /// 速度运行按钮抬起事件
-        /// </summary>
-        private void SpeedRunBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        private void Valve2Jog_Click(object sender, RoutedEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SpeedRunToFalse();
+            PlcSettingMessageBus.pLCManagement.SwitchValveManualControl(1);
         }
 
-        /// <summary>
-        /// 设备运行按钮按下事件
-        /// </summary>
-        private void EquipmentOperationBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void Valve3Jog_Click(object sender, RoutedEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.EquipmentOperationToTrue();
+            PlcSettingMessageBus.pLCManagement.SwitchValveManualControl(2);
         }
 
-        /// <summary>
-        /// 设备运行按钮抬起事件
-        /// </summary>
-        private void EquipmentOperationBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        private void Valve4Jog_Click(object sender, RoutedEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.EquipmentOperationToFalse();
+            PlcSettingMessageBus.pLCManagement.SwitchValveManualControl(3);
         }
 
-        /// <summary>
-        /// 开始按钮按下事件
-        /// </summary>
-        private void InitiateBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void Valve5Jog_Click(object sender, RoutedEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.InitiateToTrue();
+            PlcSettingMessageBus.pLCManagement.SwitchValveManualControl(4);
         }
 
-        /// <summary>
-        /// 开始按钮抬起事件
-        /// </summary>
-        private void InitiateBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        private void Valve6Jog_Click(object sender, RoutedEventArgs e)
         {
-            //pLCManagement.InitiateToFalse();
+            PlcSettingMessageBus.pLCManagement.SwitchValveManualControl(5);
         }
 
-        /// <summary>
-        /// 停止按钮按下事件
-        /// </summary>
-        private void StopBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void Valve7Jog_Click(object sender, RoutedEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.StopToTrue();
+            PlcSettingMessageBus.pLCManagement.SwitchValveManualControl(6);
         }
 
-        /// <summary>
-        /// 停止按钮抬起事件
-        /// </summary>
-        private void StopBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        private void Valve8Jog_Click(object sender, RoutedEventArgs e)
         {
-            //pLCManagement.StopToFalse();
+            PlcSettingMessageBus.pLCManagement.SwitchValveManualControl(7);
         }
 
-        private void Button_Click(object sender, RoutedEventArgs e)
+        private void ScrewHomeBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchEnable();
+            PlcSettingMessageBus.pLCManagement.ScrewHomeToTrue();
         }
 
-        private void LevelOneVibrationTableBtn_Click(object sender, RoutedEventArgs e)
+        private void ScrewJogFwdBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchLevelOneVibrationTable();
+            PlcSettingMessageBus.pLCManagement.ScrewJogFwdToTrue();
         }
 
-        private void LevelTwoVibrationTableBtn_Click(object sender, RoutedEventArgs e)
+        private void ScrewJogFwdBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchLevelTwoVibrationTable();
+            PlcSettingMessageBus.pLCManagement.ScrewJogFwdToFalse();
         }
 
-        private void LevelThreeVibrationTableBtn_Click(object sender, RoutedEventArgs e)
+        private void ScrewJogRevBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchLevelThreeVibrationTable();
+            PlcSettingMessageBus.pLCManagement.ScrewJogRevToTrue();
         }
 
-        private void DeviceUpBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void ScrewJogRevBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteDeviceUpToTrue();
+            PlcSettingMessageBus.pLCManagement.ScrewJogRevToFalse();
         }
 
-        private void DeviceUpBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        private void FillingValveManualOpenBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteDeviceUpToFalse();
+            PlcSettingMessageBus.pLCManagement.FillingValveManualOpenToTrue();
         }
 
-        private void DeviceDownBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void FillingValveManualCloseBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteDeviceDownToTrue();
+            PlcSettingMessageBus.pLCManagement.FillingValveManualCloseToTrue();
         }
 
-        private void DeviceDownBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        private void FillingValveManualCacheBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteDeviceDownToFalse();
+            PlcSettingMessageBus.pLCManagement.FillingValveManualCache();
         }
 
-        private void TransferStartBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveJogFwdBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchTransferStart();
+            PlcSettingMessageBus.pLCManagement.FillingValveJogFwdToTrue();
         }
 
-        private void AirValveCloseBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveJogFwdBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchAirValveClose();
+            PlcSettingMessageBus.pLCManagement.FillingValveJogFwdToFalse();
         }
 
-        private void BottleFeedingWheelResetBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void FillingValveJogRevBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelResetToTrue();
+            PlcSettingMessageBus.pLCManagement.FillingValveJogRevToTrue();
         }
 
-        private void BottleFeedingWheelResetBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        private void FillingValveJogRevBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelResetToFalse();
+            PlcSettingMessageBus.pLCManagement.FillingValveJogRevToFalse();
         }
 
-        private void BottleFeedingWheelReturnToZeroBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void FillingValveHomeBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelReturnToZeroToTrue();
+            PlcSettingMessageBus.pLCManagement.FillingValveHomeToTrue();
         }
 
-        private void BottleFeedingWheelReturnToZeroBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        private void BeltsJogBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelReturnToZeroToFalse();
+            PlcSettingMessageBus.pLCManagement.BeltsJogToTrue();
         }
 
-        private void BottleFeedingWheelShaftStopsBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void BeltsJogBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelShaftStopsToTrue();
+            PlcSettingMessageBus.pLCManagement.BeltsJogToFalse();
         }
 
-        private void BottleFeedingWheelShaftStopsBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        private void ShakeTableJogBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelShaftStopsToFalse();
+            PlcSettingMessageBus.pLCManagement.ShakeTableJogToTrue();
         }
 
-        private void BottleFeedingWheelPositiveRotationJogBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void ShakeTableJogBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelPositiveRotationJogToTrue();
+            PlcSettingMessageBus.pLCManagement.ShakeTableJogToFalse();
         }
 
-        private void Valve1Jog_Click(object sender, RoutedEventArgs e)
+        private void MachineManualUpBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchValveJog(0);
+            PlcSettingMessageBus.pLCManagement.MachineManualUpToTrue();
         }
 
-        private void Valve2Jog_Click(object sender, RoutedEventArgs e)
+        private void MachineManualUpBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchValveJog(1);
+            PlcSettingMessageBus.pLCManagement.MachineManualUpToFalse();
         }
 
-        private void Valve3Jog_Click(object sender, RoutedEventArgs e)
+        private void MachineManualDownBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchValveJog(2);
+            PlcSettingMessageBus.pLCManagement.MachineManualDownToTrue();
         }
 
-        private void Valve4Jog_Click(object sender, RoutedEventArgs e)
+        private void MachineManualDownBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchValveJog(3);
+            PlcSettingMessageBus.pLCManagement.MachineManualDownToFalse();
         }
 
-        private void Valve5Jog_Click(object sender, RoutedEventArgs e)
+        private void FunnelValveManualControlBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchValveJog(4);
+            PlcSettingMessageBus.pLCManagement.SwitchFunnelValveManualControl();
         }
 
-        private void Valve6Jog_Click(object sender, RoutedEventArgs e)
+        private void MachineManualBeltsBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchValveJog(5);
+            PlcSettingMessageBus.pLCManagement.SwitchMachineManualControl();
         }
 
-        private void Valve7Jog_Click(object sender, RoutedEventArgs e)
+        private void MachineAirLockValveBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchValveJog(6);
+            PlcSettingMessageBus.pLCManagement.SwitchMachineAirLockValve();
         }
 
-        private void Valve8Jog_Click(object sender, RoutedEventArgs e)
+        private void FillingValveManualOpenBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchValveJog(7);
+            PlcSettingMessageBus.pLCManagement.FillingValveManualOpenToFalse();
         }
 
-        private void BottleFeedingWheelEnableBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveManualCloseBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.SwitchBottleFeedingWheelEnable();
+            PlcSettingMessageBus.pLCManagement.FillingValveManualCloseToFalse();
         }
 
-
-        private void BottleFeedingWheelPositiveRotationJogBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        private void DataResetBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelPositiveRotationJogToFalse();
+            PlcSettingMessageBus.pLCManagement.DataResetToTrue();
         }
 
-        private void BottleFeedingWheelReverseRotationJogBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void DataResetBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelReverseRotationJogToTrue();
+            PlcSettingMessageBus.pLCManagement.DataResetToFalse();
         }
 
-        private void BottleFeedingWheelReverseRotationJogBtn_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        private void ShakeTable_TestBtn_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            PlcSettingMessageBus.pLCManagement.WriteBottleFeedingWheelReverseRotationJogToFalse();
+            PlcSettingMessageBus.pLCManagement.SwitchShakeTable_Test();
         }
     }
 }

+ 230 - 150
CCDCountWpf/WpfPage/PlcSettingPage.xaml

@@ -5,235 +5,315 @@
       xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
       xmlns:local="clr-namespace:CCDCountWpf.WpfPage"
       mc:Ignorable="d"
-      Title="PlcSettingPage" Width="1002" Height="674">
+      Title="PlcSettingPage" Width="1002" Height="1200">
     <Grid>
-        <Grid x:Name="ShowGrid">
+        <Grid x:Name="ShowGrid" Margin="0,0,0,0">
+            <Button x:Name="ReloadBtn" Height="50" Width="80" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" Click="ReloadBtn_Click"></Button>
             <WrapPanel Orientation="Horizontal" Grid.Column="0"
                            ItemHeight="50" ItemWidth="300" HorizontalAlignment="Left"
-                           VerticalAlignment="Top">
+                           VerticalAlignment="Top" Margin="0,60,0,0">
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="速度模式运行速度:" FontSize="16" Margin="5,0,16,0" VerticalAlignment="Center"/>
-                    <Button x:Name="SpeedModeRunningSpeedUpBtn" Content="+" Width="30" Height="30" Click="SpeedModeRunningSpeedUpBtn_Click" />
-                    <TextBox Text="{Binding SpeedModeRunningSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="SpeedModeRunningSpeedDownBtn" Content="-" Width="30" Click="SpeedModeRunningSpeedDownBtn_Click" />
+                    <TextBlock Text="罐装料筒震台高速值:" FontSize="16" Margin="5,0,0,0" VerticalAlignment="Center"/>
+                    <Button x:Name="ShakeTable1H_FillingSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable1H_FillingSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable1H_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable1H_FillingSpeedDownBtn" Content="-" Width="30" Click="ShakeTable1H_FillingSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="点动速度:" FontSize="16" Margin="5,0,80,0" VerticalAlignment="Center"/>
-                    <Button x:Name="JogSpeedUpBtn" Content="+" Width="30" Height="30" Click="JogSpeedUpBtn_Click" />
-                    <TextBox Text="{Binding JogSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="JogSpeedDownBtn" Content="-" Width="30" Click="JogSpeedDownBtn_Click" />
+                    <TextBlock Text="罐装过滤震台高速值:" FontSize="16" Margin="5,0,0,0" VerticalAlignment="Center"/>
+                    <Button x:Name="ShakeTable2H_FillingSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable2H_FillingSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable2H_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable2H_FillingSpeedDownBtn" Content="-" Width="30" Click="ShakeTable2H_FillingSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="瓶装设定值:" FontSize="16" Margin="5,0,64,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottValueSetUpBtn" Content="+" Width="30" Height="30" Click="BottValueSetUpBtn_Click" />
-                    <TextBox Text="{Binding BottValueSet,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottValueSetDownBtn" Content="-" Width="30" Click="BottValueSetDownBtn_Click" />
+                    <TextBlock Text="罐装计数震台高速值:" FontSize="16" Margin="5,0,0,0" VerticalAlignment="Center"/>
+                    <Button x:Name="ShakeTable3H_FillingSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable3H_FillingSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable3H_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable3H_FillingSpeedDownBtn" Content="-" Width="30" Click="ShakeTable3H_FillingSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="中转阀打开速度:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
-                    <Button x:Name="TransferValveOpeningSpeedUpBtn" Content="+" Width="30" Height="30" Click="TransferValveOpeningSpeedUpBtn_Click" />
-                    <TextBox Text="{Binding TransferValveOpeningSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="TransferValveOpeningSpeedDownBtn" Content="-" Width="30" Click="TransferValveOpeningSpeedDownBtn_Click" />
+                    <TextBlock Text="罐装料筒震台减速值:" FontSize="16" Margin="5,0,0,0" VerticalAlignment="Center"/>
+                    <Button x:Name="ShakeTable1M_FillingSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable1M_FillingSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable1M_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable1M_FillingSpeedDownBtn" Content="-" Width="30" Click="ShakeTable1M_FillingSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="中转阀打开时间:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
-                    <Button x:Name="TransferValveOpeningTimeUpBtn" Content="+" Width="30" Height="30" Click="TransferValveOpeningTimeUpBtn_Click" />
-                    <TextBox Text="{Binding TransferValveOpeningTime,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="TransferValveOpeningTimeDownBtn" Content="-" Width="30" Click="TransferValveOpeningTimeDownBtn_Click" />
+                    <TextBlock Text="罐装过滤震台减速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
+                    <Button x:Name="ShakeTable2M_FillingSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable2M_FillingSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable2M_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable2M_FillingSpeedDownBtn" Content="-" Width="30" Click="ShakeTable2M_FillingSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="罐装减速值:" FontSize="16" Margin="5,0,64,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottingDecelerationValueUpBtn" Content="+" Width="30" Height="30" Click="BottingDecelerationValueUpBtn_Click" />
-                    <TextBox Text="{Binding BottingDecelerationValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottingDecelerationValueDownBtn" Content="-" Width="30" Click="BottingDecelerationValueDownBtn_Click" />
+                    <TextBlock Text="罐装计数震台减速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
+                    <Button x:Name="ShakeTable3M_FillingSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable3M_FillingSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable3M_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable3M_FillingSpeedDownBtn" Content="-" Width="30" Click="ShakeTable3M_FillingSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="缓存减速值:" FontSize="16" Margin="5,0,64,0" VerticalAlignment="Center"/>
-                    <Button x:Name="CacheDecelerationValueUpBtn" Content="+" Width="30" Height="30" Click="CacheDecelerationValueUpBtn_Click" />
-                    <TextBox Text="{Binding CacheDecelerationValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="CacheDecelerationValueDownBtn" Content="-" Width="30" Click="CacheDecelerationValueDownBtn_Click" />
+                    <TextBlock Text="罐装料筒震台低速值:" FontSize="16" Margin="5,0,0,0" VerticalAlignment="Center"/>
+                    <Button x:Name="ShakeTable1L_FillingSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable1L_FillingSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable1L_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable1L_FillingSpeedDownBtn" Content="-" Width="30" Click="ShakeTable1L_FillingSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="缓存计数延迟时间:" FontSize="16" Margin="5,0,16,0" VerticalAlignment="Center"/>
-                    <Button x:Name="CacheCountDelayTimingUpBtn" Content="+" Width="30" Height="30" Click="CacheCountDelayTimingUpBtn_Click" />
-                    <TextBox Text="{Binding CacheCountDelayTiming,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="CacheCountDelayTimingDownBtn" Content="-" Width="30" Click="CacheCountDelayTimingDownBtn_Click" />
+                    <TextBlock Text="罐装过滤震台低速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
+                    <Button x:Name="ShakeTable2L_FillingSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable2L_FillingSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable2L_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable2L_FillingSpeedDownBtn" Content="-" Width="30" Click="ShakeTable2L_FillingSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="缓存停机值:" FontSize="16" Margin="5,0,64,0" VerticalAlignment="Center"/>
-                    <Button x:Name="CacheShutdownValueUpBtn" Content="+" Width="30" Height="30" Click="CacheShutdownValueUpBtn_Click" />
-                    <TextBox Text="{Binding CacheShutdownValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="CacheShutdownValueDownBtn" Content="-" Width="30" Click="CacheShutdownValueDownBtn_Click" />
+                    <TextBlock Text="罐装计数震台低速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
+                    <Button x:Name="ShakeTable3L_FillingSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable3L_FillingSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable3L_FillingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable3L_FillingSpeedDownBtn" Content="-" Width="30" Click="ShakeTable3L_FillingSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="罐装料筒震台高速值:" FontSize="16" Margin="5,0,0,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="BottingMaterialCylinderVibrationTableHighSpeedValueUpBtn_Click" />
-                    <TextBox Text="{Binding BottingMaterialCylinderVibrationTableHighSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueDownBtn" Content="-" Width="30" Click="BottingMaterialCylinderVibrationTableHighSpeedValueDownBtn_Click" />
+                    <TextBlock Text="缓存料筒震台高速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
+                    <Button x:Name="ShakeTable1H_CacheSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable1H_CacheSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable1H_CacheSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable1H_CacheSpeedDownBtn" Content="-" Width="30" Click="ShakeTable1H_CacheSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="罐装过滤震台高速值:" FontSize="16" Margin="5,0,0,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottingFilterVibrationTableHighSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="BottingFilterVibrationTableHighSpeedValueUpBtn_Click" />
-                    <TextBox Text="{Binding BottingFilterVibrationTableHighSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottingFilterVibrationTableHighSpeedValueDownBtn" Content="-" Width="30" Click="BottingFilterVibrationTableHighSpeedValueDownBtn_Click" />
+                    <TextBlock Text="缓存过滤震台高速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
+                    <Button x:Name="ShakeTable2H_CacheSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable2H_CacheSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable2H_CacheSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable2H_CacheSpeedDownBtn" Content="-" Width="30" Click="ShakeTable2H_CacheSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="罐装计数震台高速值:" FontSize="16" Margin="5,0,0,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottingCountVibrationTableHighSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="BottingCountVibrationTableHighSpeedValueUpBtn_Click" />
-                    <TextBox Text="{Binding BottingCountVibrationTableHighSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottingCountVibrationTableHighSpeedValueDownBtn" Content="-" Width="30" Click="BottingCountVibrationTableHighSpeedValueDownBtn_Click" />
+                    <TextBlock Text="缓存计数震台高速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
+                    <Button x:Name="ShakeTable3H_CacheSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable3H_CacheSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable3H_CacheSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable3H_CacheSpeedDownBtn" Content="-" Width="30" Click="ShakeTable3H_CacheSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="罐装料筒震台减速值:" FontSize="16" Margin="5,0,0,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottingMaterialCylinderVibrationTableDecelerationSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="BottingMaterialCylinderVibrationTableDecelerationSpeedValueUpBtn_Click" />
-                    <TextBox Text="{Binding BottingMaterialCylinderVibrationTableDecelerationSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottingMaterialCylinderVibrationTableDecelerationSpeedValueDownBtn" Content="-" Width="30" Click="BottingMaterialCylinderVibrationTableDecelerationSpeedValueDownBtn_Click" />
+                    <TextBlock Text="缓存料筒震台减速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
+                    <Button x:Name="ShakeTable1M_CacheSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable1M_CacheSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable1M_CacheSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable1M_CacheSpeedDownBtn" Content="-" Width="30" Click="ShakeTable1M_CacheSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="罐装过滤震台减速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
-                    <Button x:Name="BottingFilterVibrationTableDecelerationSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="BottingFilterVibrationTableDecelerationSpeedValueUpBtn_Click" />
-                    <TextBox Text="{Binding BottingFilterVibrationTableDecelerationSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottingFilterVibrationTableDecelerationSpeedValueDownBtn" Content="-" Width="30" Click="BottingFilterVibrationTableDecelerationSpeedValueDownBtn_Click" />
+                    <TextBlock Text="缓存过滤震台减速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
+                    <Button x:Name="ShakeTable2M_CacheSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable2M_CacheSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable2M_CacheSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable2M_CacheSpeedDownBtn" Content="-" Width="30" Click="ShakeTable2M_CacheSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="罐装计数震台减速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
-                    <Button x:Name="BottingCountVibrationTableDecelerationSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="BottingCountVibrationTableDecelerationSpeedValueUpBtn_Click" />
-                    <TextBox Text="{Binding BottingCountVibrationTableDecelerationSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottingCountVibrationTableDecelerationSpeedValueDownBtn" Content="-" Width="30" Click="BottingCountVibrationTableDecelerationSpeedValueDownBtn_Click" />
+                    <TextBlock Text="缓存计数震台减速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
+                    <Button x:Name="ShakeTable3M_CacheSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable3M_CacheSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable3M_CacheSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable3M_CacheSpeedDownBtn" Content="-" Width="30" Click="ShakeTable3M_CacheSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="缓存料筒震台速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
-                    <Button x:Name="CacheMaterialCylinderVibrationTableHighSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="CacheMaterialCylinderVibrationTableHighSpeedValueUpBtn_Click" />
-                    <TextBox Text="{Binding CacheMaterialCylinderVibrationTableHighSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="CacheMaterialCylinderVibrationTableHighSpeedValueDownBtn" Content="-" Width="30" Click="CacheMaterialCylinderVibrationTableHighSpeedValueDownBtn_Click" />
+                    <TextBlock Text="缓存料筒震台速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
+                    <Button x:Name="ShakeTable1L_CacheSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable1L_CacheSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable1L_CacheSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable1L_CacheSpeedDownBtn" Content="-" Width="30" Click="ShakeTable1L_CacheSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="缓存过滤震台速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
-                    <Button x:Name="CacheFilterVibrationTableHighSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="CacheFilterVibrationTableHighSpeedValueUpBtn_Click" />
-                    <TextBox Text="{Binding CacheFilterVibrationTableHighSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="CacheFilterVibrationTableHighSpeedValueDownBtn" Content="-" Width="30" Click="CacheFilterVibrationTableHighSpeedValueDownBtn_Click" />
+                    <TextBlock Text="缓存过滤震台速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
+                    <Button x:Name="ShakeTable2L_CacheSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable2L_CacheSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable2L_CacheSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable2L_CacheSpeedDownBtn" Content="-" Width="30" Click="ShakeTable2L_CacheSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="缓存计数震台速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
-                    <Button x:Name="CacheCountVibrationTableHighSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="CacheCountVibrationTableHighSpeedValueUpBtn_Click" />
-                    <TextBox Text="{Binding CacheCountVibrationTableHighSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="CacheCountVibrationTableHighSpeedValueDownBtn" Content="-" Width="30" Click="CacheCountVibrationTableHighSpeedValueDownBtn_Click" />
+                    <TextBlock Text="缓存计数震台速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
+                    <Button x:Name="ShakeTable3L_CacheSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable3L_CacheSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable3L_CacheSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable3L_CacheSpeedDownBtn" Content="-" Width="30" Click="ShakeTable3L_CacheSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="缓存料筒震台减速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
-                    <Button x:Name="CacheMaterialCylinderVibrationTableDecelerationSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="CacheMaterialCylinderVibrationTableDecelerationSpeedValueUpBtn_Click" />
-                    <TextBox Text="{Binding CacheMaterialCylinderVibrationTableDecelerationSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="CacheMaterialCylinderVibrationTableDecelerationSpeedValueDownBtn" Content="-" Width="30" Click="CacheMaterialCylinderVibrationTableDecelerationSpeedValueDownBtn_Click" />
+                    <TextBlock Text="料筒震台测试速度:" FontSize="16" VerticalAlignment="Center" Margin="5,0,16,0"/>
+                    <Button x:Name="ShakeTable1_TestSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable1_TestSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable1_TestSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable1_TestSpeedDownBtn" Content="-" Width="30" Click="ShakeTable1_TestSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="缓存过滤震台减速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
-                    <Button x:Name="CacheFilterVibrationTableDecelerationSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="CacheFilterVibrationTableDecelerationSpeedValueUpBtn_Click" />
-                    <TextBox Text="{Binding CacheFilterVibrationTableDecelerationSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="CacheFilterVibrationTableDecelerationSpeedValueDownBtn" Content="-" Width="30" Click="CacheFilterVibrationTableDecelerationSpeedValueDownBtn_Click" />
+                    <TextBlock Text="过滤震台测试速度:" FontSize="16" VerticalAlignment="Center" Margin="5,0,16,0"/>
+                    <Button x:Name="ShakeTable2_TestSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable2_TestSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable2_TestSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable2_TestSpeedDownBtn" Content="-" Width="30" Click="ShakeTable2_TestSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="缓存计数震台减速值:" FontSize="16" VerticalAlignment="Center" Margin="5,0,0,0"/>
-                    <Button x:Name="CacheCountVibrationTableDecelerationSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="CacheCountVibrationTableDecelerationSpeedValueUpBtn_Click" />
-                    <TextBox Text="{Binding CacheCountVibrationTableDecelerationSpeedValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="CacheCountVibrationTableDecelerationSpeedValueDownBtn" Content="-" Width="30" Click="CacheCountVibrationTableDecelerationSpeedValueDownBtn_Click" />
+                    <TextBlock Text="计数震台测试速度:" FontSize="16" VerticalAlignment="Center" Margin="5,0,16,0"/>
+                    <Button x:Name="ShakeTable3_TestSpeedUpBtn" Content="+" Width="30" Height="30" Click="ShakeTable3_TestSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ShakeTable3_TestSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ShakeTable3_TestSpeedDownBtn" Content="-" Width="30" Click="ShakeTable3_TestSpeedDownBtn_Click" />
+                </StackPanel>
+                <StackPanel Height="30" Orientation="Horizontal">
+                    <TextBlock Text="罐装高速区间:" FontSize="16" VerticalAlignment="Center" Margin="5,0,48,0"/>
+                    <Button x:Name="FillingH_SpeedRatioUpBtn" Content="+" Width="30" Height="30" Click="FillingH_SpeedRatioUpBtn_Click" />
+                    <TextBox Text="{Binding FillingH_SpeedRatio,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="FillingH_SpeedRatioDownBtn" Content="-" Width="30" Click="FillingH_SpeedRatioDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="阀门打开延时:" FontSize="16" Margin="5,0,48,0" VerticalAlignment="Center"/>
-                    <Button x:Name="GateOpeningDelayUpBtn" Content="+" Width="30" Height="30" Click="GateOpeningDelayUpBtn_Click" />
-                    <TextBox Text="{Binding GateOpeningDelay,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="GateOpeningDelayDownBtn" Content="-" Width="30" Click="GateOpeningDelayDownBtn_Click" />
+                    <TextBlock Text="罐装减速区间:" FontSize="16" VerticalAlignment="Center" Margin="5,0,48,0"/>
+                    <Button x:Name="FillingM_SpeedRatioUpBtn" Content="+" Width="30" Height="30" Click="FillingM_SpeedRatioUpBtn_Click" />
+                    <TextBox Text="{Binding FillingM_SpeedRatio,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="FillingM_SpeedRatioDownBtn" Content="-" Width="30" Click="FillingM_SpeedRatioDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="回零偏移值:" FontSize="16" Margin="5,0,64,0" VerticalAlignment="Center"/>
-                    <Button x:Name="ReturnToZeroOffsetValueUpDownBtn" Content="+" Width="30" Height="30" Click="ReturnToZeroOffsetValueUpDownBtn_Click" />
-                    <TextBox Text="{Binding ReturnToZeroOffsetValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="ReturnToZeroOffsetValueDownBtn" Content="-" Width="30" Click="ReturnToZeroOffsetValueDownBtn_Click" />
+                    <TextBlock Text="罐装低速区间:" FontSize="16" VerticalAlignment="Center" Margin="5,0,48,0"/>
+                    <Button x:Name="FillingL_SpeedRatioUpBtn" Content="+" Width="30" Height="30" Click="FillingL_SpeedRatioUpBtn_Click" />
+                    <TextBox Text="{Binding FillingL_SpeedRatio,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="FillingL_SpeedRatioDownBtn" Content="-" Width="30" Click="FillingL_SpeedRatioDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="回零偏移速度:" FontSize="16" Margin="5,0,48,0" VerticalAlignment="Center"/>
-                    <Button x:Name="ReturnToZeroOffsetSpeedUpBtn" Content="+" Width="30" Height="30" Click="ReturnToZeroOffsetSpeedUpBtn_Click" />
-                    <TextBox Text="{Binding ReturnToZeroOffsetSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="ReturnToZeroOffsetSpeedDownBtn" Content="-" Width="30" Click="ReturnToZeroOffsetSpeedDownBtn_Click" />
+                    <TextBlock Text="缓存高速区间:" FontSize="16" VerticalAlignment="Center" Margin="5,0,48,0"/>
+                    <Button x:Name="CacheH_SpeedRatioUpBtn" Content="+" Width="30" Height="30" Click="CacheH_SpeedRatioUpBtn_Click" />
+                    <TextBox Text="{Binding CacheH_SpeedRatio,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="CacheH_SpeedRatioDownBtn" Content="-" Width="30" Click="CacheH_SpeedRatioDownBtn_Click" />
+                </StackPanel>
+                <StackPanel Height="30" Orientation="Horizontal">
+                    <TextBlock Text="缓存减速区间:" FontSize="16" VerticalAlignment="Center" Margin="5,0,48,0"/>
+                    <Button x:Name="CacheM_SpeedRatioUpBtn" Content="+" Width="30" Height="30" Click="CacheM_SpeedRatioUpBtn_Click" />
+                    <TextBox Text="{Binding CacheM_SpeedRatio,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="CacheM_SpeedRatioDownBtn" Content="-" Width="30" Click="CacheM_SpeedRatioDownBtn_Click" />
+                </StackPanel>
+                <StackPanel Height="30" Orientation="Horizontal">
+                    <TextBlock Text="缓存低速区间:" FontSize="16" VerticalAlignment="Center" Margin="5,0,48,0"/>
+                    <Button x:Name="CacheL_SpeedRatioUpBtn" Content="+" Width="30" Height="30" Click="CacheL_SpeedRatioUpBtn_Click" />
+                    <TextBox Text="{Binding CacheL_SpeedRatio,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="CacheL_SpeedRatio" Content="-" Width="30" Click="CacheL_SpeedRatioDownBtn_Click" />
+                </StackPanel>
+                <StackPanel Height="30" Orientation="Horizontal">
+                    <TextBlock Text="中转阀打开速度:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
+                    <Button x:Name="FillingValveOpenSpeedUpBtn" Content="+" Width="30" Height="30" Click="FillingValveOpenSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding FillingValveOpenSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="FillingValveOpenSpeedDownBtn" Content="-" Width="30" Click="FillingValveOpenSpeedDownBtn_Click" />
+                </StackPanel>
+                <StackPanel Height="30" Orientation="Horizontal">
+                    <TextBlock Text="中转阀打开位置:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
+                    <Button x:Name="TransferValveOpenPositionUpBtn" Content="+" Width="30" Height="30" Click="FillingValveOpenPositionUpBtn_Click" />
+                    <TextBox Text="{Binding FillingValveOpenPosition,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="FillingValveOpenPositionDownBtn" Content="-" Width="30" Click="FillingValveOpenPositionDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
                     <TextBlock Text="中转阀关闭速度:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
-                    <Button x:Name="TransferValveClosingSpeedUpBtn" Content="+" Width="30" Height="30" Click="TransferValveClosingSpeedUpBtn_Click" />
-                    <TextBox Text="{Binding TransferValveClosingSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="TransferValveClosingSpeedDownBtn" Content="-" Width="30" Click="TransferValveClosingSpeedDownBtn_Click" />
+                    <Button x:Name="FillingValveCloseSpeedUpBtn" Content="+" Width="30" Height="30" Click="FillingValveCloseSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding FillingValveCloseSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="FillingValveCloseSpeedDownBtn" Content="-" Width="30" Click="FillingValveCloseSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="中转阀开位置:" FontSize="16" Margin="5,0,48,0" VerticalAlignment="Center"/>
-                    <Button x:Name="TransferValveOpenPositionUpBtn" Content="+" Width="30" Height="30" Click="TransferValveOpenPositionUpBtn_Click" />
-                    <TextBox Text="{Binding TransferValveOpenPosition,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="TransferValveOpenPositionDownBtn" Content="-" Width="30" Click="TransferValveOpenPositionDownBtn_Click" />
+                    <TextBlock Text="中转阀关闭位置:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
+                    <Button x:Name="FillingValveClosePositionUpBtn" Content="+" Width="30" Height="30" Click="FillingValveClosePositionUpBtn_Click" />
+                    <TextBox Text="{Binding FillingValveClosePosition,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="FillingValveClosePositionDownBtn" Content="-" Width="30" Click="FillingValveClosePositionDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="中转阀关位置:" FontSize="16" Margin="5,0,48,0" VerticalAlignment="Center"/>
-                    <Button x:Name="TransferValveClosePositionUpBtn" Content="+" Width="30" Height="30" Click="TransferValveClosePositionUpBtn_Click" />
-                    <TextBox Text="{Binding TransferValveClosePosition,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="TransferValveClosePositionDownBtn" Content="-" Width="30" Click="TransferValveClosePositionDownBtn_Click" />
+                    <TextBlock Text="中转阀缓存速度:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
+                    <Button x:Name="FillingValveCacheSpeedUpBtn" Content="+" Width="30" Height="30" Click="FillingValveCacheSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding FillingValveCacheSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="FillingValveCacheSpeedDownBtn" Content="-" Width="30" Click="FillingValveCacheSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="气阀开延时:" FontSize="16" Margin="5,0,64,0" VerticalAlignment="Center"/>
-                    <Button x:Name="AirValveOpeningDelayUpBtn" Content="+" Width="30" Height="30" Click="AirValveOpeningDelayUpBtn_Click" />
-                    <TextBox Text="{Binding AirValveOpeningDelay,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="AirValveOpeningDelayDownBtn" Content="-" Width="30" Click="AirValveOpeningDelayDownBtn_Click" />
+                    <TextBlock Text="中转阀缓存位置:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
+                    <Button x:Name="FillingValveCachePositionUpBtn" Content="+" Width="30" Height="30" Click="FillingValveCachePositionUpBtn_Click" />
+                    <TextBox Text="{Binding FillingValveCachePosition,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="FillingValveCachePositionDownBtn" Content="-" Width="30" Click="FillingValveCachePositionDownBtn_Click" />
+                </StackPanel>
+                <StackPanel Height="30" Orientation="Horizontal">
+                    <TextBlock Text="传动轴定位速度:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
+                    <Button x:Name="BottlePosSpeedUpBtn" Content="+" Width="30" Height="30" Click="BottlePosSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding BottlePosSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="BottlePosSpeedDownBtn" Content="-" Width="30" Click="BottlePosSpeedDownBtn_Click" />
+                </StackPanel>
+                <StackPanel Height="30" Orientation="Horizontal">
+                    <TextBlock Text="传动轴定位位置:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
+                    <Button x:Name="BottlePosPositionUpBtn" Content="+" Width="30" Height="30" Click="BottlePosPositionUpBtn_Click" />
+                    <TextBox Text="{Binding BottlePosPosition,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="BottlePosPositionDownBtn" Content="-" Width="30" Click="BottlePosPositionDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="装瓶停机值:" FontSize="16" Margin="5,0,64,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottlingShutdownValueUpBtn" Content="+" Width="30" Height="30" Click="BottlingShutdownValueUpBtn_Click" />
-                    <TextBox Text="{Binding BottlingShutdownValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottlingShutdownValueDownBtn" Content="-" Width="30" Click="BottlingShutdownValueDownBtn_Click" />
+                    <TextBlock Text="传动轴点动速度:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
+                    <Button x:Name="ScrewJogSpeedUpBtn" Content="+" Width="30" Height="30" Click="ScrewJogSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding ScrewJogSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ScrewJogSpeedDownBtn" Content="-" Width="30" Click="ScrewJogSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="装瓶停机时间:" FontSize="16" Margin="5,0,48,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottlingShutdownTimeUpBtn" Content="+" Width="30" Height="30" Click="BottlingShutdownTimeUpBtn_Click" />
-                    <TextBox Text="{Binding BottlingShutdownTime,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottlingShutdownTimeDownBtn" Content="-" Width="30" Click="BottlingShutdownTimeDownBtn_Click" />
+                    <TextBlock Text="进瓶速度:" FontSize="16" Margin="5,0,80,0" VerticalAlignment="Center"/>
+                    <Button x:Name="InBottleSpeedUpBtn" Content="+" Width="30" Height="30" Click="InBottleSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding InBottleSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="InBottleSpeedDownBtn" Content="-" Width="30" Click="InBottleSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="送瓶轮运行速度:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottleFeedingWheelRunningSpeedUpBtn" Content="+" Width="30" Height="30" Click="BottleFeedingWheelRunningSpeedUpBtn_Click" />
-                    <TextBox Text="{Binding BottleFeedingWheelRunningSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottleFeedingWheelRunningSpeedDownBtn" Content="-" Width="30" Click="BottleFeedingWheelRunningSpeedDownBtn_Click"/>
+                    <TextBlock Text="中转阀点动速度:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
+                    <Button x:Name="FillingValueJogSpeedUpBtn" Content="+" Width="30" Height="30" Click="FillingValueJogSpeedUpBtn_Click" />
+                    <TextBox Text="{Binding FillingValveJogSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="FillingValueJogSpeedDownBtn" Content="-" Width="30" Click="FillingValueJogSpeedDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="送瓶轮点动速度:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottleFeedingWheelJogRunningSpeedUpBtn" Content="+" Width="30" Height="30" Click="BottleFeedingWheelJogRunningSpeedUpBtn_Click" />
-                    <TextBox Text="{Binding BottleFeedingWheelJogRunningSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottleFeedingWheelJogRunningSpeedDownBtn" Content="-" Width="30" Click="BottleFeedingWheelJogRunningSpeedDownBtn_Click" />
+                    <TextBlock Text="漏斗下降延时:" FontSize="16" Margin="5,0,48,0" VerticalAlignment="Center"/>
+                    <Button x:Name="MachineDelayFunneDownTimeUpBtn" Content="+" Width="30" Height="30" Click="MachineDelayFunneDownTimeUpBtn_Click" />
+                    <TextBox Text="{Binding MachineDelayFunneDownTime,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="MachineDelayFunneDownTimeDownBtn" Content="-" Width="30" Click="MachineDelayFunneDownTimeDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="送瓶轮回零偏移值:" FontSize="16" Margin="5,0,16,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottleFeedingWheelReturnToZeroOffsetValueUpBtn" Content="+" Width="30" Height="30" Click="BottleFeedingWheelReturnToZeroOffsetValueUpBtn_Click"/>
-                    <TextBox Text="{Binding BottleFeedingWheelReturnToZeroOffsetValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottleFeedingWheelReturnToZeroOffsetValueDownBtn" Content="-" Width="30" Click="BottleFeedingWheelReturnToZeroOffsetValueDownBtn_Click"/>
+                    <TextBlock Text="漏斗上升延时:" FontSize="16" Margin="5,0,48,0" VerticalAlignment="Center"/>
+                    <Button x:Name="MachineDelayFunneUpTimeUpBtn" Content="+" Width="30" Height="30" Click="MachineDelayFunneUpTimeUpBtn_Click" />
+                    <TextBox Text="{Binding MachineDelayFunneUpTime,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="MachineDelayFunneUpTimeDownBtn" Content="-" Width="30" Click="MachineDelayFunneUpTimeDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="送瓶轮回零速度:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottleFeedingWheelReturnToZeroSpeedUpBtn" Content="+" Width="30" Height="30" Click="BottleFeedingWheelReturnToZeroSpeedUpBtn_Click"/>
-                    <TextBox Text="{Binding BottleFeedingWheelReturnToZeroSpeed,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottleFeedingWheelReturnToZeroSpeedDownBtn" Content="-" Width="30" Click="BottleFeedingWheelReturnToZeroSpeedDownBtn_Click" />
+                    <TextBlock Text="中转阀打开延时:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
+                    <Button x:Name="MachineDelayFillingValveOpenTimeUpBtn" Content="+" Width="30" Height="30" Click="MachineDelayFillingValveOpenTimeUpBtn_Click" />
+                    <TextBox Text="{Binding MachineDelayFillingValveOpenTime,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="MachineDelayFillingValveOpenTimeDownBtn" Content="-" Width="30" Click="MachineDelayFillingValveOpenTimeDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="送瓶轮定位长度:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottleFeedingWheelPositionLengthUpBtn" Content="+" Width="30" Height="30" Click="BottleFeedingWheelPositionLengthUpBtn_Click" />
-                    <TextBox Text="{Binding BottleFeedingWheelPositionLength,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottleFeedingWheelPositionLengthDownBtn" Content="-" Width="30" Click="BottleFeedingWheelPositionLengthDownBtn_Click" />
+                    <TextBlock Text="中转阀关闭延时:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
+                    <Button x:Name="MachineDelayFillingValveCloseTimeUpBtn" Content="+" Width="30" Height="30" Click="MachineDelayFillingValveCloseTimeUpBtn_Click" />
+                    <TextBox Text="{Binding MachineDelayFillingValveCloseTime,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="MachineDelayFillingValveCloseTimeDownBtn" Content="-" Width="30" Click="MachineDelayFillingValveCloseTimeDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="送瓶轮暂停时间:" FontSize="16" Margin="5,0,32,0" VerticalAlignment="Center"/>
-                    <Button x:Name="BottleFeedingWheelPauseTimeUpBtn" Content="+" Width="30" Height="30" Click="BottleFeedingWheelPauseTimeUpBtn_Click" />
-                    <TextBox Text="{Binding BottleFeedingWheelPauseTime,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="BottleFeedingWheelPauseTimeDownBtn" Content="-" Width="30" Click="BottleFeedingWheelPauseTimeDownBtn_Click" />
+                    <TextBlock Text="进瓶延时:" FontSize="16" Margin="5,0,80,0" VerticalAlignment="Center"/>
+                    <Button x:Name="MachineDelayInBottleTimeUpBtn" Content="+" Width="30" Height="30" Click="MachineDelayInBottleTimeUpBtn_Click" />
+                    <TextBox Text="{Binding MachineDelayInBottleTime,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="MachineDelayInBottleTimeDownBtn" Content="-" Width="30" Click="MachineDelayInBottleTimeDownBtn_Click" />
                 </StackPanel>
                 <StackPanel Height="30" Orientation="Horizontal">
-                    <TextBlock Text="装瓶停机时间:" FontSize="16" Margin="5,0,48,0" VerticalAlignment="Center"/>
-                    <Button x:Name="DelayBlankingUpBtn" Content="+" Width="30" Height="30" Click="DelayBlankingUpBtn_Click" />
-                    <TextBox Text="{Binding DelayBlanking,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
-                    <Button x:Name="DelayBlankingDownBtn" Content="-" Width="30" Click="DelayBlankingDownBtn_Click" />
+                    <TextBlock Text="气阀开延时:" FontSize="16" Margin="5,0,64,0" VerticalAlignment="Center"/>
+                    <Button x:Name="ValveDelytimeUpBtn" Content="+" Width="30" Height="30" Click="ValveDelytimeUpBtn_Click" />
+                    <TextBox Text="{Binding ValveDelytime,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="ValveDelytimeDownBtn" Content="-" Width="30" Click="ValveDelytimeDownBtn_Click" />
+                </StackPanel>
+                <StackPanel Height="30" Orientation="Horizontal">
+                    <TextBlock Text="缺瓶检测时间:" FontSize="16" Margin="5,0,48,0" VerticalAlignment="Center"/>
+                    <Button x:Name="MissingDelaytimeUpBtn" Content="+" Width="30" Height="30" Click="MissingDelaytimeUpBtn_Click" />
+                    <TextBox Text="{Binding MissingDelaytime,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="MissingDelaytimeDownBtn" Content="-" Width="30" Click="MissingDelaytimeDownBtn_Click" />
+                </StackPanel>
+                <StackPanel Height="30" Orientation="Horizontal">
+                    <TextBlock Text="堵瓶检测时间:" FontSize="16" Margin="5,0,48,0" VerticalAlignment="Center"/>
+                    <Button x:Name="BottleJamDelaytimeUpBtn" Content="+" Width="30" Height="30" Click="BottleJamDelaytimeUpBtn_Click" />
+                    <TextBox Text="{Binding BottleJamDelaytime,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="BottleJamDelaytimeDownBtn" Content="-" Width="30" Click="BottleJamDelaytimeDownBtn_Click" />
+                </StackPanel>
+                <StackPanel Height="30" Orientation="Horizontal">
+                    <TextBlock Text="剔废气缸延时时间:" FontSize="16" Margin="5,0,16,0" VerticalAlignment="Center"/>
+                    <Button x:Name="EliminateCylinderDelayTimeUpBtn" Content="+" Width="30" Height="30" Click="EliminateCylinderDelayTimeUpBtn_Click" />
+                    <TextBox Text="{Binding EliminateCylinderDelayTime,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="EliminateCylinderDelayTimeDownBtn" Content="-" Width="30" Click="EliminateCylinderDelayTimeDownBtn_Click" />
+                </StackPanel>
+                <StackPanel Height="30" Orientation="Horizontal">
+                    <TextBlock Text="剔废气缸保持时间:" FontSize="16" Margin="5,0,16,0" VerticalAlignment="Center"/>
+                    <Button x:Name="EliminateCylinderHoldingTimeUpBtn" Content="+" Width="30" Height="30" Click="EliminateCylinderHoldingTimeUpBtn_Click" />
+                    <TextBox Text="{Binding EliminateCylinderHoldingTime,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="EliminateCylinderHoldingTimeDownBtn" Content="-" Width="30" Click="EliminateCylinderHoldingTimeDownBtn_Click" />
+                </StackPanel>
+                <StackPanel Height="30" Orientation="Horizontal">
+                    <TextBlock Text="瓶装设定值:" FontSize="16" Margin="5,0,64,0" VerticalAlignment="Center"/>
+                    <Button x:Name="BottValueSetUpBtn" Content="+" Width="30" Height="30" Click="BottValueSetUpBtn_Click" />
+                    <TextBox Text="{Binding BottValueSet,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="BottValueSetDownBtn" Content="-" Width="30" Click="BottValueSetDownBtn_Click" />
+                </StackPanel>
+                <StackPanel Height="30" Orientation="Horizontal">
+                    <TextBlock Text="缓存停机值:" FontSize="16" Margin="5,0,64,0" VerticalAlignment="Center"/>
+                    <Button x:Name="CacheShutdownValueUpBtn" Content="+" Width="30" Height="30" Click="CacheShutdownValueUpBtn_Click" />
+                    <TextBox Text="{Binding CacheShutdownValue,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" FontSize="16" Width="80" KeyDown="TextBox_KeyDown"/>
+                    <Button x:Name="CacheShutdownValueDownBtn" Content="-" Width="30" Click="CacheShutdownValueDownBtn_Click" />
                 </StackPanel>
             </WrapPanel>
+            
         </Grid>
     </Grid>
 </Page>

+ 658 - 303
CCDCountWpf/WpfPage/PlcSettingPage.xaml.cs

@@ -23,681 +23,1036 @@ namespace CCDCountWpf.WpfPage
             DataContext = PlcSettingMessageBus.PlcMessageShowBindage;
         }
 
-        private void SpeedModeRunningSpeedUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ScrewJogSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.SpeedModeRunningSpeed, out float result))
+            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.ScrewJogSpeed, out float result))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.SpeedModeRunningSpeed = (result + 0.5f).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.ScrewJogSpeed = (result + 0.5f).ToString();
             }
         }
 
-        private void SpeedModeRunningSpeedDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ScrewJogSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.SpeedModeRunningSpeed, out float result))
+            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.ScrewJogSpeed, out float result))
             {
                 if((result - 0.5f)>=0)
                 {
-                    PlcSettingMessageBus.PlcMessageShowBindage.SpeedModeRunningSpeed = (result - 0.5f).ToString();
+                    PlcSettingMessageBus.PlcMessageShowBindage.ScrewJogSpeed = (result - 0.5f).ToString();
                 }
             }
         }
 
-        private void JogSpeedUpBtn_Click(object sender, RoutedEventArgs e)
+        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.JogSpeed, out float result))
+            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenSpeed, out float result))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.JogSpeed = (result + 0.5f).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenSpeed = (result + 0.5f).ToString();
             }
         }
 
-        private void JogSpeedDownBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveOpenSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.JogSpeed, out float result))
+            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenSpeed, out float result))
             {
                 if((result - 0.5f)>=0)
                 {
-                    PlcSettingMessageBus.PlcMessageShowBindage.JogSpeed = (result - 0.5f).ToString();
+                    PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenSpeed = (result - 0.5f).ToString();
                 }
             }
         }
 
-        private void BottValueSetUpBtn_Click(object sender, RoutedEventArgs e)
+
+        private void CacheShutdownValueUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet + 1) > 
-                PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue + 1) > 
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue += 1;
             }
         }
 
-        private void BottValueSetDownBtn_Click(object sender, RoutedEventArgs e)
+        private void CacheShutdownValueDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet - 1) <
-                PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue - 1) < 
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottValueSet -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue -= 1;
             }
         }
 
-        private void TransferValveOpeningSpeedUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable1H_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningSpeed, out float result))
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed + 1) > 
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningSpeed = (result + 0.5f).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed += 1;
             }
         }
 
-        private void TransferValveOpeningSpeedDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable1H_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningSpeed, out float result))
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed - 1) < 
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed)
             {
-                if((result - 0.5f)>=0)
-                {
-                    PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningSpeed = (result - 0.5f).ToString();
-                }
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_FillingSpeed -= 1;
             }
         }
 
-        private void TransferValveOpeningTimeUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable2H_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningTime + 1) > 
-                PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningTime)
+            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.TransferValveOpeningTime += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_FillingSpeed -= 1;
             }
         }
 
-        private void TransferValveOpeningTimeDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable3H_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningTime - 1) < 
-                PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningTime)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed+1)>
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpeningTime -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed += 1;
             }
         }
 
-        private void BottingDecelerationValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable3H_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingDecelerationValue + 1) > 
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingDecelerationValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed - 1)<
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingDecelerationValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_FillingSpeed -= 1;
             }
         }
 
-        private void BottingDecelerationValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable1M_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingDecelerationValue - 1) < 
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingDecelerationValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed +1)>
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingDecelerationValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed += 1;
             }
         }
 
-        private void CacheDecelerationValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable1M_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheDecelerationValue + 1) > 
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheDecelerationValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed - 1)<
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheDecelerationValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_FillingSpeed -= 1;
             }
         }
 
-        private void CacheDecelerationValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable2M_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheDecelerationValue - 1) < 
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheDecelerationValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed + 1)>
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheDecelerationValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed += 1;
             }
         }
 
-        private void CacheCountDelayTimingUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable2M_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.CacheCountDelayTiming + 1) > 
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheCountDelayTiming)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed - 1) < 
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheCountDelayTiming += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_FillingSpeed -= 1;
             }
         }
 
-        private void CacheCountDelayTimingDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable3M_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.CacheCountDelayTiming - 1) < 
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheCountDelayTiming)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed + 1)>
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheCountDelayTiming -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed += 1;
             }
         }
 
-        private void CacheShutdownValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable3M_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue + 1) > 
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_FillingSpeed -= 1;
             }
         }
 
-        private void CacheShutdownValueDownBtn_Click(object sender, RoutedEventArgs e)
+
+        private void ShakeTable1L_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue - 1) < 
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_FillingSpeed + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheShutdownValue -= 1;
+                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 BottingMaterialCylinderVibrationTableHighSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable2L_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue + 1) > 
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed += 1;
             }
         }
 
-        private void BottingMaterialCylinderVibrationTableHighSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable2L_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue - 1) < 
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableHighSpeedValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_FillingSpeed -= 1;
             }
         }
 
-        private void BottingFilterVibrationTableHighSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable3L_FillingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue + 1) > 
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue)
-            PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue += 1;
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed)
+            {
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed += 1;
+            }
         }
 
-        private void BottingFilterVibrationTableHighSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable3L_FillingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue - 1) <
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableHighSpeedValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_FillingSpeed -= 1;
             }
         }
 
-        private void BottingCountVibrationTableHighSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable1H_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue+1)>
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed + 1)>
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed += 1;
             }
         }
 
-        private void BottingCountVibrationTableHighSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable1H_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue - 1)<
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableHighSpeedValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1H_CacheSpeed -= 1;
             }
         }
 
-        private void BottingMaterialCylinderVibrationTableDecelerationSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable2H_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableDecelerationSpeedValue +1)>
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableDecelerationSpeedValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed + 1)>
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableDecelerationSpeedValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed += 1;
             }
         }
 
-        private void BottingMaterialCylinderVibrationTableDecelerationSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable2H_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableDecelerationSpeedValue - 1)<
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableDecelerationSpeedValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed - 1)<
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingMaterialCylinderVibrationTableDecelerationSpeedValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2H_CacheSpeed -= 1;
             }
         }
 
-        private void BottingFilterVibrationTableDecelerationSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable3H_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableDecelerationSpeedValue + 1)>
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableDecelerationSpeedValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed + 1)>
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableDecelerationSpeedValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed += 1;
             }
         }
 
-        private void BottingFilterVibrationTableDecelerationSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable3H_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableDecelerationSpeedValue - 1) < 
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableDecelerationSpeedValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed - 1)<
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingFilterVibrationTableDecelerationSpeedValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3H_CacheSpeed -= 1;
             }
         }
 
-        private void BottingCountVibrationTableDecelerationSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable1M_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableDecelerationSpeedValue + 1)>
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableDecelerationSpeedValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed + 1)>
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableDecelerationSpeedValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed += 1;
             }
         }
 
-        private void BottingCountVibrationTableDecelerationSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable1M_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableDecelerationSpeedValue - 1) <
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableDecelerationSpeedValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottingCountVibrationTableDecelerationSpeedValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1M_CacheSpeed -= 1;
             }
         }
 
-        private void CacheMaterialCylinderVibrationTableHighSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable2M_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableHighSpeedValue + 1)>
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableHighSpeedValue)
+            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.CacheMaterialCylinderVibrationTableHighSpeedValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2M_CacheSpeed -= 1;
             }
         }
 
-        private void CacheMaterialCylinderVibrationTableHighSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
+        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.CacheMaterialCylinderVibrationTableHighSpeedValue - 1) <
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableHighSpeedValue)
+            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_CacheSpeed - 1)<
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_CacheSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableHighSpeedValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3M_CacheSpeed -= 1;
             }
         }
 
-        private void CacheFilterVibrationTableHighSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable1L_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableHighSpeedValue + 1)>
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableHighSpeedValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed += 1;
             }
         }
 
-        private void CacheFilterVibrationTableHighSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable1L_CacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableHighSpeedValue - 1)<
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableHighSpeedValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable1L_CacheSpeed -= 1;
             }
         }
 
-        private void CacheCountVibrationTableHighSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
+        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.CacheCountVibrationTableHighSpeedValue + 1)>
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableHighSpeedValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_CacheSpeed - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_CacheSpeed)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableHighSpeedValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable2L_CacheSpeed -= 1;
             }
         }
 
-        private void CacheCountVibrationTableHighSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ShakeTable3L_CacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableHighSpeedValue - 1)<
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableHighSpeedValue)
+            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.CacheCountVibrationTableHighSpeedValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ShakeTable3L_CacheSpeed -= 1;
             }
         }
 
-        private void CacheMaterialCylinderVibrationTableDecelerationSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveCloseSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableDecelerationSpeedValue + 1)>
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableDecelerationSpeedValue)
+            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCloseSpeed, out float value))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableDecelerationSpeedValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCloseSpeed = (value + 0.5).ToString();
             }
         }
 
-        private void CacheMaterialCylinderVibrationTableDecelerationSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveCloseSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableDecelerationSpeedValue - 1) <
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableDecelerationSpeedValue)
+            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCloseSpeed, out float value))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheMaterialCylinderVibrationTableDecelerationSpeedValue -= 1;
+                if(value - 0.5 < 0) return;
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCloseSpeed = (value - 0.5).ToString();
             }
         }
 
-        private void CacheFilterVibrationTableDecelerationSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveOpenPositionUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableDecelerationSpeedValue + 1)>
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableDecelerationSpeedValue)
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableDecelerationSpeedValue += 1;
+            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenPosition, out float value))
+            {
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenPosition = (value + 0.5).ToString();
+            }
         }
 
-        private void CacheFilterVibrationTableDecelerationSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveOpenPositionDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableDecelerationSpeedValue - 1)<
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableDecelerationSpeedValue)
+            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenPosition, out float value))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheFilterVibrationTableDecelerationSpeedValue -= 1;
+                if(value - 0.5 < 0) return;
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveOpenPosition = (value - 0.5).ToString();
             }
         }
 
-        private void CacheCountVibrationTableDecelerationSpeedValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveClosePositionUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableDecelerationSpeedValue + 1) >
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableDecelerationSpeedValue)
-            PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableDecelerationSpeedValue += 1;
+            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveClosePosition, out float value))
+            {
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveClosePosition = (value + 0.5).ToString();
+            }    
         }
 
-        private void CacheCountVibrationTableDecelerationSpeedValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveClosePositionDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableDecelerationSpeedValue - 1)<
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableDecelerationSpeedValue)
+            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveClosePosition, out float value))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.CacheCountVibrationTableDecelerationSpeedValue -= 1;
+                if(value - 0.5 < 0) return;
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveClosePosition = (value - 0.5).ToString();
             }
         }
 
-        private void GateOpeningDelayUpBtn_Click(object sender, RoutedEventArgs e)
+        private void ValveDelytimeUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.GateOpeningDelay + 1)>
-                PlcSettingMessageBus.PlcMessageShowBindage.GateOpeningDelay)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.GateOpeningDelay += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime += 1;
             }
         }
 
-        private void GateOpeningDelayDownBtn_Click(object sender, RoutedEventArgs e)
+        private void ValveDelytimeDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.GateOpeningDelay - 1) <
-                PlcSettingMessageBus.PlcMessageShowBindage.GateOpeningDelay)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime &&
+                PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime - 1 > 0)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.GateOpeningDelay -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.ValveDelytime -= 1;
             }
         }
 
-        private void ReturnToZeroOffsetValueUpDownBtn_Click(object sender, RoutedEventArgs e)
+        private void TextBox_KeyDown(object sender, KeyEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetValue, out float value))
+            if (e.Key == Key.Enter)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetValue = (value + 0.5).ToString();
+                TextBox textBox = sender as TextBox;
+                if (textBox != null)
+                {
+                    // 强制更新源数据
+                    BindingExpression bindingExpression = textBox.GetBindingExpression(TextBox.TextProperty);
+                    bindingExpression.UpdateSource();
+                }
             }
         }
 
-        private void ReturnToZeroOffsetValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingH_SpeedRatioUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetValue, out float value))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio)
             {
-                //if(value - 0.5 < 0) return;
-                PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetValue = (value - 0.5).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio += 1;
             }
         }
 
-        private void ReturnToZeroOffsetSpeedUpBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingH_SpeedRatioDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetSpeed, out float value))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio&& 
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio-1>0)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetSpeed = (value + 0.5).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingH_SpeedRatio -= 1;
             }
         }
 
-        private void ReturnToZeroOffsetSpeedDownBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingM_SpeedRatioUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetSpeed, out float value))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio)
             {
-                if(value - 0.5 < 0) return;
-                PlcSettingMessageBus.PlcMessageShowBindage.ReturnToZeroOffsetSpeed = (value - 0.5).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio += 1;
             }
         }
 
-        private void TransferValveClosingSpeedUpBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingM_SpeedRatioDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosingSpeed, out float value))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio &&
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio - 1 > 0)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosingSpeed = (value + 0.5).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingM_SpeedRatio -= 1;
             }
         }
 
-        private void TransferValveClosingSpeedDownBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingL_SpeedRatioUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosingSpeed, out float value))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio)
             {
-                if(value - 0.5 < 0) return;
-                PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosingSpeed = (value - 0.5).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio += 1;
             }
         }
 
-        private void TransferValveOpenPositionUpBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingL_SpeedRatioDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpenPosition, out float value))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio &&
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio - 1 > 0)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpenPosition = (value + 0.5).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingL_SpeedRatio -= 1;
             }
         }
 
-        private void TransferValveOpenPositionDownBtn_Click(object sender, RoutedEventArgs e)
+        private void CacheH_SpeedRatioUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpenPosition, out float value))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio)
             {
-                if(value - 0.5 < 0) return;
-                PlcSettingMessageBus.PlcMessageShowBindage.TransferValveOpenPosition = (value - 0.5).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio += 1;
             }
         }
 
-        private void TransferValveClosePositionUpBtn_Click(object sender, RoutedEventArgs e)
+        private void CacheH_SpeedRatioDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosePosition, out float value))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio &&
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio - 1 > 0)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosePosition = (value + 0.5).ToString();
-            }    
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheH_SpeedRatio -= 1;
+            }
         }
 
-        private void TransferValveClosePositionDownBtn_Click(object sender, RoutedEventArgs e)
+        private void CacheM_SpeedRatioUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if(float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosePosition, out float value))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio)
             {
-                if(value - 0.5 < 0) return;
-                PlcSettingMessageBus.PlcMessageShowBindage.TransferValveClosePosition = (value - 0.5).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio += 1;
             }
         }
 
-        private void AirValveOpeningDelayUpBtn_Click(object sender, RoutedEventArgs e)
+        private void CacheM_SpeedRatioDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.AirValveOpeningDelay + 1)>
-                PlcSettingMessageBus.PlcMessageShowBindage.AirValveOpeningDelay)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio &&
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio - 1 > 0)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.AirValveOpeningDelay += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheM_SpeedRatio -= 1;
             }
         }
 
-        private void AirValveOpeningDelayDownBtn_Click(object sender, RoutedEventArgs e)
+        private void CacheL_SpeedRatioUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.AirValveOpeningDelay - 1)<
-                PlcSettingMessageBus.PlcMessageShowBindage.AirValveOpeningDelay)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.AirValveOpeningDelay -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio += 1;
             }
         }
 
-        private void BottlingShutdownValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void CacheL_SpeedRatioDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownValue + 1) >
-                PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownValue)
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio &&
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio - 1 > 0)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownValue += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.CacheL_SpeedRatio -= 1;
             }
         }
 
-        private void BottlingShutdownValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void InBottleSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownValue - 1) <
-                PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownValue)
+            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.InBottleSpeed, out float value))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownValue -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.InBottleSpeed = (value + 0.5).ToString();
             }
         }
 
-        private void BottlingShutdownTimeUpBtn_Click(object sender, RoutedEventArgs e)
+        private void InBottleSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownTime + 1)>
-                PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownTime)
+            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.InBottleSpeed, out float value))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownTime += 1;
+                if (value - 0.5 < 0) return;
+                PlcSettingMessageBus.PlcMessageShowBindage.InBottleSpeed = (value - 0.5).ToString();
             }
         }
 
-        private void BottlingShutdownTimeDownBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValueJogSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownTime - 1) <
-                PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownTime)
+            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveJogSpeed, out float value))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottlingShutdownTime -= 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveJogSpeed = (value + 0.5).ToString();
             }
         }
 
-        private void BottleFeedingWheelRunningSpeedUpBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValueJogSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelRunningSpeed, out float result))
+            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveJogSpeed, out float value))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelRunningSpeed = (result + 0.5f).ToString();
+                if (value - 0.5 < 0) return;
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveJogSpeed = (value - 0.5).ToString();
             }
         }
 
-        private void BottleFeedingWheelRunningSpeedDownBtn_Click(object sender, RoutedEventArgs e)
+        private void MachineDelayFunneDownTimeUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelRunningSpeed, out float result))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime)
             {
-                if (result - 0.5f >= 0)
-                {
-                    PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelRunningSpeed = (result - 0.5f).ToString();
-                }
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime += 1;
             }
         }
 
-        private void BottleFeedingWheelJogRunningSpeedUpBtn_Click(object sender, RoutedEventArgs e)
+        private void MachineDelayFunneDownTimeDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelJogRunningSpeed, out float result))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime &&
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime - 1 > 0)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelJogRunningSpeed = (result + 0.5f).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneDownTime -= 1;
             }
         }
 
-        private void BottleFeedingWheelJogRunningSpeedDownBtn_Click(object sender, RoutedEventArgs e)
+        private void MachineDelayFunneUpTimeUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelJogRunningSpeed, out float result))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime)
             {
-                if (result - 0.5f >= 0)
-                {
-                    PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelJogRunningSpeed = (result - 0.5f).ToString();
-                }
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime += 1;
             }
         }
 
-        private void BottleFeedingWheelReturnToZeroOffsetValueUpBtn_Click(object sender, RoutedEventArgs e)
+        private void MachineDelayFunneUpTimeDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroOffsetValue, out float result))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime &&
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime - 1 > 0)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroOffsetValue = (result + 0.5f).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFunneUpTime -= 1;
             }
         }
 
-        private void BottleFeedingWheelReturnToZeroOffsetValueDownBtn_Click(object sender, RoutedEventArgs e)
+        private void MachineDelayFillingValveOpenTimeUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroOffsetValue, out float result))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveOpenTime + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveOpenTime)
             {
-                if (result - 0.5f >= 0)
-                {
-                    PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroOffsetValue = (result - 0.5f).ToString();
-                }
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveOpenTime += 1;
             }
         }
 
-        private void BottleFeedingWheelReturnToZeroSpeedUpBtn_Click(object sender, RoutedEventArgs e)
+        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 (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroSpeed, out float result))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroSpeed = (result + 0.5f).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime += 1;
             }
         }
 
-        private void BottleFeedingWheelReturnToZeroSpeedDownBtn_Click(object sender, RoutedEventArgs e)
+        private void MachineDelayFillingValveCloseTimeDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroSpeed, out float result))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime &&
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime - 1 > 0)
             {
-                if (result - 0.5f >= 0)
-                {
-                    PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelReturnToZeroSpeed = (result - 0.5f).ToString();
-                }
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayFillingValveCloseTime -= 1;
             }
         }
 
-        private void BottleFeedingWheelPositionLengthUpBtn_Click(object sender, RoutedEventArgs e)
+        private void MachineDelayInBottleTimeUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPositionLength, out float result))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime + 1) >
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime)
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPositionLength = (result + 0.5f).ToString();
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime += 1;
             }
         }
 
-        private void BottleFeedingWheelPositionLengthDownBtn_Click(object sender, RoutedEventArgs e)
+        private void MachineDelayInBottleTimeDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPositionLength, out float result))
+            if ((ushort)(PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime - 1) <
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime &&
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime - 1 > 0)
             {
-                if (result - 0.5f >= 0)
-                {
-                    PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPositionLength = (result - 0.5f).ToString();
-                }
+                PlcSettingMessageBus.PlcMessageShowBindage.MachineDelayInBottleTime -= 1;
             }
         }
 
-        private void BottleFeedingWheelPauseTimeUpBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveCacheSpeedUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPauseTime + 1) >
-                PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPauseTime)
+            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCacheSpeed, out float value))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPauseTime += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCacheSpeed = (value + 0.5).ToString();
             }
         }
 
-        private void BottleFeedingWheelPauseTimeDownBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveCacheSpeedDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPauseTime - 1) <
-                PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPauseTime)
+            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCacheSpeed, out float value))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.BottleFeedingWheelPauseTime -= 1;
+                if (value - 0.5 < 0) return;
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCacheSpeed = (value - 0.5).ToString();
             }
         }
 
-        private void DelayBlankingUpBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveCachePositionUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.DelayBlanking + 1) >
-                PlcSettingMessageBus.PlcMessageShowBindage.DelayBlanking)
+            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCachePosition, out float value))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.DelayBlanking += 1;
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCachePosition = (value + 0.5).ToString();
             }
         }
 
-        private void DelayBlankingDownBtn_Click(object sender, RoutedEventArgs e)
+        private void FillingValveCachePositionDownBtn_Click(object sender, RoutedEventArgs e)
         {
-            if ((UInt32)(PlcSettingMessageBus.PlcMessageShowBindage.DelayBlanking - 1) <
-                PlcSettingMessageBus.PlcMessageShowBindage.DelayBlanking)
+            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCachePosition, out float value))
             {
-                PlcSettingMessageBus.PlcMessageShowBindage.DelayBlanking -= 1;
+                if (value - 0.5 < 0) return;
+                PlcSettingMessageBus.PlcMessageShowBindage.FillingValveCachePosition = (value - 0.5).ToString();
             }
         }
 
-        private void TextBox_KeyDown(object sender, KeyEventArgs e)
+        private void BottlePosPositionUpBtn_Click(object sender, RoutedEventArgs e)
         {
-            if (e.Key == Key.Enter)
+            if (float.TryParse(PlcSettingMessageBus.PlcMessageShowBindage.BottlePosPosition, out float value))
             {
-                TextBox textBox = sender as TextBox;
-                if (textBox != null)
-                {
-                    // 强制更新源数据
-                    BindingExpression bindingExpression = textBox.GetBindingExpression(TextBox.TextProperty);
-                    bindingExpression.UpdateSource();
-                }
+                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;
+        }
     }
 }

+ 13 - 26
CCDCountWpf/WpfPage/SettingPage.xaml

@@ -20,31 +20,7 @@
 
             <Grid Grid.Column="1"  Margin="2,2,2,2">
                 <Border BorderBrush="Black" BorderThickness="1"/>
-                <Grid  x:Name="HeardGrid" Height="40" VerticalAlignment="Top">
-                    <Border BorderBrush="Black" BorderThickness="1"/>
-                    <Button x:Name="Cam1Btn" HorizontalAlignment="Left" Width="60" Background="{x:Null}" Click="Cam1Btn_Click">
-                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
-                            <TextBlock Text="相机一" FontSize="10" FontWeight="Bold" Margin="0,0,0,0" HorizontalAlignment="Center" />
-                        </StackPanel>
-                    </Button>
-                    <Button x:Name="Cam2Btn" HorizontalAlignment="Left" Width="60" Margin="60,0,0,0" Background="{x:Null}" Click="Cam2Btn_Click">
-                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
-                            <TextBlock Text="相机二" FontSize="10" FontWeight="Bold" Margin="0,0,0,0" HorizontalAlignment="Center" />
-                        </StackPanel>
-                    </Button>
-                    <Button x:Name="Cam3Btn" HorizontalAlignment="Left" Width="60" Margin="120,0,0,0" Background="{x:Null}">
-                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
-                            <TextBlock Text="相机三" FontSize="10" FontWeight="Bold" Margin="0,0,0,0" HorizontalAlignment="Center" />
-                        </StackPanel>
-                    </Button>
-                    <Button x:Name="Cam4Btn" HorizontalAlignment="Left" Width="60" Margin="180,0,0,0" Background="{x:Null}">
-                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
-                            <TextBlock Text="相机四" FontSize="10" FontWeight="Bold" Margin="0,0,0,0" HorizontalAlignment="Center" />
-                        </StackPanel>
-                    </Button>
-                    <ComboBox x:Name="CamNumCoBox"  HorizontalAlignment="Right" Margin="240,2,0,2" Width="90" Background="{x:Null}" FontSize="12" HorizontalContentAlignment="Center" Padding="6,12,5,3" SelectionChanged="CamNumCoBox_SelectionChanged"/>
-                </Grid>
-                <Grid x:Name="SettingGrid" Margin="0,40,0,44">
+                <Grid x:Name="SettingGrid" Margin="0,0,0,0">
                     <Grid x:Name ="BtnList" Height="40" VerticalAlignment="Top">
                         <Button x:Name="CameraSettingBtn" Content="相机参数设置" HorizontalAlignment="Left" Margin="0,0,0,0" Width="165" Background="{x:Null}" Click="CameraSettingBtn_Click"/>
                         <Button x:Name="ShuLiSettingBtn" Content="数粒参数设置" HorizontalAlignment="Left" Margin="165,0,0,0" Width="165" Background="{x:Null}" Click="ShuLiSettingBtn_Click"/>
@@ -104,7 +80,7 @@
                         <RadioButton x:Name="CheckModel2RadBtn" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="40,235,0,0" Content="通过长度检测" FontSize="15" Checked="CheckModel2RadBtn_Checked" />
                         <RadioButton x:Name="CheckModel3RadBtn" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="40,265,0,0" Content="通过面积" FontSize="15" Checked="CheckModel3RadBtn_Checked" />
                         <RadioButton x:Name="CheckModel4RadBtn" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="40,295,0,0" Content="通过长度面积检测" FontSize="15" Checked="CheckModel4RadBtn_Checked" />
-                        <StackPanel Orientation="Vertical" Height="100" VerticalAlignment="Top" Margin="0,320,0,0">
+                        <StackPanel Orientation="Vertical" Height="60" VerticalAlignment="Top" Margin="0,320,0,0">
                             <StackPanel x:Name="WHParaPanel" Orientation="Horizontal">
                                 <Label HorizontalAlignment="Left" VerticalAlignment="Top" Height="30" Width="120" Content="合格长度范围:" FontSize="15" Margin="10,0,0,0"/>
                                 <TextBox x:Name="MIN_OBJECT_HEIGHT_TBX" Text="{Binding MIN_OBJECT_LENGTH,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" Height="20" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="15" Margin="10,5,0,0" Width="70" KeyDown="TextBox_KeyDown"/>
@@ -117,6 +93,17 @@
                                 <Label HorizontalAlignment="Left" VerticalAlignment="Top" Height="30" Width="15" Content="-" FontSize="15" Margin="10,0,0,0"/>
                                 <TextBox x:Name="MaxArea_TBX" Text="{Binding MaxArea,Mode=TwoWay,UpdateSourceTrigger=LostFocus}" Height="20" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="15" Margin="10,4,0,0" Width="70" KeyDown="TextBox_KeyDown"/>
                             </StackPanel>
+                        </StackPanel>
+                        <StackPanel Orientation="Vertical" Height="100" VerticalAlignment="Top" Margin="0,380,0,0">
+                            <StackPanel Orientation="Horizontal">
+                                <Label HorizontalAlignment="Left" VerticalAlignment="Top" Height="30" Width="120" Content="标准药粒宽高:" FontSize="15" Margin="10,0,0,0"/>
+                            </StackPanel>
+                            <StackPanel x:Name="KeliLWPanel" Orientation="Horizontal">
+                                <Label HorizontalAlignment="Left" VerticalAlignment="Top" Height="30" Width="30" Content="宽:" FontSize="15" Margin="10,0,0,0"/>
+                                <TextBox x:Name="KeLiW_TBX" Height="20" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="15" Margin="10,4,0,0" Width="100" KeyDown="TextBox_KeyDown"/>
+                                <Label HorizontalAlignment="Left" VerticalAlignment="Top" Height="30" Width="30" Content="高:" FontSize="15" Margin="10,0,0,0"/>
+                                <TextBox x:Name="KeLiL_TBX" Height="20" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="15" Margin="10,4,0,0" Width="100" KeyDown="TextBox_KeyDown"/>
+                            </StackPanel>
                             <StackPanel x:Name="ParametricTrainingPanel" Orientation="Horizontal" HorizontalAlignment="Right">
                                 <Button x:Name="ParametricTrainingBtn" Content="参数训练" Width="80" Height="35" Margin="0,2,10,0" Click="ParametricTrainingBtn_Click"/>
                             </StackPanel>

+ 8 - 65
CCDCountWpf/WpfPage/SettingPage.xaml.cs

@@ -21,16 +21,10 @@ namespace CCDCountWpf.WpfPage
         {
             InitializeComponent();
             DataContext = ShowMessageBus.ShowBinding;
-            Cam1Btn_Click(null, null);
         }
 
         private void Page_Loaded(object sender, RoutedEventArgs e)
         {
-            CamNumCoBox.Items.Add("单相机");
-            CamNumCoBox.Items.Add("双相机");
-            CamNumCoBox.Items.Add("三相机");
-            CamNumCoBox.Items.Add("四相机");
-            CamNumCoBox.SelectedIndex = 0;
             if (MessageBus.NowSettingLoadMainThread != null)
             {
                 CamSelectConBox.SelectedValue = MessageBus.NowSettingLoadMainThread.cameraConfig.CameraSNNum;
@@ -57,64 +51,6 @@ namespace CCDCountWpf.WpfPage
             }
         }
 
-        private void CamNumCoBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-            if(CamNumCoBox.SelectedItem.ToString() == "单相机")
-            {
-                Cam1Btn.Visibility = Visibility.Visible;
-                Cam2Btn.Visibility = Visibility.Collapsed;
-                Cam3Btn.Visibility = Visibility.Collapsed;
-                Cam4Btn.Visibility = Visibility.Collapsed;
-                if(!(MessageBus.SeetingNowLoadInMaThreadsIndex>0&&MessageBus.SeetingNowLoadInMaThreadsIndex < 1))
-                {
-                    Cam1Btn_Click(null, null);
-                }
-            }
-            else if(CamNumCoBox.SelectedItem.ToString() == "双相机")
-            {
-                Cam1Btn.Visibility = Visibility.Visible;
-                Cam2Btn.Visibility = Visibility.Visible;
-                Cam3Btn.Visibility = Visibility.Collapsed;
-                Cam4Btn.Visibility = Visibility.Collapsed;
-                if (!(MessageBus.SeetingNowLoadInMaThreadsIndex > 0 && MessageBus.SeetingNowLoadInMaThreadsIndex < 2))
-                {
-                    Cam1Btn_Click(null, null);
-                }
-            }
-            else if(CamNumCoBox.SelectedItem.ToString() == "三相机")
-            {
-                Cam1Btn.Visibility = Visibility.Visible;
-                Cam2Btn.Visibility = Visibility.Visible;
-                Cam3Btn.Visibility = Visibility.Visible;
-                Cam4Btn.Visibility = Visibility.Collapsed;
-                if (!(MessageBus.SeetingNowLoadInMaThreadsIndex > 0 && MessageBus.SeetingNowLoadInMaThreadsIndex < 3))
-                {
-                    Cam1Btn_Click(null, null);
-                }
-            }
-            else if(CamNumCoBox.SelectedItem.ToString() == "四相机")
-            {
-                Cam1Btn.Visibility = Visibility.Visible;
-                Cam2Btn.Visibility = Visibility.Visible;
-                Cam3Btn.Visibility = Visibility.Visible;
-                Cam4Btn.Visibility = Visibility.Visible;
-            }
-        }
-
-        private void Cam1Btn_Click(object sender, RoutedEventArgs e)
-        {
-            if (MessageBus.MainThreadS == null|| MessageBus.MainThreadS.Count<1|| MessageBus.MainThreadS[0] == null)
-                return;
-            MessageBus.SeetingNowLoadInMaThreadsIndex = 0;
-            MessageBus.NowSettingLoadMainThread = MessageBus.MainThreadS[0];
-        }
-
-        private void Cam2Btn_Click(object sender, RoutedEventArgs e)
-        {
-            //MessageBus.ShowBondage.ExposureTimeValue = "300";
-            MessageBox.Show($"NowThread.ETime:{MessageBus.NowSettingLoadMainThread.cameraConfig.ExposureTimeValue},Thread[0].ETime:{MessageBus.MainThreadS[0].cameraConfig.ExposureTimeValue}");
-        }
-
         private void CameraSettingBtn_Click(object sender, RoutedEventArgs e)
         {
             CameraSettingGrid.Visibility = Visibility.Visible;
@@ -277,7 +213,14 @@ namespace CCDCountWpf.WpfPage
 
         private void ParametricTrainingBtn_Click(object sender, RoutedEventArgs e)
         {
-            var paravalue = MessageBus.NowSettingLoadMainThread.ParameterTrain();
+            if(string.IsNullOrEmpty(KeLiW_TBX.Text)||string.IsNullOrEmpty(KeLiL_TBX.Text))
+            {
+                MessageBox.Show("请输入标准颗粒的宽高");
+                return;
+            }
+            int KeliW = Convert.ToInt32(KeLiW_TBX.Text);
+            int KeliL = Convert.ToInt32(KeLiL_TBX.Text);
+            var paravalue = MessageBus.NowSettingLoadMainThread.ParameterTrain(KeliW, KeliL);
             ShowMessageBus.ShowBinding.NoiseFilter = paravalue.NoiseFilterThreshold.ToString();
             ShowMessageBus.ShowBinding.MaxArea = ((int)(paravalue.MaxArea*1.1)).ToString();
             ShowMessageBus.ShowBinding.MinArea = ((int)(paravalue.MinArea*0.9)).ToString();

+ 1 - 0
TestWork.DLL/CCDCount.DLL.csproj

@@ -92,6 +92,7 @@
     <Compile Include="SqlDataClass\BatchMessSqliteDataClass.cs" />
     <Compile Include="SqlDataClass\UserMessSqliteDataClass.cs" />
     <Compile Include="Tools\IniFileClass.cs" />
+    <Compile Include="Tools\LineScanCameraCalibrator.cs" />
     <Compile Include="Tools\LoadSplieImageClass.cs" />
     <Compile Include="Tools\LogClass.cs" />
     <Compile Include="MainThreadClass.cs" />

+ 47 - 35
TestWork.DLL/FormulationClass.cs

@@ -36,46 +36,56 @@ namespace CCDCount.DLL
                 MAX_GAP = shuLiConfig.MAX_GAP,
                 MAX_Object_LENGTH = shuLiConfig.MAX_Object_LENGTH,
                 MIN_Object_LENGTH = shuLiConfig.MIN_Object_LENGTH,
+                ScaleX = shuLiConfig.ScaleX,
+                ScaleY = shuLiConfig.ScaleY,
             };
             if(plcParaModel != null)
             {
-                result.SpeedModeRunningSpeed = plcParaModel.SpeedModeRunningSpeed;
-                result.JogSpeed = plcParaModel.JogSpeed;
+                result.FillingMode = plcParaModel.FillingMode;
+                result.BeltsSpeed = plcParaModel.BeltsSpeed;
+                result.ShakeTable1H_FillingSpeed = plcParaModel.ShakeTable1H_FillingSpeed;
+                result.ShakeTable2H_FillingSpeed = plcParaModel.ShakeTable2H_FillingSpeed;
+                result.ShakeTable3H_FillingSpeed = plcParaModel.ShakeTable3H_FillingSpeed;
+                result.ShakeTable1M_FillingSpeed = plcParaModel.ShakeTable1M_FillingSpeed;
+                result.ShakeTable2M_FillingSpeed = plcParaModel.ShakeTable2M_FillingSpeed;
+                result.ShakeTable3M_FillingSpeed = plcParaModel.ShakeTable3M_FillingSpeed;
+                result.ShakeTable1L_FillingSpeed = plcParaModel.ShakeTable1L_FillingSpeed;
+                result.ShakeTable2L_FillingSpeed = plcParaModel.ShakeTable2L_FillingSpeed;
+                result.ShakeTable3L_FillingSpeed = plcParaModel.ShakeTable3L_FillingSpeed;
+                result.ShakeTable1H_CacheSpeed = plcParaModel.ShakeTable1H_CacheSpeed;
+                result.ShakeTable2H_CacheSpeed = plcParaModel.ShakeTable2H_CacheSpeed;
+                result.ShakeTable3H_CacheSpeed = plcParaModel.ShakeTable3H_CacheSpeed;
+                result.ShakeTable1M_CacheSpeed = plcParaModel.ShakeTable1M_CacheSpeed;
+                result.ShakeTable2M_CacheSpeed = plcParaModel.ShakeTable2M_CacheSpeed;
+                result.ShakeTable3M_CacheSpeed = plcParaModel.ShakeTable3M_CacheSpeed;
+                result.ShakeTable1L_CacheSpeed = plcParaModel.ShakeTable1L_CacheSpeed;
+                result.ShakeTable2L_CacheSpeed = plcParaModel.ShakeTable2L_CacheSpeed;
+                result.ShakeTable3L_CacheSpeed = plcParaModel.ShakeTable3L_CacheSpeed;
+                result.FillingH_SpeedRatio = plcParaModel.FillingH_SpeedRatio;
+                result.FillingM_SpeedRatio = plcParaModel.FillingM_SpeedRatio;
+                result.FillingL_SpeedRatio = plcParaModel.FillingL_SpeedRatio;
+                result.CacheH_SpeedRatio = plcParaModel.CacheH_SpeedRatio;
+                result.CacheM_SpeedRatio = plcParaModel.CacheM_SpeedRatio;
+                result.CacheL_SpeedRatio = plcParaModel.CacheL_SpeedRatio;
+                result.ScrewJogSpeed = plcParaModel.ScrewJogSpeed;
+                result.InBottleSpeed = plcParaModel.InBottleSpeed;
+                result.BottlePosSpeed = plcParaModel.BottlePosSpeed;
+                result.BottlePosPosition = plcParaModel.BottlePosPosition;
+                result.FillingValveOpenSpeed = plcParaModel.FillingValveOpenSpeed;
+                result.FillingValveOpenPosition = plcParaModel.FillingValveOpenPosition;
+                result.FillingValveCloseSpeed = plcParaModel.FillingValveCloseSpeed;
+                result.FillingValveClosePosition = plcParaModel.FillingValveClosePosition;
+                result.FillingValveCacheSpeed = plcParaModel.FillingValveCacheSpeed;
+                result.FillingValueCachePosition = plcParaModel.FillingValueCachePosition;
+                result.FillingValueJogSpeed = plcParaModel.FillingValueJogSpeed;
+                result.MachineDelayFunneDownTime = plcParaModel.MachineDelayFunneDownTime;
+                result.MachineDelayFunneUpTime = plcParaModel.MachineDelayFunneUpTime;
+                result.MachineDelayFillingValveOpenTime = plcParaModel.MachineDelayFillingValveOpenTime;
+                result.MachineDelayFillingValveCloseTime = plcParaModel.MachineDelayFillingValveCloseTime;
+                result.MachineDelayInBottleTime = plcParaModel.MachineDelayInBottleTime;
+                result.ValveDelytime = plcParaModel.ValveDelytime;
                 result.BottValueSet = plcParaModel.BottValueSet;
-                result.TransferValveOpeningSpeed = plcParaModel.TransferValveOpeningSpeed;
-                result.TransferValveOpeningTime = plcParaModel.TransferValveOpeningTime;
-                result.BottingDecelerationValue = plcParaModel.BottingDecelerationValue;
-                result.CacheDecelerationValue = plcParaModel.CacheDecelerationValue;
-                result.CacheCountDelayTiming = plcParaModel.CacheCountDelayTiming;
                 result.CacheShutdownValue = plcParaModel.CacheShutdownValue;
-                result.BottingMaterialCylinderVibrationTableHighSpeedValue = plcParaModel.BottingMaterialCylinderVibrationTableHighSpeedValue;
-                result.BottingFilterVibrationTableHighSpeedValue = plcParaModel.BottingFilterVibrationTableHighSpeedValue;
-                result.BottingCountVibrationTableHighSpeedValue = plcParaModel.BottingCountVibrationTableHighSpeedValue;
-                result.BottingMaterialCylinderVibrationTableDecelerationSpeedValue = plcParaModel.BottingMaterialCylinderVibrationTableDecelerationSpeedValue;
-                result.BottingFilterVibrationTableDecelerationSpeedValue = plcParaModel.BottingFilterVibrationTableDecelerationSpeedValue;
-                result.BottingCountVibrationTableDecelerationSpeedValue = plcParaModel.BottingCountVibrationTableDecelerationSpeedValue;
-                result.CacheMaterialCylinderVibrationTableHighSpeedValue = plcParaModel.CacheMaterialCylinderVibrationTableHighSpeedValue;
-                result.CacheFilterVibrationTableHighSpeedValue = plcParaModel.CacheFilterVibrationTableHighSpeedValue;
-                result.CacheCountVibrationTableHighSpeedValue = plcParaModel.CacheCountVibrationTableHighSpeedValue;
-                result.CacheMaterialCylinderVibrationTableDecelerationSpeedValue = plcParaModel.CacheMaterialCylinderVibrationTableDecelerationSpeedValue;
-                result.CacheFilterVibrationTableDecelerationSpeedValue = plcParaModel.CacheFilterVibrationTableDecelerationSpeedValue;
-                result.CacheCountVibrationTableDecelerationSpeedValue = plcParaModel.CacheCountVibrationTableDecelerationSpeedValue;
-                result.GateOpeningDelay = plcParaModel.GateOpeningDelay;
-                result.ReturnToZeroOffsetValue = plcParaModel.ReturnToZeroOffsetValue;
-                result.ReturnToZeroOffsetSpeed = plcParaModel.ReturnToZeroOffsetSpeed;
-                result.TransferValveClosingSpeed = plcParaModel.TransferValveClosingSpeed;
-                result.TransferValveOpenPosition = plcParaModel.TransferValveOpenPosition;
-                result.TransferValveClosePosition = plcParaModel.TransferValveClosePosition;
-                result.AirValveOpeningDelay = plcParaModel.AirValveOpeningDelay;
-                result.BottlingShutdownValue = plcParaModel.BottlingShutdownValue;
-                result.BottlingShutdownTime = plcParaModel.BottlingShutdownTime;
-                result.BottleFeedingWheelRunningSpeed = plcParaModel.BottleFeedingWheelRunningSpeed;
-                result.BottleFeedingWheelJogRunningSpeed = plcParaModel.BottleFeedingWheelJogRunningSpeed;
-                result.BottleFeedingWheelReturnToZeroOffsetValue = plcParaModel.BottleFeedingWheelReturnToZeroOffsetValue;
-                result.BottleFeedingWheelReturnToZeroSpeed = plcParaModel.BottleFeedingWheelReturnToZeroSpeed;
-                result.BottleFeedingWheelPositionLength = plcParaModel.BottleFeedingWheelPositionLength;
-                result.BottleFeedingWheelPauseTime = plcParaModel.BottleFeedingWheelPauseTime;
-                result.DelayBlanking = plcParaModel.DelayBlanking;
             }
             else
             {
@@ -107,6 +117,8 @@ namespace CCDCount.DLL
             formulationConfig.MAX_GAP = shuLiConfig.MAX_GAP;
             formulationConfig.MAX_Object_LENGTH = shuLiConfig.MAX_Object_LENGTH;
             formulationConfig.MIN_Object_LENGTH = shuLiConfig.MIN_Object_LENGTH;
+            formulationConfig.ScaleX = shuLiConfig.ScaleX;
+            formulationConfig.ScaleY = shuLiConfig.ScaleY;
         }
     }
 }

+ 247 - 62
TestWork.DLL/MainThreadClass.cs

@@ -10,6 +10,7 @@ using MvCameraControl;
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
+using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder;
 using System.Diagnostics;
 using System.Drawing;
 using System.Linq;
@@ -59,6 +60,7 @@ namespace CCDCount.DLL
 
         // 返回交换线程状态
         public bool CameraRunStatic { get { return IsSwitch; } }
+        public bool CameraSendMessageStatic { get { return IsSend; } }
 
         public bool IsOpenLoadThread { get  { return _IsOpenLoadThread; }}
         private bool _IsOpenLoadThread = false;
@@ -88,7 +90,7 @@ namespace CCDCount.DLL
         private bool _ShuLiState = true;
         public bool ShuLiState { get { return _ShuLiState; } }
 
-        private bool _IsDebug = false;
+        private bool _IsDebug = true;
         public bool IsDebug { get { return _IsDebug; } }
         private bool IsConnectModbus = false;
 
@@ -235,7 +237,7 @@ namespace CCDCount.DLL
                 actionMesSqliteDataClass.GetAllActionMinStartMaxEndLine(out int num, out int StartLine, out int EndLine);
                 shuLiClass.InitCurrentLine(EndLine);
                 //shuLiClass.InitNum(num);
-                // 取图线程开启
+                // 取图开启
                 if (!cameraClass.StartCamera())
                 {
                     return result;
@@ -465,6 +467,17 @@ namespace CCDCount.DLL
             return result;
         }
 
+        public bool ClearSendQueue()
+        {
+            bool result = false;
+            while(SendQueue.Count>0)
+            {
+                SendQueue.TryDequeue(out TestSenMessage testSen);
+            }
+            result = true;
+            return result;
+        }
+
         /// <summary>
         /// 获取过去一秒内颗粒数量
         /// </summary>
@@ -523,6 +536,10 @@ namespace CCDCount.DLL
             } 
         }
 
+        /// <summary>
+        /// 运行参数训练
+        /// </summary>
+        /// <returns></returns>
         public ParaTrainResultClass ParameterTrain()
         {
             var ListValues = shuLiClass.GetHistoryActive();
@@ -533,37 +550,104 @@ namespace CCDCount.DLL
                 {
                     ListValues = ListValues.Skip(ListValues.Count - 500).OrderByDescending(o => o.Area).ToList();
                 }
-                if (ListValues.Count < 2) return Result;
-                int ChazhiId = -1;
-                int MaxChazhi = 0;
-                for (int i = 1; i < ListValues.Count; i++)
+                if (ListValues.Count < 2)
+                {
+                    Result = null;
+                    return Result;
+                }
+
+                Result.NoiseFilterThreshold = 5;
+
+                var LengthListValues = ListValues.OrderBy(o => o.MaxLength).Skip(100).Take(300).ToList();
+                Result.MaxLength = Convert.ToInt32(ListValues.Max(x => x.MaxLength) * 1.1);
+                Result.MinLength = Convert.ToInt32(ListValues.Min(x => x.MaxLength) * 0.9);
+
+                var AreaListValues = ListValues.OrderBy(o => o.Area).Skip(100).Take(300).ToList();
+                Result.MaxArea = Convert.ToInt32(ListValues.Max(x => x.Area) * 1.1);
+                Result.MinArea = Convert.ToInt32(ListValues.Min(x => x.Area) * 0.9);
+            }
+            return Result;
+        }
+        public ParaTrainResultClass ParameterTrain(int KeliW,int KeliL)
+        {
+            var ListValues = shuLiClass.GetHistoryActive();
+            ParaTrainResultClass Result = new ParaTrainResultClass();
+            List<ActiveObjectClass> LengthListValues = null;
+            List<ActiveObjectClass> AreaListValues = null;
+            if (ListValues.Count() > 0)
+            {
+                try
                 {
-                    if ((ListValues[i - 1].Area*3 <= ListValues[i].Area))
+                    LOG.log("参数训练-数据筛选", 6);
+                    if (ListValues.Count() > 1000)
+                    {
+                        ListValues = ListValues.Skip(ListValues.Count - 1000).OrderByDescending(o => o.Num).ToList();
+                    }
+                    if (ListValues.Count < 2)
+                    {
+                        Result = null;
+                        return Result;
+                    }
+                    List<MaxLengthModel> maxLengthModels = new List<MaxLengthModel>();
+                    LOG.log("参数训练-凸包计算-未标定长度检测", 6);
+                    foreach (var item in ListValues)
                     {
-                        int Chazhi = (ListValues[i - 1].Area - ListValues[i].Area);
-                        if (Chazhi > MaxChazhi)
+                        List<Point> points = shuLiClass.ConvexHull(item.RowsData);
+                        var itemLenValue = shuLiClass.CoefficientCalculateMinimumBoundingRectangle(points);
+                        var UseValue = new MaxLengthModel()
                         {
-                            MaxChazhi = Chazhi;
-                            ChazhiId = i;
-                        }
+                            MaxLength = itemLenValue.Height,
+                            Point1 = itemLenValue.HeightPoints[0],
+                            Point2 = itemLenValue.HeightPoints[1]
+                        };
+                        maxLengthModels.Add(UseValue);
                     }
-                }
-                if (ChazhiId != -1)
-                {
-                    Result.NoiseFilterThreshold = ListValues[ChazhiId].Area>=200?200:(int)(ListValues[ChazhiId].Area * 1.1);
-                }
-                else
-                {
+
+                    LOG.log("参数训练-标定计算", 6);
+                    var ScaleResult = LineScanCameraCalibrator.CalculateLineScanPixelScale(maxLengthModels, KeliL);
+
+                    shuLiClass.SetXCoefficient(ScaleResult.XScale);
+                    shuLiClass.SetYCoefficient(ScaleResult.YScale);
+                    shuLiConfig.ScaleX = ScaleResult.XScale;
+                    shuLiConfig.ScaleY = ScaleResult.YScale;
+                    Result.ScaleX = ScaleResult.XScale;
+                    Result.ScaleY = ScaleResult.YScale;
+
                     Result.NoiseFilterThreshold = 5;
+                    LOG.log("参数训练-计算标定后的长度", 6);
+                    foreach (var item in ListValues)
+                    {
+                        item.MaxLength = shuLiClass.SizeCalculation(item.RowsData).Height;
+                    }
+                    LOG.log("参数训练-长度数据筛选", 6);
+                    if (ListValues.Count >= 1000)
+                    {
+                        LengthListValues = ListValues.OrderBy(o => o.MaxLength).Skip(50).Take(900).ToList();
+                    }
+                    else
+                    {
+                        LengthListValues = ListValues.OrderBy(o => o.MaxLength).Skip(10).Take(ListValues.Count - 20).ToList();
+                    }
+                    LOG.log("参数训练-长度数据计算", 6);
+                    Result.MaxLength = Convert.ToInt32(LengthListValues.Max(x => x.MaxLength)) + 1;
+                    Result.MinLength = Convert.ToInt32(LengthListValues.Min(x => x.MaxLength) - 1);
+                    LOG.log("参数训练-面积数据筛选", 6);
+                    if (ListValues.Count >= 1000)
+                    {
+                        AreaListValues = ListValues.OrderBy(o => o.Area).Skip(50).Take(900).ToList();
+                    }
+                    else
+                    {
+                        AreaListValues = ListValues.OrderBy(o => o.Area).Skip(10).Take(ListValues.Count - 20).ToList();
+                    }
+                    LOG.log("参数训练-面积数据计算", 6);
+                    Result.MaxArea = Convert.ToInt32(AreaListValues.Max(x => x.Area)) + 1;
+                    Result.MinArea = Convert.ToInt32(AreaListValues.Min(x => x.Area)) - 1;
                 }
-                if (Result.NoiseFilterThreshold != -1)
+                catch(Exception ex)
                 {
-                    ListValues = ListValues.Where(o => o.Area >= Result.NoiseFilterThreshold).ToList();
+                    LOG.error(ex.Message);
                 }
-                Result.MaxArea = ListValues.Max(x => x.Area);
-                Result.MinArea = ListValues.Min(x => x.Area);
-                Result.MaxLength = ListValues.Max(x => x.MaxLength);
-                Result.MinLength = ListValues.Min(x => x.MaxLength);
             }
             return Result;
         }
@@ -597,6 +681,7 @@ namespace CCDCount.DLL
 
             //Int16 result = new Int16();
             ushort[] result = new ushort[2];
+            var Hset = new HashSet<int>();
             // 事件处理逻辑
             foreach (ActiveObjectClass oneActive in e.Actives)
             {
@@ -605,7 +690,8 @@ namespace CCDCount.DLL
                 if (BatchNumber!="") oneActive.BatchNumber = BatchNumber;
                 LOG.log(string.Format("输出当前颗粒信息,颗粒编号:{0},开始时间:{1},结束时间:{2},识别耗时:{3},颗粒状态:{4},通道数:{5}",
                     oneActive.Num, oneActive.StartCheckTime.ToString("O"), oneActive.EndCheckTime.ToString("O"),UseTime.ToString(), oneActive.StateCode, oneActive.ChannelNO), 6);
-                
+
+                //记录到数据库
                 ThreadPool.QueueUserWorkItem(_ =>
                 {
                     if (actionMesSqliteDataClass != null)
@@ -621,43 +707,68 @@ namespace CCDCount.DLL
                     }
                 });
 
-                //if (oneActive.StateCode != 7 && oneActive.ChannelNO != -1)
-                //{
-                //    //单通道合格计数
-                //    result |= (ushort)(1 << oneActive.ChannelNO);
-                //    if (oneActive.StateCode != 0)
-                //    {
-                //        result |= (ushort)(1 << (8 + oneActive.ChannelNO));
-                //    }
-                //}
-                //else
-                //{
-                //    //单通道不合格计数
-                //    Console.WriteLine($"通道{oneActive.ChannelNO}的激活数据有误!");
-                //}
-                //新的数据发送格式,需要与新的PLC程序配合
-                if(oneActive.ChannelNO == -1)
+                if (!Hset.Add(oneActive.ChannelNO))
                 {
-                    FaultLog.RecordErrorMessage("颗粒通道判定异常");
-                    return ;
-                }
-                if (oneActive.StateCode == 0)
-                {
-                    //单通道合格计数
-                    result[0] |= (ushort)(1 << oneActive.ChannelNO);
+                    //有重复的通道的异常记录流程
+                    var EResult = new ushort[2];
+                    //正常运行流程
+                    if (oneActive.ChannelNO == -1)
+                    {
+                        FaultLog.RecordErrorMessage("颗粒通道判定异常");
+                        continue;
+                    }
+                    if (oneActive.StateCode == 0)
+                    {
+                        //单通道合格计数
+                        EResult[0] |= (ushort)(1 << oneActive.ChannelNO);
+                    }
+                    else
+                    {
+                        if (oneActive.StateCode != 7)
+                        {
+                            //单通道不合格计数
+                            EResult[1] |= (ushort)(1 << (oneActive.ChannelNO));
+                        }
+                        else if (oneActive.StateCode == 7)
+                        {
+                            FaultLog.RecordErrorMessage("视野存在遮挡,请检查相机");
+                        }
+                    }
+                    SendQueue.Enqueue(new TestSenMessage()
+                    {
+                        Message = EResult,
+                        NumMessage = new ushort[] { (ushort)oneActive.Num },
+                        count = 1
+                    });
+                    continue;
                 }
                 else
                 {
-                    if (oneActive.StateCode != 7)
+                    //正常运行流程
+                    if (oneActive.ChannelNO == -1)
                     {
-                        //单通道不合格计数
-                        result[1] |= (ushort)(1 << (oneActive.ChannelNO));
+                        FaultLog.RecordErrorMessage("颗粒通道判定异常");
+                        continue;
                     }
-                    else if (oneActive.StateCode == 7)
+                    if (oneActive.StateCode == 0)
                     {
-                        FaultLog.RecordErrorMessage("视野存在遮挡,请检查相机");
+                        //单通道合格计数
+                        result[0] |= (ushort)(1 << oneActive.ChannelNO);
+                    }
+                    else
+                    {
+                        if (oneActive.StateCode != 7)
+                        {
+                            //单通道不合格计数
+                            result[1] |= (ushort)(1 << (oneActive.ChannelNO));
+                        }
+                        else if (oneActive.StateCode == 7)
+                        {
+                            FaultLog.RecordErrorMessage("视野存在遮挡,请检查相机");
+                        }
                     }
                 }
+                
             }
             //LOG.log("当前待发送队列数量:" + SendQueue.Count, 6);
             if (IsSend)
@@ -753,25 +864,28 @@ namespace CCDCount.DLL
         /// <summary>
         /// 启动发送消息线程
         /// </summary>
-        private void StartSendBottLogicMessageThread()
+        private bool StartSendBottLogicMessageThread()
         {
+            bool result = false;
             try
             {
-                if(!IsConnectModbus) return;
+                if(!IsConnectModbus) return result;
 
                 timeBeginPeriod(1); // 设置为1ms精度
                 IsSend = true;
                 SendBottLogicMessageThread = new Thread(SendBottLogicMessageProcess);
                 SendBottLogicMessageThread.Start();
                 SystemAlarm.AlarmCancel(AlarmMessageList.结果发送线程启动失败);
+                result = true;
             }
             catch (Exception ex)
             {
                 //FaultLog.RecordErrorMessage("MianThread-StartSendBottLogicMessageThread:Start thread failed!, " + ex.Message);
                 SystemAlarm.AlarmAlert(AlarmMessageList.结果发送线程启动失败, "MianThread-StartSendBottLogicMessageThread:Start thread failed!, " + ex.Message, "DLL:MainThreadClass-StartSendBottLogicMessageThread");
                 Console.WriteLine("MianThread-StartSendBottLogicMessageThread:Start thread failed!, " + ex.Message);
-                throw;
+                result = false;
             }
+            return result;
         }
         /// <summary>
         /// 停止发送消息线程
@@ -798,7 +912,7 @@ namespace CCDCount.DLL
         /// <summary>
         /// 信息发送线程
         /// </summary>
-        private void SendBottLogicMessageProcess()
+        private void SendBottLogicMessageProcess1()
         {
             //获取数据
             TestSenMessage sendMessage;
@@ -840,18 +954,89 @@ namespace CCDCount.DLL
                     {
                         //写入数据
                         modbusTcpClient.WriteMultipleRegisters(slaveId: 1, startAddress: 100, values: sendMessage.Message);
-                        modbusTcpClient.WriteMultipleRegisters(slaveId: 1, startAddress: 150, values: sendMessage.NumMessage);
-                        modbusTcpClient.WriteSingleRegister(slaveId: 1, registerAddress: 170, value: sendMessage.count);
                         modbusTcpClient.WriteCoilsRegister(slaveId: 1, CoilsAddress: 11, values: true);
                         sw.Stop();
                         LOG.log(string.Format("SendMessageOk:{0},SendMessageNg:{1},此次写值耗时:{2},此次写入数据量{3}", sendMessage.Message[0],sendMessage.Message[1], sw.Elapsed,sendMessage.count), 6);
                     }
-
-                    //FaultLog.RecordLogMessage(string.Format("sendMessage[1]:{0},此次写值耗时:{1}", sendMessage, sw.Elapsed),1);
                 }
                 Thread.Sleep(1);
             }
         }
+
+        /// <summary>
+        /// 信息发送线程2
+        /// </summary>
+        private void SendBottLogicMessageProcess()
+        {
+            //获取数据
+            TestSenMessage sendMessage;
+            Stopwatch sw = Stopwatch.StartNew();
+            ushort writedoneMes = 0;
+            writedoneMes |= (ushort)(1 << 0);
+            while (IsSend)
+            {
+                //LOG.log("进入线程", 6);
+                sw.Restart();
+                sendMessage = new TestSenMessage();
+                ushort[] ReturnValue = null;
+                ushort[] result = new ushort[20];
+                modbusTcpClient.ReadHoldingRegisters(slaveId: 1, startAddress: 0, numRegisters: 1, out ReturnValue);
+                if (ReturnValue == null)
+                {
+                    continue;
+                }
+                if ((ReturnValue[0] & 1) == 0)
+                {
+                    if (SendQueue.Count > 0)
+                    {
+                        int SendMessageCount = SendQueue.Count > 10 ? 10 : SendQueue.Count;
+                        LOG.log(string.Format("待发送数量{0}", SendQueue.Count), 6);
+                        for (int i = 0; i < SendMessageCount; i++)
+                        {
+                            if (!SendQueue.TryDequeue(out sendMessage))
+                            {
+                                //FaultLog.RecordErrorMessage("MainThreadClass-SendBottLogicMessageProcess-SendQueue.TryDequeue failed!");
+                            }
+                            if (sendMessage.Message == null)
+                            {
+                                continue;
+                            }
+                            result[i * 2] = sendMessage.Message[0];
+                            result[i * 2 + 1] = sendMessage.Message[1];
+                        }
+
+                    }
+                }
+                //写入数据
+                modbusTcpClient.WriteMultipleRegisters(slaveId: 1, startAddress: 100, values: result);
+                modbusTcpClient.WriteSingleRegister(slaveId: 1, registerAddress: 0, value: writedoneMes);
+                if (result[0] != 0 || result[1] != 0)
+                {
+                    LOG.log(string.Format("SendMess1Ok:{0},SendMess1Ng:{1},SendMess2Ok:{2},SendMess2Ng:{3}," +
+                        "\nSendMessage3Ok:{4},SendMessage3Ng:{5},SendMessage4Ok:{6},SendMessage4Ng:{7}," +
+                        "\nSendMessage5Ok:{8},SendMessage5Ng:{9},SendMessage6Ok:{10},SendMessage6Ng:{11}," +
+                        "\nSendMessage7Ok:{12},SendMessage7Ng:{13},SendMessage8Ok:{14},SendMessage8Ng:{15}," +
+                        "\nSendMessage9Ok:{16},SendMessage9Ng:{17},SendMessage10Ok:{18},SendMessage10Ng:{19}," +
+                        "\n此次写值耗时:{20},此次写入数据量{21}",
+                        result[0], result[1], result[2], result[3],
+                        result[4], result[5], result[6], result[7],
+                        result[8], result[9], result[10], result[11],
+                        result[12], result[13], result[14], result[15],
+                        result[16], result[17], result[18], result[19],
+                        sw.Elapsed, sendMessage.count), 6);
+                }
+                sw.Stop();
+                int sleepvalue = 10 - (int)sw.ElapsedMilliseconds;
+                if (sleepvalue > 0)
+                {
+                    Thread.Sleep(sleepvalue);
+                }
+                else
+                {
+                    FaultLog.RecordErrorMessage("MainThreadClass-SendBottLogicMessageProcess-SendQueue.SendMessage TimeOut");
+                }
+            }
+        }
         #endregion
 
         #region 外部函数

Разлика између датотеке није приказан због своје велике величине
+ 443 - 403
TestWork.DLL/PLCManagementClass.cs


+ 432 - 141
TestWork.DLL/ShuLiClass.cs

@@ -1,5 +1,6 @@
 using CCDCount.DLL.AlarmTools;
 using CCDCount.MODEL.ConfigModel;
+using CCDCount.MODEL.ResultModel;
 using CCDCount.MODEL.ShuLiModel;
 using LogClass;
 using MvCameraControl;
@@ -34,12 +35,12 @@ namespace CCDCount.DLL
         private List<int> _ChannelsRoi = new List<int>();
         private int ChannelWidth = 0;//每个区域的宽度
         private int IdentifyImageWidth = -1;
-        //private static readonly object _lockObj = new object(); // 专用锁对象
         private int ObjectNum = 0;
         public int ImageNum { get { return IFrameDatas.Count; } }
         private ReaderWriterLockSlim _rwLock = new ReaderWriterLockSlim();
         private double XCoefficient = 1;
-        private double YCoefficient = 1;
+        private double YCoefficient = 2;
+        private DateTime[] ChannelIntervalTime = new DateTime[8];
         #endregion
 
         #region 公共方法
@@ -54,13 +55,24 @@ namespace CCDCount.DLL
                 Channel = 8,
                 PandingCode = 2
             };
+            for(int i = 0; i < ChannelIntervalTime.Length; i++)
+            {
+                ChannelIntervalTime[i] = DateTime.Now;
+            }
+
         }
+
+        /// <summary>
+        /// 带参数的构造方法
+        /// </summary>
         public ShuLiClass(ShuLiConfigClass config)
         {
             if (config.IsLoadCanfig)
             {
                 // 加载传出的参数
                 shuLiConfig = config;
+                XCoefficient = shuLiConfig.ScaleX;
+                YCoefficient = shuLiConfig.ScaleY;
             }
             else
             {
@@ -140,9 +152,27 @@ namespace CCDCount.DLL
                     item.Num = Interlocked.Increment(ref ObjectNum) + 1;
                     item.ChannelNO = ActiveChannel(item);
                     item.EndCheckTime = DateTime.Now;
-                    item.MaxLength = GetActionMaxLength(item.RowsData);
-                    //item.MaxLength = 100;
-                    if ((item.LastSeenLine - item.StartLine) > shuLiConfig.MAX_Idetify_Height)
+                    if(item.StartLine == item.LastSeenLine)
+                    {
+                        item.MaxLength = item.MaxEndCol - item.MinStartCol;
+                        item.StateCode = 10;
+                        LOG.log(string.Format("颗粒{0}的有效高度仅一行", item.Num));
+                    }
+                    else
+                    {
+                        var CalculationResult = SizeCalculation(item.RowsData);
+                        item.MaxLength = CalculationResult.Height;
+                        item.hasSignificantConcavity = CalculationResult.hasSignificantConcavity;
+                        item.concavityRatio = CalculationResult.concavityRatio;
+                        if(CalculationResult.hasSignificantConcavity)
+                        {
+                            if(CalculationResult.concavityRatio>0.3)
+                            {
+                                item.StateCode= 11;
+                            }
+                        }
+                    }
+                    if ((item.LastSeenLine - item.StartLine) > shuLiConfig.MAX_Idetify_Height&&item.StateCode != -1)
                     {
                         item.StateCode = 7;
                         //FaultLog.RecordLogMessage("ShuLiClass-ProcessLine:非颗粒,视野异常", 3);
@@ -150,49 +180,49 @@ namespace CCDCount.DLL
                         //Console.WriteLine("ShuLiClass-ProcessLine:非颗粒,视野异常");
                     }
                     else if (shuLiConfig.PandingCode != -1)
+                    {
+                        if (item.StateCode != -1)
                         {
-                            if (item.StateCode != -1)
+                            if (item.StateCode == 8)
                             {
-                                if (item.StateCode == 8)
-                                {
-                                    LOG.log(string.Format("颗粒编号{0}:疑似叠片或缺损", item.Num));
-                                }
-                            }
-                            else if (item.Area < shuLiConfig.MinArea
-                                && (shuLiConfig.PandingCode == 2 || shuLiConfig.PandingCode == 1))
-                            {
-                                item.StateCode = 5;
-                                LOG.log(string.Format("颗粒编号{0}:面积过小", item.Num));
-                                Console.WriteLine("颗粒编号{0}:面积过小", item.Num);
-                            }
-                            else if (item.Area > shuLiConfig.MaxArea
-                                && (shuLiConfig.PandingCode == 2 || shuLiConfig.PandingCode == 1))
-                            {
-                                item.StateCode = 6;
-                                LOG.log(string.Format("颗粒编号{0}:面积过大", item.Num));
-                                Console.WriteLine("颗粒编号{0}:面积过大", item.Num);
-                            }
-                            else if (item.MaxLength < shuLiConfig.MIN_Object_LENGTH
-                                && (shuLiConfig.PandingCode == 2 || shuLiConfig.PandingCode == 0))
-                            {
-                                item.StateCode = 2;
-                                LOG.log(string.Format("颗粒编号{0}:超短粒", item.Num));
-                                Console.WriteLine("颗粒编号{0}:超短粒", item.Num);
-                            }
-                            else if (item.MaxLength > shuLiConfig.MAX_Object_LENGTH
-                                && (shuLiConfig.PandingCode == 2 || shuLiConfig.PandingCode == 0))
-                            {
-                                item.StateCode = 1;
-                                LOG.log(string.Format("颗粒编号{0}:超长粒", item.Num));
-                                Console.WriteLine("颗粒编号{0}:超长粒", item.Num);
-                            }
-                            else
-                            {
-                                item.StateCode = 0;
-                                LOG.log(string.Format("颗粒编号{0}:正常粒", item.Num));
-                                Console.WriteLine("颗粒编号{0}:正常粒", item.Num);
+                                LOG.log(string.Format("颗粒编号{0}:疑似叠片或缺损", item.Num));
                             }
                         }
+                        else if (item.Area < shuLiConfig.MinArea
+                            && (shuLiConfig.PandingCode == 2 || shuLiConfig.PandingCode == 1))
+                        {
+                            item.StateCode = 5;
+                            LOG.log(string.Format("颗粒编号{0}:面积过小", item.Num));
+                            Console.WriteLine("颗粒编号{0}:面积过小", item.Num);
+                        }
+                        else if (item.Area > shuLiConfig.MaxArea
+                            && (shuLiConfig.PandingCode == 2 || shuLiConfig.PandingCode == 1))
+                        {
+                            item.StateCode = 6;
+                            LOG.log(string.Format("颗粒编号{0}:面积过大", item.Num));
+                            Console.WriteLine("颗粒编号{0}:面积过大", item.Num);
+                        }
+                        else if (item.MaxLength < shuLiConfig.MIN_Object_LENGTH
+                            && (shuLiConfig.PandingCode == 2 || shuLiConfig.PandingCode == 0))
+                        {
+                            item.StateCode = 2;
+                            LOG.log(string.Format("颗粒编号{0}:超短粒", item.Num));
+                            Console.WriteLine("颗粒编号{0}:超短粒", item.Num);
+                        }
+                        else if (item.MaxLength > shuLiConfig.MAX_Object_LENGTH
+                            && (shuLiConfig.PandingCode == 2 || shuLiConfig.PandingCode == 0))
+                        {
+                            item.StateCode = 1;
+                            LOG.log(string.Format("颗粒编号{0}:超长粒", item.Num));
+                            Console.WriteLine("颗粒编号{0}:超长粒", item.Num);
+                        }
+                        else
+                        {
+                            item.StateCode = 0;
+                            LOG.log(string.Format("颗粒编号{0}:正常粒", item.Num));
+                            Console.WriteLine("颗粒编号{0}:正常粒", item.Num);
+                        }
+                    }
                     OneActive.Add(item);
                 }
                 stopwatch.Stop();
@@ -203,13 +233,9 @@ namespace CCDCount.DLL
                 //stopwatch.Restart();
                 if (OneActive.Count > 0)
                 {
-                    //LOG.log(string.Format("识别完成,首个颗粒编号:{0},颗粒数量:{1}", OneActive[0].Num, OneActive.Count), 6);
                     //触发回调事件
-                    //Task.Run(() =>
-                    //{
-                    //    OnWorkCompleted(OneActive);
-                    //});
-                    ThreadPool.QueueUserWorkItem(_ =>OnWorkCompleted(OneActive));
+                    OnWorkCompleted(OneActive);
+                    //ThreadPool.QueueUserWorkItem(_ =>OnWorkCompleted(OneActive));
                 }
                 stopwatch.Stop();
                 //if (stopwatch.ElapsedMilliseconds > 1)
@@ -221,16 +247,12 @@ namespace CCDCount.DLL
             {
                 OneActive.Clear();
             }
-            //lock (_lockObj)
-            //{
             _rwLock.EnterWriteLock();
             // 累加到总数并从活跃物体转移到历史物体
             OneActive.ForEach(o => TryAdd(historyActiveObjects, o, 2500));
             //lostObjects.Where(o => o.StateCode != 7 && o.StateCode != 9).ToList().ForEach(o => TryAdd(historyActiveObjects, o, 2500));
             lostObjects.ForEach(o => activeObjects.Remove(o));
             _rwLock.ExitWriteLock();
-            //}
-
             return result;
         }
 
@@ -485,7 +507,7 @@ namespace CCDCount.DLL
         /// <param name="image">当前行像素数组</param>
         private bool ProcessLine(IImage imagedata, int RowNo)
         {
-            Stopwatch stopwatch = Stopwatch.StartNew();
+            //Stopwatch stopwatch = Stopwatch.StartNew();
             bool result = false;
             // 步骤1:检测当前行的有效区域
             var currentRegions = FindValidRegions(imagedata, RowNo);
@@ -503,14 +525,12 @@ namespace CCDCount.DLL
                 }
             }
             IsPrintLightOnError = false;
-            stopwatch.Stop();
-            if (stopwatch.ElapsedMilliseconds > 1)
-            {
-                FaultLog.RecordErrorMessage($"ShuLiClass-ProcessLine:图像连通域检测超时,此次识别耗时:{stopwatch.Elapsed}");
-            }
-            stopwatch.Restart();
-            //lock (_lockObj)
+            //stopwatch.Stop();
+            //if (stopwatch.ElapsedMilliseconds > 1)
             //{
+            //    FaultLog.RecordErrorMessage($"ShuLiClass-ProcessLine:图像连通域检测超时,此次识别耗时:{stopwatch.Elapsed}");
+            //}
+            //stopwatch.Restart();
             foreach (var region in currentRegions)
             {
 
@@ -540,7 +560,7 @@ namespace CCDCount.DLL
                         Area = matcheds.Sum(o => o.Area),
                         RowsData = CopeRowsData,
                         ImageWidth = matcheds.FirstOrDefault().ImageWidth,
-                        //StateCode = 8
+                        StateCode = 8
                     };
                     _rwLock.EnterWriteLock();
                     // 从活跃区域中删除被合并的区域
@@ -597,13 +617,12 @@ namespace CCDCount.DLL
                     _rwLock.ExitWriteLock();
                 }
             }
-            //}
-            stopwatch.Stop();
-            if (stopwatch.ElapsedMilliseconds > 1)
-            {
-                FaultLog.RecordErrorMessage($"ShuLiClass-ProcessLine:图像区域合并超时,此次识别耗时:{stopwatch.Elapsed}");
-            }
 
+            //stopwatch.Stop();
+            //if (stopwatch.ElapsedMilliseconds > 1)
+            //{
+            //    FaultLog.RecordErrorMessage($"ShuLiClass-ProcessLine:图像区域合并超时,此次识别耗时:{stopwatch.Elapsed}");
+            //}
             currentRegions.Clear();
             
             return result;
@@ -727,32 +746,60 @@ namespace CCDCount.DLL
         /// </summary>
         /// <param name="Rows"></param>
         /// <returns></returns>
-        private double GetActionMaxLength(List<RowStartEndCol> Rows)
+        public BoundingRectangleMdoel SizeCalculation(List<RowStartEndCol> Rows)
         {
             //Stopwatch stopwatch = Stopwatch.StartNew();
-            List<Point> points = ConvexHull(Rows);
+            ConvexResultClass points = ConvexHullWithConcavityDetection(Rows);
             //stopwatch.Stop();
             //Console.WriteLine($"凸包计算耗时:{stopwatch.Elapsed}");
-            //var test = CalculateMinimumBoundingRectangle(points);
-            var result = RotatingCalipers(points);
-            if (result!= null)
+            //var test = CalculateMinimumBoundingRectangle(points); 
+            var result = CoefficientCalculateMinimumBoundingRectangle(points.convexHull);
+            result.hasSignificantConcavity = points.hasSignificantConcavity;
+            result.concavityRatio = points.concavityRatio;
+            return result;
+        }
+
+        /// <summary>
+        /// 凸包点集合获取
+        /// </summary>
+        /// <param name="Rows"></param>
+        /// <returns></returns>
+        public List<Point> ConvexHull(List<RowStartEndCol> Rows)
+        {
+            List<Point> points = Rows.Select(o => new Point(o.StartCol, (int)o.RowsCol)).ToList();
+            points.AddRange(Rows.Select(o => new Point(o.EndCol, (int)o.RowsCol)).ToList());
+            points = points.OrderBy(o => o.X).ThenBy(o => o.Y).ToList();
+            var lower = new List<Point>();
+            foreach (var p in points)
             {
-                return result.Height;
+                while (lower.Count >= 2 && Cross(lower[lower.Count - 2], lower[lower.Count - 1], p) <= 0)
+                    lower.RemoveAt(lower.Count - 1);
+                lower.Add(p);
             }
-            else
+
+            var upper = new List<Point>();
+            for (int i = points.Count - 1; i >= 0; i--)
             {
-                return 0;
+                var p = points[i];
+                while (upper.Count >= 2 && Cross(upper[upper.Count - 2], upper[upper.Count - 1], p) <= 0)
+                    upper.RemoveAt(upper.Count - 1);
+                upper.Add(p);
             }
+
+            lower.RemoveAt(lower.Count - 1);
+            upper.RemoveAt(upper.Count - 1);
+            lower.AddRange(upper);
+            return lower;
         }
 
         /// <summary>
-        /// 凸包点集合获取
+        /// 凸包点集合获取,输出原点集
         /// </summary>
         /// <param name="Rows"></param>
         /// <returns></returns>
-        private List<Point> ConvexHull(List<RowStartEndCol> Rows)
+        public List<Point> ConvexHull(List<RowStartEndCol> Rows,out List<Point> points)
         {
-            List<Point> points = Rows.Select(o => new Point(o.StartCol, (int)o.RowsCol)).ToList();
+            points = Rows.Select(o => new Point(o.StartCol, (int)o.RowsCol)).ToList();
             points.AddRange(Rows.Select(o => new Point(o.EndCol, (int)o.RowsCol)).ToList());
             points = points.OrderBy(o => o.X).ThenBy(o => o.Y).ToList();
             var lower = new List<Point>();
@@ -779,52 +826,174 @@ namespace CCDCount.DLL
         }
 
         /// <summary>
-        /// 凸包最长边
+        /// 凸包点集合获取,同时检测较大的内凹
+        /// </summary>
+        /// <param name="Rows"></param>
+        /// <returns>返回凸包点集</returns>
+        public ConvexResultClass ConvexHullWithConcavityDetection(List<RowStartEndCol> Rows)
+        {
+            ConvexResultClass result = null;
+            // 构建原始点集
+            var lower = ConvexHull(Rows, out List<Point> originalPoints);
+
+            // 检测内凹
+            ConvexResultClass ConvexResult = DetectConcavity(originalPoints, lower);
+
+            return result = new ConvexResultClass()
+            {
+                convexHull = lower,
+                hasSignificantConcavity = ConvexResult.hasSignificantConcavity,
+                concavityRatio = ConvexResult.concavityRatio,
+            };
+        }
+
+        /// <summary>
+        /// 检测是否存在显著的内凹
+        /// </summary>
+        /// <param name="originalPoints">原始点集</param>
+        /// <param name="convexHull">凸包点集</param>
+        /// <returns>是否存在显著内凹和程度比值</returns>
+        private ConvexResultClass DetectConcavity(List<Point> originalPoints, List<Point> convexHull)
+        {
+            if (convexHull.Count < 3) return new ConvexResultClass()
+            {
+                hasSignificantConcavity = false,
+                concavityRatio = 0,
+            };
+
+            // 检查原始点集中有多少点在凸包内部(即非凸包顶点)
+            HashSet<Point> hullPoints = new HashSet<Point>(convexHull);
+            var internalPoints = originalPoints.Where(p => !hullPoints.Contains(p)).ToList();
+
+            if (internalPoints.Count == 0)
+            {
+                // 所有点都在凸包上,没有内凹
+                return new ConvexResultClass()
+                {
+                    hasSignificantConcavity = false,
+                    concavityRatio = 0,
+                };
+            }
+
+            // 计算凸包面积
+            double convexHullArea = CalculatePolygonArea(convexHull);
+
+            double PointsArea = CalculatePolygonArea(SortPointsByNearestNeighbor(originalPoints));
+
+            var concavityMeasure = (convexHullArea - PointsArea) / convexHullArea;
+
+
+            // 判断是否存在显著内凹(可以根据实际需求调整阈值)
+            bool hasSignificantConcavity = concavityMeasure > 0.3;
+
+            return new ConvexResultClass()
+            {
+                hasSignificantConcavity = hasSignificantConcavity,
+                concavityRatio = concavityMeasure,
+            }; 
+        }
+
+        /// <summary>
+        /// 计算封闭多边形的面积(鞋带公式)
+        /// </summary>
+        /// <param name="polygon">多边形顶点(必须是封闭的)</param>
+        /// <returns>面积</returns>
+        private double CalculatePolygonArea(List<Point> polygon)
+        {
+            if (polygon.Count < 3) return 0;
+
+            // 确保多边形是封闭的
+            var closedPolygon = new List<Point>(polygon);
+            if (closedPolygon.First() != closedPolygon.Last())
+            {
+                closedPolygon.Add(closedPolygon[0]);
+            }
+
+            double area = 0;
+            for (int i = 0; i < closedPolygon.Count - 1; i++)
+            {
+                area += (double)closedPolygon[i].X * closedPolygon[i + 1].Y;
+                area -= (double)closedPolygon[i].Y * closedPolygon[i + 1].X;
+            }
+
+            return Math.Abs(area) / 2.0;
+        }
+
+
+        /// <summary>
+        /// 凸包最长边,结果通过系数计算
         /// </summary>
         /// <param name="hull"></param>
         /// <returns></returns>
-        private BoundingRectangleMdoel RotatingCalipers(List<Point> hull)
+        public MaxLengthModel CoefficientRotatingCalipers(List<Point> hull)
         {
-            /* 老方法注释
+            //老方法
+            MaxLengthModel result = new MaxLengthModel();
             int n = hull.Count;
-            if (n == 1) return 0;
-            if (n == 2) return Distance(hull[0], hull[1]);
+            if (n == 1)
+            {
+                result = null;
+                return result;
+            }
+            if (n == 2)
+            {
+                result.MaxLength = Distance(hull[0], hull[1]);
+                result.Point1Index = 0;
+                result.Point1 = hull[0];
+                result.Point2Index = 1;
+                result.Point2 = hull[1];
+                return result;
+            }
 
-            int k = 1;
             double maxDist = 0;
+            int pointIndex1 = 0;
+            int pointIndex2 = 0;
 
             for (int i = 0; i < n; i++)
             {
-                while (Area2(hull[i], hull[(i + 1) % n], hull[(k + 1) % n]) >
-                       Area2(hull[i], hull[(i + 1) % n], hull[k]))
+                for (int j = i + 1; j < n; j++)
                 {
-                    k = (k + 1) % n;
-                }
+                    if (CoefficientDistance(hull[i], hull[j]) > maxDist)
+                    {
+                        maxDist = CoefficientDistance(hull[i], hull[j]);
+                        pointIndex1 = i;
+                        pointIndex2 = j;
+                    }
 
-                double currentDist = DistanceToLine(hull[i], hull[(i + 1) % n], hull[k]);
-                maxDist = Math.Max(maxDist, currentDist);
+                }
             }
 
-            return maxDist;
-            */
+            result.Point1 = hull[pointIndex1];
+            result.Point1Index = pointIndex1;
+            result.Point2 = hull[pointIndex2];
+            result.Point2Index = pointIndex2;
+            result.MaxLength = maxDist;
+
+            return result;
+        }
 
-            BoundingRectangleMdoel result = null;
+        /// <summary>
+        /// 凸包最长边
+        /// </summary>
+        /// <param name="hull"></param>
+        /// <returns></returns>
+        public MaxLengthModel RotatingCalipers(List<Point> hull)
+        {
+            //老方法
+            MaxLengthModel result = new MaxLengthModel();
             int n = hull.Count;
             if (n == 1)
             {
+                result = null;
                 return result;
             }
             if (n == 2)
             {
-                result = new BoundingRectangleMdoel
-                {
-                    points = hull,
-                    CenterPoint = new Point() { X = (hull[1].X + hull[0].X) / 2, Y = (hull[1].Y + hull[0].Y) / 2 },
-                    Width = 0,
-                    Height = Distance(hull[0], hull[1]),
-                    Angle = Math.Atan2(hull[1].Y - hull[0].Y, hull[1].X - hull[0].X),
-                    MaxLength = Distance(hull[0], hull[1])
-                };
+                result.MaxLength = Distance(hull[0], hull[1]);
+                result.Point1Index = 0;
+                result.Point1 = hull[0];
+                result.Point2Index = 1;
+                result.Point2 = hull[1];
                 return result;
             }
 
@@ -832,8 +1001,6 @@ namespace CCDCount.DLL
             int pointIndex1 = 0;
             int pointIndex2 = 0;
 
-            maxDist = Distance(hull[pointIndex1], hull[pointIndex2], XCoefficient, YCoefficient);
-
             for (int i = 0; i < n; i++)
             {
                 for (int j = i + 1; j < n; j++)
@@ -844,42 +1011,107 @@ namespace CCDCount.DLL
                         pointIndex1 = i;
                         pointIndex2 = j;
                     }
+
                 }
             }
 
+            result.Point1 = hull[pointIndex1];
+            result.Point1Index = pointIndex1;
+            result.Point2 = hull[pointIndex2];
+            result.Point2Index = pointIndex2;
+            result.MaxLength = Distance(result.Point1, result.Point2);
+
+            return result;
+        }
 
+        /// <summary>
+        /// 计算凸包的最小外接矩形
+        /// </summary>
+        /// <param name="convexHull">凸包顶点列表(按逆时针顺序排列)</param>
+        /// <returns>最小外接矩形的四个顶点</returns>
+        public BoundingRectangleMdoel CalculateMinimumBoundingRectangle(List<Point> convexHull)
+        {
+            BoundingRectangleMdoel result = new BoundingRectangleMdoel();
+            if (convexHull == null || convexHull.Count < 3)
+                return null;
 
-            double angle = Math.Atan2(hull[pointIndex2].Y - hull[pointIndex1].Y, hull[pointIndex2].X - hull[pointIndex2].X);
-            var rotatedPoints = hull.Select(p => RotatePoint(p, -angle)).ToList();
-            // 找到包围盒
-            int minX = rotatedPoints.Min(p => p.X);
-            int maxX = rotatedPoints.Max(p => p.X);
-            int minY = rotatedPoints.Min(p => p.Y);
-            int maxY = rotatedPoints.Max(p => p.Y);
-            int centerX = (minX + maxX) / 2;
-            int centerY = (minY + maxY) / 2;
+            double minArea = double.MaxValue;
 
-            int height = maxX - minX;
-            int width = maxY - minY;
+            int n = convexHull.Count;
 
-            // 构造矩形的四个顶点并旋转回原来的角度
-            var rectangle = new List<Point>
+            // 遍历每一条边作为基准边
+            for (int i = 0; i < n; i++)
             {
-                 RotatePoint(new Point(minX, minY), angle),
-                 RotatePoint(new Point(maxX, minY), angle),
-                 RotatePoint(new Point(maxX, maxY), angle),
-                 RotatePoint(new Point(minX, maxY), angle)
-            };
+                Point edgeStart = convexHull[i];
+                Point edgeEnd = convexHull[(i + 1) % n];
+
+                // 计算当前边的角度
+                double angle = Math.Atan2(edgeEnd.Y - edgeStart.Y, edgeEnd.X - edgeStart.X);
+
+                // 将所有点绕原点旋转-angle角度,使当前边与x轴平行
+                var rotatedPoints = convexHull.Select(p => RotatePoint(p, -angle)).ToList();
+
+                // 找到包围盒
+                int minX = rotatedPoints.Min(p => p.X);
+                int maxX = rotatedPoints.Max(p => p.X);
+                int minY = rotatedPoints.Min(p => p.Y);
+                int maxY = rotatedPoints.Max(p => p.Y);
+
+                // 计算面积
+                double area = (maxX - minX) * (maxY - minY);
+
+                // 如果面积更小,则更新最小矩形
+                if (area < minArea)
+                {
+                    minArea = area;
+
+                    // 构造矩形的四个顶点并旋转回原来的角度
+                    var rectangle = new List<Point>
+                    {
+                         RotatePoint(new Point(minX, minY), angle),
+                         RotatePoint(new Point(maxX, minY), angle),
+                         RotatePoint(new Point(maxX, maxY), angle),
+                         RotatePoint(new Point(minX, maxY), angle)
+                    };
+
+                    result.points = rectangle;
+                    result.Angle = angle;
+                    result.CenterPoint = RotatePoint(new Point((maxX + minX) / 2, (maxY + minY) / 2), angle);
+                }
+            }
 
-            result = new BoundingRectangleMdoel
+            double l1 = Distance(result.points[0], result.points[1]);
+            double l2 = Distance(result.points[1], result.points[2]);
+
+            if (l1 < l2)
             {
-                points = rectangle,
-                CenterPoint = RotatePoint(new Point() { X = centerX, Y = centerY }, angle),
-                Width = width,
-                Height = height,
-                Angle = angle,
-                MaxLength = maxDist
-            };
+                result.WidthPoints = new List<Point>
+                {
+                    result.points[0],
+                    result.points[1],
+                };
+                result.HeightPoints = new List<Point>
+                {
+                    result.points[1],
+                    result.points[2],
+                };
+            }
+            else
+            {
+                result.WidthPoints = new List<Point>
+                {
+                    result.points[2],
+                    result.points[1],
+                };
+                result.HeightPoints = new List<Point>
+                {
+                    result.points[1],
+                    result.points[0],
+                };
+            }
+
+            result.Height = Math.Max(l1, l2);
+            result.Width = Math.Min(l1, l2);
 
             return result;
         }
@@ -889,13 +1121,13 @@ namespace CCDCount.DLL
         /// </summary>
         /// <param name="convexHull">凸包顶点列表(按逆时针顺序排列)</param>
         /// <returns>最小外接矩形的四个顶点</returns>
-        private List<Point> CalculateMinimumBoundingRectangle(List<Point> convexHull)
+        public BoundingRectangleMdoel CoefficientCalculateMinimumBoundingRectangle(List<Point> convexHull)
         {
+            BoundingRectangleMdoel result = new BoundingRectangleMdoel();
             if (convexHull == null || convexHull.Count < 3)
                 return null;
 
             double minArea = double.MaxValue;
-            List<Point> minRectangle = null;
 
             int n = convexHull.Count;
 
@@ -934,11 +1166,70 @@ namespace CCDCount.DLL
                          RotatePoint(new Point(minX, maxY), angle)
                     };
 
-                    minRectangle = rectangle;
+                    result.points = rectangle;
+                    result.Angle = angle;
+                    result.CenterPoint = RotatePoint(new Point((maxX + minX) / 2, (maxY + minY) / 2), angle);
                 }
             }
 
-            return minRectangle;
+            double l1 = CoefficientDistance(result.points[0], result.points[1]);
+            double l2 = CoefficientDistance(result.points[1], result.points[2]);
+
+            if (l1 < l2)
+            {
+                result.WidthPoints = new List<Point>
+                {
+                    result.points[0],
+                    result.points[1],
+                };
+                result.HeightPoints = new List<Point>
+                {
+                    result.points[1],
+                    result.points[2],
+                };
+            }
+            else
+            {
+                result.WidthPoints = new List<Point>
+                {
+                    result.points[2],
+                    result.points[1],
+                };
+                result.HeightPoints = new List<Point>
+                {
+                    result.points[1],
+                    result.points[0],
+                };
+            }
+
+            result.Height = Math.Max(l1, l2);
+            result.Width = Math.Min(l1, l2);
+
+            return result;
+        }
+
+        public List<Point> SortPointsByNearestNeighbor(List<Point> points)
+        {
+            if (points.Count <= 1) return points;
+
+            var sorted = new List<Point>();
+            var remaining = new HashSet<Point>(points);
+
+            // 选择起始点(例如最左边的点)
+            var current = remaining.OrderBy(p => p.X).First();
+            sorted.Add(current);
+            remaining.Remove(current);
+
+            while (remaining.Any())
+            {
+                // 找到最近的点
+                var nearest = remaining.OrderBy(p => Distance(current, p)).First();
+                sorted.Add(nearest);
+                remaining.Remove(nearest);
+                current = nearest;
+            }
+
+            return sorted;
         }
 
         /// <summary>
@@ -985,14 +1276,14 @@ namespace CCDCount.DLL
         {
             int dx = a.X - b.X;
             int dy = a.Y - b.Y;
-            return Math.Sqrt(dx * dx + dy * dy);
+            return Math.Sqrt((dx * dx) + (dy * dy));
         }
 
-        public double Distance(Point a,Point b,double XCoefficient,double YCoefficient)
+        private double CoefficientDistance(Point a,Point b)
         {
-            double dx = a.X - b.X;
-            double dy = a.Y - b.Y;
-            return Math.Sqrt(dx * dx * XCoefficient + dy * dy * YCoefficient);
+            double dx = (a.X - b.X) * XCoefficient;
+            double dy = (a.Y - b.Y) * YCoefficient;
+            return Math.Sqrt((dx * dx) + (dy * dy));
         }
 
         private bool TryAdd(List<ActiveObjectClass> list, ActiveObjectClass item, int maxSize)

+ 9 - 3
TestWork.DLL/SqlDataClass/ActionMesSqliteDataClass.cs

@@ -59,7 +59,9 @@ namespace CCDCount.DLL.SqlDataClass
                     ChannelNO INTEGER NOT NULL,
                     ImageWidth INTEGER NOT NULL,
                     StateCode INTEGER NOT NULL DEFAULT -1,
-                    BatchNumber TEXT NOT NULL
+                    BatchNumber TEXT NOT NULL,
+                    hasSignificantConcavity INTEGER CHECK (hasSignificantConcavity IN (0, 1)),
+                    concavityRatio REAL NOT NULL
                 )";
 
                 // 创建从表
@@ -103,12 +105,14 @@ namespace CCDCount.DLL.SqlDataClass
                             Num, MinStartCol, MaxEndCol, LastSeenLineStartCol, 
                             LastSeenLineEndCol, StartLine, LastSeenLine, 
                             StartCheckTime, EndCheckTime, Area, MaxLength,
-                            ChannelNO, ImageWidth, StateCode, BatchNumber
+                            ChannelNO, ImageWidth, StateCode, BatchNumber,
+                            hasSignificantConcavity,concavityRatio
                             ) VALUES (
                             @Num, @MinStartCol, @MaxEndCol, @LastSeenLineStartCol, 
                             @LastSeenLineEndCol, @StartLine, @LastSeenLine, 
                             @StartCheckTime, @EndCheckTime, @Area, @MaxLength,
-                            @ChannelNO, @ImageWidth, @StateCode, @BatchNumber
+                            @ChannelNO, @ImageWidth, @StateCode, @BatchNumber,
+                            @hasSignificantConcavity,@concavityRatio
                         ); SELECT last_insert_rowid();";
 
                             using (var cmd = new SQLiteCommand(insertActiveObject, conn))
@@ -128,6 +132,8 @@ namespace CCDCount.DLL.SqlDataClass
                                 cmd.Parameters.AddWithValue("@ImageWidth", activeObject.ImageWidth);
                                 cmd.Parameters.AddWithValue("@StateCode", activeObject.StateCode);
                                 cmd.Parameters.AddWithValue("@BatchNumber", activeObject.BatchNumber);
+                                cmd.Parameters.AddWithValue("@hasSignificantConcavity", activeObject.hasSignificantConcavity);
+                                cmd.Parameters.AddWithValue("@concavityRatio", activeObject.concavityRatio);
 
                                 // 获取新插入的主键ID
                                 var activeObjectId = Convert.ToInt32(cmd.ExecuteScalar());

+ 258 - 0
TestWork.DLL/Tools/LineScanCameraCalibrator.cs

@@ -0,0 +1,258 @@
+using CCDCount.MODEL.ShuLiModel;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CCDCount.DLL.Tools
+{
+    public static class LineScanCameraCalibrator
+    {
+        /// <summary>
+        /// 计算线阵相机X和Y方向的单像素精度
+        /// 线阵相机在X方向(像素方向)和Y方向(扫描方向)有不同的缩放系数
+        /// </summary>
+        /// <param name="knownPairs">已知物理距离的点对集合</param>
+        /// <param name="actualDistance">实际物理距离(单位:mm)</param>
+        /// <returns>包含X和Y方向单像素精度的结构体</returns>
+        public static PixelScale CalculateLineScanPixelScale(List<MaxLengthModel> knownPairs, double actualDistance)
+        {
+            if (knownPairs == null || knownPairs.Count == 0)
+                throw new ArgumentException("至少需要一个点对来进行校准");
+
+            List<double> xScales = new List<double>();
+            List<double> yScales = new List<double>();
+
+            foreach (var pair in knownPairs)
+            {
+                int deltaX = pair.Point2.X - pair.Point1.X;
+                int deltaY = pair.Point2.Y - pair.Point1.Y;
+
+                // 计算像素欧几里得距离
+                double pixelDistance = Math.Sqrt(deltaX * deltaX + deltaY * deltaY);
+
+                if (pixelDistance == 0)
+                    continue; // 避免除零错误
+
+                // 计算每像素的物理距离(缩放因子)
+                double scalePerPixel = actualDistance / pixelDistance;
+
+                // 对于线阵相机,我们需要根据X和Y方向的贡献来分解缩放因子
+                // X方向精度 = 总缩放因子 * |ΔX| / 像素距离
+                // Y方向精度 = 总缩放因子 * |ΔY| / 像素距离
+                if (Math.Abs(deltaX) > double.Epsilon)
+                {
+                    double xScale = scalePerPixel * Math.Abs(deltaX) / pixelDistance;
+                    xScales.Add(xScale);
+                }
+
+                if (Math.Abs(deltaY) > double.Epsilon)
+                {
+                    double yScale = scalePerPixel * Math.Abs(deltaY) / pixelDistance;
+                    yScales.Add(yScale);
+                }
+            }
+
+            // 计算平均值作为最终精度
+            double avgXScale = xScales.Count > 0 ? xScales.Average() : 1.0;
+            double avgYScale = yScales.Count > 0 ? yScales.Average() : 1.0;
+
+            return new PixelScale(avgXScale, avgYScale);
+        }
+
+        /// <summary>
+        /// 使用更精确的方法计算线阵相机的像素精度
+        /// 分别处理纯X方向、纯Y方向和对角线方向的点对
+        /// </summary>
+        /// <param name="horizontalPairs">纯水平方向点对(Y坐标相同)</param>
+        /// <param name="verticalPairs">纯垂直方向点对(X坐标相同)</param>
+        /// <param name="diagonalPairs">对角线方向点对</param>
+        /// <param name="actualDistance">实际物理距离(单位:mm)</param>
+        /// <returns>包含X和Y方向单像素精度的结构体</returns>
+        public static PixelScale CalculatePreciseLineScanPixelScale(
+            List<MaxLengthModel> horizontalPairs,
+            List<MaxLengthModel> verticalPairs,
+            List<MaxLengthModel> diagonalPairs,
+            double actualDistance)
+        {
+            double xScale = 1.0, yScale = 1.0;
+
+            // 优先使用纯水平方向点对计算X方向精度
+            if (horizontalPairs != null && horizontalPairs.Count > 0)
+            {
+                var xScales = new List<double>();
+                foreach (var pair in horizontalPairs)
+                {
+                    if (pair.Point1.Y != pair.Point2.Y) continue; // 确保是水平方向
+
+                    int deltaX = pair.Point2.X - pair.Point1.X;
+                    if (Math.Abs(deltaX) > 0)
+                    {
+                        xScales.Add(actualDistance / Math.Abs(deltaX));
+                    }
+                }
+                if (xScales.Count > 0)
+                    xScale = xScales.Average();
+            }
+
+            // 优先使用纯垂直方向点对计算Y方向精度
+            if (verticalPairs != null && verticalPairs.Count > 0)
+            {
+                var yScales = new List<double>();
+                foreach (var pair in verticalPairs)
+                {
+                    if (pair.Point1.X != pair.Point2.X) continue; // 确保是垂直方向
+
+                    int deltaY = pair.Point2.Y - pair.Point1.Y;
+                    if (Math.Abs(deltaY) > 0)
+                    {
+                        yScales.Add(actualDistance / Math.Abs(deltaY));
+                    }
+                }
+                if (yScales.Count > 0)
+                    yScale = yScales.Average();
+            }
+
+            // 如果缺少某个方向的纯方向点对,使用对角线点对进行补充
+            if (horizontalPairs == null || horizontalPairs.Count == 0)
+            {
+                // 从对角线点对中估算X方向精度
+                if (diagonalPairs != null && diagonalPairs.Count > 0)
+                {
+                    var xScalesFromDiagonal = new List<double>();
+                    foreach (var pair in diagonalPairs)
+                    {
+                        int deltaX = pair.Point2.X - pair.Point1.X;
+                        int deltaY = pair.Point2.Y - pair.Point1.Y;
+
+                        double pixelDistance = Math.Sqrt(deltaX * deltaX + deltaY * deltaY);
+                        if (pixelDistance > 0)
+                        {
+                            double scalePerPixel = actualDistance / pixelDistance;
+                            if (Math.Abs(deltaX) > double.Epsilon)
+                            {
+                                double xScaleFromDiagonal = scalePerPixel * Math.Abs(deltaX) / pixelDistance;
+                                xScalesFromDiagonal.Add(xScaleFromDiagonal);
+                            }
+                        }
+                    }
+                    if (xScalesFromDiagonal.Count > 0 && xScale == 1.0) // 只在没有纯水平点对时更新
+                        xScale = xScalesFromDiagonal.Average();
+                }
+            }
+
+            if (verticalPairs == null || verticalPairs.Count == 0)
+            {
+                // 从对角线点对中估算Y方向精度
+                if (diagonalPairs != null && diagonalPairs.Count > 0)
+                {
+                    var yScalesFromDiagonal = new List<double>();
+                    foreach (var pair in diagonalPairs)
+                    {
+                        int deltaX = pair.Point2.X - pair.Point1.X;
+                        int deltaY = pair.Point2.Y - pair.Point1.Y;
+
+                        double pixelDistance = Math.Sqrt(deltaX * deltaX + deltaY * deltaY);
+                        if (pixelDistance > 0)
+                        {
+                            double scalePerPixel = actualDistance / pixelDistance;
+                            if (Math.Abs(deltaY) > double.Epsilon)
+                            {
+                                double yScaleFromDiagonal = scalePerPixel * Math.Abs(deltaY) / pixelDistance;
+                                yScalesFromDiagonal.Add(yScaleFromDiagonal);
+                            }
+                        }
+                    }
+                    if (yScalesFromDiagonal.Count > 0 && yScale == 1.0) // 只在没有纯垂直点对时更新
+                        yScale = yScalesFromDiagonal.Average();
+                }
+            }
+
+            return new PixelScale(xScale, yScale);
+        }
+
+        /// <summary>
+        /// 使用已知的像素精度计算两点间的物理距离
+        /// </summary>
+        /// <param name="point1">第一个点</param>
+        /// <param name="point2">第二个点</param>
+        /// <param name="scale">像素精度</param>
+        /// <returns>物理距离(单位:mm)</returns>
+        public static double CalculatePhysicalDistance(Point point1, Point point2, PixelScale scale)
+        {
+            int deltaX = point2.X - point1.X;
+            int deltaY = point2.Y - point1.Y;
+
+            // 使用各自的像素精度计算X和Y方向的物理距离
+            double physicalDistanceX = Math.Abs(deltaX) * scale.XScale;
+            double physicalDistanceY = Math.Abs(deltaY) * scale.YScale;
+
+            // 使用勾股定理计算实际距离
+            return Math.Sqrt(
+                Math.Pow(physicalDistanceX, 2) +
+                Math.Pow(physicalDistanceY, 2)
+            );
+        }
+
+        /// <summary>
+        /// 自动分类点对为水平、垂直和对角线方向
+        /// </summary>
+        /// <param name="allPairs">所有点对</param>
+        /// <param name="horizontalPairs">输出:纯水平方向点对</param>
+        /// <param name="verticalPairs">输出:纯垂直方向点对</param>
+        /// <param name="diagonalPairs">输出:对角线方向点对</param>
+        public static void ClassifyPointPairs(
+            List<MaxLengthModel> allPairs,
+            out List<MaxLengthModel> horizontalPairs,
+            out List<MaxLengthModel> verticalPairs,
+            out List<MaxLengthModel> diagonalPairs)
+        {
+            horizontalPairs = new List<MaxLengthModel>();
+            verticalPairs = new List<MaxLengthModel>();
+            diagonalPairs = new List<MaxLengthModel>();
+
+            foreach (var pair in allPairs)
+            {
+                int deltaX = pair.Point2.X - pair.Point1.X;
+                int deltaY = pair.Point2.Y - pair.Point1.Y;
+
+                if (deltaY == 0 && Math.Abs(deltaX) > 0)
+                {
+                    // 水平方向点对(Y坐标相同)
+                    horizontalPairs.Add(pair);
+                }
+                else if (deltaX == 0 && Math.Abs(deltaY) > 0)
+                {
+                    // 垂直方向点对(X坐标相同)
+                    verticalPairs.Add(pair);
+                }
+                else
+                {
+                    // 对角线方向点对
+                    diagonalPairs.Add(pair);
+                }
+            }
+        }
+    }
+    /// <summary>
+    /// 存储X和Y方向的像素精度
+    /// </summary>
+    public struct PixelScale
+    {
+        public double XScale { get; set; } // X方向单像素精度 (mm/pixel)
+        public double YScale { get; set; } // Y方向单像素精度 (mm/pixel)
+
+        public PixelScale(double xScale, double yScale)
+        {
+            XScale = xScale;
+            YScale = yScale;
+        }
+
+        public override string ToString()
+        {
+            return $"XScale: {XScale:F6} mm/pixel, YScale: {YScale:F6} mm/pixel";
+        }
+    }
+}

+ 242 - 7
TestWork.DLL/Tools/ModbusClass.cs

@@ -9,6 +9,9 @@ namespace CCDCount.DLL.Tools
     {
         private TcpClient _tcpClient;
         private IModbusMaster _modbusMaster;
+        private string LastIpAddress = string.Empty;
+        private int LastPort = 0;
+
 
         public bool IsTcpClientConnected()
         {
@@ -45,6 +48,8 @@ namespace CCDCount.DLL.Tools
                 // 使用 ModbusFactory 创建 Master(新版本 API)
                 var factory = new ModbusFactory();
                 _modbusMaster = factory.CreateMaster(_tcpClient);
+                LastIpAddress = ipAddress;
+                LastPort = port;
                 return true;
             }
             catch (Exception ex)
@@ -119,6 +124,10 @@ namespace CCDCount.DLL.Tools
             }
             catch (Exception ex)
             {
+                if(ex.HResult== -2146232800)
+                {
+                    ReConnect();
+                }
                 Console.WriteLine($"读取保持寄存器失败: {ex.Message}");
                 //FaultLog.RecordErrorMessage($"MainThreadClass-ReadHoldingRegisters-ReadHoldingRegisters failed:{ex.Message}");
                 result = false;
@@ -215,6 +224,49 @@ namespace CCDCount.DLL.Tools
             }
         }
 
+        /// <summary>
+        /// 读取保持寄存器中的REAL值(支持不同字节序)(功能码03)
+        /// </summary>
+        /// <param name="slaveId">从站ID</param>
+        /// <param name="startAddress">起始地址</param>
+        /// <param name="count">REAL值的数量</param>
+        /// <param name="byteOrder">字节序 (ABCD, CDAB, BADC, DCBA)</param>
+        /// <returns>REAL值数组</returns>
+        public double[] ReadHoldingRegistersAsLReal(byte slaveId, ushort startAddress, ushort count, string byteOrder = "BADC")
+        {
+            if (_modbusMaster == null)
+            {
+                //FaultLog.RecordErrorMessage($"MainThreadClass-ReadHoldingRegistersAsReal failed:未连接到服务器");
+                return null;
+            }
+
+            try
+            {
+                // 每个LREAL值占用4个寄存器
+                ushort[] registers = _modbusMaster.ReadHoldingRegisters(slaveId, startAddress, (ushort)(count * 4));
+                double[] realValues = new double[count];
+
+                for (int i = 0; i < count; i++)
+                {
+                    ushort reg1 = registers[i * 4];
+                    ushort reg2 = registers[i * 4 + 1];
+                    ushort reg3 = registers[i * 4 + 2];
+                    ushort reg4 = registers[i * 4 + 3];
+
+                    byte[] bytes = ConvertToByteArray8Bytes(reg1, reg2, reg3, reg4, byteOrder);
+                    realValues[i] = BitConverter.ToDouble(bytes, 0);
+                }
+
+                return realValues;
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine($"读取LREAL值失败: {ex.Message}");
+                //FaultLog.RecordErrorMessage($"MainThreadClass-ReadHoldingRegistersAsReal failed:{ex.Message}");
+                return null;
+            }
+        }
+
         /// <summary>
         /// 读取保持寄存器中的Int32值(功能码03)
         /// </summary>
@@ -253,7 +305,7 @@ namespace CCDCount.DLL.Tools
             }
             catch (Exception ex)
             {
-                //Console.WriteLine($"读取Int32值失败: {ex.Message}");
+                Console.WriteLine($"读取Int32值失败: {ex.Message}");
                 return null;
             }
         }
@@ -280,7 +332,7 @@ namespace CCDCount.DLL.Tools
             }
             catch (Exception ex)
             {
-                //Console.WriteLine($"写入线圈失败: {ex.Message}");
+                Console.WriteLine($"写入线圈失败: {ex.Message}");
                 //FaultLog.RecordErrorMessage($"MainThreadClass-WriteCoilsRegister-WriteCoilsRegister failed:{ex.Message}");
                 result = false;
             }
@@ -310,7 +362,7 @@ namespace CCDCount.DLL.Tools
             }
             catch (Exception ex)
             {
-                //Console.WriteLine($"写入单个寄存器失败: {ex.Message}");
+                Console.WriteLine($"写入单个寄存器失败: {ex.Message}");
                 //FaultLog.RecordErrorMessage($"MainThreadClass-WriteSingleRegister-WriteSingleRegister failed:{ex.Message}");
                 result = false;
             }
@@ -333,7 +385,7 @@ namespace CCDCount.DLL.Tools
             }
             catch (Exception ex)
             {
-                //Console.WriteLine($"写入单个寄存器失败: {ex.Message}");
+                Console.WriteLine($"写入单个寄存器失败: {ex.Message}");
                 //FaultLog.RecordErrorMessage($"MainThreadClass-WriteSingleRegister-WriteSingleRegister failed:{ex.Message}");
                 result = false;
             }
@@ -362,7 +414,7 @@ namespace CCDCount.DLL.Tools
             }
             catch (Exception ex)
             {
-                //Console.WriteLine($"写入多个寄存器失败: {ex.Message}");
+                Console.WriteLine($"写入多个寄存器失败: {ex.Message}");
                 //FaultLog.RecordErrorMessage($"MainThreadClass-WriteMultipleRegisters-WriteMultipleRegisters failed:{ex.Message}");
                 result = false;
             }
@@ -397,7 +449,42 @@ namespace CCDCount.DLL.Tools
             }
             catch (Exception ex)
             {
-                //Console.WriteLine($"写入REAL值失败: {ex.Message}");
+                Console.WriteLine($"写入REAL值失败: {ex.Message}");
+                //FaultLog.RecordErrorMessage($"MainThreadClass-WriteSingleReal failed:{ex.Message}");
+                result = false;
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// 写入单个LREAL值到保持寄存器(功能码16)
+        /// </summary>
+        /// <param name="slaveId">从站ID</param>
+        /// <param name="startAddress">起始地址</param>
+        /// <param name="value">REAL值</param>
+        /// <param name="byteOrder">字节序 (ABCD, CDAB, BADC, DCBA)</param>
+        public bool WriteSingleLReal(byte slaveId, ushort startAddress, double value, string byteOrder = "BADC")
+        {
+            bool result = false;
+            if (_modbusMaster == null)
+            {
+                //FaultLog.RecordErrorMessage($"MainThreadClass-WriteSingleReal failed:未连接到服务器");
+                return false;
+            }
+            try
+            {
+                // 将float转换为字节数组
+                byte[] bytes = BitConverter.GetBytes(value);
+
+                // 根据字节序重新排列字节
+                ushort[] registers = ConvertBytesTo8Registers(bytes, byteOrder);
+
+                // 写入连续的寄存器
+                result = WriteMultipleRegisters(slaveId, startAddress, registers);
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine($"写入LREAL值失败: {ex.Message}");
                 //FaultLog.RecordErrorMessage($"MainThreadClass-WriteSingleReal failed:{ex.Message}");
                 result = false;
             }
@@ -449,7 +536,7 @@ namespace CCDCount.DLL.Tools
             }
             catch (Exception ex)
             {
-                //Console.WriteLine($"写入多个REAL值失败: {ex.Message}");
+                Console.WriteLine($"写入多个REAL值失败: {ex.Message}");
                 //FaultLog.RecordErrorMessage($"MainThreadClass-WriteMultipleReals failed:{ex.Message}");
                 result = false;
             }
@@ -478,6 +565,32 @@ namespace CCDCount.DLL.Tools
             return WriteMultipleRegisters(slaveId, startAddress, registers);
         }
 
+        private bool ReConnect()
+        {
+            bool result = false;
+            if (LastIpAddress!=string.Empty&&LastPort!=0)
+            {
+                try
+                {
+                    _tcpClient = new TcpClient(LastIpAddress, LastPort)
+                    {
+                        SendTimeout = 2000,
+                        ReceiveTimeout = 2000
+                    };
+                    // 使用 ModbusFactory 创建 Master(新版本 API)
+                    var factory = new ModbusFactory();
+                    _modbusMaster = factory.CreateMaster(_tcpClient);
+                    return true;
+                }
+                catch (Exception ex)
+                {
+                    Console.WriteLine($"连接失败: {ex.Message}");
+                    return false;
+                }
+            }
+            return result;
+        }
+
         /// <summary>
         /// 将寄存器数组换为字节数组转(根据指定字节序)
         /// </summary>
@@ -526,6 +639,76 @@ namespace CCDCount.DLL.Tools
             return bytes;
         }
 
+        /// <summary>
+        /// 将寄存器数组转换为字节数组(根据指定字节序,用于8字节double值)
+        /// </summary>
+        /// <param name="reg1">第1个寄存器(最高位寄存器)</param>
+        /// <param name="reg2">第2个寄存器</param>
+        /// <param name="reg3">第3个寄存器</param>
+        /// <param name="reg4">第4个寄存器(最低位寄存器)</param>
+        /// <param name="byteOrder">字节序</param>
+        /// <returns>字节数组</returns>
+        private byte[] ConvertToByteArray8Bytes(ushort reg1, ushort reg2, ushort reg3, ushort reg4, string byteOrder)
+        {
+            byte[] bytes = new byte[8];
+
+            switch (byteOrder.ToUpper())
+            {
+                case "ABCD": // 大端序 - 寄存器顺序:reg1-reg2-reg3-reg4,字节顺序:0-1-2-3-4-5-6-7
+                    bytes[0] = (byte)(reg1 >> 8);  // reg1高位字节
+                    bytes[1] = (byte)(reg1 & 0xFF); // reg1低位字节
+                    bytes[2] = (byte)(reg2 >> 8);  // reg2高位字节
+                    bytes[3] = (byte)(reg2 & 0xFF); // reg2低位字节
+                    bytes[4] = (byte)(reg3 >> 8);  // reg3高位字节
+                    bytes[5] = (byte)(reg3 & 0xFF); // reg3低位字节
+                    bytes[6] = (byte)(reg4 >> 8);  // reg4高位字节
+                    bytes[7] = (byte)(reg4 & 0xFF); // reg4低位字节
+                    break;
+                case "CDAB": // 交换32位字 - 寄存器顺序:reg3-reg4-reg1-reg2
+                    bytes[0] = (byte)(reg3 >> 8);  // reg3高位字节
+                    bytes[1] = (byte)(reg3 & 0xFF); // reg3低位字节
+                    bytes[2] = (byte)(reg4 >> 8);  // reg4高位字节
+                    bytes[3] = (byte)(reg4 & 0xFF); // reg4低位字节
+                    bytes[4] = (byte)(reg1 >> 8);  // reg1高位字节
+                    bytes[5] = (byte)(reg1 & 0xFF); // reg1低位字节
+                    bytes[6] = (byte)(reg2 >> 8);  // reg2高位字节
+                    bytes[7] = (byte)(reg2 & 0xFF); // reg2低位字节
+                    break;
+                case "BADC": // 交换字内字节 - 高位字节在前,低位字节在后
+                    bytes[0] = (byte)(reg1 & 0xFF); // reg1低位字节
+                    bytes[1] = (byte)(reg1 >> 8);   // reg1高位字节
+                    bytes[2] = (byte)(reg2 & 0xFF); // reg2低位字节
+                    bytes[3] = (byte)(reg2 >> 8);   // reg2高位字节
+                    bytes[4] = (byte)(reg3 & 0xFF); // reg3低位字节
+                    bytes[5] = (byte)(reg3 >> 8);   // reg3高位字节
+                    bytes[6] = (byte)(reg4 & 0xFF); // reg4低位字节
+                    bytes[7] = (byte)(reg4 >> 8);   // reg4高位字节
+                    break;
+                case "DCBA": // 完全反转 - 寄存器顺序:reg4-reg3-reg2-reg1
+                    bytes[0] = (byte)(reg4 & 0xFF); // reg4低位字节
+                    bytes[1] = (byte)(reg4 >> 8);   // reg4高位字节
+                    bytes[2] = (byte)(reg3 & 0xFF); // reg3低位字节
+                    bytes[3] = (byte)(reg3 >> 8);   // reg3高位字节
+                    bytes[4] = (byte)(reg2 & 0xFF); // reg2低位字节
+                    bytes[5] = (byte)(reg2 >> 8);   // reg2高位字节
+                    bytes[6] = (byte)(reg1 & 0xFF); // reg1低位字节
+                    bytes[7] = (byte)(reg1 >> 8);   // reg1高位字节
+                    break;
+                default:
+                    // 默认使用ABCD顺序
+                    bytes[0] = (byte)(reg1 >> 8);
+                    bytes[1] = (byte)(reg1 & 0xFF);
+                    bytes[2] = (byte)(reg2 >> 8);
+                    bytes[3] = (byte)(reg2 & 0xFF);
+                    bytes[4] = (byte)(reg3 >> 8);
+                    bytes[5] = (byte)(reg3 & 0xFF);
+                    bytes[6] = (byte)(reg4 >> 8);
+                    bytes[7] = (byte)(reg4 & 0xFF);
+                    break;
+            }
+            return bytes;
+        }
+
         /// <summary>
         /// 将字节数组转换为寄存器数组(根据指定字节序)
         /// </summary>
@@ -565,5 +748,57 @@ namespace CCDCount.DLL.Tools
             }
             return registers;
         }
+
+        /// <summary>
+        /// 将字节数组转换为寄存器数组(根据指定字节序)
+        /// </summary>
+        /// <param name="bytes">字节数组(4字节)</param>
+        /// <param name="byteOrder">字节序</param>
+        /// <returns>寄存器数组(2个ushort)</returns>
+        private ushort[] ConvertBytesTo8Registers(byte[] bytes, string byteOrder)
+        {
+            if (bytes.Length != 8)
+                throw new ArgumentException("字节数组必须包含8个字节用于LREAL值转换");
+
+            ushort[] registers = new ushort[4];
+
+            switch (byteOrder.ToUpper())
+            {
+                case "ABCD": // 大端序 - 顺序:寄存器0-1-2-3,字节0-1-2-3-4-5-6-7
+                    registers[0] = (ushort)((bytes[0] << 8) | bytes[1]); // 最高字节寄存器
+                    registers[1] = (ushort)((bytes[2] << 8) | bytes[3]);
+                    registers[2] = (ushort)((bytes[4] << 8) | bytes[5]);
+                    registers[3] = (ushort)((bytes[6] << 8) | bytes[7]); // 最低字节寄存器
+                    break;
+                case "CDAB": // 交换32位字节序
+                    registers[0] = (ushort)((bytes[4] << 8) | bytes[5]); // 高32位
+                    registers[1] = (ushort)((bytes[6] << 8) | bytes[7]);
+                    registers[2] = (ushort)((bytes[0] << 8) | bytes[1]); // 低32位
+                    registers[3] = (ushort)((bytes[2] << 8) | bytes[3]);
+                    break;
+                case "BADC": // 交换字节内的高低位
+                    registers[0] = (ushort)((bytes[1] << 8) | bytes[0]);
+                    registers[1] = (ushort)((bytes[3] << 8) | bytes[2]);
+                    registers[2] = (ushort)((bytes[5] << 8) | bytes[4]);
+                    registers[3] = (ushort)((bytes[7] << 8) | bytes[6]);
+                    break;
+                case "DCBA": // 完全反转字节序
+                    registers[0] = (ushort)((bytes[7] << 8) | bytes[6]); // 原始最低字节变最高
+                    registers[1] = (ushort)((bytes[5] << 8) | bytes[4]);
+                    registers[2] = (ushort)((bytes[3] << 8) | bytes[2]);
+                    registers[3] = (ushort)((bytes[1] << 8) | bytes[0]); // 原始最高字节变最低
+                    break;
+                default:
+                    // 默认使用ABCD顺序
+                    registers[0] = (ushort)((bytes[0] << 8) | bytes[1]);
+                    registers[1] = (ushort)((bytes[2] << 8) | bytes[3]);
+                    registers[2] = (ushort)((bytes[4] << 8) | bytes[5]);
+                    registers[3] = (ushort)((bytes[6] << 8) | bytes[7]);
+                    break;
+            }
+
+            return registers;
+        }
+
     }
 }

+ 1 - 1
TestWork.MODEL/CCDCount.MODEL.csproj

@@ -70,8 +70,8 @@
     <Compile Include="ConfigModel\SaveConfigModel.cs" />
     <Compile Include="ConfigModel\SystemMessageConfigModel.cs" />
     <Compile Include="PlcModel\PlcParaModelClass.cs" />
-    <Compile Include="PlcModel\PlcStaticModelClass.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="ResultModel\ConvexResultClass.cs" />
     <Compile Include="ResultModel\ParaTrainResultClass.cs" />
     <Compile Include="ShuLiModel\ActiveObjectClass.cs" />
     <Compile Include="ShuLiModel\ActiveObjectEventArgsClass.cs" />

+ 113 - 88
TestWork.MODEL/ConfigModel/FormulationConfigClass.cs

@@ -53,6 +53,14 @@ namespace CCDCount.MODEL.ConfigModel
         /// </summary>
         public int Channel { get; set; } = 1;
         /// <summary>
+        /// X计算系数
+        /// </summary>
+        public double ScaleX { get; set; }
+        /// <summary>
+        /// Y计算系数
+        /// </summary>
+        public double ScaleY { get; set; }
+        /// <summary>
         /// 曝光时间
         /// </summary>
         public float ExposureTimeValue { get; set; } = 100;
@@ -66,188 +74,205 @@ namespace CCDCount.MODEL.ConfigModel
         public string DeviceName { get; set; } = string.Empty;
 
         /// <summary>
-        /// 速度模式运行速度
+        /// 罐装模式
         /// </summary>
-        public float SpeedModeRunningSpeed { get; set; }
+        public ushort FillingMode { get; set; }
 
         /// <summary>
-        /// 点动速度
+        /// 传送带速度
         /// </summary>
-        public float JogSpeed { get; set; }
+        public ushort BeltsSpeed { get; set; }
 
         /// <summary>
-        /// 瓶装设定
+        /// 罐装料筒震台高速
         /// </summary>
-        public ushort BottValueSet { get; set; }
+        public ushort ShakeTable1H_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 中转阀打开速度
+        /// 罐装过滤震台高速值
         /// </summary>
-        public float TransferValveOpeningSpeed { get; set; }
+        public ushort ShakeTable2H_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 中转阀打开时间
+        /// 罐装计数震台高速值
         /// </summary>
-        public UInt32 TransferValveOpeningTime { get; set; }
+        public ushort ShakeTable3H_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 罐装减速值
+        /// 罐装料筒震台减速值
         /// </summary>
-        public ushort BottingDecelerationValue { get; set; }
+        public ushort ShakeTable1M_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 缓存减速值
+        /// 罐装过滤震台减速值
         /// </summary>
-        public UInt16 CacheDecelerationValue { get; set; }
+        public ushort ShakeTable2M_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 缓存计数延迟时间
+        /// 罐装计数震台减速值
         /// </summary>
-        public UInt32 CacheCountDelayTiming { get; set; }
+        public ushort ShakeTable3M_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 缓存停机
+        /// 罐装料筒震台低速
         /// </summary>
-        public ushort CacheShutdownValue { get; set; }
+        public ushort ShakeTable1L_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 罐装料筒震台高速值
+        /// 罐装过滤震台低速值
         /// </summary>
-        public ushort BottingMaterialCylinderVibrationTableHighSpeedValue { get; set; }
+        public ushort ShakeTable2L_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 罐装过滤震台高速值
+        /// 罐装计数震台低速值
         /// </summary>
-        public ushort BottingFilterVibrationTableHighSpeedValue { get; set; }
+        public ushort ShakeTable3L_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 罐装计数震台高速值
+        /// 缓存料筒震台高速值
         /// </summary>
-        public ushort BottingCountVibrationTableHighSpeedValue { get; set; }
+        public ushort ShakeTable1H_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 罐装料筒震台减速值
+        /// 缓存过滤震台高速值
         /// </summary>
-        public ushort BottingMaterialCylinderVibrationTableDecelerationSpeedValue { get; set; }
+        public ushort ShakeTable2H_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 罐装过滤震台减速值
+        /// 缓存计数震台高速值
         /// </summary>
-        public ushort BottingFilterVibrationTableDecelerationSpeedValue { get; set; }
+        public ushort ShakeTable3H_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 罐装计数震台减速值
+        /// 缓存料筒震台减速值
         /// </summary>
-        public ushort BottingCountVibrationTableDecelerationSpeedValue { get; set; }
+        public ushort ShakeTable1M_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 缓存料筒震台高速值
+        /// 缓存过滤震台减速值
         /// </summary>
-        public ushort CacheMaterialCylinderVibrationTableHighSpeedValue { get; set; }
+        public ushort ShakeTable2M_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 缓存过滤震台高速值
+        /// 缓存计数震台减速值
         /// </summary>
-        public ushort CacheFilterVibrationTableHighSpeedValue { get; set; }
+        public ushort ShakeTable3M_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 缓存计数震台高速值
+        /// 缓存料筒震台低速值
         /// </summary>
-        public ushort CacheCountVibrationTableHighSpeedValue { get; set; }
+        public ushort ShakeTable1L_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 缓存料筒震台减速值
+        /// 缓存过滤震台低速值
         /// </summary>
-        public ushort CacheMaterialCylinderVibrationTableDecelerationSpeedValue { get; set; }
+        public ushort ShakeTable2L_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 缓存过滤震台减速值
+        /// 缓存计数震台低速值
         /// </summary>
-        public ushort CacheFilterVibrationTableDecelerationSpeedValue { get; set; }
-
+        public ushort ShakeTable3L_CacheSpeed { get; set; }
         /// <summary>
-        /// 缓存计数震台减速值
+        /// 罐装高速区间
         /// </summary>
-        public ushort CacheCountVibrationTableDecelerationSpeedValue { get; set; }
-
+        public ushort FillingH_SpeedRatio { get; set; }
         /// <summary>
-        /// 阀门打开延迟
+        /// 罐装减速区间
         /// </summary>
-        public UInt32 GateOpeningDelay { get; set; }
-
+        public ushort FillingM_SpeedRatio { get; set; }
         /// <summary>
-        /// 回零偏移值
+        /// 罐装低速区间
         /// </summary>
-        public float ReturnToZeroOffsetValue { get; set; }
-
+        public ushort FillingL_SpeedRatio { get; set; }
         /// <summary>
-        /// 回零偏移速度
+        /// 罐装高速区间
         /// </summary>
-        public float ReturnToZeroOffsetSpeed { get; set; }
-
+        public ushort CacheH_SpeedRatio { get; set; }
         /// <summary>
-        /// 中转阀关闭速度
+        /// 罐装减速区间
         /// </summary>
-        public float TransferValveClosingSpeed { get; set; }
-
+        public ushort CacheM_SpeedRatio { get; set; }
+        /// <summary>
+        /// 罐装低速区间
+        /// </summary>
+        public ushort CacheL_SpeedRatio { get; set; }
+        /// <summary>
+        /// 传动轴点动速度
+        /// </summary>
+        public double ScrewJogSpeed { get; set; }
+        /// <summary>
+        /// 进瓶速度
+        /// </summary>
+        public double InBottleSpeed { get; set; }
+        /// <summary>
+        /// 传动轴绝对定位速度
+        /// </summary>
+        public double BottlePosSpeed { get; set; }
+        /// <summary>
+        /// 传动轴绝对定位位置
+        /// </summary>
+        public double BottlePosPosition { get; set; }
+        /// <summary>
+        /// 中转阀打开速度
+        /// </summary>
+        public double FillingValveOpenSpeed { get; set; }
         /// <summary>
         /// 中转阀打开位置
         /// </summary>
-        public float TransferValveOpenPosition { get; set; }
-
+        public double FillingValveOpenPosition { get; set; }
         /// <summary>
-        /// 中转阀关闭位置
+        /// 中转阀关闭速度
         /// </summary>
-        public float TransferValveClosePosition { get; set; }
-
+        public double FillingValveCloseSpeed { get; set; }
         /// <summary>
-        /// 气阀打开延迟
+        /// 中转阀关位置
         /// </summary>
-        public UInt32 AirValveOpeningDelay { get; set; }
-
+        public double FillingValveClosePosition { get; set; }
         /// <summary>
-        ///  装瓶停机值
+        /// 中转阀缓存速度
         /// </summary>
-        public UInt16 BottlingShutdownValue { get; set; }
-
+        public double FillingValveCacheSpeed { get; set; }
         /// <summary>
-        /// 装瓶停机时间
+        /// 中转阀缓存位置
         /// </summary>
-        public UInt32 BottlingShutdownTime { get; set; }
-
+        public double FillingValueCachePosition { get; set; }
         /// <summary>
-        /// 送瓶轮运行速度
+        /// 中转阀点动速度
         /// </summary>
-        public float BottleFeedingWheelRunningSpeed { get; set; }
-
+        public double FillingValueJogSpeed { get; set; }
         /// <summary>
-        /// 送瓶轮点动速度
+        /// 漏斗下降延时
         /// </summary>
-        public float BottleFeedingWheelJogRunningSpeed { get; set; }
-
+        public ushort MachineDelayFunneDownTime { get; set; }
         /// <summary>
-        /// 送瓶轮回零偏移值
+        /// 漏斗上升延时
         /// </summary>
-        public float BottleFeedingWheelReturnToZeroOffsetValue { get; set; }
-
+        public ushort MachineDelayFunneUpTime { get; set; }
         /// <summary>
-        /// 送瓶轮回零速度
+        /// 中转阀打开延时
         /// </summary>
-        public float BottleFeedingWheelReturnToZeroSpeed { get; set; }
-
+        public ushort MachineDelayFillingValveOpenTime { get; set; }
+        /// <summary>
+        /// 中转阀关闭延时
+        /// </summary>
+        public ushort MachineDelayFillingValveCloseTime { get; set; }
+        /// <summary>
+        /// j进瓶延时
+        /// </summary>
+        public ushort MachineDelayInBottleTime { get; set; }
         /// <summary>
-        /// 送瓶轮位置长度
+        /// 气动闸板延时
         /// </summary>
-        public float BottleFeedingWheelPositionLength { get; set; }
+        public ushort ValveDelytime { get; set; }
 
         /// <summary>
-        /// 送瓶轮暂停时间
+        /// 罐装设定值
         /// </summary>
-        public UInt32 BottleFeedingWheelPauseTime { get; set; }
+        public ushort BottValueSet { get; set; }
 
         /// <summary>
-        /// 下料延时
+        /// 缓存停机值
         /// </summary>
-        public UInt32 DelayBlanking { get; set; }
+        public ushort CacheShutdownValue { get; set; }
     }
 }

+ 8 - 0
TestWork.MODEL/ConfigModel/ShuLiConfigClass.cs

@@ -89,5 +89,13 @@
         /// 是否为配置文件读取
         /// </summary>
         public bool IsLoadCanfig { get; set; } = false;
+        /// <summary>
+        /// X计算系数
+        /// </summary>
+        public double ScaleX { get; set; } = 1;
+        /// <summary>
+        /// Y计算系数
+        /// </summary>
+        public double ScaleY { get; set; } = 1;
     }
 }

+ 137 - 90
TestWork.MODEL/PlcModel/PlcParaModelClass.cs

@@ -9,188 +9,235 @@ namespace CCDCount.MODEL.PlcModel
     public class PlcParaModelClass
     {
         /// <summary>
-        /// 速度模式运行速度
+        /// 罐装模式
         /// </summary>
-        public float SpeedModeRunningSpeed { get; set;}
+        public ushort FillingMode { get; set; }
 
         /// <summary>
-        /// 点动速度
+        /// 传送带速度
         /// </summary>
-        public float JogSpeed { get; set;}
+        public ushort BeltsSpeed { get; set;}
 
         /// <summary>
-        /// 罐装设定
+        /// 罐装料筒震台高速
         /// </summary>
-        public ushort BottValueSet { get; set;}
+        public ushort ShakeTable1H_FillingSpeed { get; set;}
 
         /// <summary>
-        /// 中转阀打开速度
+        /// 罐装过滤震台高速值
         /// </summary>
-        public float TransferValveOpeningSpeed { get; set;}
+        public ushort ShakeTable2H_FillingSpeed { get; set;}
 
         /// <summary>
-        /// 中转阀打开时间
+        /// 罐装计数震台高速值
         /// </summary>
-        public UInt32 TransferValveOpeningTime { get; set;}
+        public ushort ShakeTable3H_FillingSpeed { get; set;}
 
         /// <summary>
-        /// 罐装减速值
+        /// 罐装料筒震台减速值
         /// </summary>
-        public ushort BottingDecelerationValue { get; set;}
+        public ushort ShakeTable1M_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 缓存减速值
+        /// 罐装过滤震台减速值
         /// </summary>
-        public ushort CacheDecelerationValue { get; set;}
+        public ushort ShakeTable2M_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 缓存计数延时计时
+        /// 罐装计数震台减速值
         /// </summary>
-        public UInt32 CacheCountDelayTiming { get; set;}
+        public ushort ShakeTable3M_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 缓存停机
+        /// 罐装料筒震台低速
         /// </summary>
-        public ushort CacheShutdownValue { get; set;}
+        public ushort ShakeTable1L_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 罐装料筒震台高速值
+        /// 罐装过滤震台低速值
         /// </summary>
-        public ushort BottingMaterialCylinderVibrationTableHighSpeedValue { get; set;}
+        public ushort ShakeTable2L_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 罐装过滤震台高速值
+        /// 罐装计数震台低速值
         /// </summary>
-        public ushort BottingFilterVibrationTableHighSpeedValue { get; set;}
+        public ushort ShakeTable3L_FillingSpeed { get; set; }
 
         /// <summary>
-        /// 罐装计数震台高速值
+        /// 缓存料筒震台高速值
         /// </summary>
-        public ushort BottingCountVibrationTableHighSpeedValue { get; set;}
+        public ushort ShakeTable1H_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 罐装料筒震台减速值
+        /// 缓存过滤震台高速值
         /// </summary>
-        public ushort BottingMaterialCylinderVibrationTableDecelerationSpeedValue { get; set; }
+        public ushort ShakeTable2H_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 罐装过滤震台减速值
+        /// 缓存计数震台高速值
         /// </summary>
-        public ushort BottingFilterVibrationTableDecelerationSpeedValue { get; set; }
+        public ushort ShakeTable3H_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 罐装计数震台减速值
+        /// 缓存料筒震台减速值
         /// </summary>
-        public ushort BottingCountVibrationTableDecelerationSpeedValue { get; set; }
+        public ushort ShakeTable1M_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 缓存料筒震台高速值
+        /// 缓存过滤震台减速值
         /// </summary>
-        public ushort CacheMaterialCylinderVibrationTableHighSpeedValue { get; set; }
+        public ushort ShakeTable2M_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 缓存过滤震台高速值
+        /// 缓存计数震台减速值
         /// </summary>
-        public ushort CacheFilterVibrationTableHighSpeedValue { get; set; }
+        public ushort ShakeTable3M_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 缓存计数震台高速值
+        /// 缓存料筒震台低速值
         /// </summary>
-        public ushort CacheCountVibrationTableHighSpeedValue { get; set; }
+        public ushort ShakeTable1L_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 缓存料筒震台减速值
+        /// 缓存过滤震台低速值
         /// </summary>
-        public ushort CacheMaterialCylinderVibrationTableDecelerationSpeedValue { get; set; }
+        public ushort ShakeTable2L_CacheSpeed { get; set; }
 
         /// <summary>
-        /// 缓存过滤震台减速值
+        /// 缓存计数震台低速值
         /// </summary>
-        public ushort CacheFilterVibrationTableDecelerationSpeedValue { get; set; }
-
+        public ushort ShakeTable3L_CacheSpeed { get; set; }
         /// <summary>
-        /// 缓存计数震台减速值
+        /// 罐装高速区间
         /// </summary>
-        public ushort CacheCountVibrationTableDecelerationSpeedValue { get; set; }
-
+        public ushort FillingH_SpeedRatio { get; set; }
         /// <summary>
-        /// 闸板打开延时
+        /// 罐装减速区间
         /// </summary>
-        public UInt32 GateOpeningDelay { get; set; }
-
+        public ushort FillingM_SpeedRatio { get; set; }
         /// <summary>
-        /// 回零偏移值
+        /// 罐装低速区间
         /// </summary>
-        public float ReturnToZeroOffsetValue { get; set; }
-
+        public ushort FillingL_SpeedRatio { get; set; }
         /// <summary>
-        /// 回零偏移速度
+        /// 缓存高速区间
         /// </summary>
-        public float ReturnToZeroOffsetSpeed { get; set; }
-
+        public ushort CacheH_SpeedRatio { get; set; }
         /// <summary>
-        /// 中转阀关闭速度
+        /// 缓存减速区间
         /// </summary>
-        public float TransferValveClosingSpeed  { get; set; }
-
+        public ushort CacheM_SpeedRatio { get; set; }
         /// <summary>
-        /// 中转阀开位置
+        /// 缓存低速区间
         /// </summary>
-        public float TransferValveOpenPosition { get; set; }
-
+        public ushort CacheL_SpeedRatio { get; set; }
+        /// <summary>
+        /// 传动轴点动速度
+        /// </summary>
+        public double ScrewJogSpeed {  get; set; }
+        /// <summary>
+        /// 进瓶速度
+        /// </summary>
+        public double InBottleSpeed {  get; set; }
+        /// <summary>
+        /// 传动轴绝对定位速度
+        /// </summary>
+        public double BottlePosSpeed { get; set; }
+        /// <summary>
+        /// 传动轴绝对定位位置
+        /// </summary>
+        public double BottlePosPosition {  get; set; }
+        /// <summary>
+        /// 中转阀打开速度
+        /// </summary>
+        public double FillingValveOpenSpeed { get; set; }
+        /// <summary>
+        /// 中转阀打开位置
+        /// </summary>
+        public double FillingValveOpenPosition { get; set; }
+        /// <summary>
+        /// 中转阀关闭速度
+        /// </summary>
+        public double FillingValveCloseSpeed { get; set; }
         /// <summary>
         /// 中转阀关位置
         /// </summary>
-        public float TransferValveClosePosition { get; set; }
-
+        public double FillingValveClosePosition { get; set; }
         /// <summary>
-        /// 气阀开延时
+        /// 中转阀缓存速度
         /// </summary>
-        public UInt32 AirValveOpeningDelay { get; set; }
-
+        public double FillingValveCacheSpeed {  get; set; }
         /// <summary>
-        /// 装瓶停机值
+        /// 中转阀缓存位置
         /// </summary>
-        public ushort BottlingShutdownValue { get; set; }
-
+        public double FillingValueCachePosition {  get; set; }
         /// <summary>
-        /// 装瓶停机时间
+        /// 中转阀点动速度
         /// </summary>
-        public UInt32 BottlingShutdownTime { get; set; }
-
+        public double FillingValueJogSpeed { get;set; }
         /// <summary>
-        /// 送瓶轮运行速度
+        /// 漏斗下降延时
         /// </summary>
-        public float BottleFeedingWheelRunningSpeed { get; set; }
-
+        public ushort MachineDelayFunneDownTime {  get; set; }
         /// <summary>
-        /// 送瓶轮点动速度
+        /// 漏斗上升延时
         /// </summary>
-        public float BottleFeedingWheelJogRunningSpeed { get; set; }
-
+        public ushort MachineDelayFunneUpTime { get; set; }
         /// <summary>
-        /// 送瓶轮回零偏移值
+        /// 中转阀打开延时
         /// </summary>
-        public float BottleFeedingWheelReturnToZeroOffsetValue { get; set; }
-
+        public ushort MachineDelayFillingValveOpenTime { get; set; }
         /// <summary>
-        /// 送瓶轮回零速度
+        /// 中转阀关闭延时
         /// </summary>
-        public float BottleFeedingWheelReturnToZeroSpeed { get; set; }
-
+        public ushort MachineDelayFillingValveCloseTime { get; set; }
         /// <summary>
-        /// 送瓶轮定位长度
+        /// 进瓶延时
         /// </summary>
-        public float BottleFeedingWheelPositionLength { get; set; }
-
+        public ushort MachineDelayInBottleTime { get; set; }
         /// <summary>
-        /// 送瓶轮暂停时间
+        /// 气动闸板延时
         /// </summary>
-        public UInt32 BottleFeedingWheelPauseTime { get; set; }
-
+        public ushort ValveDelytime { get; set; }
+        /// <summary>
+        /// 缺瓶检测时间
+        /// </summary>
+        public ushort MissingDelaytime { get; set; }
+        /// <summary>
+        /// 堵瓶检测时间
+        /// </summary>
+        public ushort BottleJamDelaytime {  get; set; }
+        /// <summary>
+        /// 剔废气缸延时时间
+        /// </summary>
+        public ushort EliminateCylinderDelayTime { get; set; }
+        /// <summary>
+        /// 剔废气缸保持时间
+        /// </summary>
+        public ushort EliminateCylinderHoldingTime { get; set; }
+        /// <summary>
+        /// 料筒震台测试速度
+        /// </summary>
+        public ushort ShakeTable1_TestSpeed { get; set; }
+        /// <summary>
+        /// 缓存震台测试速度
+        /// </summary>
+        public ushort ShakeTable2_TestSpeed { get; set; }
+        /// <summary>
+        /// 计数震台测试速度
+        /// </summary>
+        public ushort ShakeTable3_TestSpeed { get; set; }
+        /// <summary>
+        /// 罐装设定值
+        /// </summary>
+        public ushort BottValueSet { get; set; }
+        /// <summary>
+        /// 缓存停机值
+        /// </summary>
+        public ushort CacheShutdownValue { get; set; }
         /// <summary>
-        /// 下料延时
+        /// 装瓶数量
         /// </summary>
-        public UInt32 DelayBlanking { get; set; }
+        public ushort BottleCounting { get; set; }
     }
 }

+ 0 - 76
TestWork.MODEL/PlcModel/PlcStaticModelClass.cs

@@ -1,76 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace CCDCount.MODEL.PlcModel
-{
-    public class PlcStaticModelClass
-    {
-        /// <summary>
-        /// 使能完成
-        /// </summary>
-        public bool EnableCompletion { get; set; }
-
-        /// <summary>
-        /// 归零完成
-        /// </summary>
-        public bool ReturnToZeroCompletion { get; set; }
-
-        /// <summary>
-        /// 停止完成
-        /// </summary>
-        public bool StopCompletion { get; set; }
-
-        /// <summary>
-        /// 速度运行
-        /// </summary>
-        public bool SpeedRunning { get; set;}
-
-        /// <summary>
-        /// 回零中
-        /// </summary>
-        public bool ReturnToZero { get; set;}
-
-        /// <summary>
-        /// 中转阀开定位完成 
-        /// </summary>
-        public bool TransferValveOpenCompletion { get; set;}
-
-        /// <summary>
-        /// 中转阀关定位完成
-        /// </summary>
-        public bool TransferValveCloseCompletion { get; set;}
-
-        /// <summary>
-        /// 允许数据交换
-        /// </summary>
-        public bool AllowsDataExchange { get; set;}
-
-        /// <summary>
-        /// 暂停获取数据
-        /// </summary>
-        public bool PauseDataExchange { get; set;}
-
-        /// <summary>
-        /// 缓存计数延时完成
-        /// </summary>
-        public bool CacheCountDelayed { get; set;}
-
-        /// <summary>
-        /// 使能
-        /// </summary>
-        public bool Enable { get; set;}
-
-        /// <summary>
-        /// 送瓶轮使能完成
-        /// </summary>
-        public bool BottleFeedingWheelEnableCompletion { get; set; }
-
-        /// <summary>
-        /// 送瓶轮停止完成
-        /// </summary>
-        public bool BottleFeedingWheelStopCompletion { get; set; }
-    }
-}

+ 25 - 0
TestWork.MODEL/ResultModel/ConvexResultClass.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CCDCount.MODEL.ResultModel
+{
+    public class ConvexResultClass
+    {
+        /// <summary>
+        /// 凸包点集
+        /// </summary>
+        public List<Point> convexHull { get; set; } 
+        /// <summary>
+        /// 原点集是否有内凹
+        /// </summary>
+        public bool hasSignificantConcavity { get; set; } 
+        /// <summary>
+        /// 原点集内凹程度
+        /// </summary>
+        public double concavityRatio { get; set; }
+    }
+}

+ 2 - 0
TestWork.MODEL/ResultModel/ParaTrainResultClass.cs

@@ -13,5 +13,7 @@ namespace CCDCount.MODEL.ResultModel
         public int MinArea { get;set;}
         public double MaxLength { get;set;}
         public double MinLength { get;set;}
+        public double ScaleX { get;set;}
+        public double ScaleY { get;set;}
     }
 }

+ 15 - 0
TestWork.MODEL/ShuLiModel/ActiveObjectClass.cs

@@ -79,12 +79,27 @@ namespace CCDCount.MODEL.ShuLiModel
         /// 7:非颗粒视野异常遮挡
         /// 8:疑似叠粒或缺损粒
         /// 9;噪点
+        /// 10:颗粒数据仅单行
+        /// 11:外形有明显内凹
         /// </summary>
         public int StateCode { get; set; } = -1;
         /// <summary>
         /// 批次号
         /// </summary>
         public string BatchNumber { get; set; }
+        /// <summary>
+        /// 是否太近
+        /// </summary>
+        public bool IsTooClose { get; set; } = false;
+
+        /// <summary>
+        /// 是否有内凹
+        /// </summary>
+        public bool hasSignificantConcavity { get; set; }
+        /// <summary>
+        /// 内凹程度
+        /// </summary>
+        public double concavityRatio { get; set; }
     }
 
     // 活动物体跟踪类

+ 38 - 4
TestWork.MODEL/ShuLiModel/BoundingRectangleMdoel.cs

@@ -9,16 +9,50 @@ namespace CCDCount.MODEL.ShuLiModel
 {
     public class BoundingRectangleMdoel
     {
+        /// <summary>
+        /// 外接矩形全部点
+        /// </summary>
         public List<Point> points { get; set; }
-
+        /// <summary>
+        /// 外接矩形中心点
+        /// </summary>
         public Point CenterPoint { get; set; }
-
+        /// <summary>
+        /// 外接矩形高的两个端点
+        /// </summary>
+        public List<Point> HeightPoints { get; set; }
+        /// <summary>
+        /// 外接矩形宽的两个端点
+        /// </summary>
+        public List<Point> WidthPoints { get; set; }
+        /// <summary>
+        /// 外接矩形宽
+        /// </summary>
         public double Width { get; set; }
-
+        /// <summary>
+        /// 外接矩形高
+        /// </summary>
         public double Height { get; set; }
-
+        /// <summary>
+        /// 角度
+        /// </summary>
         public double Angle { get; set; }
+        /// <summary>
+        /// 是否有内凹
+        /// </summary>
+        public bool hasSignificantConcavity { get; set; }
+        /// <summary>
+        /// 内凹程度
+        /// </summary>
+        public double concavityRatio { get; set; }
+    }
 
+    public class MaxLengthModel
+    {
         public double MaxLength { get; set; }
+        public Point Point1 { get; set; }
+        public int Point1Index { get; set; }
+        public Point Point2 { get; set; }
+        public int Point2Index { get; set; }
     }
 }

Неке датотеке нису приказане због велике количине промена