Ejemplo n.º 1
0
        /**
         * This method
         *  1) Prepares the csv log file for logging Wiimote Data
         *  2) Initializes the Matlab matrix to send data
         */

        public override string startWiimoteLogging(IWiimoteChildRecord wiimoteRecord)
        {
            try
            {
                ITrainingSegmentInfo l_ParentRecord = (ITrainingSegmentInfo)wiimoteRecord.ParentRecord;
                //TODO : Change to member variable
                IWiimoteCalibrationRecordInfo l_Calibration = WiimoteDataStore.getWiimoteDataStore().Calibration;
                setCalibration();

                m_CSVFileWriter = new WiimoteCSVFileWriter(wiimoteRecord.FilePath.Insert(wiimoteRecord.FilePath.Length - 4, "CSharp"));
                m_CSVFileWriter = new WiimoteCSVFileWriter(wiimoteRecord.FilePath);
                m_CSVFileWriter.logHeader(m_CalibrationRecord);

                startRecordingSignalMatlab();
            }
            catch (PipeCommunicationException ex)
            {
                throw new WiimoteCommunicationException(ex);
            }
            catch (CSVFileFormatException ex)
            {
                throw new WiimoteCommunicationException(ex);
            }

            return(null);
        }
Ejemplo n.º 2
0
 public void OnTimerInterruptedEvent(object sender, TimerEventArgs e)
 {
     handleTimerCompletedEvent(sender, e);
     if (m_SelectedRowForRecord != null)
     {
         RecordingInterruptedEvent(this, new WiimoteRecordingEventArgs(e, m_SelectedRowForRecord, m_RecordingInvoker));
         m_SelectedRowForRecord = null;
     }
 }
