public void SingleMoveC(HoleInfo moveInfo, string axisType, int?speed) { if (moveInfo.C.HasValue) { decimal actPosC = Contra.GetActPosC(axisType); isCPlus = moveInfo.C.Value >= actPosC; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisC, GetMovePosition("C", moveInfo.C, actPosC, Contra.LogPosC, isCPlus != isOldCPlus, isOldCPlus, out jianxiC), Contra.StartSpeed, speed ?? (int)AxisSet.SpeedCPerSecond, (double)Contra.AddSpeedTime); isOldCPlus = isCPlus; } }
public void UnionMove(UnionMoveInfo moveInfo, string axisType) { if (moveInfo.X.HasValue && moveInfo.Y.HasValue) { decimal actPosX = Contra.GetActPosX(axisType); isXPlus = moveInfo.X.Value >= actPosX; decimal actPosY = Contra.GetActPosY(axisType); isYPlus = moveInfo.Y.Value >= actPosY; CtrlCard.Sym_AbsoluteLine2(AxisSet.AxisX, AxisSet.AxisY, GetMovePosition("X", moveInfo.X, actPosX, Contra.LogPosX, isXPlus != isOldXPlus, isOldXPlus, out jianxiX), GetMovePosition("Y", moveInfo.Y, actPosY, Contra.LogPosY, isYPlus != isOldYPlus, isOldYPlus, out jianxiY), Contra.StartSpeed, (int)AxisSet.SpeedXPerSecond, Contra.AddSpeedTime); isOldXPlus = isXPlus; isOldYPlus = isYPlus; } if (moveInfo.W.HasValue && moveInfo.A.HasValue) { decimal actPosW = Contra.GetActPosW(axisType); isWPlus = moveInfo.W.Value >= actPosW; decimal actPosA = Contra.GetActPosA(axisType); isAPlus = moveInfo.A.Value >= actPosA; CtrlCard.Sym_AbsoluteLine2(AxisSet.AxisW, AxisSet.AxisZ, GetMovePosition("W", moveInfo.W, actPosW, Contra.LogPosW, isWPlus != isOldWPlus, isOldWPlus, out jianxiW), GetMovePosition("A", moveInfo.A, actPosA, Contra.LogPosA, isAPlus != isOldAPlus, isOldAPlus, out jianxiA), Contra.StartSpeed, (int)AxisSet.SpeedWPerSecond, Contra.AddSpeedTime); isOldWPlus = isWPlus; isOldAPlus = isAPlus; } if (moveInfo.B.HasValue && moveInfo.C.HasValue) { decimal actPosB = Contra.GetActPosB(axisType); isBPlus = moveInfo.B.Value >= actPosB; decimal actPosC = Contra.GetActPosC(axisType); isCPlus = moveInfo.C.Value >= actPosC; CtrlCard.Sym_AbsoluteLine2(AxisSet.AxisB, AxisSet.AxisC, GetMovePosition("B", moveInfo.B, actPosB, Contra.LogPosB, isBPlus != isOldBPlus, isOldBPlus, out jianxiB), GetMovePosition("C", moveInfo.C, actPosC, Contra.LogPosC, isCPlus != isOldCPlus, isOldCPlus, out jianxiC), Contra.StartSpeed, (int)AxisSet.SpeedWPerSecond, Contra.AddSpeedTime); isOldWPlus = isWPlus; isOldAPlus = isAPlus; } isMove = true; }
public void SingleMove(HoleInfo moveInfo, string axisType) { decimal actPosW = Contra.GetActPosW(axisType); decimal moveToW = moveInfo.W ?? actPosW; if (moveState == 0 && actPosW < moveToW) { isWPlus = moveInfo.W.Value >= actPosW; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisW, GetMovePosition("W", moveInfo.W, actPosW, Contra.LogPosW, isWPlus != isOldWPlus, isOldWPlus, out jianxiW), Contra.StartSpeed, (int)AxisSet.SpeedWPerSecond, (double)Contra.AddSpeedTime); isOldWPlus = isWPlus; moveState = 1; } else if (moveState == 1 || (!moveInfo.W.HasValue && moveState != 2) || (moveInfo.W.HasValue && actPosW >= moveToW && moveState != 2)) { if (moveInfo.X.HasValue) { decimal actPosX = Contra.GetActPosX(axisType); isXPlus = moveInfo.X.Value >= actPosX; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisX, GetMovePosition("X", moveInfo.X, actPosX, Contra.LogPosX, isXPlus != isOldXPlus, isOldXPlus, out jianxiX), Contra.StartSpeed, (int)AxisSet.SpeedXPerSecond, (double)Contra.AddSpeedTime); isOldXPlus = isXPlus; } if (moveInfo.Y.HasValue) { decimal actPosY = Contra.GetActPosY(axisType); isYPlus = moveInfo.Y.Value >= actPosY; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisY, GetMovePosition("Y", moveInfo.Y, actPosY, Contra.LogPosY, isYPlus != isOldYPlus, isOldYPlus, out jianxiY), Contra.StartSpeed, (int)AxisSet.SpeedYPerSecond, (double)Contra.AddSpeedTime); isOldYPlus = isYPlus; } if (moveInfo.Z.HasValue) { Contra.LogPosZ = GetActPos(AxisSet.ZReadAxis) * AxisSet.ZResolution; Contra.LogPosA = GetLogPos(AxisSet.AxisZ); Contra.TempLogPosA = Contra.LogPosZ + Contra.TempLogPosZ - Contra.LogPosA; Contra.TempLogPosA55 = Contra.LogPosZ + Contra.TempLogPosZ55 - Contra.LogPosA; Contra.TempLogPosA56 = Contra.LogPosZ + Contra.TempLogPosZ56 - Contra.LogPosA; Contra.TempLogPosA57 = Contra.LogPosZ + Contra.TempLogPosZ57 - Contra.LogPosA; Contra.TempLogPosA58 = Contra.LogPosZ + Contra.TempLogPosZ58 - Contra.LogPosA; Contra.TempLogPosA59 = Contra.LogPosZ + Contra.TempLogPosZ59 - Contra.LogPosA; Contra.TempLogPosA60 = Contra.LogPosZ + Contra.TempLogPosZ60 - Contra.LogPosA; Contra.TempLogPosA61 = Contra.LogPosZ + Contra.TempLogPosZ61 - Contra.LogPosA; Contra.TempLogPosA62 = Contra.LogPosZ + Contra.TempLogPosZ62 - Contra.LogPosA; Contra.TempLogPosA63 = Contra.LogPosZ + Contra.TempLogPosZ63 - Contra.LogPosA; Contra.TempLogPosA64 = Contra.LogPosZ + Contra.TempLogPosZ64 - Contra.LogPosA; Contra.TempLogPosA65 = Contra.LogPosZ + Contra.TempLogPosZ65 - Contra.LogPosA; decimal actPosA = Contra.GetActPosZ(axisType); isAPlus = moveInfo.Z.Value >= actPosA; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisZ, GetMovePosition("Z", moveInfo.Z, actPosA, Contra.LogPosA, isAPlus != isOldAPlus, isOldAPlus, out jianxiA), Contra.StartSpeed, (int)AxisSet.SpeedZPerSecond, (double)Contra.AddSpeedTime); isOldAPlus = isAPlus; } if (moveInfo.B.HasValue) { decimal actPosB = Contra.GetActPosB(axisType); isBPlus = moveInfo.B.Value >= actPosB; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisB, GetMovePosition("B", moveInfo.B, actPosB, Contra.LogPosB, isBPlus != isOldBPlus, isOldBPlus, out jianxiB), Contra.StartSpeed, (int)AxisSet.SpeedBPerSecond, (double)Contra.AddSpeedTime); isOldBPlus = isBPlus; } if (moveInfo.C.HasValue) { decimal actPosC = Contra.GetActPosC(axisType); isCPlus = moveInfo.C.Value >= actPosC; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisC, GetMovePosition("C", moveInfo.C, actPosC, Contra.LogPosC, isCPlus != isOldCPlus, isOldCPlus, out jianxiC), Contra.StartSpeed, (int)AxisSet.SpeedCPerSecond, (double)Contra.AddSpeedTime); isOldCPlus = isCPlus; } moveState = (!moveInfo.W.HasValue || actPosW >= moveToW) ? 2 : 0; } else if (moveState == 2 && actPosW >= moveToW) { if (moveInfo.W.HasValue) { isWPlus = moveInfo.W.Value >= actPosW; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisW, GetMovePosition("W", moveInfo.W, actPosW, Contra.LogPosW, isWPlus != isOldWPlus, isOldWPlus, out jianxiW), Contra.StartSpeed, (int)AxisSet.SpeedWPerSecond, (double)Contra.AddSpeedTime); isOldWPlus = isWPlus; } moveState = 0; } }
private bool isMove = false;//TODO public void SingleMove(HoleInfo moveInfo, string axisType) { if (moveInfo.X.HasValue) { decimal actPosX = Contra.GetActPosX(axisType); isXPlus = moveInfo.X.Value >= actPosX; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisX, GetMovePosition("X", moveInfo.X, actPosX, Contra.LogPosX, isXPlus != isOldXPlus, isOldXPlus, out jianxiX), Contra.StartSpeed, (int)AxisSet.SpeedXPerSecond, (double)Contra.AddSpeedTime); isOldXPlus = isXPlus; } if (moveInfo.Y.HasValue) { decimal actPosY = Contra.GetActPosY(axisType); isYPlus = moveInfo.Y.Value >= actPosY; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisY, GetMovePosition("Y", moveInfo.Y, actPosY, Contra.LogPosY, isYPlus != isOldYPlus, isOldYPlus, out jianxiY), Contra.StartSpeed, (int)AxisSet.SpeedYPerSecond, (double)Contra.AddSpeedTime); isOldYPlus = isYPlus; } if (moveInfo.W.HasValue) { decimal actPosW = Contra.GetActPosW(axisType); isWPlus = moveInfo.W.Value >= actPosW; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisW, GetMovePosition("W", moveInfo.W, actPosW, Contra.LogPosW, isWPlus != isOldWPlus, isOldWPlus, out jianxiW), Contra.StartSpeed, (int)AxisSet.SpeedWPerSecond, (double)Contra.AddSpeedTime); isOldWPlus = isWPlus; } if (moveInfo.Z.HasValue) { Contra.LogPosZ = GetActPos(AxisSet.ZReadAxis) * AxisSet.ZResolution; Contra.LogPosA = GetLogPos(AxisSet.AxisZ); Contra.TempLogPosA = Contra.LogPosZ + Contra.TempLogPosZ - Contra.LogPosA; Contra.TempLogPosA55 = Contra.LogPosZ + Contra.TempLogPosZ55 - Contra.LogPosA; Contra.TempLogPosA56 = Contra.LogPosZ + Contra.TempLogPosZ56 - Contra.LogPosA; Contra.TempLogPosA57 = Contra.LogPosZ + Contra.TempLogPosZ57 - Contra.LogPosA; Contra.TempLogPosA58 = Contra.LogPosZ + Contra.TempLogPosZ58 - Contra.LogPosA; Contra.TempLogPosA59 = Contra.LogPosZ + Contra.TempLogPosZ59 - Contra.LogPosA; decimal actPosA = Contra.GetActPosZ(axisType); isAPlus = moveInfo.Z.Value >= actPosA; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisZ, GetMovePosition("Z", moveInfo.Z, actPosA, Contra.LogPosA, isAPlus != isOldAPlus, isOldAPlus, out jianxiA), Contra.StartSpeed, (int)AxisSet.SpeedZPerSecond, (double)Contra.AddSpeedTime); isOldAPlus = isAPlus; } if (moveInfo.B.HasValue) { decimal actPosB = Contra.GetActPosB(axisType); isBPlus = moveInfo.B.Value >= actPosB; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisB, GetMovePosition("B", moveInfo.B, actPosB, Contra.LogPosB, isBPlus != isOldBPlus, isOldBPlus, out jianxiB), Contra.StartSpeed, (int)AxisSet.SpeedBPerSecond, (double)Contra.AddSpeedTime); isOldBPlus = isBPlus; } if (moveInfo.C.HasValue) { decimal actPosC = Contra.GetActPosC(axisType); isCPlus = moveInfo.C.Value >= actPosC; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisC, GetMovePosition("C", moveInfo.C, actPosC, Contra.LogPosC, isCPlus != isOldCPlus, isOldCPlus, out jianxiC), Contra.StartSpeed, (int)AxisSet.SpeedCPerSecond, (double)Contra.AddSpeedTime); isOldCPlus = isCPlus; } isMove = true; }