using HMI.Core.Entity;
|
using System.Collections.ObjectModel;
|
using System.Xml.Serialization;
|
|
namespace Plugin.TestBuilder.Model
|
{
|
public class Sequence : NotifyBase
|
{
|
private string _Name;
|
|
public string Name
|
{
|
get { return _Name; }
|
set => Set(ref _Name, value);
|
}
|
|
[XmlIgnore]
|
public Program Program { get; set; }
|
|
private ObservableCollection<Step> _Steps = new ObservableCollection<Step>();
|
public ObservableCollection<Step> Steps
|
{
|
get { return _Steps; }
|
set => Set(ref _Steps, value);
|
}
|
|
public Sequence AddStep(params Step[] steps)
|
{
|
foreach (Step step in steps)
|
{
|
if (step == null) continue;
|
step.Sequence = this;
|
Steps.Add(step);
|
}
|
return this;
|
}
|
|
public void RunSequnce()
|
{
|
foreach (Step step in Steps)
|
{
|
step.RunStep();
|
}
|
}
|
|
public Sequence()
|
{
|
AddStep(new Step { Name = "000" }, new Step { Name = "111" });
|
}
|
|
}
|
}
|