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.

67 lines
2.2 KiB

8 months ago
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.Text.Json.Serialization;
  4. namespace Mirle.Component.API.ProgrammableLogicController.Models
  5. {
  6. /// <summary>
  7. /// 取消命令請求類別
  8. /// </summary>
  9. public class TP007CancelCommandRequestDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 取消模式
  13. /// </summary>
  14. /// <value>
  15. /// 0 = Cancel <br/>
  16. /// 1 = Force Cancel <br/>
  17. /// 2 = Force Complete <br/>
  18. /// </value>
  19. [Required, JsonPropertyName("cancel_mode"), JsonPropertyOrder(5)]
  20. public TaskCancelMode CancelMode { get; set; }
  21. /// <summary>
  22. /// 取得取消命令請求
  23. /// </summary>
  24. /// <param name="transName">交易名稱</param>
  25. /// <param name="softwareID">軟體編號</param>
  26. /// <param name="taskID">任務編號</param>
  27. /// <param name="cancelMode">取消模式</param>
  28. /// <returns>取消命令請求</returns>
  29. public static TP007CancelCommandRequestDto Get(TransactionName transName, string softwareID, string taskID, TaskCancelMode cancelMode)
  30. {
  31. return new TP007CancelCommandRequestDto()
  32. {
  33. Timetick = DateTime.Now,
  34. TransactionName = transName.ToTransactionName(),
  35. SoftwareID = softwareID,
  36. TaskID = taskID,
  37. CancelMode = cancelMode
  38. };
  39. }
  40. }
  41. /// <summary>
  42. /// 取消命令回應類別
  43. /// </summary>
  44. public class FP008CancelCommandResponseDto : CommonMessage
  45. {
  46. /// <summary>
  47. /// 取消類別
  48. /// </summary>
  49. /// <value>
  50. /// 0 = Cancel <br/>
  51. /// 1 = Force Cancel <br/>
  52. /// 2 = Force Complete <br/>
  53. /// </value>
  54. [Required, JsonPropertyName("cancel_mode"), JsonPropertyOrder(101)]
  55. public TaskCancelMode CancelMode { get; set; }
  56. /// <summary>
  57. /// 結果代碼
  58. /// </summary>
  59. /// <value>
  60. /// 0 = Success <br/>
  61. /// 1 = Reject <br/>
  62. /// </value>
  63. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)]
  64. public CancelCommandResultCode ResultCode { get; set; }
  65. }
  66. }