Esempio n. 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public MainForm()
        {
            InitializeComponent();
            //name thread (useful for debug)
            Thread.CurrentThread.Name = "Main Form Thread";
            //load camera calibration profile
            MotionCapture.LoadProfile("C:\\Users\\mag501\\Documents\\SVN_WorkingCopy\\Stromohab\\stromohab_08\\OptiTrack_Calibrations\\CalibrationFile_020609.cal");
            //register custom events
            OptitrackCommandParser_Server.camerasStartedEvent += new OptitrackCommandParser_Server.CamerasStartedHandler(commandParser_camerasStartedEvent);
            TCPServer.ServerListeningStartedEvent             += new TCPServer.ServerListeningStartedHandler(TCPServer_ServerListeningStartedEvent);
            TCPServer.ClientConnectionAcceptedEvent           += new TCPServer.ClientConnectionAcceptedHandler(TCPServer_ClientConnectionAcceptedEvent);
            //start listening for incoming connections
            TCPServer tcpServer = new TCPServer();

            //enumerate COM ports
            foreach (string portName in System.IO.Ports.SerialPort.GetPortNames())
            {
                comboBoxTreadmillPort.Items.Add(portName);
            }
            comboBoxTreadmillPort.Text = (string)comboBoxTreadmillPort.Items[comboBoxTreadmillPort.Items.Count - 1];

            TreadmillController.SetSerialPortName(comboBoxTreadmillPort.Text);
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        public MainForm()
        {
            InitializeComponent();
        //name thread (useful for debug)
            Thread.CurrentThread.Name = "Main Form Thread";
        //load camera calibration profile
            MotionCapture.LoadProfile("C:\\Users\\mag501\\Documents\\SVN_WorkingCopy\\Stromohab\\stromohab_08\\OptiTrack_Calibrations\\CalibrationFile_020609.cal");
        //register custom events
            OptitrackCommandParser_Server.camerasStartedEvent += new OptitrackCommandParser_Server.CamerasStartedHandler(commandParser_camerasStartedEvent);
            TCPServer.ServerListeningStartedEvent +=new TCPServer.ServerListeningStartedHandler(TCPServer_ServerListeningStartedEvent);
            TCPServer.ClientConnectionAcceptedEvent += new TCPServer.ClientConnectionAcceptedHandler(TCPServer_ClientConnectionAcceptedEvent);
        //start listening for incoming connections            
            TCPServer tcpServer = new TCPServer();

        //enumerate COM ports
            foreach (string portName in System.IO.Ports.SerialPort.GetPortNames())
            {
                comboBoxTreadmillPort.Items.Add(portName);
            }
            comboBoxTreadmillPort.Text = (string)comboBoxTreadmillPort.Items[comboBoxTreadmillPort.Items.Count-1];

            TreadmillController.SetSerialPortName(comboBoxTreadmillPort.Text);

        }