private void unloadTracker_Click(object sender, EventArgs e)
 {
     Console.WriteLine("Shutting down tracker...");
     trackerinterface = null;
     recorder = null;
     startButton.Enabled = false;
     startButton.BackColor = Color.DarkGray;
     stopButton.BackColor = Color.DarkGray;
     nextTrial.BackColor = Color.DarkGray;
     loadTracker.Enabled = true;
     unloadTracker.Enabled = false;
     samplingFreq.Enabled = true;
     radiusSettings.Enabled = true;
 }
        private void loadTracker_Click(object sender, EventArgs e)
        {
            Console.WriteLine("Attempting to start tracker...");
            trackerinterface = new TrackerInterface(Convert.ToDouble(samplingFreq.Text) / 3.0, Convert.ToDouble(radiusSettings.SelectedValue), this);
            if (trackerinterface.init_error != 0)
            {
                MessageBox.Show("ERROR: Could not initialize tracker.  Is tracker plugged in and turned on?");
                Console.WriteLine(System.IO.Directory.GetCurrentDirectory());
                return;
            }
            recorder = new Recorder(database);
            Console.WriteLine("Tracker initialized");
            startButton.Enabled = true;
            loadTracker.Enabled = false;
            unloadTracker.Enabled = true;
            samplingFreq.Enabled = false;
            radiusSettings.Enabled = false;

            startButton.BackColor = Color.Green;
            stopButton.BackColor = Color.DarkGray;
            nextTrial.BackColor = Color.DarkGray;
        }