Pallet.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. using Newtonsoft.Json;
  2. using Prism.Mvvm;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using TeamAAS_VP.Enums;
  9. using TeamAAS_VP.Interfaces;
  10. using TeamAAS_VP.Models.PLC;
  11. namespace TeamAAS_VP.Models.Robot
  12. {
  13. /// <summary>
  14. /// 托盘
  15. /// </summary>
  16. public class Pallet : BindableBase
  17. {
  18. private Guid _Id;
  19. public Guid Id
  20. {
  21. get { return _Id; }
  22. set { SetProperty(ref _Id,value); }
  23. }
  24. private int _PalletNo;
  25. /// <summary>
  26. /// 编号
  27. /// </summary>
  28. public int PalletNo
  29. {
  30. get { return _PalletNo; }
  31. set { SetProperty(ref _PalletNo, value); }
  32. }
  33. private string _Name;
  34. public string Name
  35. {
  36. get { return _Name; }
  37. set { SetProperty(ref _Name, value); }
  38. }
  39. private string _Description;
  40. /// <summary>
  41. /// 描述
  42. /// </summary>
  43. public string Description
  44. {
  45. get { return _Description; }
  46. set { SetProperty(ref _Description, value); }
  47. }
  48. private int _Row;
  49. public int Row
  50. {
  51. get { return _Row; }
  52. set { SetProperty(ref _Row, value); }
  53. }
  54. private int _Column;
  55. public int Column
  56. {
  57. get { return _Column; }
  58. set { SetProperty(ref _Column, value); }
  59. }
  60. private RPoint _P0;
  61. public RPoint P0
  62. {
  63. get { return _P0; }
  64. set { SetProperty(ref _P0, value); }
  65. }
  66. private RPoint _P1;
  67. public RPoint P1
  68. {
  69. get { return _P1; }
  70. set { SetProperty(ref _P1, value); }
  71. }
  72. private RPoint _P2;
  73. public RPoint P2
  74. {
  75. get { return _P2; }
  76. set { SetProperty(ref _P2, value); }
  77. }
  78. private PalletArrangement _Arrangement;
  79. public PalletArrangement Arrangement
  80. {
  81. get { return _Arrangement; }
  82. set { SetProperty(ref _Arrangement, value); }
  83. }
  84. private PalletExtend _Extend;
  85. /// <summary>
  86. /// 组合托盘功能
  87. /// </summary>
  88. public PalletExtend Extend
  89. {
  90. get { return _Extend; }
  91. set { SetProperty(ref _Extend, value); }
  92. }
  93. public Pallet Clone()
  94. {
  95. return JsonConvert.DeserializeObject<Pallet>(JsonConvert.SerializeObject(this)); ;
  96. }
  97. }
  98. /// <summary>
  99. /// 托盘
  100. /// </summary>
  101. public class PalletEx : BindableBase
  102. {
  103. private Guid _Id;
  104. public Guid Id
  105. {
  106. get { return _Id; }
  107. set { SetProperty(ref _Id, value); }
  108. }
  109. private int _PalletNo;
  110. /// <summary>
  111. /// 编号
  112. /// </summary>
  113. public int PalletNo
  114. {
  115. get { return _PalletNo; }
  116. set { SetProperty(ref _PalletNo, value); }
  117. }
  118. private string _Name;
  119. public string Name
  120. {
  121. get { return _Name; }
  122. set { SetProperty(ref _Name, value); }
  123. }
  124. private string _Description;
  125. /// <summary>
  126. /// 描述
  127. /// </summary>
  128. public string Description
  129. {
  130. get { return _Description; }
  131. set { SetProperty(ref _Description, value); }
  132. }
  133. private int _Row;
  134. public int Row
  135. {
  136. get { return _Row; }
  137. set { SetProperty(ref _Row, value); }
  138. }
  139. private int _Column;
  140. public int Column
  141. {
  142. get { return _Column; }
  143. set { SetProperty(ref _Column, value); }
  144. }
  145. private PlcPoint _P0;
  146. public PlcPoint P0
  147. {
  148. get { return _P0; }
  149. set { SetProperty(ref _P0, value); }
  150. }
  151. private PlcPoint _P1;
  152. public PlcPoint P1
  153. {
  154. get { return _P1; }
  155. set { SetProperty(ref _P1, value); }
  156. }
  157. private PlcPoint _P2;
  158. public PlcPoint P2
  159. {
  160. get { return _P2; }
  161. set { SetProperty(ref _P2, value); }
  162. }
  163. private PalletArrangement _Arrangement;
  164. public PalletArrangement Arrangement
  165. {
  166. get { return _Arrangement; }
  167. set { SetProperty(ref _Arrangement, value); }
  168. }
  169. private PalletExtend _Extend;
  170. /// <summary>
  171. /// 组合托盘功能
  172. /// </summary>
  173. public PalletExtend Extend
  174. {
  175. get { return _Extend; }
  176. set { SetProperty(ref _Extend, value); }
  177. }
  178. public PalletEx Clone()
  179. {
  180. return new PalletEx()
  181. {
  182. Id = this.Id,
  183. PalletNo = this.PalletNo,
  184. Name = this.Name,
  185. Description = this.Description,
  186. Row = this.Row,
  187. Column = this.Column,
  188. P0 = this.P0?.Clone(),
  189. P1 = this.P1?.Clone(),
  190. P2 = this.P2?.Clone(),
  191. Arrangement = this.Arrangement,
  192. Extend = this.Extend
  193. };
  194. }
  195. }
  196. }