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.

70 lines
2.4 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 FP029ResetAlarmReportDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 異常代碼
  13. /// </summary>
  14. [Required, StringLength(10), JsonPropertyName("alarm_code"), JsonPropertyOrder(101)]
  15. public string AlarmCode { get; set; }
  16. /// <summary>
  17. /// 設備編號
  18. /// </summary>
  19. [Required, StringLength(10), JsonPropertyName("vehicle_id"), JsonPropertyOrder(102)]
  20. public string VehicleID { get; set; }
  21. /// <summary>
  22. /// 異常清除時間
  23. /// </summary>
  24. [Required, JsonPropertyName("end_time"), JsonPropertyOrder(103)]
  25. public DateTime EndTime { get; set; }
  26. }
  27. /// <summary>
  28. /// 清除異常回應類別
  29. /// </summary>
  30. public class TP030ResetAlarmAckDto : CommonMessage
  31. {
  32. /// <summary>
  33. /// 異常代碼
  34. /// </summary>
  35. [Required, StringLength(10), JsonPropertyName("alarm_code"), JsonPropertyOrder(101)]
  36. public string AlarmCode { get; set; }
  37. /// <summary>
  38. /// 回應代碼
  39. /// </summary>
  40. /// <value>
  41. /// 0 = OK <br/>
  42. /// 1 = NG <br/>
  43. /// </value>
  44. [Required, JsonPropertyName("reply_code"), JsonPropertyOrder(102)]
  45. public ReplyCode ReplyCode { get; set; }
  46. /// <summary>
  47. /// 取得清除異常回應
  48. /// </summary>
  49. /// <param name="transName">交易名稱</param>
  50. /// <param name="softwareID">軟體編號</param>
  51. /// <param name="taskID">任務編號</param>
  52. /// <param name="alarmCode">異常代碼</param>
  53. /// <param name="replyCode">回應代碼</param>
  54. /// <returns>清除異常回應</returns>
  55. public static TP030ResetAlarmAckDto Get(TransactionName transName, string softwareID, string taskID,
  56. string alarmCode, ReplyCode replyCode)
  57. {
  58. return new TP030ResetAlarmAckDto()
  59. {
  60. Timetick = DateTime.Now,
  61. TransactionName = transName.ToTransactionName(),
  62. SoftwareID = softwareID,
  63. TaskID = taskID,
  64. AlarmCode = alarmCode,
  65. ReplyCode = replyCode
  66. };
  67. }
  68. }
  69. }