예제 #1
0
        private void StartData()
        {
            SendMCECommand.Calibrate();
            TestSubject person = new TestSubject("Me", "111", "Male", 20, markerHeightCal);

            dataCollection = new TightropeData(person, "Test1", 1);
            sound          = new ALSoundEnvironment(person);
            SendMCECommand.SetTreadmillSpeed((float)nudSpeed.Value);
        }
예제 #2
0
        /*
         * int LSSstate = 0;//cycle stage counters for each of the symmetry variables
         * int LCDstate = 0;
         * int LSIstate = 0;
         * int LDSstate = 0;
         * int RSSstate = 0;
         * int RCDstate = 0;
         * int RSIstate = 0;
         * int RDSstate = 0;
         * double sssi = 0;
         * double cdsi = 0;
         * double sisi = 0;
         * double dssi = 0;
         * double[] LSS, LCD, LSI, LDS;
         * double[] RSS, RCD, RSI, RDS;
         * List<double> LSSlist;
         * List<double> LCDlist;
         * List<double> LSIlist;
         * List<double> LDSlist;
         * List<double> RSSlist;
         * List<double> RCDlist;
         * List<double> RSIlist;
         * List<double> RDSlist;
         */
        #endregion

        public TightropeData(TestSubject subject, string fileID, int startTime)
        {
            this.fileID        = fileID;
            left               = subject.Left;
            right              = subject.Right;
            DSSI               = new List <SIdata>();
            SISI               = new List <SIdata>();
            CDSI               = new List <SIdata>();
            SSSI               = new List <SIdata>();
            LeftList           = new List <PositionData>();
            RightList          = new List <PositionData>();
            LeftOvershootList  = new List <PositionData>();
            RightOvershootList = new List <PositionData>();
            statetable         = new int[8];
            teststart          = startTime;

            LTO = new List <float>();
            LHD = new List <float>();
            RTO = new List <float>();
            RHD = new List <float>();

            #region Asynchronous arrays and lists

            /*
             * LSS = new double[5];
             * LCD = new double[4];
             * LSI = new double[4];
             * LDS = new double[4];
             * RSS = new double[5];
             * RCD = new double[4];
             * RSI = new double[4];
             * RDS = new double[4];
             * LSSlist = new List<double>();
             * LCDlist = new List<double>();
             * LSIlist = new List<double>();
             * LDSlist = new List<double>();
             * RSSlist = new List<double>();
             * RCDlist = new List<double>();
             * RSIlist = new List<double>();
             * RDSlist = new List<double>();
             */
            #endregion

            Foot.FootDownDetected  += new Foot.FootDownEventHandler(Foot_FootDownDetected);
            Foot.zFootPeakDetected += new Foot.Z_PeakEventHandler(Foot_zFootPeakDetected);
            //Foot.xFootPeakDetected += new Foot.X_PeakEventHandler(Foot_xFootPeakDetected);

            //debug output - feet calibration positions
            System.Diagnostics.Debug.WriteLine("Start Left" + left.CalibrationMarker.MarkerId + ": x" + ((int)left.CalibrationMarker.xCoordinate).ToString() + " y" +
                                               ((int)left.CalibrationMarker.yCoordinate).ToString() + " z" + ((int)left.CalibrationMarker.zCoordinate).ToString() + " Time: " + left.CalibrationMarker.TimeStamp.ToString());
            System.Diagnostics.Debug.WriteLine("Start Right" + right.CalibrationMarker.MarkerId + ": x" + ((int)right.CalibrationMarker.xCoordinate).ToString() + " y" +
                                               ((int)right.CalibrationMarker.yCoordinate).ToString() + " z" + ((int)right.CalibrationMarker.zCoordinate).ToString() + "\n");
        }
        public ALSoundEnvironment(TestSubject person)
        {
            this.person = person;
            left        = person.Left;
            right       = person.Right;

            ALsetup.SLsetenvironment();
            //if (!ALsetup.SLsetenvironment())
            //{
            //    MessageBox.Show("Sound is not fully functioning!");
            //}
            StartSound();
        }
        public ALSoundEnvironment(TestSubject person)
        {
            this.person = person;
            left = person.Left;
            right = person.Right;

            ALsetup.SLsetenvironment();
            //if (!ALsetup.SLsetenvironment())
            //{
            //    MessageBox.Show("Sound is not fully functioning!");
            //}
            StartSound();
        }
