| | |
| | | using System.Linq;
|
| | | using System.Text;
|
| | | using System.Threading.Tasks;
|
| | | using System.Xml.Serialization;
|
| | | using VisionBuilder.Core.Entity;
|
| | |
|
| | | namespace WPFProject.Models
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 序列集合
|
| | | /// </summary>
|
| | | private ObservableCollection<Sequence> _Sequences = new ObservableCollection<Sequence>();
|
| | | public ObservableCollection<Sequence> Sequences
|
| | | {
|
| | | get { return _Sequences; }
|
| | | set => RaiseAndSetIfChanged(ref _Sequences, value);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 程序所需参数
|
| | | /// </summary>
|
| | | private ObservableCollection<Variable> _Variables;
|
| | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 序列集合
|
| | | /// 初始参数参数
|
| | | /// </summary>
|
| | | private ObservableCollection<Sequence> _Sequences;
|
| | | public ObservableCollection<Sequence> Sequences
|
| | | private Dictionary<string, Variable> _InitVars;
|
| | | [XmlIgnore]
|
| | | public Dictionary<string, Variable> InitVars
|
| | | {
|
| | | get { return _Sequences; }
|
| | | set => RaiseAndSetIfChanged(ref _Sequences, value);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 所需参数
|
| | | /// </summary>
|
| | | private Dictionary<string, Variable> _Vars;
|
| | | public Dictionary<string, Variable> Vars
|
| | | {
|
| | | get { return _Vars; }
|
| | | set { _Vars = value; }
|
| | | get { return _InitVars; }
|
| | | set { _InitVars = value; }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 计算临时参数
|
| | | /// </summary>
|
| | | private Dictionary<string, Variable> _TempVars;
|
| | | public Dictionary<string, Variable> TempVars
|
| | | private Dictionary<string, Param> _TempVars;
|
| | | [XmlIgnore]
|
| | | public Dictionary<string, Param> TempVars
|
| | | {
|
| | | get { return _TempVars; }
|
| | | set { _TempVars = value; }
|
| | | }
|
| | |
|
| | | public Program AddSequnce(params Sequence[] sequences)
|
| | | {
|
| | | foreach (Sequence sequence in sequences)
|
| | | {
|
| | | if (sequence == null) continue;
|
| | | sequence.Program = this;
|
| | | Sequences.Add(sequence);
|
| | | }
|
| | | return this;
|
| | | }
|
| | |
|
| | | public void Run()
|
| | | {
|
| | | foreach (Sequence sequence in Sequences)
|
| | | {
|
| | | sequence.Run();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|