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.

125 lines
3.4 KiB

8 months ago
  1. using System.Collections.Generic;
  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 TemporaryDataDto
  10. {
  11. /// <summary>
  12. /// 建構式
  13. /// </summary>
  14. public TemporaryDataDto()
  15. {
  16. DataBuffers = new List<DataBuffer>();
  17. }
  18. /// <summary>
  19. /// 資料暫存
  20. /// </summary>
  21. [Required, JsonPropertyName("data_buffer")]
  22. public List<DataBuffer> DataBuffers { get; set; }
  23. }
  24. /// <summary>
  25. /// 資料暫存類別
  26. /// </summary>
  27. public class DataBuffer
  28. {
  29. /// <summary>
  30. /// 設備編號
  31. /// </summary>
  32. [JsonPropertyName("EPQT_ID")]
  33. public string EquipmentID { get; set; }
  34. /// <summary>
  35. /// 暫存器區塊名稱
  36. /// </summary>
  37. [JsonPropertyName("DATA_MAP_KEY")]
  38. public string DataMapKey { get; set; }
  39. /// <summary>
  40. /// 資料
  41. /// </summary>
  42. [JsonPropertyName("DATA")]
  43. public string Data { get; set; }
  44. }
  45. /// <summary>
  46. /// 設備暫存類別
  47. /// </summary>
  48. public class TemporaryEquipmentDto
  49. {
  50. /// <summary>
  51. /// 建構式
  52. /// </summary>
  53. public TemporaryEquipmentDto()
  54. {
  55. EquipmentBuffers = new List<EquipmentBuffer>();
  56. }
  57. /// <summary>
  58. /// 設備暫存資料清單
  59. /// </summary>
  60. [Required, JsonPropertyName("equipment_buffer")]
  61. public List<EquipmentBuffer> EquipmentBuffers { get; set; }
  62. }
  63. /// <summary>
  64. /// 設備暫存類別
  65. /// </summary>
  66. public class EquipmentBuffer
  67. {
  68. /// <summary>
  69. /// 設備/系統編號
  70. /// </summary>
  71. [JsonPropertyName("DEVICE_ID")]
  72. public string DeviceID { get; set; }
  73. /// <summary>
  74. /// 第1暫存器資料
  75. /// </summary>
  76. [JsonPropertyName("D01")]
  77. public int D01 { get; set; }
  78. /// <summary>
  79. /// 第2暫存器資料
  80. /// </summary>
  81. [JsonPropertyName("D02")]
  82. public int D02 { get; set; }
  83. /// <summary>
  84. /// 第3暫存器資料
  85. /// </summary>
  86. [JsonPropertyName("D03")]
  87. public int D03 { get; set; }
  88. /// <summary>
  89. /// 第4暫存器資料
  90. /// </summary>
  91. [JsonPropertyName("D04")]
  92. public int D04 { get; set; }
  93. /// <summary>
  94. /// 第5暫存器資料
  95. /// </summary>
  96. [JsonPropertyName("D05")]
  97. public int D05 { get; set; }
  98. /// <summary>
  99. /// 第6暫存器資料
  100. /// </summary>
  101. [JsonPropertyName("D06")]
  102. public int D06 { get; set; }
  103. /// <summary>
  104. /// 第7暫存器資料
  105. /// </summary>
  106. [JsonPropertyName("D07")]
  107. public int D07 { get; set; }
  108. /// <summary>
  109. /// 第8暫存器資料
  110. /// </summary>
  111. [JsonPropertyName("D08")]
  112. public int D08 { get; set; }
  113. /// <summary>
  114. /// 第9暫存器資料
  115. /// </summary>
  116. [JsonPropertyName("D09")]
  117. public int D09 { get; set; }
  118. /// <summary>
  119. /// 第10暫存器資料
  120. /// </summary>
  121. [JsonPropertyName("D10")]
  122. public int D10 { get; set; }
  123. }
  124. }