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.

79 lines
2.8 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 FP035RepairDoorStatusReportDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 維修門編號
  13. /// </summary>
  14. [Required, StringLength(9), JsonPropertyName("repair_door_id"), JsonPropertyOrder(101)]
  15. public string RepairDoorID { get; set; }
  16. /// <summary>
  17. /// 維修門狀態
  18. /// </summary>
  19. /// <value>
  20. /// 0 = Open <br/>
  21. /// 1 = Force Open <br/>
  22. /// 2 = Close <br/>
  23. /// </value>
  24. [Required, JsonPropertyName("repair_door_status"), JsonPropertyOrder(102)]
  25. public RepairDoorStatus RepairDoorStatus { get; set; }
  26. }
  27. /// <summary>
  28. /// 維修門狀態回應類別
  29. /// </summary>
  30. public class TP036RepairDoorStatusAckDto : CommonMessage
  31. {
  32. /// <summary>
  33. /// 維修門編號
  34. /// </summary>
  35. [Required, StringLength(9), JsonPropertyName("repair_door_id"), JsonPropertyOrder(101)]
  36. public string RepairDoorID { get; set; }
  37. /// <summary>
  38. /// 維修門狀態
  39. /// </summary>
  40. /// <value>
  41. /// 0 = Open <br/>
  42. /// 1 = Force Open <br/>
  43. /// 2 = Close <br/>
  44. /// </value>
  45. [Required, JsonPropertyName("repair_door_status"), JsonPropertyOrder(102)]
  46. public RepairDoorStatus RepairDoorStatus { get; set; }
  47. /// <summary>
  48. /// 回應代碼
  49. /// </summary>
  50. /// <value>
  51. /// 0 = OK <br/>
  52. /// 1 = NG <br/>
  53. /// </value>
  54. [Required, JsonPropertyName("reply_code"), JsonPropertyOrder(103)]
  55. public ReplyCode ReplyCode { get; set; }
  56. /// <summary>
  57. /// 取得維修門狀態回應
  58. /// </summary>
  59. /// <param name="transName">交易名稱</param>
  60. /// <param name="softwareID">軟體編號</param>
  61. /// <param name="repairDoorID">維修門編號</param>
  62. /// <param name="repairDoorStatus">維修門狀態</param>
  63. /// <param name="replyCode">回應代碼</param>
  64. /// <returns>維修門狀態回應</returns>
  65. public static TP036RepairDoorStatusAckDto Get(TransactionName transName, string softwareID, string repairDoorID, RepairDoorStatus repairDoorStatus, ReplyCode replyCode)
  66. {
  67. return new TP036RepairDoorStatusAckDto()
  68. {
  69. Timetick = DateTime.Now,
  70. TransactionName = transName.ToTransactionName(),
  71. SoftwareID = softwareID,
  72. RepairDoorID = repairDoorID,
  73. RepairDoorStatus = repairDoorStatus,
  74. ReplyCode = replyCode
  75. };
  76. }
  77. }
  78. }