using Rs.Controls; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Rs.MotionPlat.Commom { /// /// 重排 /// public static class RearrangeManager { public static List GeneralRearrangeTask(TurnoverType fromtray, TurnoverType totray, RsTray tray, TraySlot slot,int floor) { int needTakeNum = 0; List task = new List(); //首先判断总列数是奇数还是偶数 if (tray.ColumnNum % 2 == 0)//偶数 { if (slot.Column+1 > tray.ColumnNum/2) { needTakeNum = tray.ColumnNum - slot.Column; } else { needTakeNum = slot.Column; } } //找到要搬运的行的第一个和最后一个 int last = slot.Index + (tray.ColumnNum - (slot.Column + 1)); int first = slot.Index - slot.Column; for( int i=0;i