From 375b488be2666cd56e70728624f4eadaefee0440 Mon Sep 17 00:00:00 2001
From: chenghaoran <chenghaoran@ipilotwhale.com>
Date: 星期二, 12 三月 2024 17:36:49 +0800
Subject: [PATCH] 优化项目结构;

---
 WPFProject/Models/Sequence.cs |   35 ++++++++++++++++++++---------------
 1 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/Models/Sequence.cs b/WPFProject/Models/Sequence.cs
similarity index 67%
rename from Models/Sequence.cs
rename to WPFProject/Models/Sequence.cs
index ee95225..f563b94 100644
--- a/Models/Sequence.cs
+++ b/WPFProject/Models/Sequence.cs
@@ -1,5 +1,7 @@
-锘縰sing System.Collections.ObjectModel;
+锘縰sing System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Xml.Serialization;
+using VisionBuilder.Core.Api;
 
 namespace WPFProject.Models
 {
@@ -11,38 +13,41 @@
         {
             get { return _Name; }
             set => RaiseAndSetIfChanged(ref _Name, value);
-        }
-
+        }
+
         [XmlIgnore]
         public Program Program { get; set; }
 
-        private ObservableCollection<Step> _Steps = new ObservableCollection<Step>() { 
-        
-            new Step{ Name = "000"},new Step{ Name="111"}
-        };
+        private ObservableCollection<Step> _Steps = new ObservableCollection<Step>();
         public ObservableCollection<Step> Steps
         {
             get { return _Steps; }
             set => RaiseAndSetIfChanged(ref _Steps, value);
         }
 
-        public Sequence AddStep(params Step[] steps)
-        {
-            foreach (Step step in steps)
+        public Sequence AddStep(params Step[] steps)
+        {
+            foreach (Step step in steps)
             {
                 if (step == null) continue;
-                step.Program = Program;
+                step.Sequence = this;
                 Steps.Add(step);
             }
             return this;
         }
 
-        public void Run()
-        {
-            foreach (Step step in Steps) {
-                step.Run();
+        public void RunSequnce()
+        {
+            foreach (Step step in Steps)
+            {
+                step.RunStep();
             }
         }
 
+        public Sequence()
+        {
+            AddStep(new Step { Name = "000" }, new Step { Name = "111" });
+        }
+
     }
 }

--
Gitblit v1.9.1