From 771a0e7b6b1276087515bbe94de28358cb92963b Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 04 六月 2026 10:32:27 +0800
Subject: [PATCH] 优化老化;

---
 Plugin.SeqEditor/Entity/EditablePO/NumValTestEPO.cs |   43 +++++++++++++++++++++++++++----------------
 1 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/Plugin.SeqEditor/Entity/EditablePO/NumValTestEPO.cs b/Plugin.SeqEditor/Entity/EditablePO/NumValTestEPO.cs
index 69d3272..ee71906 100644
--- a/Plugin.SeqEditor/Entity/EditablePO/NumValTestEPO.cs
+++ b/Plugin.SeqEditor/Entity/EditablePO/NumValTestEPO.cs
@@ -1,5 +1,4 @@
-锘縰sing CommunityToolkit.Mvvm.ComponentModel;
-using NationalInstruments.TestStand.Interop.API;
+锘縰sing NationalInstruments.TestStand.Interop.API;
 
 namespace Plugin.SeqEditor.Entity.EditablePO
 {
@@ -11,8 +10,26 @@
         public NumValTestEPO(StepUI stepUI)
         {
             StepUI = stepUI;
+            StepUI.PropertyChanged += StepUI_PropertyChanged;
+
             Step = stepUI?.step;
             PropertyObject = Step?.AsPropertyObject();
+        }
+
+        private void StepUI_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
+        {
+            if (e.PropertyName == "Low" || e.PropertyName == "High")
+            {
+                OnPropertyChanged(e.PropertyName);
+            }
+        }
+
+        ~NumValTestEPO()
+        {
+            if (StepUI != null)
+            {
+                StepUI.PropertyChanged -= StepUI_PropertyChanged;
+            }
         }
 
         public string ComparisonType
@@ -28,29 +45,23 @@
             }
         }
 
-        public double? Low
+        public string Low
         {
-            get => PropertyObject?.GetValNumber("Limits.Low", 0);
+            get => StepUI?.Low?.ToString();
             set
             {
-                if (PropertyObject != null)
-                {
-                    PropertyObject.SetValNumber("Limits.Low", 0, value ?? 0);
-                    CustomPropertyChanged(nameof(Low));
-                }
+                double.TryParse(value, out var dob);
+                StepUI.Low = value;
             }
         }
 
-        public double? High
+        public string High
         {
-            get => PropertyObject?.GetValNumber("Limits.High", 0);
+            get => StepUI?.High?.ToString();
             set
             {
-                if (PropertyObject != null)
-                {
-                    PropertyObject.SetValNumber("Limits.High", 0, value ?? 0);
-                    CustomPropertyChanged(nameof(Low));
-                }
+                double.TryParse(value, out var dob);
+                StepUI.High = dob;
             }
         }
     }

--
Gitblit v1.9.1