You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.0 KiB

  1. using BPA.Model.Recipe;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading;
  7. using System.Threading.Tasks;
  8. namespace BPA.Model
  9. {
  10. /// <summary>
  11. /// 配料线程服务类。
  12. /// </summary>
  13. public class TaskServer
  14. {
  15. /// <summary>
  16. /// 任务ID,本程序中直接使用配方的下发时间Ticks做标识。
  17. /// </summary>
  18. public long ID { get; set; }
  19. /// <summary>
  20. /// 任务名称
  21. /// </summary>
  22. public string TaskName { get; set; }
  23. /// <summary>
  24. /// 是否结束。
  25. /// </summary>
  26. public bool IsCompleted { get; set; }
  27. public Task RunTask { get; set; }
  28. /// <summary>
  29. /// 任务取消标识
  30. /// </summary>
  31. public CancellationTokenSource Cts { get; set; } = new CancellationTokenSource();
  32. /// <summary>
  33. /// 当前线程执行的配方。
  34. /// </summary>
  35. public RecipeData CurrentRecipe { get; set; }
  36. }
  37. }