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.

84 lines
3.1 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 TP055CreateLifterCommandRequestDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 當下任務編號
  13. /// </summary>
  14. /// <remarks>A[YYYYMMDDHH][Sequnce * 5]/S[YYYYMMDDHH][Sequnce * 5]</remarks>
  15. [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
  16. public string CurrentTaskID { get; set; }
  17. /// <summary>
  18. /// 站點編號
  19. /// </summary>
  20. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
  21. public string StationID { get; set; }
  22. /// <summary>
  23. /// 起始樓層
  24. /// </summary>
  25. [Required, JsonPropertyName("from"), JsonPropertyOrder(103)]
  26. public int From { get; set; }
  27. /// <summary>
  28. /// 目標樓層
  29. /// </summary>
  30. [Required, JsonPropertyName("to"), JsonPropertyOrder(104)]
  31. public int To { get; set; }
  32. /// <summary>
  33. /// 取得建立電梯命令請求
  34. /// </summary>
  35. /// <param name="transName">交易名稱</param>
  36. /// <param name="softwareID">軟體編號</param>
  37. /// <param name="currentTaskID">當前任務編號</param>
  38. /// <param name="staionID">站點編號</param>
  39. /// <param name="from">起始樓層</param>
  40. /// <param name="to">目標樓層</param>
  41. /// <returns>建立電梯命令請求</returns>
  42. public static TP055CreateLifterCommandRequestDto Get(TransactionName transName, string softwareID,
  43. string currentTaskID, string staionID, int from, int to)
  44. {
  45. return new TP055CreateLifterCommandRequestDto()
  46. {
  47. Timetick = DateTime.Now,
  48. TransactionName = transName.ToTransactionName(),
  49. SoftwareID = softwareID,
  50. CurrentTaskID = currentTaskID,
  51. StationID = staionID,
  52. From = from,
  53. To = to
  54. };
  55. }
  56. }
  57. /// <summary>
  58. /// 建立電梯命令回應類別
  59. /// </summary>
  60. public class FP056CreateLifterCommandResponseDto : CommonMessage
  61. {
  62. /// <summary>
  63. /// 當下任務編號
  64. /// </summary>
  65. /// <remarks>AGVC 任務編號/SHTC 任務編號</remarks>
  66. [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
  67. public string CurrentTaskID { get; set; }
  68. /// <summary>
  69. /// 站點編號
  70. /// </summary>
  71. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
  72. public string StationID { get; set; }
  73. /// <summary>
  74. /// 結果代碼
  75. /// </summary>
  76. /// <value>
  77. /// 0 = Success <br/>
  78. /// 1 = Reject <br/>
  79. /// </value>
  80. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(103)]
  81. public CreateLifterCommandResultCode ResultCode { get; set; }
  82. }
  83. }