Files
Shi.Ji e31d3560bb 添加 MX-PD-盘古 项目文件
将 MX-PD-盘古 - new 目录下的所有文件添加到主仓库
2026-05-18 11:43:09 +08:00

48 lines
1.2 KiB
C#

using MainShell.Recipe.BaseBoard.Model;
using System.Collections.Generic;
using System.Linq;
namespace MainShell.Process
{
public class PadTransferRow
{
public PadTransferRow()
{
Pads = new List<Pad>();
Direction = DieTransferRowDirection.Positive;
}
public int RowIndex { get; set; }
public DieTransferRowDirection Direction { get; set; }
public List<Pad> Pads { get; set; }
public int AvailableCount
{
get
{
return Pads == null ? 0 : Pads.Count(pad => pad != null);
}
}
public IReadOnlyList<Pad> GetOrderedPads()
{
if (Pads == null)
{
return new List<Pad>();
}
IEnumerable<Pad> orderedPads = Direction == DieTransferRowDirection.Positive
? Pads.OrderBy(pad => pad.Column)
: Pads.OrderByDescending(pad => pad.Column);
return orderedPads.ToList();
}
public IReadOnlyList<Pad> GetAvailablePads()
{
return GetOrderedPads().Where(pad => pad != null).ToList();
}
}
}