예제 #5
0
        public TightropeData(TestSubject subject, string testname, int testnumber)
        {
            this.fileID = testname + subject.SubjectID + testnumber.ToString();
            Xfile       = new StreamWriter(@"D:Test/" + fileID + "Accuracy.csv", false);
            Xfile.Write("Right, Left\n");
            left  = subject.Left;
            right = subject.Right;

            LSS     = new double[5];
            LCD     = new double[4];
            LSI     = new double[4];
            LDS     = new double[4];
            RSS     = new double[5];
            RCD     = new double[4];
            RSI     = new double[4];
            RDS     = new double[4];
            LSSlist = new List <double>();
            LCDlist = new List <double>();
            LSIlist = new List <double>();
            LDSlist = new List <double>();
            RSSlist = new List <double>();
            RCDlist = new List <double>();
            RSIlist = new List <double>();
            RDSlist = new List <double>();

            sound = new SoundPlayer(@"D:/Test/Conga2.wav");
            sound.Load();

            Foot.FootDownDetected  += new Foot.FootDownEventHandler(Foot_FootDownDetected);
            Foot.zFootPeakDetected += new Foot.Z_PeakEventHandler(Foot_zFootPeakDetected);

            //debug output - feet calibration positions
            Console.WriteLine("Start Left:" + " x" + ((int)left.CalibrationMarker.xCoordinate).ToString() + " y" +
                              ((int)left.CalibrationMarker.yCoordinate).ToString() + " z" + ((int)left.CalibrationMarker.zCoordinate).ToString());
            Console.WriteLine("Start Right:" + " x" + ((int)right.CalibrationMarker.xCoordinate).ToString() + " y" +
                              ((int)right.CalibrationMarker.yCoordinate).ToString() + " z" + ((int)right.CalibrationMarker.zCoordinate).ToString() + "\n");
        }
        public TightropeData(TestSubject subject, string testname, int testnumber)
        {
            this.fileID = testname+ subject.SubjectID + testnumber.ToString();
            Xfile = new StreamWriter(@"D:Test/" + fileID + "Accuracy.csv", false);
            Xfile.Write("Right, Left\n");
            left = subject.Left;
            right = subject.Right;

            LSS = new double[5];
            LCD = new double[4];
            LSI = new double[4];
            LDS = new double[4];
            RSS = new double[5];
            RCD = new double[4];
            RSI = new double[4];
            RDS = new double[4];
            LSSlist = new List<double>();
            LCDlist = new List<double>();
            LSIlist = new List<double>();
            LDSlist = new List<double>();
            RSSlist = new List<double>();
            RCDlist = new List<double>();
            RSIlist = new List<double>();
            RDSlist = new List<double>();

            sound = new SoundPlayer(@"D:/Test/Conga2.wav");
            sound.Load();
            
            Foot.FootDownDetected += new Foot.FootDownEventHandler(Foot_FootDownDetected);
            Foot.zFootPeakDetected += new Foot.Z_PeakEventHandler(Foot_zFootPeakDetected);
            
            //debug output - feet calibration positions
            Console.WriteLine("Start Left:" + " x" + ((int)left.CalibrationMarker.xCoordinate).ToString() + " y" + 
                ((int)left.CalibrationMarker.yCoordinate).ToString() + " z" + ((int)left.CalibrationMarker.zCoordinate).ToString());
            Console.WriteLine("Start Right:" + " x" + ((int)right.CalibrationMarker.xCoordinate).ToString() + " y" +
                ((int)right.CalibrationMarker.yCoordinate).ToString() + " z" + ((int)right.CalibrationMarker.zCoordinate).ToString() + "\n");
        }
        /*
        int LSSstate = 0;//cycle stage counters for each of the symmetry variables
        int LCDstate = 0;
        int LSIstate = 0;
        int LDSstate = 0;
        int RSSstate = 0;
        int RCDstate = 0;
        int RSIstate = 0;
        int RDSstate = 0;
        double sssi = 0;
        double cdsi = 0;
        double sisi = 0;
        double dssi = 0;
        double[] LSS, LCD, LSI, LDS;
        double[] RSS, RCD, RSI, RDS;
        List<double> LSSlist;
        List<double> LCDlist;
        List<double> LSIlist;
        List<double> LDSlist;
        List<double> RSSlist;
        List<double> RCDlist;
        List<double> RSIlist;
        List<double> RDSlist;
        */
        #endregion

        public TightropeData(TestSubject subject, string fileID, int startTime)
        {
            
            this.fileID = fileID;
            left = subject.Left;
            right = subject.Right;
            DSSI = new List<SIdata>();
            SISI = new List<SIdata>();
            CDSI = new List<SIdata>();
            SSSI = new List<SIdata>();
            LeftList = new List<PositionData>();
            RightList = new List<PositionData>();
            LeftOvershootList = new List<PositionData>();
            RightOvershootList = new List<PositionData>();
            statetable = new int[8];
            teststart = startTime;

            LTO = new List<float>();
            LHD = new List<float>();
            RTO = new List<float>();
            RHD = new List<float>();

            #region Asynchronous arrays and lists
            /*
            LSS = new double[5];
            LCD = new double[4];
            LSI = new double[4];
            LDS = new double[4];
            RSS = new double[5];
            RCD = new double[4];
            RSI = new double[4];
            RDS = new double[4];
            LSSlist = new List<double>();
            LCDlist = new List<double>();
            LSIlist = new List<double>();
            LDSlist = new List<double>();
            RSSlist = new List<double>();
            RCDlist = new List<double>();
            RSIlist = new List<double>();
            RDSlist = new List<double>();
            */
            #endregion

            Foot.FootDownDetected += new Foot.FootDownEventHandler(Foot_FootDownDetected);
            Foot.zFootPeakDetected += new Foot.Z_PeakEventHandler(Foot_zFootPeakDetected);
            //Foot.xFootPeakDetected += new Foot.X_PeakEventHandler(Foot_xFootPeakDetected);
            
            //debug output - feet calibration positions
            System.Diagnostics.Debug.WriteLine("Start Left" + left.CalibrationMarker.MarkerId + ": x" + ((int)left.CalibrationMarker.xCoordinate).ToString() + " y" + 
                ((int)left.CalibrationMarker.yCoordinate).ToString() + " z" + ((int)left.CalibrationMarker.zCoordinate).ToString() + " Time: " + left.CalibrationMarker.TimeStamp.ToString());
            System.Diagnostics.Debug.WriteLine("Start Right" + right.CalibrationMarker.MarkerId + ": x" + ((int)right.CalibrationMarker.xCoordinate).ToString() + " y" +
                ((int)right.CalibrationMarker.yCoordinate).ToString() + " z" + ((int)right.CalibrationMarker.zCoordinate).ToString() + "\n");

        }
