Пример #1
0
        public SensorReading(Study study, Subject subject, Session session, Trial trial, long recordnum, TrackerInterface.Record rec)
        {
            this.study = study;
            this.subject = subject;
            this.session = session;
            this.trial = trial;
            this.time = rec.time[0];

            sensors = new Sensor[32];

            for (int i = 0; i < sensors.Length; i++)
            {
                sensors[i] = new Sensor();
                sensors[i].active = rec.active[i];
                sensors[i].x = rec.x[i];
                sensors[i].y = rec.y[i];
                sensors[i].z = rec.z[i];
                sensors[i].pitch = rec.pitch[i];
                sensors[i].yaw = rec.yaw[i];
                sensors[i].roll = rec.roll[i];
                sensors[i].time = rec.time[i];
                if (this.time == 0)
                {
                    time = rec.time[i];
                }
                sensors[i].quality = rec.quality[i];
                sensors[i].button = rec.button[i];
            }
        }
Пример #2
0
        public void Start(TrackerInterface tracker, Trial trial)
        {
            this.tracker = tracker;

            this.trial = trial;

            this.running = true;

            Thread getThread = new Thread(new ThreadStart(CollectRecord));
            getThread.Start();
        }
Пример #3
0
        public void Start(TrackerInterface tracker, Trial trial)
        {
            this.tracker = tracker;

            this.trial = trial;

            this.running = true;

            Thread getThread = new Thread(new ThreadStart(CollectRecord));

            getThread.Start();
        }
Пример #4
0
 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;
 }
Пример #5
0
        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;
        }
Пример #6
0
        public SensorReading(long recordnum, TrackerInterface.Record rec)
        {
            sensors = new Sensor[32];

            for ( int i = 0; i < sensors.Length;i++ )
            {
                sensors[i] = new Sensor();
                sensors[i].active = rec.active[i];
                sensors[i].x = rec.x[i];
                sensors[i].y = rec.y[i];
                sensors[i].z = rec.z[i];
                sensors[i].pitch = rec.pitch[i];
                sensors[i].yaw = rec.yaw[i];
                sensors[i].roll = rec.roll[i];
                sensors[i].time = rec.time[i];
                if (this.time == 0)
                {
                    time = rec.time[i];
                }
                sensors[i].quality = rec.quality[i];
                sensors[i].button = rec.button[i];
            }
        }
Пример #7
0
 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;
 }
Пример #8
0
        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;
        }