RecipePointGroup.cs 2.4 KB

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