Пример #1
0
        /// <summary>
        /// User changed import settings, so update trial import data grid view.
        /// </summary>
        private void UpdatePreview()
        {
            if (!this.isInitializing)
            {
                this.Cursor = Cursors.WaitCursor;

                // Clear preview data grid view
                this.dgvTrialsPreview.Rows.Clear();

                // Save trial start time to trial id assignments if applicable
                if (!this.SaveTrialImportDataGridView())
                {
                    this.Cursor = Cursors.Default;
                    return;
                }

                // Update preview
                switch (this.detectionSetting.ImportType)
                {
                case ImportTypes.Rawdata:
                    foreach (TrialsData trial in ImportRawData.GetTrialList(this.numberOfImportLines))
                    {
                        this.dgvTrialsPreview.Rows.Add(new object[]
                        {
                            trial.SubjectName,
                            trial.TrialSequence,
                            trial.TrialID,
                            trial.Category,
                            trial.TrialStartTime,
                            trial.Duration
                        });
                    }

                    break;

                case ImportTypes.Fixations:
                    var trials = ImportFixations.GetTrialList(this.numberOfImportLines);
                    if (trials == null)
                    {
                        this.DialogResult = DialogResult.Abort;
                        this.Close();
                        break;
                    }

                    foreach (TrialsData trial in trials)
                    {
                        this.dgvTrialsPreview.Rows.Add(new object[]
                        {
                            trial.SubjectName,
                            trial.TrialSequence,
                            trial.TrialID
                        });
                    }

                    break;
                }

                this.Cursor = Cursors.Default;
            }
        }
Пример #2
0
        /// <summary>
        /// User changed import settings, so update image import data grid view.
        /// </summary>
        private void UpdatePreview()
        {
            // Do not call this for every UI component during Form.Load event.
            if (!this.isInitializing)
            {
                this.Cursor = Cursors.WaitCursor;

                // Clear preview data grid view
                this.dgvTrialsPreview.Rows.Clear();

                // Save trialID-Image file assignments if applicable
                if (!this.SaveImageImportDataGridView())
                {
                    this.Cursor = Cursors.Default;
                    return;
                }

                // Update preview
                switch (this.detectionSetting.ImportType)
                {
                case ImportTypes.Rawdata:
                    foreach (TrialsData trial in ImportRawData.GetTrialList(this.numberOfImportLines))
                    {
                        this.dgvTrialsPreview.Rows.Add(
                            new object[]
                        {
                            trial.SubjectName, trial.TrialSequence, trial.TrialID, trial.Category, trial.TrialName,
                            trial.TrialStartTime, trial.Duration
                        });
                    }

                    break;

                case ImportTypes.Fixations:
                    foreach (TrialsData trial in ImportFixations.GetTrialList(this.numberOfImportLines))
                    {
                        this.dgvTrialsPreview.Rows.Add(
                            new object[] { trial.SubjectName, trial.TrialSequence, trial.TrialID, string.Empty, trial.TrialName });
                    }

                    break;
                }

                this.Cursor = Cursors.Default;
            }
        }