예제 #8
0
 private void StartData()
 {
     SendMCECommand.Calibrate();
     TestSubject person = new TestSubject("Me", "111", "Male", 20, markerHeightCal);
     dataCollection = new TightropeData(person, "Test1", 1);
     sound = new ALSoundEnvironment(person);
     SendMCECommand.SetTreadmillSpeed((float)nudSpeed.Value);
 }
예제 #9
0
 private void btnSavePersonData_Click(object sender, EventArgs e)
 {
     if (btnSavePersonData.Text == "Save record")
     {
         person.PersonData.Age = (uint)nudAge.Value;
         if (rbF.Checked)
         {
             person.PersonData.Gender = "F";
         }
         else
         {
             person.PersonData.Gender = "M";
         }
         if (rbLeft.Checked)
         {
             person.PersonData.FootPreference = "L";
         }
         else
         {
             if (rbRight.Checked)
             {
                 person.PersonData.FootPreference = "R";
             }
             else
             {
                 person.PersonData.FootPreference = "N";
             }
         }
         person.PersonData.AddPersonNotes(txtNotes.Text);
         personDataList.Add(person.PersonData);
         //person.Left.FootCleanUp();
         //person.Right.FootCleanUp();
         Foot.Frontfoot            = null;
         person.Left               = null;
         person.Right              = null;
         person.PersonData         = null;
         person                    = null;
         btnStartTreadmill.Enabled = false;
         txtTestNumber.Text        = "0";
         btnSavePersonData.Enabled = false;
         txtNotes.Text             = "";
         txtFileName.Text          = "";
         txtInitials.Enabled       = true;
         lbFileNames.Items.Clear();
         SavePersonData();
         btnSavePersonData.Text = "New test subject";
         txtInitials.Text       = "";
         txtInitials.Focus();
     }
     else
     {
         try
         {
             person = new TestSubject(newID);
             txtInitials.Enabled       = false;
             btnStartTreadmill.Enabled = true;
             txtTestNumber.Text        = "1";
             txtFileName.Text          = cbTestID.Text + @"\" + cbTestID.Text + "_" + txtTestNumber.Text + "_" + person.PersonData.PersonID;
             btnSavePersonData.Text    = "Save record";
             btnSavePersonData.Enabled = false;
         }
         catch (NullReferenceException)
         {
             MessageBox.Show("Check test participant is on the treadmill with markers in place.");
         }
     }
 }
