public void TakeTipAuto() { //生成装帧动作 if (this.SelectedBJ == null) { return; } if (SelectedBJ is T_BJ_Tip tipseat) { var sequ_taketip = Sequence.create(); var tip_seat = resmanager.GetFreeTipActPoint(injectorDevice.GetSeleteced().Length, 2, tipseat.Name); if (tip_seat != null) { int index = 0; var tip_seat_tem = IMask.Gen(new ActionPoint(-1, -1, -1)); foreach (var ent in injectorDevice.GetSeleteced()) { tip_seat_tem[ent.Index] = tip_seat[index]; index++; } var move_act = InjectMoveActs.create(20000, tip_seat_tem, false); //sequ_taketip.AddAction(InjectMoveTo.create(3000, injectorDevice.GetSeleteced(), -1, IMask.Gen(-1), IMask.Gen(0))); sequ_taketip.AddAction(move_act); sequ_taketip.runAction(injectorDevice); } else { ErrorSystem.WriteActError("吸盘盒为空!", true, false, 9999); } } }
public void SubLiquid() { if (SelectedBJ is T_BJ_GelSeat gelseat) { int x = (int)(gelseat.InjectorX); int y = gelseat.GetInjectorY(SeatYIndex); var sequ_putsample = Sequence.create( InjectMoveTo.create(injectorDevice, 3000, injectorDevice.GetSeleteced(), -1, IMask.Gen(-1), IMask.Gen(0)), InjectAbsorbMove.create(300, injectorDevice.GetSeleteced(), 100, IMask.Gen(0))); for (int i = 0; i < 8; i++) { var points = IMask.Gen(new ActionPoint(-1, -1, -1)); foreach (var ent in injectorDevice.GetSeleteced()) { points[ent.Index].x = x + i * (int)gelseat.InjectorGapX; points[ent.Index].y = y + ent.Index * (int)gelseat.InjectorGapY; points[ent.Index].z = (int)gelseat.InjectorZ; points[ent.Index].zb = points[ent.Index].z - 1500; points[ent.Index].minwidth = (double)gelseat.MinWidth; points[ent.Index].type = TestStepEnum.SpuLiquid; points[ent.Index].capacity = 500; } sequ_putsample.AddAction(InjectMoveActs.create(3000, points.ToArray(), true)); } sequ_putsample.runAction(injectorDevice); } }
public void TakeTip() { if (this.SelectedBJ == null) { return; } if (SelectedBJ is T_BJ_Tip tipseat) { var tip_seat = IMask.Gen(new ActionPoint(-1, -1, -1)); int x = (int)(tipseat.X - SeatXIndex * tipseat.GapX); int y = (int)(tipseat.Y + SeatYIndex * tipseat.GapY); foreach (var ent in injectorDevice.GetSeleteced()) { var point = new ActionPoint(); point.x = x; point.y = y; point.z = (int)tipseat.Limit; point.type = TestStepEnum.JXZT; point.index = ent.Index; tip_seat[ent.Index] = point; } var sequ_taketip = Sequence.create(); var move_act = InjectMoveActs.create(3000, tip_seat.ToArray(), false); sequ_taketip.AddAction(InjectMoveTo.create(3000, injectorDevice.GetSeleteced(), -1, IMask.Gen(-1), IMask.Gen(0))); sequ_taketip.AddAction(move_act); sequ_taketip.runAction(injectorDevice); } }
public void MoveXY() { if (this.SelectedBJ == null) { return; } var move_act = Sequence.create(); move_act.AddAction(InjectMoveTo.create(10000, injectorDevice.GetSeleteced(), -1, IMask.Gen(-1), IMask.Gen(0))); int x = 0; int y = 0; double min_width = 1.0f; if (SelectedBJ is T_BJ_Tip tipseat) { x = (int)(tipseat.X - SeatXIndex * tipseat.GapX); y = tipseat.GetY(SeatYIndex); min_width = (double)tipseat.MinWidth; } else if (SelectedBJ is T_BJ_SampleRack sampleseat) { x = (int)(sampleseat.X); y = (int)sampleseat.GetY(SeatYIndex); min_width = (double)sampleseat.MinWidth; } else if (SelectedBJ is T_BJ_DeepPlate deepplate) { x = (int)(deepplate.X + SeatXIndex * deepplate.GapX); y = deepplate.GetY(SeatYIndex); min_width = (double)deepplate.MinWidth; } else if (SelectedBJ is T_BJ_AgentiaWarehouse agentiaware) { x = (int)(agentiaware.X); y = agentiaware.GetY(SeatYIndex); min_width = (double)agentiaware.MinWidth; } else if (SelectedBJ is T_BJ_GelSeat gelseat) { x = (int)(gelseat.InjectorX + SeatXIndex * gelseat.InjectorGapX); y = gelseat.GetInjectorY(SeatYIndex); min_width = (double)gelseat.MinWidth; } else if (SelectedBJ is T_BJ_Unload unload) { x = (int)(unload.X); y = (int)(unload.Y + SeatYIndex * unload.FZ); } var points = IMask.Gen(new ActionPoint(-1, -1, -1)); foreach (var ent in injectorDevice.GetSeleteced()) { points[ent.Index].x = x; points[ent.Index].y = y; points[ent.Index].minwidth = min_width; } move_act.AddAction(InjectMoveActs.create(3001, points.ToArray(), true)); move_act.runAction(injectorDevice); }
/// <summary> /// 移动Y /// </summary> public void MoveY() { var move_act = Sequence.create(); var device = new ActionDevice(injectorDevice); move_act.AddAction(InjectMoveTo.create(10000, injectorDevice.GetSeleteced(), -1, IMask.Gen(-1), IMask.Gen(0))); int x = 0; int y = (int)DistanceY; double min_width = 1.0f; var points = IMask.Gen(new ActionPoint(-1, -1, -1)); if (device.GetRealX(ref x)) { var ens = injectorDevice.Injector.Entercloses; int[] py = { 0, (int)(ens[1].TipDis), (int)(ens[2].TipDis + ens[2].InjWidth), (int)(ens[3].TipDis + ens[3].InjWidth) }; foreach (var ent in injectorDevice.GetSeleteced()) { points[ent.Index].x = x; points[ent.Index].y = y + py[ent.Index]; points[ent.Index].minwidth = min_width; } move_act.AddAction(InjectMoveActs.create(3001, points.ToArray(), true)); move_act.runAction(injectorDevice); } //var canComm = IoC.Get<AbstractCanComm>(); //var injects = injectorDevice.GetSeleteced(); //if(IsUseTMotor) //{ // var act = InjectMoveTo.create(5001, injects.ToArray(), -1, IMask.Gen((int)DistanceY), IMask.Gen(0), 2); // act.runAction(injectorDevice); //} //else //{ // var points = IMask.Gen(new ActionPoint(-1, -1, -1)); // var device = new ActionDevice(injectorDevice); // int x = 0; // if(device.GetRealX(ref x)) // { // var min_index = injects.Min(et => et.Index); // points[min_index].x = x; // points[min_index].y = (int)DistanceY; // points[min_index].minwidth = 1.0f; // var act = InjectMoveActs.create(3001, points.ToArray(), true); // act.runAction(injectorDevice); // } //} }
public void PutTip() { var sequ_puttip = Sequence.create(); List <ActionPoint> unload_seat = new List <ActionPoint>(); var inject_unload = resmanager.unload_list; if (inject_unload.Count() == 1) { var unloader = inject_unload[0]; for (int i = 0; i < 4; i++) { var unload_point = new ActionPoint((int)unloader.X, (int)unloader.Y + i * (int)unloader.FZ, (int)unloader.Z, TestStepEnum.PutTip); unload_point.puttip_x = (int)unloader.FirstX; unload_seat.Add(unload_point); } sequ_puttip.AddAction(InjectMoveTo.create(3000, injectorDevice.GetSeleteced(), -1, IMask.Gen(-1), IMask.Gen(0))); sequ_puttip.AddAction(InjectMoveActs.create(3000, unload_seat.ToArray(), true)); sequ_puttip.runAction(injectorDevice); } }
//按小组生成动作 public Sequence GenerateAction(List <T_GelStep> act_group) { //更新坐标计算吸头个数 int zt_count = 0; foreach (var act in act_group) { zt_count += act.InjectCount; } var resmanager = ResManager.getInstance(); Enterclose[] enters = new Enterclose[zt_count];//使用加样器个数 for (int i = 0; i < zt_count; i++) { enters[i] = Engine.getInstance().injectorDevice.Injector.Entercloses[i]; } //生成装帧动作 var tip_seat = resmanager.GetFreeTipActPoint(zt_count, 2); var sequ_taketip = InjectMoveActs.create(3001, tip_seat, false); //生成加样动作 var sequ_takesample = Sequence.create(); List <ActionPoint> abs_seat = new List <ActionPoint>(); foreach (var act_abs in act_group) { var abs_point = GelStepToActionPoint(act_abs, TestStepEnum.AbsLiquid); abs_seat.Add(abs_point); } sequ_takesample.AddAction(InjectMoveActs.create(3001, abs_seat.ToArray(), true)); //生成混合液体 var sequ_mixsample = Sequence.create(); List <ActionPoint> mix_seat = new List <ActionPoint>(); foreach (var act_mix in act_group) { if (act_mix.is_mix) { var mix_point = GelStepToActionPoint(act_mix, TestStepEnum.MixLiquid); mix_seat.Add(mix_point); } } sequ_mixsample.AddAction(InjectMoveActs.create(3001, mix_seat.ToArray(), true)); //生成分配动作 var sequ_putsample = Sequence.create(); List <ActionPoint> spu_seat = new List <ActionPoint>(); int spu_index = 0; foreach (var act_spu in act_group) { if (act_spu.is_spu) { var spu_point = GelStepToActionPoint(act_spu, TestStepEnum.SpuLiquid); var tubelist = spu_point.GetTubeList(); for (int i = 0; i < tubelist.Count(); i++) { var points = IMask.Gen(new ActionPoint(-1, -1, -1)); points[spu_index] = (ActionPoint)spu_point.Clone(); points[spu_index].x = (int)(spu_point.x + tubelist[i] * spu_point.tube_gap); if (tubelist.Count() != 1 && i >= 0 && i < tubelist.Count() - 1) { points[spu_index].zb = points[spu_index].z - 1500; if (points[spu_index].zb <= 0) { points[spu_index].zb = 0; } } sequ_putsample.AddAction(InjectMoveActs.create(3001, points.ToArray(), true)); } } spu_index++; } //生成脱针动作 var sequ_puttip = Sequence.create(); List <ActionPoint> unload_seat = new List <ActionPoint>(); var inject_unload = resmanager.unload_list; if (inject_unload.Count() == 1) { var unloader = inject_unload[0]; for (int i = 0; i < 4; i++) { var unload_point = new ActionPoint((int)unloader.X, (int)unloader.Y + i * (int)unloader.FZ, (int)unloader.Z, TestStepEnum.PutTip); unload_point.puttip_x = (int)unloader.FirstX; unload_seat.Add(unload_point); } sequ_puttip.AddAction(InjectMoveActs.create(3001, unload_seat.ToArray(), true)); } var action_list = Sequence.create(); action_list.node = Engine.getInstance().injectorDevice; action_list.AddAction(sequ_taketip); action_list.AddAction(sequ_takesample); action_list.AddAction(sequ_mixsample); action_list.AddAction(sequ_putsample); //action_list.AddAction(sequ_puttip); return(action_list); }
//按小组生成动作 public Sequence GenerateAction(List <T_GelStep> act_group) { //更新坐标计算吸头个数 int zt_count = 0; foreach (var act in act_group) { act.InjIndex = zt_count; zt_count += act.InjectCount; } var resmanager = ResManager.getInstance(); Enterclose[] enters = new Enterclose[zt_count];//使用加样器个数 for (int i = 0; i < zt_count; i++) { enters[i] = Engine.getInstance().injectorDevice.Injector.Entercloses[i]; } //生成装帧动作 var tip_seat = resmanager.GetFreeTipActPoint(zt_count, 2); var sequ_taketip = InjectMoveActs.create(3001, tip_seat, false); //生成加样动作 var sequ_takesample = Sequence.create(); List <ActionPoint> abs_seat = new List <ActionPoint>(); int abs_index = 0; var abs_width_rate = IMask.Gen(1.0f); foreach (var act_abs in act_group) { var abs_point = GelStepToActionPoint(act_abs, TestStepEnum.AbsLiquid, null); var agentseat = resmanager.GetAgentiaWarehouseSeat(abs_point.liquid_type); if (agentseat != null) { abs_width_rate[act_abs.InjIndex] = !act_abs.GetLiquidInfo().IsAgentia ? 0.7693f : 1.1f; abs_point.y += (int)(agentseat.Gap * abs_index) * (agentseat.Count == 1 ? 1 : 0); } abs_seat.Add(abs_point); abs_index++; } sequ_takesample.AddAction(InjectMoveActs.create(3001, abs_seat.ToArray(), true, abs_width_rate)); //计算混合是否需要分配(当前卡在第一卡位时且只有一个试验) var inj_exp_list = ExperimentLogic.getInstance().GetInjExpPackageList(); foreach (var act_mix in act_group) { var exp = (ExperimentPackage)act_mix.ExperPackage; var piperseat = resmanager.GetResByCode(exp.GetGelMask(), "T_BJ_GelSeat", "", "4"); if (piperseat.CountX == 0 && inj_exp_list.Count == 1) { act_mix.is_spu = act_mix.InjIndex == 0; } else { act_mix.is_spu = act_mix.LiquidTypeIndex == act_mix.GetFpytInfo().LiquidList.Count - 1; } } //得到可用深盘 var mix_list = act_group.Where(item => item.is_mix == true).ToList(); mix_list = mix_list.Where((x, x_index) => x_index == (mix_list.FindIndex(y => y.MixCode == x.MixCode))).ToList(); int mix_inj_count = mix_list.Count; var mix_deep_seat = resmanager.GetFreeDeepPlate(mix_inj_count, 2); //生成混合液体 var sequ_mixsample = Sequence.create(); var mix_seat = IMask.Gen(new ActionPoint(-1, -1, -1)); int mix_index = 0; foreach (var act_mix in act_group) { if (act_mix.is_mix) { var mix_point = GelStepToActionPoint(act_mix, TestStepEnum.MixLiquid, mix_deep_seat[mix_index % mix_inj_count]); mix_seat[act_mix.InjIndex] = mix_point; mix_index++; } } sequ_mixsample.AddAction(InjectMoveActs.create(3001, mix_seat.ToArray(), true)); //生成分配动作 var sequ_putsample = Sequence.create(); //查找卡位 List <ActionPoint> spupoint_list = new List <ActionPoint>(); foreach (var act_spu in act_group) { if (act_spu.is_spu) { var spu_point = GelStepToActionPoint(act_spu, TestStepEnum.SpuLiquid, null); spu_point.index = act_spu.InjIndex; spupoint_list.Add(spu_point); } } var hit_count = IMask.Gen(0); for (int i = 0; i < 8; i++) { bool is_find = false; var points = IMask.Gen(new ActionPoint(-1, -1, -1)); foreach (var spuc in spupoint_list) { bool is_hit = (spuc.tube & (0x01 << i)) != 0; if (is_hit) { var tubelist = spuc.GetTubeList(); points[spuc.index] = (ActionPoint)spuc.Clone(); points[spuc.index].x = (int)(spuc.x + i * spuc.tube_gap); points[spuc.index].y = (int)spuc.y; if (tubelist.Count() != 1 && hit_count[spuc.index] < tubelist.Count() - 1) { points[spuc.index].zb = points[spuc.index].z - 1500; if (points[spuc.index].zb <= 0) { points[spuc.index].zb = 0; } } hit_count[spuc.index]++; is_find = true; } } if (is_find) { sequ_putsample.AddAction(InjectMoveActs.create(3001, points.ToArray(), true)); } } //生成脱针动作 var sequ_puttip = Sequence.create(); List <ActionPoint> unload_seat = new List <ActionPoint>(); var inject_unload = resmanager.unload_list; if (inject_unload.Count() == 1) { var unloader = inject_unload[0]; for (int i = 0; i < 4; i++) { var unload_point = new ActionPoint((int)unloader.X, (int)unloader.Y + i * (int)unloader.FZ, (int)unloader.Z, TestStepEnum.PutTip); unload_point.puttip_x = (int)unloader.FirstX; unload_seat.Add(unload_point); } sequ_puttip.AddAction(InjectMoveActs.create(3001, unload_seat.ToArray(), true)); } var action_list = Sequence.create(); action_list.node = Engine.getInstance().injectorDevice; action_list.AddAction(sequ_taketip); action_list.AddAction(sequ_takesample); action_list.AddAction(sequ_mixsample); action_list.AddAction(sequ_putsample); action_list.AddAction(sequ_puttip); return(action_list); }
public void AbsLiquid() { if (this.SelectedBJ == null) { return; } var move_act = Sequence.create(); bool is_find = false; move_act.AddAction(InjectMoveTo.create(10000, injectorDevice.GetSeleteced(), -1, IMask.Gen(-1), IMask.Gen(0))); int x = 0; int y = 0; int z = 0; if (SelectedBJ is T_BJ_SampleRack sampleseat) { x = (int)(sampleseat.X); y = (int)(sampleseat.Y + SeatYIndex * sampleseat.Gap); z = (int)(sampleseat.Z); is_find = true; } else if (SelectedBJ is T_BJ_DeepPlate deepplate) { x = (int)(deepplate.X + SeatXIndex * deepplate.GapX); y = (int)(deepplate.Y + SeatYIndex * deepplate.GapY); z = (int)(deepplate.Z); is_find = true; } else if (SelectedBJ is T_BJ_AgentiaWarehouse agentiaware) { x = (int)(agentiaware.X); y = (int)(agentiaware.Y + SeatYIndex * agentiaware.Gap); z = (int)(agentiaware.Z); is_find = true; } else if (SelectedBJ is T_BJ_GelSeat gelseat) { x = (int)(gelseat.InjectorX + SeatXIndex * gelseat.InjectorGapX); y = (int)(gelseat.InjectorY + SeatYIndex * gelseat.InjectorGapY); z = (int)(gelseat.InjectorZ); is_find = true; } else if (SelectedBJ is T_BJ_Unload unload) { x = (int)(unload.X); y = (int)(unload.Y); z = (int)(unload.Z); is_find = true; } if (is_find) { var tip_seat = IMask.Gen(new ActionPoint(-1, -1, -1)); foreach (var ent in injectorDevice.GetSeleteced()) { var point = new ActionPoint(); point.x = x; point.y = y; point.z = z; point.zb = 0; point.type = TestStepEnum.JXZT; point.index = ent.Index; tip_seat[ent.Index] = point; } move_act.AddAction(InjectMoveActs.create(3000, tip_seat.ToArray(), false)); move_act.runAction(injectorDevice); } }
/// <summary> /// 探测液面 /// </summary> public void Detect() { if (this.SelectedBJ == null) { return; } var move_act = Sequence.create(); move_act.AddAction(InjectMoveTo.create(10000, injectorDevice.GetSeleteced(), -1, IMask.Gen(-1), IMask.Gen(0))); int x = 0; int y = 0; int z = 0; int zl = (int)ZDeepWhenDetecting; double gap = 0; if (SelectedBJ is T_BJ_SampleRack sampleseat) { x = (int)(sampleseat.X); y = (int)(sampleseat.Y + SeatYIndex * sampleseat.Gap); z = (int)sampleseat.Z; if (zl == 0) { zl = (int)sampleseat.Z + 1000; } else { zl = (int)sampleseat.Z + (int)ZDeepWhenDetecting; } gap = (double)sampleseat.Gap; } else if (SelectedBJ is T_BJ_DeepPlate deepplate) { x = (int)(deepplate.X + SeatXIndex * deepplate.GapX); y = (int)(deepplate.Y + SeatYIndex * deepplate.GapY); z = (int)deepplate.Z; if (zl == 0) { zl = (int)deepplate.Z; } else { zl = (int)deepplate.Z + (int)ZDeepWhenDetecting; } gap = (double)deepplate.GapX; } else if (SelectedBJ is T_BJ_AgentiaWarehouse agentiaware) { x = (int)(agentiaware.X); y = (int)(agentiaware.Y + SeatYIndex * agentiaware.Gap); z = (int)agentiaware.Z; if (zl == 0) { zl = (int)agentiaware.Z + 1000; } else { zl = (int)agentiaware.Z + (int)ZDeepWhenDetecting; } gap = (double)agentiaware.Gap; } var points = IMask.Gen(new ActionPoint(-1, -1, -1)); foreach (var ent in injectorDevice.GetSeleteced()) { points[ent.Index].x = x; points[ent.Index].y = y + (int)(ent.Index * gap); points[ent.Index].z = z; points[ent.Index].zb = z; } move_act.AddAction(InjectMoveActs.create(3001, points.ToArray(), true)); move_act.AddAction(InjectDetector.create(30000, injectorDevice.GetSeleteced(), IMask.Gen(z), IMask.Gen((int)zl), IMask.Gen((int)0))); move_act.runAction(injectorDevice); }
private bool RunLogic(IList <T_LogicStep> steps, out String msg) { msg = null; var seque_root = Sequence.create(); var seque = Sequence.create(); var resmanager = ResManager.getInstance(); var generater = ActionGenerater.getInstance(); int loop_times = 0; foreach (var step in steps) { switch (step.StepEnum) { case LogicStepEnum.Alert: seque.AddAction(SkCallBackFun.create((ActionBase act_tem) => { ErrorSystem.WriteActError(step.Parameters, true, false, 9999); return(true); })); break; case LogicStepEnum.InitAll: var act_init = opDevice.InitAllDevice(); seque.AddAction(act_init); break; case LogicStepEnum.Centrifuge: { CommonAction action = Convert2T <CommonAction>(step.Parameters); var cen = cenMrg.GetCentrifugeByCode(action.Code); if (cen != null) { if (action.DoAction == 0) //正常离心程序 { int hspeed = (int)cen.Centrifugem.HightSpeed.SetValue; int lspeed = (int)cen.Centrifugem.LowSpeed.SetValue; int htime = (int)cen.Centrifugem.HightSpeedTime.SetValue; int ltime = (int)cen.Centrifugem.LowSpeedTime.SetValue; int uphtime = (int)cen.Centrifugem.AddHSpeedTime.SetValue; int upltime = (int)cen.Centrifugem.AddLSpeedTime.SetValue; int stime = (int)cen.Centrifugem.StopSpeedTime.SetValue; var act = CentrifugeStart.create(cen, 3000000, hspeed, lspeed, htime, ltime, uphtime, upltime, stime); seque.AddAction(act); } else if (action.DoAction == 1) //移动指定卡位 { var resinfo = ResManager.getInstance().SearchGelCard("T_BJ_Centrifuge", action.Code, "", (int)action.SeatIndex); var act = MoveTo.create(cen, 30000, -1, -1, resinfo.CenGelP[resinfo.CountX], 5); seque.AddAction(act); } else if (action.DoAction == 2) //开舱门 { var act = HandOpenCloseDoor.create(handDevice, 3000, action.Code, true); seque.AddAction(act); } else if (action.DoAction == 3) //关舱门 { var act = HandOpenCloseDoor.create(handDevice, 3000, action.Code, false); seque.AddAction(act); } else if (action.DoAction == 4) //初始化 { var act = InitXyz.create(cen, 3000, false, false, true); seque.AddAction(act); } } else { ErrorSystem.WriteActError("找不到指定离心机", true, false, 9999); } } break; case LogicStepEnum.Couveuse: { } break; case LogicStepEnum.Delay: { int DelayTime = Convert.ToInt32(step.Parameters); seque.AddAction(SKSleep.create(DelayTime)); } break; case LogicStepEnum.DetectSquid: { DetectAction action = Convert2T <DetectAction>(step.Parameters); List <Enterclose> iinjects = new List <Enterclose>(); foreach (var entindex in action.Indexs) { iinjects.Add(injDevice.Injector.Entercloses[entindex]); } seque.AddAction(InjectDetector.create(3000, iinjects.ToArray(), IMask.Gen((int)action.Start), IMask.Gen((int)action.ZLimit), IMask.Gen(0))); } break; case LogicStepEnum.SimpleAction: { SimpleAction action = Convert2T <SimpleAction>(step.Parameters); AbstractCanDevice device = null; switch (action.Device) { case "加样器": device = injDevice; break; case "机械手": device = handDevice; break; case "卡仓": device = gelwareDevice; break; case "破孔器": device = gelwareDevice; break; } if (action.Action == "移动") { ActionBase act_move = null; int x = action.Direction == "X" ? (int)action.Value : -1; int y = action.Direction == "Y" ? (int)action.Value : -1; int z = action.Direction == "Z"? (int)action.Value:-1; if (action.Direction == "XYZ") { x = y = z = (int)action.Value; } if (device is InjectorDevice) { act_move = InjectMoveTo.create(device, 3000, injDevice.Injector.Entercloses, x, IMask.Gen(y), IMask.Gen(z)); } else { act_move = MoveTo.create(device, 3000, x, y, z); } seque.AddAction(act_move); } else if (action.Action == "初始化") { ActionBase act_move = null; bool x = action.Direction == "X" ? true : false; bool y = action.Direction == "Y" ? true : false; bool z = action.Direction == "Z" ? true : false; if (action.Direction == "XYZ") { x = y = z = true; } if (device is InjectorDevice) { act_move = InitXyz.create(device, 30000, injDevice.Injector.Entercloses, x, y, z); } else { act_move = InitXyz.create(device, 30000, x, y, z); } seque.AddAction(act_move); } } break; case LogicStepEnum.TakeAndPutDownGel: { GelAction[] actions = Convert2T <GelAction[]>(step.Parameters); seque.AddAction(MoveTo.create(handDevice, 3000, -1, -1, 0)); ResInfoData take_seat = null; if (actions[0].BJType == "T_BJ_GelSeat") { take_seat = resmanager.SearchGelCard("T_BJ_GelSeat", "", "", actions[0].Index, 0, true, actions[0].BJName); generater.GenerateTakeGelFromNormal(take_seat, ref seque); } else if (actions[0].BJType == "T_BJ_Centrifuge") { take_seat = resmanager.SearchGelCard("T_BJ_Centrifuge", "", "", actions[0].Index, 0, true, actions[0].BJName); var act = generater.GenerateTakeGelFromCent(take_seat, "", ref seque); } else if (actions[0].BJType == "T_BJ_GelWarehouse") { take_seat = resmanager.SearchGelCard("T_BJ_GelWarehouse", "", "", actions[0].Index, 0, true, actions[0].BJName); var act = generater.GenerateTakeGelFromWare(take_seat, ref seque); } if (actions[1].BJType == "T_BJ_GelSeat") { var put_seat = resmanager.SearchGelCard("T_BJ_GelSeat", "", "", actions[1].Index, 0, true, actions[1].BJName); generater.GeneratePutGelToNormal(put_seat, take_seat, ref seque); } else if (actions[1].BJType == "T_BJ_Centrifuge") { var put_seat = resmanager.SearchGelCard("T_BJ_Centrifuge", "", "", actions[1].Index, 0, true, actions[1].BJName); generater.GeneratePutGelToCent(put_seat.CenCode, put_seat, take_seat, ref seque); } else if (actions[1].BJType == "T_BJ_GelWarehouse") { var put_seat = resmanager.SearchGelCard("T_BJ_GelWarehouse", "", "", actions[1].Index, 0, true, actions[1].BJName); generater.GeneratePutGelToWare(put_seat, take_seat, ref seque); } } break; case LogicStepEnum.TakeGel: { GelAction action = Convert2T <GelAction>(step.Parameters); ResInfoData take_seat = null; if (action.BJType == "T_BJ_GelSeat") { take_seat = resmanager.SearchGelCard("T_BJ_GelSeat", "", "", action.Index, 0, true, action.BJName); generater.GenerateTakeGelFromNormal(take_seat, ref seque); } else if (action.BJType == "T_BJ_Centrifuge") { take_seat = resmanager.SearchGelCard("T_BJ_Centrifuge", "", "", action.Index, 0, true, action.BJName); var act = generater.GenerateTakeGelFromCent(take_seat, "", ref seque); } else if (action.BJType == "T_BJ_GelWarehouse") { take_seat = resmanager.SearchGelCard("T_BJ_GelWarehouse", "", "", action.Index, 0, true, action.BJName); var act = generater.GenerateTakeGelFromWare(take_seat, ref seque); } break; } case LogicStepEnum.PutDownGel: { GelAction action = Convert2T <GelAction>(step.Parameters); ResInfoData take_seat = resmanager.handseat_resinfo; if (action.BJType == "T_BJ_GelSeat") { var put_seat = resmanager.SearchGelCard("T_BJ_GelSeat", "", "", action.Index, 0, true, action.BJName); generater.GeneratePutGelToNormal(put_seat, take_seat, ref seque); } else if (action.BJType == "T_BJ_Centrifuge") { var put_seat = resmanager.SearchGelCard("T_BJ_Centrifuge", "", "", action.Index, 0, true, action.BJName); generater.GeneratePutGelToCent(put_seat.CenCode, put_seat, take_seat, ref seque); } else if (action.BJType == "T_BJ_GelWarehouse") { var put_seat = resmanager.SearchGelCard("T_BJ_GelWarehouse", "", "", action.Index, 0, true, action.BJName); generater.GeneratePutGelToWare(put_seat, take_seat, ref seque); } break; } case LogicStepEnum.TakeTip: { TakeTipAction action = Convert2T <TakeTipAction>(step.Parameters); var ents = injDevice.Injector.Entercloses.Where(ent => ent.Valid && action.Indexs.Contains(ent.Index)).ToArray(); var tipseat = Constants.BJDict[typeof(T_BJ_Tip).Name].Where(item => item.Name == action.TipBoxName).FirstOrDefault() as T_BJ_Tip; List <ActionPoint> tip_seat = new List <ActionPoint>(); foreach (var ent in ents) { int x = (int)(tipseat.X - action.C * tipseat.GapX); int y = (int)(tipseat.Y + action.R * tipseat.GapY); var point = new ActionPoint(); point.x = x; point.y = y; point.z = (int)tipseat.Limit; point.type = TestStepEnum.JXZT; point.index = ent.Index; tip_seat.Add(point); } var sequ_taketip = Sequence.create(); var move_act = InjectMoveActs.create(injDevice, 3000, tip_seat.ToArray(), false); sequ_taketip.AddAction(InjectMoveTo.create(injDevice, 3000, ents, -1, IMask.Gen(-1), IMask.Gen(0))); sequ_taketip.AddAction(move_act); seque.AddAction(sequ_taketip); } break; case LogicStepEnum.OutTip: { TakeTipAction action = Convert2T <TakeTipAction>(step.Parameters); var ents = injDevice.Injector.Entercloses.Where(ent => ent.Valid && action.Indexs.Contains(ent.Index)).ToArray(); var sequ_puttip = Sequence.create(); List <ActionPoint> unload_seat = new List <ActionPoint>(); var inject_unload = resmanager.unload_list; if (inject_unload.Count() == 1) { var unloader = inject_unload[0]; for (int i = 0; i < 4; i++) { var unload_point = new ActionPoint((int)unloader.X, (int)unloader.Y + i * (int)unloader.FZ, (int)unloader.Z, TestStepEnum.JXZT); unload_point.puttip_x = (int)unloader.FirstX; unload_seat.Add(unload_point); } sequ_puttip.AddAction(InjectMoveTo.create(injDevice, 3000, ents, -1, IMask.Gen(-1), IMask.Gen(0))); sequ_puttip.AddAction(InjectMoveActs.create(injDevice, 3000, unload_seat.ToArray(), true)); seque.AddAction(sequ_puttip); } } break; case LogicStepEnum.Piercer: { var paper_seat = resmanager.GetResByCode("", "T_BJ_GelSeat", "", "4"); seque.AddAction(PaperCard.create(pieDevice, 3000, paper_seat, 0)); } break; case LogicStepEnum.LoopStart: { LogicLoop logicLoop = Convert2T <LogicLoop>(step.Parameters); loop_times = logicLoop.Count; seque_root.AddAction(seque); seque = Sequence.create(); } break; case LogicStepEnum.LoopEnd: { var act_repat = Repeat.create(seque, loop_times); seque_root.AddAction(act_repat); seque = Sequence.create(); loop_times = 0; } break; } } seque_root.AddAction(seque); seque_root.runAction(opDevice); return(true); }