using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace SKMC.Api.Process.Model { /// /// 路由分支步骤 /// public class ProcessRouteStep : ProcessStep { /// /// 循环扫码间隔时间(ms) /// public int CT { get; set; } = 100; /// /// 路由分支动作, 该动作通常包含分支判断与Step跳转 /// true表示分支结束, false表示未结束 /// public Func Routes { get; set; } public ProcessRouteStep() { Actions = () => { while (true) { Thread.Sleep(CT); if (ProcessStation.CheckTaskCancelled()) return; if (Routes != null && Routes.Invoke()) return; } }; } } }