Ver Fonte

修复ProductGlobalParamEx初始无数据问题

844184169 há 6 meses atrás
pai
commit
26a93fd6f0

+ 1 - 0
TeamAAS-VM/Core/Management.cs

@@ -1198,6 +1198,7 @@ namespace TeamAAS_VP.Core
             if (currentProduct == null) return;
             try
             {
+                if (currentProduct.GlobalParamEx == null) currentProduct.GlobalParamEx = new Models.Product.ProductGlobalParamEx();
                 await plc.WriteNodeAsync(addressConfig.Down_Time.Address, currentProduct.GlobalParamEx.DownPressure.PressureTime);
                 await plc.WriteNodeAsync(addressConfig.Down_WetOut_Num.Address, currentProduct.GlobalParamEx.DownPressure.PressureNum);
                 await plc.WriteNodeAsync(addressConfig.Down_WetOut_Num_max.Address, currentProduct.GlobalParamEx.DownPressure.PressureNumMax);

+ 1 - 1
TeamAAS-VM/Models/Product/ProductGlobalParamEx.cs

@@ -4,7 +4,7 @@ namespace TeamAAS_VP.Models.Product
 {
     public class ProductGlobalParamEx : BindableBase
     {
-        private PressureModel _DownPressure;
+        private PressureModel _DownPressure = new PressureModel();
         /// <summary>
         /// 保压
         /// </summary>

+ 1 - 1
TeamAAS-VM/Views/Product/ProductParams.xaml

@@ -120,7 +120,7 @@
                         <StackPanel Orientation="Vertical"
                                     Margin="0">
                             <GroupBox Header="组装保压配置"
-                                      Margin="20,0"
+                                      Margin="5"
                                       Width="200">
                                 <Grid Margin="10">
                                     <Grid.ColumnDefinitions>