예제 #10
0
 private void btnSavePersonData_Click(object sender, EventArgs e)
 {
     if (btnSavePersonData.Text == "Save record")
     {
         person.PersonData.Age = (uint)nudAge.Value;
         if (rbF.Checked) person.PersonData.Gender = "F";
         else person.PersonData.Gender = "M";
         if (rbLeft.Checked)
         {
             person.PersonData.FootPreference = "L";
         }
         else
         {
             if (rbRight.Checked)
             {
                 person.PersonData.FootPreference = "R";
             }
             else
             {
                 person.PersonData.FootPreference = "N";
             }
         }
         person.PersonData.AddPersonNotes(txtNotes.Text);
         personDataList.Add(person.PersonData);
         //person.Left.FootCleanUp();
         //person.Right.FootCleanUp();
         Foot.Frontfoot = null;
         person.Left = null;
         person.Right = null;
         person.PersonData = null;
         person = null;
         btnStartTreadmill.Enabled = false;
         txtTestNumber.Text = "0";
         btnSavePersonData.Enabled = false;
         txtNotes.Text = "";
         txtFileName.Text = "";
         txtInitials.Enabled = true;
         lbFileNames.Items.Clear();
         SavePersonData();
         btnSavePersonData.Text = "New test subject";
         txtInitials.Text = "";
         txtInitials.Focus();
     }
     else
     {
         try
         {
             person = new TestSubject(newID);
             txtInitials.Enabled = false;
             btnStartTreadmill.Enabled = true;
             txtTestNumber.Text = "1";
             txtFileName.Text = cbTestID.Text + @"\" + cbTestID.Text + "_" + txtTestNumber.Text + "_" + person.PersonData.PersonID;
             btnSavePersonData.Text = "Save record";
             btnSavePersonData.Enabled = false;
         }
         catch (NullReferenceException)
         {
             MessageBox.Show("Check test participant is on the treadmill with markers in place.");
         }
     }
 }