コード例 #1
0
        public Form1()
        {
            InitializeComponent();

            this.controller = new Controller();
            this.listener   = new LeapEventListener(this);
            controller.AddListener(listener);
        }
コード例 #2
0
        //Using System.Reflection to call the tracking methods dynamically? - Working on that
        //Gestures are no longer supported by Leap!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

        public LeapTestForm()
        {
            InitializeComponent();
            this.controller = new Controller();
            this.listener   = new LeapEventListener(this);
            controller.AddListener(listener);
            baseFrame = 0;
            tracking  = true;

            timer1      = new Stopwatch();
            diagnostics = new fittsDiags();

            trackType   = startupMenu.trackType;
            clickType   = startupMenu.clickType;
            orientation = startupMenu.orientation;
            size        = startupMenu.size;
            IDSetting   = startupMenu.ID;
            bounds      = calibrationForm.bounds;
            subjNum     = startupMenu.subNum;
            upRightPos  = startupMenu.upRightPos;
            botLeftPos  = startupMenu.botLeftPos;

            //Setting up the form and buttons
            this.Size           = (Size)bounds;
            infoButton.Location = new Point(Convert.ToInt32(this.Width * .5 - .5 * infoButton.Width), this.Height - 95);
            //calibButton.Location = new Point(Convert.ToInt32(this.Width * .5 - calibButton.Width * .5), Convert.ToInt32(this.Height * .5 - calibButton.Height * .5));
            //startButton1.Location = new Point(5, 5);
            //startButton2.Location = new Point(this.Width - 5 - startButton2.Width, this.Height - 65 - startButton2.Width);
            //startButton3.Location = new Point(this.Width - 5 - startButton3.Width, 5);
            //startButton4.Location = new Point(5, this.Height - 65 - startButton4.Width);
            fittsButton.Width    = (int)(bounds.X / (20 * Math.Log(IDSetting + IDSetting * 3, 2)));
            fittsButton.Height   = fittsButton.Width;
            fittsRadius          = (int)((fittsButton.Width * Math.Pow(2, IDSetting)) / 2);
            fittsButton.Location = new Point(Convert.ToInt32(this.Width * .5), Convert.ToInt32(this.Height * 0.5 - fittsRadius));
            label36.Text         = fittsButton.Location.ToString();

            //Show the menu screen options
            label30.Text = trackType;
            label32.Text = clickType;
            label34.Text = new Point(this.Height, this.Width).ToString();
            label62.Text = orientation;
            label66.Text = IDSetting.ToString();

            fittsOut = new StreamWriter(@"fittsOutput.txt", true);
            fittsOut.WriteLine("ID: " + IDSetting.ToString() + " Subj#: " + subjNum + " Size: " + size.ToString() + " " + " Tracking Type: " + trackType.ToString() + " Click type: " + clickType.ToString() + " " + DateTime.Now);
            fittsOut.WriteLine("MT   Err  Pos(x,y) Click_Pos(x,y)");
            //fittsOut.Close();
        }