Ejemplo n.º 1
0
Archivo: Form1.cs Proyecto: solson/DSAE
        public Form1(PolhemusController newPolhemusController, PhidgetController newPhidgetController, string host, string port)
        {
            this.host = host;
            this.port = port;

            InitializeComponent();

            this.SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.UserPaint |
                ControlStyles.OptimizedDoubleBuffer, true);

            polhemusController = newPolhemusController;
            phidgetController = newPhidgetController;

            this.BackColor = Color.Black;
            this.Size = new Size(Program.tableWidth, Program.tableHeight);

            studyController = new HaikuStudyController(HaikuStudyPosition.SideBySide);//, HaikuStudyType.RealArmsPictureArms);
            wordBoxController = new WordBoxController(studyController);

            if (studyController.isActuatePenalty == true)
            {
                //phidgetController.setUpServos();
            }

            //to snap words back to their original locations when dropped outside of a user's paper, set this to true.
            wordBoxController.boxesShouldSnapBack = true;

            studyController.wordBoxController = wordBoxController;
            studyController.currentCondition = HaikuStudyCondition.Cursors;
            studyController.isInSetUpMode = false;

            setMouseProperties();
            setUpEmbodiments();

            if (Program.kinectEnabled)
            {
                // Set up KinectTable
                kinectData = new KinectData();

                // Set up session parameters
                SessionParameters sessionParams = new SessionParameters(KinectDataParams.EnableType.All);
                sessionParams.DataParams.validityImageEnable = false;
                sessionParams.DataParams.testImageEnable = false;

                // Connect to a local Kinect and hook up to the data event
                kinectClient = KinectTableNet.KinectTable.ConnectLocal(sessionParams);
                kinectClient.DataReady += kinectClient_DataReady;

                // Set up Kinect calibration
                kinectCalibration = new KinectCalibrationController();

                // Read the saved table depth tweak value
                ReadTableDepthTweak();
            }

            Cursor.Hide();

            Load += Form1_Load;
            FormClosed += Form1_FormClosed;

            playerID = 0;

            updateTimer = new Timer();
            updateTimer.Interval = 25;
            updateTimer.Tick += new EventHandler(updateTimer_Tick);
            updateTimer.Start();
        }
Ejemplo n.º 2
0
 public void setWordBoxController(WordBoxController newBoxController)
 {
     boxController = newBoxController;
 }