Esempio n. 1
0
        //生成离心机抓卡动作
        public bool GenerateTakeGelFromCent(T_Gel gel, ref Sequence seque, string code = "", int seatindex = -1)
        {
            var             resmanager = ResManager.getInstance();
            T_BJ_Centrifuge gelselect  = (T_BJ_Centrifuge)resmanager.SearchGelCard(typeof(T_BJ_Centrifuge).Name, gel, true, code, seatindex);
            var             centrifuge = cenMrg.GetCentrifugeByCode(code);

            if (centrifuge == null)
            {
                centrifuge = cenMrg.GetFreeCentrifuge();
            }
            if (gelselect != null)
            {
                //离心机位移动
                //抓手移动到离心机位
                var move_act = Spawn.create(
                    MoveTo.create(centrifuge, 30000, -1, -1, (int)(seatindex * (double)gelselect.Gel0), 5),
                    MoveTo.create(handDevice, 30000, (int)gelselect.HandX, (int)gelselect.HandY));
                seque.AddAction(move_act);
                //抓手抓卡
                seque.AddAction(HandTakeCard.create(700000, (int)gelselect.HandZ, (int)gelselect.ZLimit, (int)gelselect.ZCatch, 0));
                //把测试卡放在离心Gel位中
                gelselect.Values[seatindex, 0] = null;
                seque.destroyfun = (ActionBase act) =>
                {
                    gelselect.Values[seatindex, 0] = gel;
                    return(true);
                };
            }
            else
            {
                ErrorSystem.WriteActError("离心机位打不到卡");
            }
            return(gelselect != null);
        }
Esempio n. 2
0
        //生成在普通位抓卡
        public bool GenerateTakeGelFromNormal(T_Gel gel, ref Sequence seque, string code = "", int seatindex = -1)
        {
            var          resmanager = ResManager.getInstance();
            T_BJ_GelSeat gelselect  = (T_BJ_GelSeat)resmanager.SearchGelCard(typeof(T_BJ_GelSeat).Name, gel, true, code, seatindex);

            if (gelselect != null)
            {
                //抓手移动
                seque.AddAction(MoveTo.create(300000, (int)gelselect.X, (int)(gelselect.Y + gelselect.Gap * seatindex), 0));
                //抓手抓卡
                seque.AddAction(HandTakeCard.create(700000, (int)gelselect.Z, (int)gelselect.ZLimit, (int)gelselect.ZCatch, 0));
                //把测试卡放在Gel位中
                gelselect.Values[seatindex, 0] = null;
                seque.destroyfun = (ActionBase act) =>
                {
                    gelselect.Values[seatindex, 0] = gel;
                    return(true);
                };
            }
            else
            {
                ErrorSystem.WriteActError(gelselect.Code + "位已满");
            }
            return(gelselect != null);
        }
Esempio n. 3
0
 //生成卡仓抓卡动作
 public ResInfoData GenerateTakeGelFromWare(ResInfoData take_seat, ref Sequence seque, string gelmask = "")
 {
     if (take_seat != null)
     {
         //卡仓位移动
         //抓手移动到卡仓机位
         var move_act = Spawn.create(
             MoveTo.create(Engine.getInstance().gelwareDevice, 3001, take_seat.StoreX, -1, -1),
             MoveTo.create(Engine.getInstance().handDevice, 3001, take_seat.X, take_seat.Y));
         seque.AddAction(move_act);
         //抓手抓卡
         var take_act = HandTakeCard.create(Engine.getInstance().handDevice, 3001, take_seat.Z, take_seat.ZLimit, take_seat.ZCatch, 0);
         seque.AddAction(take_act);
         //把测试卡放在卡仓Gel位中
         var geltem = take_seat.Values[take_seat.CountX, 0];
         take_seat.Values[take_seat.CountX, 0] = null;
         take_act.successfun = (ActionBase act) =>
         {
             ResManager.getInstance().handseat_resinfo = (ResInfoData)geltem;
             return(true);
         };
         take_act.destroyfun = (ActionBase act) =>
         {
             take_seat.Values[take_seat.CountX, 0] = geltem;
             return(true);
         };
     }
     else
     {
         ErrorSystem.WriteActError("卡仓无卡", true, false);
     }
     return(take_seat);
 }
Esempio n. 4
0
 //生成在普通位抓卡
 public ResInfoData GenerateTakeGelFromNormal(ResInfoData take_seat, ref Sequence seque)
 {
     if (take_seat != null)
     {
         //抓手移动
         seque.AddAction(MoveTo.create(Engine.getInstance().handDevice, 3001, (int)take_seat.X, (int)(take_seat.Y), 0));
         //抓手抓卡
         var take_act = HandTakeCard.create(Engine.getInstance().handDevice, 3001, (int)take_seat.Z, (int)take_seat.ZLimit, (int)take_seat.ZCatch, 0);
         seque.AddAction(take_act);
         //把测试卡放在Gel位中
         var geltem = take_seat.Values[take_seat.CountX, 0];
         if (take_seat.Values != null)
         {
             take_seat.Values[take_seat.CountX, 0] = null;
         }
         take_act.successfun = (ActionBase act) =>
         {
             ResManager.getInstance().handseat_resinfo = (ResInfoData)geltem;
             return(true);
         };
         take_act.destroyfun = (ActionBase act) =>
         {
             take_seat.Values[take_seat.CountX, 0] = geltem;
             return(true);
         };
     }
     else
     {
         ErrorSystem.WriteActError("普通位找不到卡", true, false);
     }
     return(take_seat);
 }
Esempio n. 5
0
        //生成离心机抓卡动作
        public ResInfoData GenerateTakeGelFromCent(ResInfoData take_seat, string cen_code, ref Sequence seque)
        {
            var centrifuge = Engine.getInstance().cenMrg.GetCentrifugeByCode(cen_code);

            if (centrifuge == null)
            {
                centrifuge = Engine.getInstance().cenMrg.GetFreeCentrifuge();
            }
            if (take_seat != null)
            {
                //打开离心机门
                var opendoor_act = HandOpenCloseDoor.create(Engine.getInstance().handDevice, 5000, cen_code, true);
                seque.AddAction(opendoor_act);
                //离心机位移动
                //抓手移动到离心机位
                var move_act = Spawn.create(
                    MoveTo.create(centrifuge, 30001, -1, -1, (int)take_seat.CenGelP[take_seat.CountX]),
                    MoveTo.create(Engine.getInstance().handDevice, 3001, (int)take_seat.X, (int)take_seat.CenHandYP[take_seat.CountX]));
                seque.AddAction(move_act);
                //抓手抓卡
                var take_act = HandTakeCard.create(Engine.getInstance().handDevice, 3001, (int)take_seat.Z, (int)take_seat.ZLimit, (int)take_seat.ZCatch, 0, centrifuge);
                seque.AddAction(take_act);
                //把测试卡放在离心Gel位中
                var geltem = take_seat.Values[take_seat.CountX, 0];
                take_seat.Values[take_seat.CountX, 0] = null;
                take_act.successfun = (ActionBase act) =>
                {
                    ResManager.getInstance().handseat_resinfo = (ResInfoData)geltem;
                    return(true);
                };
                take_act.destroyfun = (ActionBase act) =>
                {
                    take_seat.Values[take_seat.CountX, 0] = geltem;
                    return(true);
                };
            }
            else
            {
                ErrorSystem.WriteActError("离心机位找不到卡", true, false);
            }
            return(take_seat);
        }