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.

58 lines
1.9 KiB

8 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.Text.Json.Serialization;
  5. namespace Mirle.Component.API.ProgrammableLogicController.Models
  6. {
  7. /// <summary>
  8. /// 緊急停止回應類別
  9. /// </summary>
  10. public class FP053EmergencyOffReportDto : CommonMessage
  11. {
  12. /// <summary>
  13. /// 站點編號
  14. /// </summary>
  15. [Required, JsonPropertyName("station_id"), JsonPropertyOrder(101)]
  16. public List<string> StationID { get; set; }
  17. }
  18. /// <summary>
  19. /// 緊急停止回應類別
  20. /// </summary>
  21. public class TP054EmergencyOffAckDto : CommonMessage
  22. {
  23. /// <summary>
  24. /// 站點編號
  25. /// </summary>
  26. [Required, JsonPropertyName("station_id"), JsonPropertyOrder(101)]
  27. public List<string> StationID { get; set; }
  28. /// <summary>
  29. /// 結果代碼
  30. /// </summary>
  31. /// <value>
  32. /// 0 = OK <br/>
  33. /// 1 = NG <br/>
  34. /// </value>
  35. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)]
  36. public ReplyCode ReplyCode { get; set; }
  37. /// <summary>
  38. /// 取得緊急停止回應
  39. /// </summary>
  40. /// <param name="transName">交易名稱</param>
  41. /// <param name="softwareID">軟體編號</param>
  42. /// <param name="staionID">站點編號</param>
  43. /// <param name="replyCode">回應代碼</param>
  44. /// <returns>緊急停止回應</returns>
  45. public static TP054EmergencyOffAckDto Get(TransactionName transName, string softwareID, List<string> staionID, ReplyCode replyCode)
  46. {
  47. return new TP054EmergencyOffAckDto()
  48. {
  49. Timetick = DateTime.Now,
  50. TransactionName = transName.ToTransactionName(),
  51. SoftwareID = softwareID,
  52. StationID = staionID,
  53. ReplyCode = replyCode
  54. };
  55. }
  56. }
  57. }