using Prism.Mvvm; using SKMC.Api.Motion.Model; using System.Collections.ObjectModel; using System.Text; namespace SKMC.Api.Recipe.Model { /// /// 点位分组 /// 一个分组可绑定一种电机组合 /// public class RecipePointGroup : BindableBase { private long _profileId; public long ProfileId { get { return _profileId; } set { _profileId = value; } } private string _code; /// /// 分组编号 /// public string Code { get { return _code; } set { _code = value; RaisePropertyChanged(); } } private string _catalog; /// /// 所属工位 /// public string Catalog { get { return _catalog; } set { _catalog = value; RaisePropertyChanged(); } } private string _name; /// /// 名称 /// public string Name { get { return _name; } set { _name = value; RaisePropertyChanged(); } } private string _note; /// /// 说明 /// public string Note { get { return _note; } set { _note = value; RaisePropertyChanged(); } } public string AxisSerials { get { StringBuilder builder = new StringBuilder(); for (int i = 0; i < MotionAxises.Count; i++) { builder.Append(MotionAxises[i].SerialNo); if (i != MotionAxises.Count - 1) { builder.Append("\r\n"); } } return builder.ToString(); } } public int AxisNum { get => RecipePoints.Count; } /// /// 关联电机集合 /// public ObservableCollection MotionAxises { get; set; } = new ObservableCollection(); /// /// 关联点位集合 /// public ObservableCollection RecipePoints { get; set; } = new ObservableCollection(); } }