添加 MX-PD-盘古 项目文件
将 MX-PD-盘古 - new 目录下的所有文件添加到主仓库
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user