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.

57 lines
1.9 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 FP003ExecuteCommandReportDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 設備編號
  13. /// </summary>
  14. [Required, StringLength(10), JsonPropertyName("vehicle_id"), JsonPropertyOrder(101)]
  15. public string VehicleID { get; set; }
  16. /// <summary>
  17. /// 任務起始時間
  18. /// </summary>
  19. [Required, JsonPropertyName("start_time"), JsonPropertyOrder(102)]
  20. public DateTime StartTime { get; set; }
  21. }
  22. /// <summary>
  23. /// 執行命令回應類別
  24. /// </summary>
  25. public class TP004ExecuteCommandAckDto : CommonMessage
  26. {
  27. /// <summary>
  28. /// 回應代碼
  29. /// </summary>
  30. /// <value>
  31. /// 0 = OK <br/>
  32. /// 1 = NG <br/>
  33. /// </value>
  34. [Required, JsonPropertyName("reply_code"), JsonPropertyOrder(101)]
  35. public ReplyCode ReplyCode { get; set; }
  36. /// <summary>
  37. /// 取得執行命令回應
  38. /// </summary>
  39. /// <param name="transName">交易名稱</param>
  40. /// <param name="softwareID">軟體編號</param>
  41. /// <param name="taskID">任務編號</param>
  42. /// <param name="replyCode">回應代碼</param>
  43. /// <returns>執行命令回應</returns>
  44. public static TP004ExecuteCommandAckDto Get(TransactionName transName, string softwareID, string taskID, ReplyCode replyCode)
  45. {
  46. return new TP004ExecuteCommandAckDto()
  47. {
  48. Timetick = DateTime.Now,
  49. TransactionName = transName.ToTransactionName(),
  50. SoftwareID = softwareID,
  51. TaskID = taskID,
  52. ReplyCode = replyCode
  53. };
  54. }
  55. }
  56. }