RecipePointGroup.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. using Prism.Mvvm;
  2. using SKMC.Api.Motion.Model;
  3. using System.Collections.Generic;
  4. using System.Collections.ObjectModel;
  5. using System.Text;
  6. namespace SKMC.Api.Recipe.Model
  7. {
  8. /// <summary>
  9. /// 点位分组
  10. /// 一个分组可绑定一种电机组合
  11. /// </summary>
  12. public class RecipePointGroup : BindableBase
  13. {
  14. public long RecipeId { get; set; }
  15. private string _code;
  16. /// <summary>
  17. /// 分组编号
  18. /// </summary>
  19. public string Code
  20. {
  21. get { return _code; }
  22. set { _code = value; RaisePropertyChanged(); }
  23. }
  24. private string _catalog;
  25. /// <summary>
  26. /// 所属工位
  27. /// </summary>
  28. public string Catalog
  29. {
  30. get { return _catalog; }
  31. set { _catalog = value; RaisePropertyChanged(); }
  32. }
  33. private string _name;
  34. /// <summary>
  35. /// 名称
  36. /// </summary>
  37. public string Name
  38. {
  39. get { return _name; }
  40. set { _name = value; RaisePropertyChanged(); }
  41. }
  42. private string _note;
  43. /// <summary>
  44. /// 说明
  45. /// </summary>
  46. public string Note
  47. {
  48. get { return _note; }
  49. set { _note = value; RaisePropertyChanged(); }
  50. }
  51. public string AxisSerials
  52. {
  53. get
  54. {
  55. StringBuilder builder = new StringBuilder();
  56. for (int i = 0; i < MotionAxises.Count; i++)
  57. {
  58. builder.Append(MotionAxises[i].SerialNo);
  59. if (i != MotionAxises.Count - 1)
  60. {
  61. builder.Append("\r\n");
  62. }
  63. }
  64. return builder.ToString();
  65. }
  66. }
  67. public int PointNum
  68. {
  69. get => RecipePoints.Count;
  70. }
  71. /// <summary>
  72. /// 关联电机序号集合
  73. /// </summary>
  74. public List<int> AxisNoList { get; set; } = new List<int>();
  75. /// <summary>
  76. /// 关联电机集合
  77. /// </summary>
  78. public List<MotionAxis> MotionAxises { get; set; } = new List<MotionAxis>();
  79. /// <summary>
  80. /// 关联点位集合
  81. /// </summary>
  82. public ObservableCollection<RecipePoint> RecipePoints { get; set; } = new ObservableCollection<RecipePoint>();
  83. }
  84. }