Ejemplo n.º 1
0
        internal async Task DrawImageAsyncInternal(EV3Color color, ushort x, ushort y, string devicePath)
        {
            Command c = new Command(CommandType.DirectNoReply);

            c.DrawImage(color, x, y, devicePath);
            await _brick.SendCommandAsyncInternal(c);
        }
Ejemplo n.º 2
0
        internal async Task DrawDottedLineAsyncInternal(EV3Color color, ushort x0, ushort y0, ushort x1, ushort y1, ushort onPixels, ushort offPixels)
        {
            Command c = new Command(CommandType.DirectNoReply);

            c.DrawDottedLine(color, x0, y0, x1, y1, onPixels, offPixels);
            await _brick.SendCommandAsyncInternal(c);
        }
Ejemplo n.º 3
0
        internal async Task DrawTextAsyncInternal(EV3Color color, ushort x, ushort y, string text)
        {
            Command c = new Command(CommandType.DirectNoReply);

            c.DrawText(color, x, y, text);
            await _brick.SendCommandAsyncInternal(c);
        }
Ejemplo n.º 4
0
        internal async Task DrawFillWindowAsyncInternal(EV3Color color, ushort y0, ushort y1)
        {
            Command c = new Command(CommandType.DirectNoReply);

            c.DrawFillWindow(color, y0, y1);
            await _brick.SendCommandAsyncInternal(c);
        }
Ejemplo n.º 5
0
        internal async Task DrawCircleAsyncInternal(EV3Color color, ushort x, ushort y, ushort radius, bool filled)
        {
            Command c = new Command(CommandType.DirectNoReply);

            c.DrawCircle(color, x, y, radius, filled);
            await _brick.SendCommandAsyncInternal(c);
        }
Ejemplo n.º 6
0
        internal async Task DrawRectangleAsyncInternal(EV3Color color, ushort x, ushort y, ushort width, ushort height, bool filled)
        {
            Command c = new Command(CommandType.DirectNoReply);

            c.DrawRectangle(color, x, y, width, height, filled);
            await _brick.SendCommandAsyncInternal(c);
        }
