示例#1
0
        public SerialInput()
        {
            InitializeComponent();

            // init the serial port
            serialPort = new SerialPort();

            // Set the read/write timeouts
            serialPort.ReadTimeout = -1;
            serialPort.WriteTimeout = -1;
            serialPort.Parity = Parity.None;
            serialPort.DataBits = 8;
            serialPort.StopBits = StopBits.Two;
            serialPort.Handshake = Handshake.None;
            serialPort.NewLine = "\r\n";

            // Linked to ui console
            uiconsole = MainForm.UIConsole;

            if (isColor)
            {
                imageMask = new FxMatrixMask(64, 64);
            }

            imageMask = new FxMatrixMask(64, 64);
            imageMaskColorMap = new ColorMap(ColorMapDefaults.Jet);

            // Create a visual view
            imageMaskView = new ImageElement(imageMask.ToFxMatrixF(), imageMaskColorMap);
            canvas1.AddElement(imageMaskView, false);

            imageView = new ImageElement(imageMask.ToFxMatrixF(), imageMaskColorMap);
            imageView._Position.x = imageMaskView.Size.X +  10f;
            imageView._Position.Y = 0;
            canvas1.AddElement(imageView, false);

            canvas1.FitView();

            // add the timer for the fps measure
            fpsTimer = new System.Windows.Forms.Timer();
            fpsTimer.Interval = 1000;
            watch.Start();

            fpsTimer.Tick += (s, te) =>
            {
                watch.Stop();
                float fps = fpsCount * 1000.0f / watch.ElapsedMilliseconds;
                //uiconsole.WriteLine("FPS:" + fps.ToString());
                //Console.WriteLine("FPS:" + fps.ToString());
                fpsLabel.Text = fps.ToString();
                fpsCount = 0;
                watch.Reset();
                watch.Start();
            };
            fpsTimer.Start();
        }
示例#2
0
        public MainForm()
        {
            InitializeComponent();

            katopsi = FxMatrixF.Load("Katopsi.jpg", FxMaths.Matrix.ColorSpace.Grayscale);

            // init the console
            UIConsole = new ConsoleOutput();
            UIConsole.Show(dockPanel1, DockState.DockBottomAutoHide);
            consoleOutputToolStripMenuItem.Checked = true;

            // init the people over view
            UIPeopleOverview = new PeopleOverview(katopsi);
            UIPeopleOverview.Show(dockPanel1, DockState.Document);
            peopleOverviewToolStripMenuItem.Checked = true;

            // Init Serial debugiing
            UISerialInput = new SerialInput();
            UISerialInput.Show(dockPanel1, DockState.Document);

            // Init serial Capture menu
            UISerialCapture = new SerialCapture();
            UISerialCapture.Show(dockPanel1, DockState.Document);
        }
示例#3
0
        private void consoleOutputToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (consoleOutputToolStripMenuItem.Checked)
            {
                UIConsole.Hide();
            }
            else
            {
                if (UIConsole == null)
                    UIConsole = new ConsoleOutput();

                // add the viewport to the dock
                UIConsole.Show(dockPanel1, DockState.DockBottom);
            }

            consoleOutputToolStripMenuItem.Checked = !consoleOutputToolStripMenuItem.Checked;
        }