using BPA.Model.Recipe;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace BPA.Model
{
    /// <summary>
    /// 配料线程服务类。
    /// </summary>
    public class TaskServer
    {
        /// <summary>
        /// 任务ID，本程序中直接使用配方的下发时间Ticks做标识。
        /// </summary>
        public long ID { get; set; }
        /// <summary>
        /// 任务名称
        /// </summary>
        public string TaskName { get; set; }
        /// <summary>
        /// 是否结束。
        /// </summary>
        public bool IsCompleted { get; set; }
        public Task RunTask { get; set; }
        /// <summary>
        /// 任务取消标识
        /// </summary>
        public CancellationTokenSource Cts { get; set; } = new CancellationTokenSource();
        /// <summary>
        /// 当前线程执行的配方。
        /// </summary>
        public RecipeData CurrentRecipe { get; set; }
    }
}