Ejemplo n.º 7
0
        internal async Task DrawPixelAsyncInternal(EV3Color color, ushort x, ushort y)
        {
            Command c = new Command(CommandType.DirectNoReply);

            c.DrawPixel(color, x, y);
            await _brick.SendCommandAsyncInternal(c);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Append the Draw Pixel command to an existing Command object
 /// </summary>
 /// <param name="color">Color of the pixel</param>
 /// <param name="x">X position</param>
 /// <param name="y">Y position</param>
 public void DrawPixel(EV3Color color, ushort x, ushort y)
 {
     AddOpcode(Opcode.UIDraw_Pixel);
     AddParameter((byte)color);
     AddParameter(x);
     AddParameter(y);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Append the Draw Fill Window command to an existing Command object
 /// </summary>
 /// <param name="color">The color to fill</param>
 /// <param name="y0">Y start</param>
 /// <param name="y1">Y end</param>
 public void DrawFillWindow(EV3Color color, ushort y0, ushort y1)
 {
     AddOpcode(Opcode.UIDraw_FillWindow);
     AddParameter((byte)color);
     AddParameter(y0);
     AddParameter(y1);
 }
Ejemplo n.º 10
0
        private Port.Colors ConvertEV3ColorToPortColor(EV3Color color)
        {
            switch (color)
            {
            case EV3Color.Black:
                return(Port.Colors.BLACK);

            case EV3Color.Blue:
                return(Port.Colors.BLUE);

            case EV3Color.Brown:
                return(Port.Colors.ORANGE);

            case EV3Color.Green:
                return(Port.Colors.GREEN);

            case EV3Color.Red:
                return(Port.Colors.RED);

            case EV3Color.White:
                return(Port.Colors.WHITE);

            case EV3Color.Yellow:
                return(Port.Colors.YELLOW);
            }

            return(Port.Colors.NONE);
        }
Ejemplo n.º 11
0
        internal async Task DrawLineAsyncInternal(EV3Color color, ushort x0, ushort y0, ushort x1, ushort y1)
        {
            Command c = new Command(CommandType.DirectNoReply);

            c.DrawLine(color, x0, y0, x1, y1);
            await _brick.SendCommandAsyncInternal(c);
        }
Ejemplo n.º 12
0
        DrawLineAsync(EV3Color color, ushort x0, ushort y0, ushort x1, ushort y1)
        {
            return(DrawLineAsyncInternal(color, x0, y0, x1, y1)
#if WINRT
                   .AsAsyncAction()
#endif
                   );
        }
Ejemplo n.º 13
0
        DrawImageAsync(EV3Color color, ushort x, ushort y, string devicePath)
        {
            return(DrawImageAsyncInternal(color, x, y, devicePath)
#if WINRT
                   .AsAsyncAction()
#endif
                   );
        }
Ejemplo n.º 14
0
        DrawFillWindowAsync(EV3Color color, ushort y0, ushort y1)
        {
            return(DrawFillWindowAsyncInternal(color, y0, y1)
#if WINRT
                   .AsAsyncAction()
#endif
                   );
        }
Ejemplo n.º 15
0
        DrawDottedLineAsync(EV3Color color, ushort x0, ushort y0, ushort x1, ushort y1, ushort onPixels, ushort offPixels)
        {
            return(DrawDottedLineAsyncInternal(color, x0, y0, x1, y1, onPixels, offPixels)
#if WINRT
                   .AsAsyncAction()
#endif
                   );
        }
Ejemplo n.º 16
0
        DrawTextAsync(EV3Color color, ushort x, ushort y, string text)
        {
            return(DrawTextAsyncInternal(color, x, y, text)
#if WINRT
                   .AsAsyncAction()
#endif
                   );
        }
Ejemplo n.º 17
0
        DrawRectangleAsync(EV3Color color, ushort x, ushort y, ushort width, ushort height, bool filled)
        {
            return(DrawRectangleAsyncInternal(color, x, y, width, height, filled)
#if WINRT
                   .AsAsyncAction()
#endif
                   );
        }
Ejemplo n.º 18
0
        DrawPixelAsync(EV3Color color, ushort x, ushort y)
        {
            return(DrawPixelAsyncInternal(color, x, y)
#if WINRT
                   .AsAsyncAction()
#endif
                   );
        }
Ejemplo n.º 19
0
        DrawCircleAsync(EV3Color color, ushort x, ushort y, ushort radius, bool filled)
        {
            return(DrawCircleAsyncInternal(color, x, y, radius, filled)
#if WINRT
                   .AsAsyncAction()
#endif
                   );
        }
Ejemplo n.º 20
0
 /// <summary>
 /// Append the Draw Image command to an existing Command object
 /// </summary>
 /// <param name="color">The color of the image to draw</param>
 /// <param name="x">X position</param>
 /// <param name="y">Y position</param>
 /// <param name="devicePath">Filename on the brick of the image to draw</param>
 public void DrawImage(EV3Color color, ushort x, ushort y, string devicePath)
 {
     AddOpcode(Opcode.UIDraw_BmpFile);
     AddParameter((byte)color);
     AddParameter(x);
     AddParameter(y);
     AddParameter(devicePath);
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Append the Draw Text command to an existing Command object
 /// </summary>
 /// <param name="color">Color of the text</param>
 /// <param name="x">X position</param>
 /// <param name="y">Y position</param>
 /// <param name="text">Text to draw</param>
 public void DrawText(EV3Color color, ushort x, ushort y, string text)
 {
     AddOpcode(Opcode.UIDraw_Text);
     AddParameter((byte)color);
     AddParameter(x);
     AddParameter(y);
     AddParameter(text);
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Append the Draw Circle command to an existing Command object
 /// </summary>
 /// <param name="color">Color of the circle</param>
 /// <param name="x">X position</param>
 /// <param name="y">Y position</param>
 /// <param name="radius">Radius of circle</param>
 /// <param name="filled">Draw a filled or empty circle</param>
 public void DrawCircle(EV3Color color, ushort x, ushort y, ushort radius, bool filled)
 {
     AddOpcode(filled ? Opcode.UIDraw_FillCircle : Opcode.UIDraw_Circle);
     AddParameter((byte)color);
     AddParameter(x);
     AddParameter(y);
     AddParameter(radius);
 }
Ejemplo n.º 23
0
 /// <summary>
 /// Append the Draw Line command to an existing Command object
 /// </summary>
 /// <param name="color">Color of the line</param>
 /// <param name="x0">X start</param>
 /// <param name="y0">Y start</param>
 /// <param name="x1">X end</param>
 /// <param name="y1">Y end</param>
 public void DrawLine(EV3Color color, ushort x0, ushort y0, ushort x1, ushort y1)
 {
     AddOpcode(Opcode.UIDraw_Line);
     AddParameter((byte)color);
     AddParameter(x0);
     AddParameter(y0);
     AddParameter(x1);
     AddParameter(y1);
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Append the Draw Rectangle command to an existing Command object
 /// </summary>
 /// <param name="color">Color of the rectangle</param>
 /// <param name="x">X position</param>
 /// <param name="y">Y position</param>
 /// <param name="width">Width of rectangle</param>
 /// <param name="height">Height of the rectangle</param>
 /// <param name="filled">Draw a filled or empty rectangle</param>
 public void DrawRectangle(EV3Color color, ushort x, ushort y, ushort width, ushort height, bool filled)
 {
     AddOpcode(filled ? Opcode.UIDraw_FillRect : Opcode.UIDraw_Rect);
     AddParameter((byte)color);
     AddParameter(x);
     AddParameter(y);
     AddParameter(width);
     AddParameter(height);
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Append the Draw Dotted Line command to an existing Command object
 /// </summary>
 /// <param name="color">The color of the line</param>
 /// <param name="x0">X start</param>
 /// <param name="y0">Y start</param>
 /// <param name="x1">X end</param>
 /// <param name="y1">Y end</param>
 /// <param name="onPixels">Number of pixels the line is on</param>
 /// <param name="offPixels">Number of pixels the line is off</param>
 public void DrawDottedLine(EV3Color color, ushort x0, ushort y0, ushort x1, ushort y1, ushort onPixels, ushort offPixels)
 {
     AddOpcode(Opcode.UIDraw_DotLine);
     AddParameter((byte)color);
     AddParameter(x0);
     AddParameter(y0);
     AddParameter(x1);
     AddParameter(y1);
     AddParameter(onPixels);
     AddParameter(offPixels);
 }