Ejemplo n.º 3
0
        Wiimotes()
        {
            m_WiimoteConnected           = false;
            m_WiimoteDataAdaptor         = new SpaceSensorDataAdaptor(this);
            m_SelectedRowForRecord       = null;
            m_ContinueConnectingAttempts = true;

            m_Wiimote1 = new Wiimote();
            m_Wiimote2 = new Wiimote();

            Initialize();
        }
        public void newReferenceRecordingItemSelected(DataGridViewRow l_TableReferenceRow)
        {
            WiimoteReferenceRecord referenceRecord = (WiimoteReferenceRecord)l_TableReferenceRow.DataBoundItem;

            string referenceRecordingItemName = referenceRecord.RecordName + "_" +
                                                ProjectConstants.UNTITLED_REFERENCE_RECORDING_PREFIX + "_" +
                                                (referenceRecord.HighestRecordingItemIndex + 1);

            IWiimoteChildRecord wiimoteRecord = (IWiimoteChildRecord)referenceRecord.addWiimoteReferenceRecordingItem(referenceRecordingItemName,
                                                                                                                      getCalibrationSelection(), m_RecordStartTime);

            this.m_parent.SetReferenceRecordingItemDataBindingSource(referenceRecord.ReferenceRecordingItems);
        }
        public bool editFilenameColumnAttempt(DataGridView l_View, DataGridViewRow l_TableReferenceRow, int columnIndex)
        {
            IWiimoteChildRecord childRecord = (IWiimoteChildRecord)l_TableReferenceRow.DataBoundItem;

            if (l_View.Columns[columnIndex].DataPropertyName.CompareTo(ProjectConstants.FILE_NAME_PROPERTY_NAME) == 0 &&
                childRecord.RecordingDone)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
 public void referenceRecordingItemRowSelected(DataGridViewRow l_TableReferenceRow)
 {
     try
     {
         IWiimoteChildRecord wiimoteRecord = (IWiimoteChildRecord)l_TableReferenceRow.DataBoundItem;
         updateChart(wiimoteRecord, this.m_parent.chart1, this.m_parent.wiimote1Gyro, this.m_parent.wiimote2AccChart,
                     this.m_parent.wiimote2Gyro, this.m_parent.chartShowOption.Checked);
     }
     catch (CSVFileException e)
     {
         MessageBox.Show(e.Message, "CSV File Error", MessageBoxButtons.OK,
                         MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 7
0
        public string getScore(IWiimoteChildRecord l_SelectedReferenceRow, IWiimoteChildRecord l_SelectedPlayRow,
            out double score, out double stars)
        {
            string lMatlabOptionCode;
            WiimoteReferenceRecord lReferenceRecord = (WiimoteReferenceRecord)l_SelectedReferenceRow.ParentRecord;

            //TODO : This is a temporary hack to check for Pop Overs
            if (lReferenceRecord.RecordName.Contains("Intro"))
                lMatlabOptionCode = ProjectConstants.TRAINING_MATLAB_OPTION_PARTS_OF_THE_FEET;
            else if (lReferenceRecord.RecordName.Contains("Toe"))
                lMatlabOptionCode = ProjectConstants.TRAINING_MATLAB_OPTION_TOE_STANDS;
            else
                lMatlabOptionCode = ProjectConstants.TRAINING_MATLAB_OPTION_POP_OVERS;

            return MatlabWiimoteWrapper.calculateScore(lMatlabOptionCode, l_SelectedPlayRow.FilePath,
                out score, out stars);
        }
        private void updateChart(IWiimoteChildRecord wiimoteRecord, Chart wiimote1AccChart, Chart wiimote1Gyro,
                                 Chart wiimote2AccChart, Chart wiimote2Gyro, bool chartShowOption)
        {
            try
            {
                clearChart(wiimote1AccChart, wiimote1Gyro, wiimote2AccChart, wiimote2Gyro);

                if (chartShowOption)
                {
                    plotChart(wiimoteRecord, wiimote1AccChart, wiimote1Gyro, wiimote2AccChart, wiimote2Gyro);
                }
            }
            catch (CSVFileException e)
            {
                throw e;
            }
        }
Ejemplo n.º 9
0
        /**
         * This method
         *  1) Prepares the csv log file for logging Wiimote Data
         *  2) Initializes the Matlab matrix to send data
         */

        public override string startWiimoteLogging(IWiimoteChildRecord wiimoteRecord)
        {
            try
            {
                ITrainingSegmentInfo l_ParentRecord = (ITrainingSegmentInfo)wiimoteRecord.ParentRecord;
                //TODO : Change to member variable
                IWiimoteCalibrationRecordInfo l_Calibration = WiimoteDataStore.getWiimoteDataStore().Calibration;
                setCalibration();
                StartDataCollection(wiimoteRecord.FilePath);

                startRecordingSignalMatlab();
            }
            catch (CSVFileFormatException ex)
            {
                throw new WiimoteCommunicationException(ex);
            }
            catch (Exception ex)
            {
                throw new WiimoteCommunicationException(ex);
            }
            return(null);
        }
Ejemplo n.º 10
0
        public void startRecording(Object recordObject, bool p_MP3Option, object recordingInvoker, string introductoryMessage, bool pUseTImer)
        {
            try
            {
                if (!m_WiimoteConnected)
                {
                    throw new WiimoteConnectionException(ProjectConstants.WIIMOTE_NOT_CONNECTED_MESSAGE, WiimoteState.wiimoteDisconnectedState);
                }


                IWiimoteChildRecord  childRecord  = (IWiimoteChildRecord)recordObject;
                ITrainingSegmentInfo parentRecord = (ITrainingSegmentInfo)childRecord.ParentRecord;

                m_RecordingInvoker = recordingInvoker;

                childRecord.RecordedTime = DateTime.UtcNow;

                //  ApplicationSpeech.speakText(ProjectConstants.RECORDING_STARTED_TEXT);

                m_WiimoteDataAdaptor.startWiimoteLogging(childRecord);


                if (pUseTImer)
                {
                    startTimer(parentRecord, p_MP3Option, introductoryMessage);
                }
//                else
//                    m_WiimoteDataAdaptor.startWiimoteRecording(); //If no TImer is used , no need to wait
                // for lead bar to complete to start recording.
                //Can start recording immediately


                m_SelectedRowForRecord = childRecord;
            }
            catch (WiimoteCommunicationException ex)
            {
                throw new WiimoteConnectionException(ex, WiimoteState.wiimoteDisconnectedState);
            }
        }
Ejemplo n.º 11
0
        public string getScore(IWiimoteChildRecord l_SelectedReferenceRow, IWiimoteChildRecord l_SelectedPlayRow,
                               out double score, out double stars)
        {
            string lMatlabOptionCode;
            WiimoteReferenceRecord lReferenceRecord = (WiimoteReferenceRecord)l_SelectedReferenceRow.ParentRecord;

            //TODO : This is a temporary hack to check for Pop Overs
            if (lReferenceRecord.RecordName.Contains("Intro"))
            {
                lMatlabOptionCode = ProjectConstants.TRAINING_MATLAB_OPTION_PARTS_OF_THE_FEET;
            }
            else if (lReferenceRecord.RecordName.Contains("Toe"))
            {
                lMatlabOptionCode = ProjectConstants.TRAINING_MATLAB_OPTION_TOE_STANDS;
            }
            else
            {
                lMatlabOptionCode = ProjectConstants.TRAINING_MATLAB_OPTION_POP_OVERS;
            }


            return(MatlabWiimoteWrapper.calculateScore(lMatlabOptionCode, l_SelectedPlayRow.FilePath,
                                                       out score, out stars));
        }
        /**
         * This method
         *  1) Prepares the csv log file for logging Wiimote Data
         *  2) Initializes the Matlab matrix to send data
         */
        public override string startWiimoteLogging(IWiimoteChildRecord wiimoteRecord)
        {
            try
            {
                ITrainingSegmentInfo l_ParentRecord = (ITrainingSegmentInfo)wiimoteRecord.ParentRecord;
                //TODO : Change to member variable
                IWiimoteCalibrationRecordInfo l_Calibration = WiimoteDataStore.getWiimoteDataStore().Calibration;
                setCalibration();

                m_CSVFileWriter = new WiimoteCSVFileWriter(wiimoteRecord.FilePath.Insert(wiimoteRecord.FilePath.Length - 4, "CSharp"));
                m_CSVFileWriter = new WiimoteCSVFileWriter(wiimoteRecord.FilePath);
                m_CSVFileWriter.logHeader(m_CalibrationRecord);

                startRecordingSignalMatlab();
            }
            catch (PipeCommunicationException ex)
            {
                throw new WiimoteCommunicationException(ex);
            }
            catch (CSVFileFormatException ex)
            {
                throw new WiimoteCommunicationException(ex);
            }

            return null;
        }
Ejemplo n.º 13
0
 public abstract string startWiimoteLogging(IWiimoteChildRecord wiimoteRecord);
Ejemplo n.º 14
0
 public abstract string startWiimoteLogging(IWiimoteChildRecord wiimoteRecord);
Ejemplo n.º 15
0
        public void startRecording(Object recordObject,bool p_MP3Option,object recordingInvoker,string introductoryMessage,bool pUseTImer)
        {
            try
            {

                if (!m_WiimoteConnected)
                {
                    throw new WiimoteConnectionException(ProjectConstants.WIIMOTE_NOT_CONNECTED_MESSAGE, WiimoteState.wiimoteDisconnectedState);
                }

                IWiimoteChildRecord childRecord = (IWiimoteChildRecord)recordObject;
                ITrainingSegmentInfo parentRecord = (ITrainingSegmentInfo)childRecord.ParentRecord;

                m_RecordingInvoker = recordingInvoker;

                childRecord.RecordedTime = DateTime.UtcNow;

                //  ApplicationSpeech.speakText(ProjectConstants.RECORDING_STARTED_TEXT);

                m_WiimoteDataAdaptor.startWiimoteLogging(childRecord);

                if (pUseTImer)
                    startTimer(parentRecord, p_MP3Option, introductoryMessage);
            //                else
            //                    m_WiimoteDataAdaptor.startWiimoteRecording(); //If no TImer is used , no need to wait
                // for lead bar to complete to start recording.
                //Can start recording immediately

                m_SelectedRowForRecord = childRecord;

            }
            catch (WiimoteCommunicationException ex)
            {
                throw new WiimoteConnectionException(ex, WiimoteState.wiimoteDisconnectedState);
            }
        }
Ejemplo n.º 16
0
 public void OnTimerInterruptedEvent(object sender, TimerEventArgs e)
 {
     handleTimerCompletedEvent(sender, e);
     if (m_SelectedRowForRecord != null)
     {
         RecordingInterruptedEvent(this, new WiimoteRecordingEventArgs(e, m_SelectedRowForRecord, m_RecordingInvoker));
         m_SelectedRowForRecord = null;
     }
 }
Ejemplo n.º 17
0
        Wiimotes()
        {
            m_WiimoteConnected = false;
            m_WiimoteDataAdaptor = new SpaceSensorDataAdaptor(this);
            m_SelectedRowForRecord = null;
            m_ContinueConnectingAttempts = true;

            m_Wiimote1 = new Wiimote();
            m_Wiimote2 = new Wiimote();

            Initialize();
        }
Ejemplo n.º 18
0
 public WiimoteRecordingEventArgs(TimerEventArgs e,IWiimoteChildRecord p_Record,object recordingInvoker)
 {
     m_TimerArgs = e;
     ChildRecord = p_Record;
     RecordingInvoker = recordingInvoker;
 }
        /**
         * This method
         *  1) Prepares the csv log file for logging Wiimote Data
         *  2) Initializes the Matlab matrix to send data
         */
        public override string startWiimoteLogging(IWiimoteChildRecord wiimoteRecord)
        {
            try
            {
                ITrainingSegmentInfo l_ParentRecord = (ITrainingSegmentInfo)wiimoteRecord.ParentRecord;
                //TODO : Change to member variable
                IWiimoteCalibrationRecordInfo l_Calibration = WiimoteDataStore.getWiimoteDataStore().Calibration;
                setCalibration();
                StartDataCollection(wiimoteRecord.FilePath);

                startRecordingSignalMatlab();
            }
            catch (CSVFileFormatException ex)
            {
                throw new WiimoteCommunicationException(ex);
            }
            catch (Exception ex)
            {
                throw new WiimoteCommunicationException(ex);
            }
            return null;
        }
        private void updateChart(IWiimoteChildRecord wiimoteRecord, Chart wiimote1AccChart, Chart wiimote1Gyro,
            Chart wiimote2AccChart, Chart wiimote2Gyro,bool chartShowOption)
        {
            try
            {
                clearChart(wiimote1AccChart, wiimote1Gyro, wiimote2AccChart, wiimote2Gyro);

                if (chartShowOption)
                    plotChart(wiimoteRecord, wiimote1AccChart, wiimote1Gyro, wiimote2AccChart, wiimote2Gyro);
            }
            catch (CSVFileException e)
            {
                throw e;
            }
        }
        private void plotChart(IWiimoteChildRecord wiimoteRecord, Chart wiimote1AccChart, Chart wiimote1Gyro,
            Chart wiimote2AccChart, Chart wiimote2Gyro)
        {
            try
            {
                if (!wiimoteRecord.RecordingDone)
                    return;

                while (true)
                {
                    string[] row = wiimoteRecord.getNextDataRow(Configuration.getConfiguration().WiimotesChartRowSkipStep);

                    if (row == null)
                        return;

                    //Series 1 :  Acc X
                    wiimote1AccChart.Series[0].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                        Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE1_ACC_X_COLUMN_INDEX]));
                    wiimote1AccChart.Series[0].Name = WiimoteRecordBase.WIIMOTE1_ACC_X_COLUMN_HEADER;

                    if (!Configuration.getConfiguration().WiimotesChartOneAxisOnly)
                    {
                        //Series 2 :  Acc Y
                        wiimote1AccChart.Series[1].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE1_ACC_Y_COLUMN_INDEX]));
                        wiimote1AccChart.Series[1].Name = WiimoteRecordBase.WIIMOTE1_ACC_Y_COLUMN_HEADER;

                        //Series 3 :  Acc Z
                        wiimote1AccChart.Series[2].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE1_ACC_Z_COLUMN_INDEX]));
                        wiimote1AccChart.Series[2].Name = WiimoteRecordBase.WIIMOTE1_ACC_Z_COLUMN_HEADER;
                    }

                    //Series 4 :  Speed Yaw
                    wiimote1Gyro.Series[0].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                        Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE1_SPEED_YAW_COLUMN_INDEX]));
                    wiimote1Gyro.Series[0].Name = WiimoteRecordBase.WIIMOTE1_SPEED_YAW_COLUMN_HEADER;

                    if (!Configuration.getConfiguration().WiimotesChartOneAxisOnly)
                    {
                        //Series 5 :  Speed Pitch
                        wiimote1Gyro.Series[1].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE1_ACC_PITCH_ANGLE_COLUMN_INDEX]));
                        wiimote1Gyro.Series[1].Name = WiimoteRecordBase.WIIMOTE1_ACC_PITCH_ANGLE_COLUMN_HEADER;

                        //Series 6 :  Speed Roll
                        wiimote1Gyro.Series[2].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE1_SPEED_ROLL_COLUMN_INDEX]));
                        wiimote1Gyro.Series[2].Name = WiimoteRecordBase.WIIMOTE1_SPEED_ROLL_COLUMN_HEADER;
                    }

                    //Series 7 :  Acc X
                    wiimote2AccChart.Series[0].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                        Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE2_ACC_X_COLUMN_INDEX]));
                    wiimote2AccChart.Series[0].Name = WiimoteRecordBase.WIIMOTE2_ACC_X_COLUMN_HEADER;

                    if (!Configuration.getConfiguration().WiimotesChartOneAxisOnly)
                    {
                        //Series 8 :  Acc Y
                        wiimote2AccChart.Series[1].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE2_ACC_Y_COLUMN_INDEX]));
                        wiimote2AccChart.Series[1].Name = WiimoteRecordBase.WIIMOTE2_ACC_Y_COLUMN_HEADER;

                        //Series 9 :  Acc Z
                        wiimote2AccChart.Series[2].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE2_ACC_Z_COLUMN_INDEX]));
                        wiimote2AccChart.Series[2].Name = WiimoteRecordBase.WIIMOTE2_ACC_Z_COLUMN_HEADER;
                    }

                    //Series 10 :  Speed Yaw
                    wiimote2Gyro.Series[0].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                        Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE2_SPEED_YAW_COLUMN_INDEX]));
                    wiimote2Gyro.Series[0].Name = WiimoteRecordBase.WIIMOTE2_SPEED_YAW_COLUMN_HEADER;

                    if (!Configuration.getConfiguration().WiimotesChartOneAxisOnly)
                    {
                        //Series 11 :  Speed Pitch
                        wiimote2Gyro.Series[1].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE2_ACC_PITCH_ANGLE_COLUMN_INDEX]));
                        wiimote2Gyro.Series[1].Name = WiimoteRecordBase.WIIMOTE2_ACC_PITCH_ANGLE_COLUMN_HEADER;

                        //Series 12 :  Speed Roll
                        wiimote2Gyro.Series[2].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE2_SPEED_ROLL_COLUMN_INDEX]));
                        wiimote2Gyro.Series[2].Name = WiimoteRecordBase.WIIMOTE2_SPEED_ROLL_COLUMN_HEADER;
                    }
                }

            }
            catch (CSVFileException e)
            {
                throw e;
            }
        }
        private void plotChart(IWiimoteChildRecord wiimoteRecord, Chart wiimote1AccChart, Chart wiimote1Gyro,
                               Chart wiimote2AccChart, Chart wiimote2Gyro)
        {
            try
            {
                if (!wiimoteRecord.RecordingDone)
                {
                    return;
                }

                while (true)
                {
                    string[] row = wiimoteRecord.getNextDataRow(Configuration.getConfiguration().WiimotesChartRowSkipStep);

                    if (row == null)
                    {
                        return;
                    }

                    //Series 1 :  Acc X
                    wiimote1AccChart.Series[0].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                                                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE1_ACC_X_COLUMN_INDEX]));
                    wiimote1AccChart.Series[0].Name = WiimoteRecordBase.WIIMOTE1_ACC_X_COLUMN_HEADER;

                    if (!Configuration.getConfiguration().WiimotesChartOneAxisOnly)
                    {
                        //Series 2 :  Acc Y
                        wiimote1AccChart.Series[1].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                                                                Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE1_ACC_Y_COLUMN_INDEX]));
                        wiimote1AccChart.Series[1].Name = WiimoteRecordBase.WIIMOTE1_ACC_Y_COLUMN_HEADER;

                        //Series 3 :  Acc Z
                        wiimote1AccChart.Series[2].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                                                                Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE1_ACC_Z_COLUMN_INDEX]));
                        wiimote1AccChart.Series[2].Name = WiimoteRecordBase.WIIMOTE1_ACC_Z_COLUMN_HEADER;
                    }

                    //Series 4 :  Speed Yaw
                    wiimote1Gyro.Series[0].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                                                        Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE1_SPEED_YAW_COLUMN_INDEX]));
                    wiimote1Gyro.Series[0].Name = WiimoteRecordBase.WIIMOTE1_SPEED_YAW_COLUMN_HEADER;

                    if (!Configuration.getConfiguration().WiimotesChartOneAxisOnly)
                    {
                        //Series 5 :  Speed Pitch
                        wiimote1Gyro.Series[1].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                                                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE1_ACC_PITCH_ANGLE_COLUMN_INDEX]));
                        wiimote1Gyro.Series[1].Name = WiimoteRecordBase.WIIMOTE1_ACC_PITCH_ANGLE_COLUMN_HEADER;

                        //Series 6 :  Speed Roll
                        wiimote1Gyro.Series[2].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                                                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE1_SPEED_ROLL_COLUMN_INDEX]));
                        wiimote1Gyro.Series[2].Name = WiimoteRecordBase.WIIMOTE1_SPEED_ROLL_COLUMN_HEADER;
                    }

                    //Series 7 :  Acc X
                    wiimote2AccChart.Series[0].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                                                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE2_ACC_X_COLUMN_INDEX]));
                    wiimote2AccChart.Series[0].Name = WiimoteRecordBase.WIIMOTE2_ACC_X_COLUMN_HEADER;

                    if (!Configuration.getConfiguration().WiimotesChartOneAxisOnly)
                    {
                        //Series 8 :  Acc Y
                        wiimote2AccChart.Series[1].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                                                                Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE2_ACC_Y_COLUMN_INDEX]));
                        wiimote2AccChart.Series[1].Name = WiimoteRecordBase.WIIMOTE2_ACC_Y_COLUMN_HEADER;

                        //Series 9 :  Acc Z
                        wiimote2AccChart.Series[2].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                                                                Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE2_ACC_Z_COLUMN_INDEX]));
                        wiimote2AccChart.Series[2].Name = WiimoteRecordBase.WIIMOTE2_ACC_Z_COLUMN_HEADER;
                    }

                    //Series 10 :  Speed Yaw
                    wiimote2Gyro.Series[0].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                                                        Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE2_SPEED_YAW_COLUMN_INDEX]));
                    wiimote2Gyro.Series[0].Name = WiimoteRecordBase.WIIMOTE2_SPEED_YAW_COLUMN_HEADER;

                    if (!Configuration.getConfiguration().WiimotesChartOneAxisOnly)
                    {
                        //Series 11 :  Speed Pitch
                        wiimote2Gyro.Series[1].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                                                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE2_ACC_PITCH_ANGLE_COLUMN_INDEX]));
                        wiimote2Gyro.Series[1].Name = WiimoteRecordBase.WIIMOTE2_ACC_PITCH_ANGLE_COLUMN_HEADER;

                        //Series 12 :  Speed Roll
                        wiimote2Gyro.Series[2].Points.AddXY(Convert.ToDouble(row[WiimoteRecordBase.TIME_COLUMN_INDEX]),
                                                            Convert.ToDouble(row[WiimoteRecordBase.WIIMOTE2_SPEED_ROLL_COLUMN_INDEX]));
                        wiimote2Gyro.Series[2].Name = WiimoteRecordBase.WIIMOTE2_SPEED_ROLL_COLUMN_HEADER;
                    }
                }
            }
            catch (CSVFileException e)
            {
                throw e;
            }
        }
Ejemplo n.º 23
0
 public WiimoteRecordingEventArgs(TimerEventArgs e, IWiimoteChildRecord p_Record, object recordingInvoker)
 {
     m_TimerArgs      = e;
     ChildRecord      = p_Record;
     RecordingInvoker = recordingInvoker;
 }