/** * 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); }
private void setCurrentPlay() { ITrainingSegmentInfo lSegmentInfo = getPreviousSegment(); if (lSegmentInfo != null) { mOutputParent.SetPreviousPlayName(getFormattedPlayName(lSegmentInfo)); } else { mOutputParent.SetPreviousPlayName(""); } if (mCurrentTrainingSegment != null && WiimoteDataStore.getWiimoteDataStore().getNumberOfTrainingSegmentInfoRecords() > 0) { mOutputParent.SetCurentPlayName(getFormattedPlayName(mCurrentTrainingSegment)); } else { mOutputParent.SetCurentPlayName(""); } lSegmentInfo = getNextSegment(); if (lSegmentInfo != null) { mOutputParent.SetNextPlayName(getFormattedPlayName(lSegmentInfo)); } else { mOutputParent.SetNextPlayName(""); } setCurrentSubFrame(); }
public void startTimer(ITrainingSegmentInfo wiimoteRecord, bool p_MP3Option, string introductoryMessage) { TimerThread.getTimerThread().startTimer(Configuration.getConfiguration().NumBeatsPerMinute, Configuration.getConfiguration().NumBeatsPerBar, Configuration.getConfiguration().NumBars, Configuration.getConfiguration().LeadIn, p_MP3Option, introductoryMessage); // TimerThread.getTimerThread().startTimer(wiimoteRecord.NumBeatsPerMinute, wiimoteRecord.NumBeatsPerBar, // wiimoteRecord.NumBars, wiimoteRecord.LeadIn, p_MP3Option, introductoryMessage); }
private string getFormattedPlayName(ITrainingSegmentInfo lSegmentInfo) { StringBuilder lPlayName = new StringBuilder(); lPlayName.Append(lSegmentInfo.RecordName); return(lPlayName.ToString()); }
public bool nextFrame() { if (mVideoPlayer != null && (mVideoPlayer.getVideoState() == VideoState.Running || mVideoPlayer.getVideoState() == VideoState.Paused)) { return(false); } mCurrentVideoIndex = (mCurrentVideoIndex + 1) % WiimoteDataStore.getWiimoteDataStore().getNumberOfTrainingSegmentInfoRecords(); mCurrentTrainingSegment = WiimoteDataStore.getWiimoteDataStore().getTrainingSegmentInfo(mCurrentVideoIndex); mCurrentSubVideoIndex = 0; setCurrentPlay(); setCommandOptions(); return(true); }
public void initializeTraining() { try { loadTrainingVideoInfoData(); if (WiimoteDataStore.getWiimoteDataStore().getNumberOfTrainingSegmentInfoRecords() == 0) { return; // throw exception here } mTrainingStarted = true; mCurrentTrainingSegment = WiimoteDataStore.getWiimoteDataStore().getTrainingSegmentInfo(0); } catch (WiimoteConnectionException ex) { Console.WriteLine(ex); throw ex; } }
public bool previousFrame() { if (mVideoPlayer != null && (mVideoPlayer.getVideoState() == VideoState.Running || mVideoPlayer.getVideoState() == VideoState.Paused)) { return(false); } if (mCurrentVideoIndex > 0) { mCurrentVideoIndex = mCurrentVideoIndex - 1; } mCurrentTrainingSegment = WiimoteDataStore.getWiimoteDataStore().getTrainingSegmentInfo(mCurrentVideoIndex); mCurrentSubVideoIndex = 0; setCurrentPlay(); setCommandOptions(); return(true); }
public bool gotoFirstSegment() { if (mVideoPlayer != null && (mVideoPlayer.getVideoState() == VideoState.Running || mVideoPlayer.getVideoState() == VideoState.Paused)) { return(false); } if (WiimoteDataStore.getWiimoteDataStore().getNumberOfTrainingSegmentInfoRecords() == 0) { throw new TrainingVideoException("No Training Data Loaded"); } mCurrentVideoIndex = 0; mCurrentSubVideoIndex = 0; mCurrentTrainingSegment = WiimoteDataStore.getWiimoteDataStore().getTrainingSegmentInfo(mCurrentVideoIndex); setCurrentPlay(); setCommandOptions(); return(true); }
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); } }
/** * 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); }
public string comparePlayToReference(IWiimotePlayRecord p_PlayRecord) { ITrainingSegmentInfo lTrainingSegmentInfo = (ITrainingSegmentInfo)((IWiimoteChildRecord)p_PlayRecord).ParentRecord; return(comparePlayToReference((IWiimoteReferenceRecord)lTrainingSegmentInfo.TrainingReferenceRecord, p_PlayRecord)); }
public void startTimer(ITrainingSegmentInfo wiimoteRecord, bool p_MP3Option,string introductoryMessage) { TimerThread.getTimerThread().startTimer(Configuration.getConfiguration().NumBeatsPerMinute, Configuration.getConfiguration().NumBeatsPerBar, Configuration.getConfiguration().NumBars, Configuration.getConfiguration().LeadIn, p_MP3Option,introductoryMessage); // TimerThread.getTimerThread().startTimer(wiimoteRecord.NumBeatsPerMinute, wiimoteRecord.NumBeatsPerBar, // wiimoteRecord.NumBars, wiimoteRecord.LeadIn, p_MP3Option, introductoryMessage); }
private string getFormattedPlayName(ITrainingSegmentInfo lSegmentInfo) { StringBuilder lPlayName = new StringBuilder(); lPlayName.Append(lSegmentInfo.RecordName); return lPlayName.ToString(); }
public bool previousFrame() { if (mVideoPlayer != null && (mVideoPlayer.getVideoState() == VideoState.Running || mVideoPlayer.getVideoState() == VideoState.Paused)) return false; if (mCurrentVideoIndex > 0) mCurrentVideoIndex = mCurrentVideoIndex - 1; mCurrentTrainingSegment = WiimoteDataStore.getWiimoteDataStore().getTrainingSegmentInfo(mCurrentVideoIndex); mCurrentSubVideoIndex = 0; setCurrentPlay(); setCommandOptions(); return true; }
public bool nextFrame() { if (mVideoPlayer != null && (mVideoPlayer.getVideoState() == VideoState.Running || mVideoPlayer.getVideoState() == VideoState.Paused)) return false; mCurrentVideoIndex = (mCurrentVideoIndex + 1) % WiimoteDataStore.getWiimoteDataStore().getNumberOfTrainingSegmentInfoRecords(); mCurrentTrainingSegment = WiimoteDataStore.getWiimoteDataStore().getTrainingSegmentInfo(mCurrentVideoIndex); mCurrentSubVideoIndex = 0; setCurrentPlay(); setCommandOptions(); return true; }
public void initializeTraining() { try { loadTrainingVideoInfoData(); if (WiimoteDataStore.getWiimoteDataStore().getNumberOfTrainingSegmentInfoRecords() == 0) return; // throw exception here mTrainingStarted = true; mCurrentTrainingSegment = WiimoteDataStore.getWiimoteDataStore().getTrainingSegmentInfo(0); } catch (WiimoteConnectionException ex) { Console.WriteLine(ex); throw ex; } }
public bool gotoFirstSegment() { if (mVideoPlayer != null && (mVideoPlayer.getVideoState() == VideoState.Running || mVideoPlayer.getVideoState() == VideoState.Paused)) return false; if (WiimoteDataStore.getWiimoteDataStore().getNumberOfTrainingSegmentInfoRecords() == 0) throw new TrainingVideoException("No Training Data Loaded"); mCurrentVideoIndex = 0; mCurrentSubVideoIndex = 0; mCurrentTrainingSegment = WiimoteDataStore.getWiimoteDataStore().getTrainingSegmentInfo(mCurrentVideoIndex); setCurrentPlay(); setCommandOptions(); return true; }