Пример #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);
        }
        /**
         * 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;
        }