| | |
| | | using CommunityToolkit.Mvvm.ComponentModel; |
| | | using NationalInstruments.TestStand.Interop.API; |
| | | using NationalInstruments.TestStand.Interop.API; |
| | | |
| | | namespace Plugin.SeqEditor.Entity.EditablePO |
| | | { |
| | |
| | | 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 |
| | |
| | | } |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | } |