From 15bbd62b0b24b72c717ae91ab45348a2083ad04e Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期五, 10 十月 2025 08:58:18 +0800
Subject: [PATCH] 优化bug;
---
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