CoolingInfo.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System.Diagnostics;
  2. namespace Venus_Core
  3. {
  4. public enum CoolingStatu
  5. {
  6. Init,
  7. WaitCooling,
  8. Cooling,
  9. Paused,
  10. End
  11. }
  12. public enum CoolingRobotAction
  13. {
  14. Place,
  15. Pick
  16. }
  17. public class CoolingInfo
  18. {
  19. public Stopwatch CoolingStopwatch { get; set; } = new Stopwatch();
  20. public CoolingStatu CurrentCoolingStatu { get; set; }
  21. public void WaitCooling()
  22. {
  23. CurrentCoolingStatu = CoolingStatu.WaitCooling;
  24. }
  25. public void StartCooling()
  26. {
  27. if (CurrentCoolingStatu == CoolingStatu.WaitCooling || CurrentCoolingStatu == CoolingStatu.Paused)
  28. {
  29. CurrentCoolingStatu = CoolingStatu.Cooling;
  30. CoolingStopwatch.Start();
  31. }
  32. }
  33. public void PauseCooling()
  34. {
  35. if (CurrentCoolingStatu == CoolingStatu.Cooling)
  36. {
  37. CurrentCoolingStatu = CoolingStatu.Paused;
  38. CoolingStopwatch.Stop();
  39. }
  40. }
  41. public void EndCooling()
  42. {
  43. CurrentCoolingStatu = CoolingStatu.End;
  44. CoolingStopwatch.Stop();
  45. }
  46. public void ResetCooling()
  47. {
  48. CurrentCoolingStatu = CoolingStatu.Init;
  49. CoolingStopwatch.Reset();
  50. }
  51. }
  52. public class CoolingTransferAction
  53. {
  54. public CoolingRobotAction CoolingRobotAction { get; set; }
  55. public int DestinationSlot { get; set; }
  56. public CoolingTransferAction(CoolingRobotAction coolingRobotAction, int destinationSlot)
  57. {
  58. CoolingRobotAction = coolingRobotAction;
  59. DestinationSlot = destinationSlot;
  60. }
  61. }
  62. }