Example #1
0
        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;
        }