Example #1
0
        public void DisplayCommand_should_exceute()
        {
            var cut    = new DisplayCommand("inv");
            var actual = cut.Execute();

            actual.Should().BeTrue();
        }
Example #2
0
 public CDisplayDataTL(DisplayConfigTL settings)
 {
     this.settings = settings;
     DispType      = settings.DisplayType;
     Speed         = settings.DisplaySpeed;
     DisplayText   = string.Empty;
     dispcommand   = DisplayCommand.show;
 }
Example #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

            editTextDisplayHost     = FindViewById <EditText>(Resource.Id.editTextDisplayHost);
            editTextDisplayHostPort = FindViewById <EditText>(Resource.Id.editTextDisplayHostPort);
            editTextDisplayCommand  = FindViewById <EditText>(Resource.Id.editTextDisplayCommand);
            relativeLayoutColorBox  = FindViewById <RelativeLayout>(Resource.Id.relativeLayoutColorBox);
            seekBarRed   = FindViewById <SeekBar>(Resource.Id.seekBarRed);
            seekBarGreen = FindViewById <SeekBar>(Resource.Id.seekBarGreen);
            seekBarBlue  = FindViewById <SeekBar>(Resource.Id.seekBarBlue);
            buttonReset  = FindViewById <Button>(Resource.Id.buttonReset);

            gridLayoutMatrix = FindViewById <GridLayout>(Resource.Id.gridLayoutMatrix);

            displayCommand    = new DrawPixelCommand(1, 1, 255, 255, 255);
            connectionManager = new ConnectionManager(editTextDisplayHost.Text, int.Parse(editTextDisplayHostPort.Text));
            connectionManager.Connect();

            PopulateMatrix(32, 32);

            buttonReset.Click += async(sender, e) =>
            {
                Reset();
            };

            editTextDisplayCommand.TextChanged += async(sender, e) =>
            {
                displayCommand = displayCommand.DisplayCommandFromString(editTextDisplayCommand.Text);
                UpdateSeekBars();
            };

            seekBarRed.ProgressChanged += async(sender, e) =>
            {
                ((DrawPixelCommand)displayCommand).R = seekBarRed.Progress;
                UpdateDisplayCommandEditTextView();
                UpdateRelativeLayoutColorBox();
            };

            seekBarGreen.ProgressChanged += async(sender, e) =>
            {
                ((DrawPixelCommand)displayCommand).G = seekBarGreen.Progress;
                UpdateDisplayCommandEditTextView();
                UpdateRelativeLayoutColorBox();
            };

            seekBarBlue.ProgressChanged += async(sender, e) =>
            {
                ((DrawPixelCommand)displayCommand).B = seekBarBlue.Progress;
                UpdateDisplayCommandEditTextView();
                UpdateRelativeLayoutColorBox();
            };
        }
Example #4
0
        public void DisplayTest()
        {
            Document doc = new Document();


            DocumentCommand discmd = new DisplayCommand(doc);

            DocumentCommand undcmd = new UndoCommand(doc);

            DocumentCommand redcmd = new RedoCommand(doc);


            DocumentInvoker invoker = new DocumentInvoker(discmd, undcmd, redcmd);

            invoker.Display();
        }
Example #5
0
        static void Main(string[] args)
        {
            Document doc = new Document();

            DocumentCommand discmd = new DisplayCommand(doc);

            DocumentCommand undcmd = new UndoCommand(doc);

            DocumentCommand redcmd = new RedoCommand(doc);

            DocumentInvoker invoker = new DocumentInvoker(discmd, undcmd, redcmd);

            invoker.Display();

            invoker.Undo();

            invoker.Redo();
        }
Example #6
0
        public MainViewModel()
        {
            DisplayCommand = ReactiveCommand.Create(this.WhenAny(x => x.Name, x => !string.IsNullOrEmpty(x.Value)));
            DisplayCommand.Subscribe(_ => MessageBox.Show("You clicked on DisplayCommand: Name is " + Name));

            StartAsyncCommand = ReactiveCommand.CreateAsyncTask <AsyncVoid>(_ =>
            {
                return(Task.Run(() =>
                {
                    Progress = 0;
                    while (Progress <= 100)
                    {
                        Progress += 10;
                        Thread.Sleep(100);
                    }

                    return AsyncVoid.Default;
                }));
            });
        }
Example #7
0
            public void PaintItem(DisplayCommand item)
            {
                switch (item)
                {
                case SolidColor solidColor:
                    var x0 = (int)solidColor.Rect.X.Adjust(0, Width);
                    var y0 = (int)solidColor.Rect.Y.Adjust(0, Height);
                    var x1 = (int)((solidColor.Rect.X + solidColor.Rect.Width).Adjust(0, Width));
                    var y1 = (int)((solidColor.Rect.Y + solidColor.Rect.Height).Adjust(0, Height));

                    foreach (var y in Enumerable.Range(y0, y1))
                    {
                        foreach (var x in Enumerable.Range(x0, x1))
                        {
                            Pixels[y * Width + x] = solidColor.Color;
                        }
                    }
                    break;
                }
            }
Example #8
0
        public bool DisplayMessage(Message msg)
        {
            DisplayCommand cmd = new DisplayCommand(msg);

            byte[] outBytes = cmd.ToBytes().ToArray();

            List <byte> result = new List <byte>(SendRecieve(outBytes, 0));

            while (result[result.Count - 1] != CommandBase.CommandEnd)
            {
                result.AddRange(Recieve());
            }

            result.RemoveAt(result.Count - 1);

            if (BitConverter.ToString(result.ToArray()) == BitConverter.ToString(cmd.ErrorResponse))
            {
                return(false);
            }
            return(true);
        }
 void SendCommand(DisplayCommand command)
 {
     SendCommand((byte)command);
 }
Example #10
0
 public void UpdateDisplay(DisplayCommand displayCommand)
 {
     System.Diagnostics.Debug.WriteLine($"Updating display with the following command: \"{displayCommand.GetFormattetCommand()}\"");
     Task.Run(() => connectionManager.SendData(displayCommand.GetFormattetCommand()));
 }
Example #11
0
 private void makeDisplay(float y, int addressId)
 {
     GameObject     newDisplay     = Instantiate(blockDataPrefab, scrollContent.transform);
     DisplayCommand displayCommand = newDisplay.GetComponent(typeof(DisplayCommand)) as DisplayCommand;
 }
Example #12
0
 internal bool ShouldLogDataForBinding()
 {
     return(DevExpress.CodeRush.Core.KeyboardServices.LogShortcutChecks && !String.IsNullOrEmpty(DisplayCommand) && DisplayCommand.StartsWith("Embed"));
 }