TrayConfig.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. using Prism.Mvvm;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6. namespace SKMC.Api.Device.Material.Tray
  7. {
  8. /// <summary>
  9. /// 基础物料盘的配置模型
  10. /// </summary>
  11. public class TrayConfig : BindableBase
  12. {
  13. private long _id;
  14. public long Id
  15. {
  16. get { return _id; }
  17. set { _id = value; }
  18. }
  19. private int _length;
  20. /// <summary>
  21. /// Tray长度mm
  22. /// </summary>
  23. public int Length
  24. {
  25. get { return _length; }
  26. set { _length = value; RaisePropertyChanged(); }
  27. }
  28. private int _width;
  29. /// <summary>
  30. /// Tray宽度mm
  31. /// </summary>
  32. public int Width
  33. {
  34. get { return _width; }
  35. set { _width = value; RaisePropertyChanged(); }
  36. }
  37. private long _profileId;
  38. /// <summary>
  39. /// 档案Id
  40. /// </summary>
  41. public long ProfileId
  42. {
  43. get { return _profileId; }
  44. set { _profileId = value; RaisePropertyChanged(); }
  45. }
  46. private int _row;
  47. /// <summary>
  48. /// Tray物料行数
  49. /// </summary>
  50. public int Row
  51. {
  52. get { return _row; }
  53. set { _row = value; RaisePropertyChanged(); }
  54. }
  55. private int _col;
  56. /// <summary>
  57. /// Tray物料列数
  58. /// </summary>
  59. public int Col
  60. {
  61. get { return _col; }
  62. set { _col = value; RaisePropertyChanged(); }
  63. }
  64. /// <summary>
  65. /// Tray的最大物料数(行*列)
  66. /// </summary>
  67. public int Number { get => _row * _col; }
  68. private double _xStart;
  69. /// <summary>
  70. /// Tray的首个物料位起始位置的X位置mm
  71. /// </summary>
  72. public double XStart
  73. {
  74. get { return _xStart; }
  75. set { _xStart = value; RaisePropertyChanged(); }
  76. }
  77. private double _xPitch;
  78. /// <summary>
  79. /// Tray的X方向(列与列)物料间隔mm
  80. /// </summary>
  81. public double XPitch
  82. {
  83. get { return _xPitch; }
  84. set { _xPitch = value; RaisePropertyChanged(); }
  85. }
  86. private double _yStart;
  87. /// <summary>
  88. /// Tray的首个物料位起始位置的Y位置mm
  89. /// </summary>
  90. public double YStart
  91. {
  92. get { return _yStart; }
  93. set { _yStart = value; RaisePropertyChanged(); }
  94. }
  95. private double _yPitch;
  96. /// <summary>
  97. /// Tray的Y方向(行与行)物料间隔mm
  98. /// </summary>
  99. public double YPitch
  100. {
  101. get { return _yPitch; }
  102. set { _yPitch = value; RaisePropertyChanged(); }
  103. }
  104. private double _height;
  105. /// <summary>
  106. /// Tray的高度
  107. /// </summary>
  108. public double Height
  109. {
  110. get { return _height; }
  111. set { _height = value; RaisePropertyChanged(); }
  112. }
  113. public double XWidth => XStart + Col * XPitch;
  114. public double YWidth => YStart + Row * YPitch;
  115. private string _linePath;
  116. /// <summary>
  117. /// Tray的走线路径(物料格序号集字符串, 空格分隔)
  118. /// </summary>
  119. public string LinePath
  120. {
  121. get { return _linePath; }
  122. set { _linePath = value; RaisePropertyChanged(); }
  123. }
  124. /// <summary>
  125. /// Tray的走线路径(物料格序号集)
  126. /// </summary>
  127. public List<int> LinePathList
  128. {
  129. get
  130. {
  131. string linePath = Regex.Replace(_linePath.Trim(), @"\s+", " ", RegexOptions.Multiline);
  132. return linePath.Split(' ').Select(Int32.Parse).ToList();
  133. }
  134. }
  135. /// <summary>
  136. /// 物料格开关(用于跳过走线与作业)
  137. /// </summary>
  138. public List<bool> SiteSwitchs { get; set; } = new List<bool>();
  139. }
  140. }