public void deleteReferenceRecordSelected(DataGridViewRow lTrainingSegmentRow, DataGridViewRow lReferenceRow, int index)
        {
            TrainingSegmentInfo    trainingSegmentInfo = (TrainingSegmentInfo)lTrainingSegmentRow.DataBoundItem;
            WiimoteReferenceRecord referenceRecord     = (WiimoteReferenceRecord)lReferenceRow.DataBoundItem;

            DialogResult result;

            if (referenceRecord.getNumberOfWiimoteReferenceRecordingItems() > 0)
            {
                result = MessageBox.Show("There are Multiple Recording Items for this Reference. Do you want to delete all the Recording Items ?",
                                         "Need User Input", MessageBoxButtons.YesNo);
            }
            else
            {
                trainingSegmentInfo.deleteWiimoteReferenceRecord(index);
                return;
            }

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                referenceRecord.deleleAllWiimoteReferenceRecordingItems();
                trainingSegmentInfo.deleteChildItem(index);
            }

            this.m_parent.SetTrainingSegmentInfoBindingSource(WiimoteDataStore.getWiimoteDataStore().TrainingSegmentInfoRecords);
        }
        public TrainingSegmentInfo addTrainingSegmentInfoRecord(string pTrainingSegmentInfoName)
        {
            TrainingSegmentInfo record = new TrainingSegmentInfo(pTrainingSegmentInfoName);

            trainingSegmentInfoRecordList.Add(record);
            return(record);
        }
Esempio n. 3
0
        private void RepeatCommand_Click(object sender, EventArgs e)
        {
            mCurrentVideoIndex = mCurrentVideoIndex - 1;
            VideoUserOptions lOptions = new VideoUserOptions();

            mCurrentTrainingSegment = mVideoInfoList[mCurrentVideoIndex];
            playTrainingVideo(lOptions);
        }
        public void newTrainingSegmentSelected()
        {
            string trainingSegmentName = ProjectConstants.UNTITLED_REFERENCE_NAME +
                                         (WiimoteDataStore.getWiimoteDataStore().HighestTrainingSegmentInfoIndex + 1);

            TrainingSegmentInfo lTrainingSegmentInfo = WiimoteDataStore.getWiimoteDataStore().addTrainingSegmentInfoRecord(trainingSegmentName);

            this.m_parent.SetTrainingSegmentInfoBindingSource(WiimoteDataStore.getWiimoteDataStore().TrainingSegmentInfoRecords);
        }
        public void newReferenceSelected(DataGridViewRow lTableReferenceRow)
        {
            TrainingSegmentInfo trainingSegmentInfo = (TrainingSegmentInfo)lTableReferenceRow.DataBoundItem;

            //add newly created Wiimote csv file to ReferenceDataStore
            IWiimoteReferenceRecord wiimoteRecord = trainingSegmentInfo.addWiimoteReferenceRecord(ProjectConstants.UNTITLED_REFERENCE_NAME + (trainingSegmentInfo.HighestRecordingItemIndex + 1),
                                                                                                  this.m_parent.VideoPathValue.Text);

            this.m_parent.SetReferenceDataBindingSource(trainingSegmentInfo.WiimoteReferenceRecords);
        }
Esempio n. 6
0
        public WiimotePlayRecord(TrainingSegmentInfo pTrainingSegmentInfo, string p_RecordName,
                                 DateTime p_RecordedTime, int p_Score)
        {
            ParentRecord = pTrainingSegmentInfo;
//            ParentRecordID = p_ReferenceRecord.RecordID;
            RecordedTime = p_RecordedTime;
            Score        = p_Score;
            RecordName   = p_RecordName;

            TrainingSegmentInfo.HighestPlayIndex++;
        }
Esempio n. 7
0
        private void continueTraining(VideoUserOptions pOptions)
        {
            try
            {
                if (!mTrainingStarted)
                {
                    initializeTraining();
                }

                if (mCurrentVideoIndex == mVideoInfoList.Count)
                {
                    return;
                }

                mCurrentTrainingSegment = mVideoInfoList[mCurrentVideoIndex];
                playTrainingVideo(pOptions);
            }
            catch (WiimoteConnectionException ex)
            {
                throw ex;
            }
        }
Esempio n. 8
0
        public void initializeTraining()
        {
            try
            {
//                mWiimotes.connectWiimotes(Configuration.getConfiguration().MaxWiimoteConnectionTries);
                initializeFeedback();
                loadTrainingVideoInfoData();

                if (mVideoInfoList.Count == 0)
                {
                    return; // throw exception here
                }
                mTrainingStarted           = true;
                mCurrentTrainingSegment    = mVideoInfoList[0];
                this.RepeatCommand.Enabled = true;
            }
            catch (WiimoteConnectionException ex)
            {
                Console.WriteLine(ex);
                throw ex;
            }
        }
Esempio n. 9
0
        internal void SetCurentPlayName()
        {
            if (mVideoInfoList.Count == 0)
            {
                MessageBox.Show("Training Data not Loaded",
                                "Tap Rapper Says", MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }

            // InvokeRequired required compares the thread ID of the
            // calling thread to the thread ID of the creating thread.
            // If these threads are different, it returns true.
            if (this.currentPlayName.InvokeRequired)
            {
                SetCurentPlayNameCallback d = new SetCurentPlayNameCallback(SetCurentPlayName);
                this.Invoke(d, new object[] { });
            }
            else
            {
                TrainingSegmentInfo lNextTrainingSegment = mVideoInfoList[mCurrentVideoIndex];
                this.currentPlayName.Text = ProjectConstants.TRAINING_CURRENT_PLAY_HEADING + "\r\n" + lNextTrainingSegment.TrainingReferenceRecord.RecordName;
            }
        }
        public void trainingSegmentInfoRowReferencePageSelected(DataGridViewRow lTableReferenceRow)
        {
            TrainingSegmentInfo trainingSegmentInfo = (TrainingSegmentInfo)lTableReferenceRow.DataBoundItem;

            this.m_parent.SetReferenceDataBindingSource(trainingSegmentInfo.WiimoteReferenceRecords);
        }