Exemple #1
0
        //生成离心机放卡动作
        public bool GeneratePutGelToCent(string cen_code, ResInfoData put_seat, ResInfoData put_gel, ref Sequence seque)
        {
            var centrifuge = Engine.getInstance().cenMrg.GetCentrifugeByCode(cen_code);

            if (centrifuge == null)
            {
                centrifuge = Engine.getInstance().cenMrg.GetFreeCentrifuge();
            }
            if (put_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, put_seat.CenGelP[put_seat.CountX]),
                    MoveTo.create(Engine.getInstance().handDevice, 3001, (int)put_seat.X, (int)put_seat.CenHandYP[put_seat.CountX]));
                seque.AddAction(move_act);
                //抓手放卡
                var put_act = HandPutCard.create(Engine.getInstance().handDevice, 3001, (int)put_seat.ZPut);
                seque.AddAction(put_act);
                //把测试卡放在离心Gel位中
                put_seat.Values[put_seat.CountX, 0] = put_gel;
                if (put_gel != null)
                {
                    put_gel.PutOk = false;
                }
                put_act.successfun = (ActionBase act) =>
                {
                    if (put_gel != null)
                    {
                        put_gel.PutOk = true;
                        put_gel.SetSeatInfo(put_seat);
                    }
                    ResManager.getInstance().handseat_resinfo = null;
                    return(true);
                };
                put_act.destroyfun = (ActionBase act) =>
                {
                    put_seat.Values[put_seat.CountX, 0] = null;
                    ResManager.getInstance().handseat_resinfo = null;
                    return(true);
                };
            }
            else
            {
                ErrorSystem.WriteActError("离心机位已满", true, false);
            }
            return(put_seat != null);
        }
Exemple #2
0
 //生成放卡在普通位
 public bool GeneratePutGelToNormal(ResInfoData put_seat, ResInfoData put_gel, ref Sequence seque)
 {
     if (put_seat != null)
     {
         //抓手移动
         seque.AddAction(MoveTo.create(Engine.getInstance().handDevice, 3001, (int)put_seat.X, (int)(put_seat.Y), 0));
         //抓手放卡
         var put_act = HandPutCard.create(Engine.getInstance().handDevice, 3001, (int)put_seat.ZPut, 0);
         seque.AddAction(put_act);
         //把测试卡放在Gel位中
         if (put_seat.Values != null)
         {
             put_seat.Values[put_seat.CountX, 0] = put_gel;
         }
         if (put_gel != null)
         {
             put_gel.PutOk = false;
         }
         put_act.successfun = (ActionBase act) =>
         {
             if (put_gel != null)
             {
                 put_gel.PutOk = true;
                 put_gel.SetSeatInfo(put_seat);
             }
             ResManager.getInstance().handseat_resinfo = null;
             return(true);
         };
         put_act.destroyfun = (ActionBase act) =>
         {
             if (put_seat.Values != null)
             {
                 put_seat.Values[put_seat.CountX, 0] = null;
             }
             ResManager.getInstance().handseat_resinfo = null;
             return(true);
         };
     }
     else
     {
         ErrorSystem.WriteActError("普通位已满", true, false);
     }
     return(put_seat != null);
 }
Exemple #3
0
 //生成卡仓放卡动作
 public bool GeneratePutGelToWare(ResInfoData put_seat, ResInfoData put_gel, ref Sequence seque)
 {
     if (put_seat != null)
     {
         var move_act = Spawn.create(
             MoveTo.create(Engine.getInstance().gelwareDevice, 3001, (int)(put_seat.StoreX), -1, -1),
             MoveTo.create(Engine.getInstance().handDevice, 3001, (int)put_seat.X, (int)put_seat.Y));
         seque.AddAction(move_act);
         //抓手放卡
         var put_act = HandPutCard.create(Engine.getInstance().handDevice, 3001, (int)put_seat.ZPut);
         seque.AddAction(put_act);
         //把测试卡放在离心Gel位中
         put_seat.Values[put_seat.CountX, 0] = put_gel;
         if (put_gel != null)
         {
             put_gel.PutOk = false;
         }
         put_act.successfun = (ActionBase act) =>
         {
             if (put_gel != null)
             {
                 put_gel.PutOk = true;
                 put_gel.SetSeatInfo(put_seat);
             }
             ResManager.getInstance().handseat_resinfo = null;
             return(true);
         };
         put_act.destroyfun = (ActionBase act) =>
         {
             put_seat.Values[put_seat.CountX, 0] = null;
             ResManager.getInstance().handseat_resinfo = null;
             return(true);
         };
     }
     else
     {
         ErrorSystem.WriteActError("卡仓位已满", true, false);
     }
     return(put_seat != null);
 }