public override ActionBase InitAll() { var by = IMask.Gen(0); foreach (var ent in Injector.Entercloses) { by[ent.Index] = (int)ent.YZero; } var inject_list = Injector.Entercloses.Where(item => item.InjEnable).ToList(); var act = Sequence.create(InitXyz.create(this, 30000, inject_list.ToArray(), false, false, true)); act.AddAction(InitXyz.create(this, 30000, inject_list.ToArray(), true, true, false, by)); var device = new ActionDevice(this); int x = 0; int[] y = new int[4]; int [] z = new int [4]; device.GetRealX(ref x); device.GetRealY(inject_list.ToArray(), ref y); device.GetRealZ(inject_list.ToArray(), ref z); Injector.XMotor.CurrentDistance = x; for (int i = 0; i < inject_list.Count(); i++) { inject_list[i].YMotor.CurrentDistance = y[i] + (int)inject_list[i].TipDis; inject_list[i].ZMotor.CurrentDistance = z[i]; } return(act); }
/// <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 override ActionBase InitAll() { InitHandTongs(); var act = Sequence.create(InitXyz.create(this, 30000, false, false, true)); act.AddAction(InitXyz.create(this, 30000, true, true, false)); var device = new ActionDevice(this); int x = 0; int y = 0; int z = 0; device.GetRealX(ref x); device.GetRealY(ref y); device.GetRealZ(ref z); Hand.XMotor.CurrentDistance = x; Hand.YMotor.CurrentDistance = y; Hand.ZMotor.CurrentDistance = z; return(act); }
//得到恢复当前状态的动作 public bool GetReSetAct(ref Sequence seque_act) { int x = 0; int [] y = IMask.Gen(-1); int[] z = IMask.Gen(-1); var device = new ActionDevice(this); var inject_list = Injector.Entercloses.Where(item => item.InjEnable).ToList(); bool ret = device.GetRealX(ref x); ret = ret && device.GetRealY(inject_list.ToArray(), ref y); ret = ret && device.GetRealZ(inject_list.ToArray(), ref z); for (int i = 0; i < inject_list.Count; i++) { y[inject_list[i].Index] += (int)inject_list[i].TipDis; } seque_act.AddAction(InjectMoveTo.create(3000, inject_list.ToArray(), -1, IMask.Gen(-1), IMask.Gen(0))); seque_act.AddAction(InjectMoveTo.create(3000, inject_list.ToArray(), x, y, IMask.Gen(-1))); seque_act.AddAction(InjectMoveTo.create(3000, inject_list.ToArray(), -1, IMask.Gen(-1), z)); return(ret); }