public override void run(double dt) { bool resultx = true; bool resulty = true; bool resultz = true; sumdt += dt; if (sumdt >= time || istimeout) { istimeout = true; isfinish = true; return; } var device = new ActionDevice(node); switch (step) { case 0: if (x >= 0) { resultx = device.MoveX((int)x); } if (y >= 0) { resulty = device.MoveY((int)y); } if (z >= 0) { resultz = device.MoveZ((int)z); } if (resultx && resulty && resultz) { step++; } break; case 1: if (xdone == false) { xdone = device.DoneX(); } if (ydone == false) { ydone = device.DoneY(); } if (zdone == false) { zdone = device.DoneZ(); } isfinish = xdone && ydone && zdone; break; } }
public override void run(double dt) { bool resultz = true; bool resultx = true; bool resulty = true; sumdt += dt; if (sumdt >= time || istimeout) { istimeout = true; isfinish = true; return; } var device = new ActionDevice(node); var inject = (InjectorDevice)node; switch (step) { case 0: //是否已有吸头 //针头数据检测(针头序号+装针个数不能大于通道个数) int inject_count = inject.GetSeleteced().Count(); if (head_index + tipdata.count <= inject_count) { step++; } else { istimeout = true; isfinish = true; } break; case 1: resultx = device.MoveX(tipdata.x); resulty = device.MoveY(tipdata.y); if (resultx && resulty) { step++; } break; case 2: if (xdone == false) { xdone = device.DoneX(); } if (ydone == false) { ydone = device.DoneY(); } if (xdone && ydone) { step = 7; } break; case 3: int[] z_tem = { -1, -1, -1, -1 }; for (int i = head_index; i < tipdata.count; i++) { z_tem[i] = z; } resultz = device.MoveInjectZ(z_tem, true); if (resultz) { step++; } break; case 4: for (int i = head_index; i < tipdata.count; i++) { if (zdone[i] == false) { xdone = device.DoneInjectZ(i); } } if (zdone[0] && zdone[1] && zdone[2] && zdone[3]) { step++; } break; case 5: resultz = device.MoveZ(0, true); if (resultz) { step++; } break; case 6: if (device.DoneZ()) { step++; } break; case 7: isfinish = true; break; } }