From ef52fd6fd07508883dce4eb002acda59f0169e59 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 23 四月 2026 10:19:33 +0800
Subject: [PATCH] 优化;

---
 HMI.ParameterManage/ParameterModal.xaml.cs |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/HMI.ParameterManage/ParameterModal.xaml.cs b/HMI.ParameterManage/ParameterModal.xaml.cs
index ab9f77a..c89f0ea 100644
--- a/HMI.ParameterManage/ParameterModal.xaml.cs
+++ b/HMI.ParameterManage/ParameterModal.xaml.cs
@@ -73,13 +73,15 @@
 
         private bool ValidateForm()
         {
-            bool flag = FormGroupHelper.ValidateForm(formPanel, new Dictionary<string, object> {
+            var cache = new Dictionary<string, object> {
                 { "FgValue",GetTargetValue()}
-            });
+            };
+            bool flag = FormGroupHelper.ValidateForm(formPanel, cache);
             if (flag)
             {
                 Data.Name = TbName.Text;
                 Data.Type = CbType.Text;
+                Data.IsArray = CbIsArray.IsChecked == true;
                 Data.Value = GetTargetValue();
                 Data.Unit = TbUnit.Text;
                 Data.Description = TbDescription.Text;
@@ -94,6 +96,7 @@
             Data = data;
             TbName.Text = Data.Name;
             CbType.SelectedValue = Data.Type;
+            CbIsArray.IsChecked = Data.IsArray;
             CbGroup.ItemsSource = groups;
             UpdateWindow(Data.Type);
             UpdateForm(Data);
@@ -106,11 +109,12 @@
 
         private string GetTargetValue()
         {
-            if (CbType.Text == "Int" || Data.Type == "Double")
+            var type = CbType.Text;
+            if (type == "Int" || type == "Double")
             {
                 return NiNumberValue.Text;
             }
-            else if (CbType.Text == "Bool")
+            else if (type == "Bool")
             {
                 return CbBoolValue.Text;
             }

--
Gitblit v1.9.1