Esempio n. 1
0
        internal override RawCommand getRawCommand(DotMatrix dotMatrix, DisplayModel displayModel, Controller controller)
        {
            float dotsPerSecond = this.getDotsPerSecond(controller.DefaultSpeedDotsPerSecond);

            if (method == Methods.Instant || dotsPerSecond <= 0f)
            {
                return(new RawCommandClear(targetState));
            }
            else if (method == ClearCommand.Methods.MoveLeft || method == ClearCommand.Methods.MoveRight || method == ClearCommand.Methods.MoveUp || method == ClearCommand.Methods.MoveDown)
            {
                return(new RawCommandClear(targetState, method, dotsPerSecond));
            }
            else if (method == ClearCommand.Methods.ColumnByColumnFromLeft || method == ClearCommand.Methods.ColumnByColumnFromRight)
            {
                return(new RawCommandClear(targetState, method, dotsPerSecond, displayModel.Width));
            }
            else if (method == ClearCommand.Methods.RowByRowFromTop || method == ClearCommand.Methods.RowByRowFromBottom)
            {
                return(new RawCommandClear(targetState, method, dotsPerSecond, displayModel.Height));
            }
            // Should be never reached
            return(null);
        }
Esempio n. 2
0
        internal RawCommand getRawCommand(DotMatrix dotMatrix, DisplayModel displayModel, Controller controller, int[,] content)
        {
            int totalHeight = content.GetLength(0);
            int totalWidth  = content.GetLength(1);

            Movements movement      = this.Movement;
            float     dotsPerSecond = this.getDotsPerSecond(controller.DefaultSpeedDotsPerSecond);

            if (dotsPerSecond <= 0f)
            {
                movement = Movements.None;
            }

            int posX = 0;
            int posY = 0;

            if (this.HorPosition == HorPositions.Right)
            {
                posX = displayModel.Width - totalWidth;
            }
            else if (this.HorPosition == HorPositions.Center)
            {
                posX = (displayModel.Width - totalWidth) / 2;
            }
            if (this.VerPosition == VerPositions.Bottom)
            {
                posY = displayModel.Height - totalHeight;
            }
            else if (this.VerPosition == VerPositions.Middle)
            {
                posY = (displayModel.Height - totalHeight) / 2;
            }

            if (movement == Movements.None)
            {
                return(new RawCommandContent(content, posX, posY));
            }

            int push = 0;

            if (movement == Movements.MoveLeftAndStop)
            {
                if (this.HorPosition == HorPositions.Left)
                {
                    push = displayModel.Width;
                }
                else if (this.HorPosition == HorPositions.Right)
                {
                    push = totalWidth;
                }
                else if (this.HorPosition == HorPositions.Center)
                {
                    push = (displayModel.Width + totalWidth) / 2;
                }
            }
            else if (movement == Movements.MoveRightAndStop)
            {
                if (this.HorPosition == HorPositions.Left)
                {
                    push = totalWidth;
                }
                else if (this.HorPosition == HorPositions.Right)
                {
                    push = displayModel.Width;
                }
                else if (this.HorPosition == HorPositions.Center)
                {
                    push = (displayModel.Width + totalWidth) / 2;
                }
            }
            else if (movement == Movements.MoveLeftAndPass || movement == Movements.MoveRightAndPass)
            {
                push = displayModel.Width + totalWidth;
            }
            else if (movement == Movements.MoveUpAndStop)
            {
                if (this.VerPosition == VerPositions.Top)
                {
                    push = displayModel.Height;
                }
                else if (this.VerPosition == VerPositions.Bottom)
                {
                    push = totalHeight;
                }
                else if (this.VerPosition == VerPositions.Middle)
                {
                    push = (displayModel.Height + totalHeight) / 2;
                }
            }
            else if (movement == Movements.MoveDownAndStop)
            {
                if (this.VerPosition == VerPositions.Top)
                {
                    push = totalHeight;
                }
                else if (this.VerPosition == VerPositions.Bottom)
                {
                    push = displayModel.Height;
                }
                else if (this.VerPosition == VerPositions.Middle)
                {
                    push = (displayModel.Height + totalHeight) / 2;
                }
            }
            else if (movement == Movements.MoveUpAndPass || movement == Movements.MoveDownAndPass)
            {
                push = displayModel.Height + totalHeight;
            }

            return(new RawCommandContent(content, posX, posY, movement, push, dotsPerSecond));
        }
Esempio n. 3
0
 internal abstract RawCommand getRawCommand(DotMatrix dotMatrix, DisplayModel displayModel, Controller controller);
Esempio n. 4
0
 internal override RawCommand getRawCommand(DotMatrix dotMatrix, DisplayModel displayModel, Controller controller)
 {
     return(new RawCommandDelay(pauseSeconds));
 }
Esempio n. 5
0
 internal override RawCommand getRawCommand(DotMatrix dotMatrix, DisplayModel displayModel, Controller controller)
 {
     return(base.getRawCommand(dotMatrix, displayModel, controller, content));
 }
 internal override RawCommand getRawCommand(DotMatrix dotMatrix, DisplayModel displayModel, Controller controller)
 {
     return(new RawCommandCallback(callback));
 }