using CommunityToolkit.Mvvm.ComponentModel;
|
using NationalInstruments.TestStand.Interop.API;
|
using System.Collections.ObjectModel;
|
|
namespace Plugin.SeqEditor.Entity
|
{
|
public partial class StepUI : ObservableObject
|
{
|
public Step step { get; private set; }
|
|
public StepUI(Step step)
|
{
|
this.step = step;
|
}
|
|
public void UpdatePropertyChanged(string name)
|
{
|
OnPropertyChanged(name);
|
}
|
|
public string Name
|
{
|
get => step?.Name;
|
set
|
{
|
if (step != null)
|
{
|
step.Name = value;
|
OnPropertyChanged(nameof(Name));
|
}
|
}
|
}
|
|
public string Description
|
{
|
get => step?.Description;
|
}
|
|
public string RunMode
|
{
|
get => step?.GetRunModeEx();
|
set
|
{
|
if (step != null)
|
{
|
step.SetRunModeEx(value);
|
OnPropertyChanged(nameof(RunMode));
|
}
|
}
|
}
|
|
public string Type
|
{
|
get => step?.StepType?.Name;
|
}
|
|
public bool CanChangeAdapter
|
{
|
get => step?.CanChangeAdapter() ?? true;
|
}
|
|
public string Adapter
|
{
|
get => step?.AdapterKeyName;
|
set
|
{
|
if (step != null)
|
{
|
step.ChangeAdapter(value);
|
OnPropertyChanged(nameof(RunMode));
|
}
|
}
|
}
|
|
|
|
public StepGroups? StepGroup
|
{
|
get
|
{
|
return step?.StepGroup;
|
}
|
}
|
|
[ObservableProperty]
|
private string group;
|
|
[ObservableProperty]
|
public ObservableCollection<StepUI> children = new();
|
}
|
}
|