/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the TrialVariable class. /// </summary> /// <param name="newFlag">A flag that unique identifies this variable.</param> /// <param name="newColumnName">The short name (8 characters) of the column in which the value should be written.</param> /// <param name="newColumnDescription">The long description of the column that describes the variable.</param> /// <param name="newColumnType">The <see cref="Type"/> of the column contents.</param> /// <param name="newColumnFormat">A <see cref="string"/> with the column formatting. (e.g. "N2")</param> /// <param name="newCheckBox">The <see cref="CheckBox"/> that enables or disables this variable.</param> /// <param name="newReturnValues">A <see cref="string"/> describing the return values of this /// variable.</param> public TrialVariable( TrialParams newFlag, string newColumnName, string newColumnDescription, Type newColumnType, string newColumnFormat, CheckBox newCheckBox, string newReturnValues) : base( newColumnName, newColumnDescription, newColumnType, newColumnFormat, newCheckBox, newReturnValues) { this.paramFlag = newFlag; }
/// <summary> /// The <see cref="Control.Click"/> event handler for the /// <see cref="ToolStripMenuItem"/> <see cref="cmuRemoveColumn"/>. /// Context menu delete column clicked. /// </summary> /// <param name="sender"> /// Source of the event /// </param> /// <param name="e"> /// An empty <see cref="EventArgs"/> /// </param> private void cmuRemoveColumn_Click(object sender, EventArgs e) { int index = this.dGVExportTable.HitTest(this.mouseClickLocation.X, this.mouseClickLocation.Y).ColumnIndex; if (index <= this.dGVExportTable.Columns.Count && index >= 0) { string currentColumnName = this.dGVExportTable.Columns[index].Name; if (this.dGVExportTable.Columns[currentColumnName] != null) { this.dGVExportTable.Columns.Remove(currentColumnName); foreach (DefaultVariable var in this.defaultVariables.Values) { if (var.ColumnName == currentColumnName) { var.CheckBox.Checked = false; if (var is SubjectVariable) { this.subjectParams &= ~((SubjectVariable)var).Flag; } else if (var is TrialVariable) { this.trialParams &= ~((TrialVariable)var).Flag; } else if (var is GazeVariable) { this.gazeParams &= ~((GazeVariable)var).Flag; } else if (var is MouseVariable) { this.mouseParams &= ~((MouseVariable)var).Flag; } break; } } foreach (CustomVariable var in this.gazeCustomParams) { if (var.ColumnName == currentColumnName) { this.gazeCustomParams.Remove(var); break; } } foreach (CustomVariable var in this.mouseCustomParams) { if (var.ColumnName == currentColumnName) { this.mouseCustomParams.Remove(var); break; } } } } }
/// <summary> /// User switched default check box in Tab "Trial information". /// Add referring column to datagridview table and set analysis flag. /// </summary> /// <param name="sender"> /// Source of the event. /// </param> /// <param name="e"> /// An empty <see cref="EventArgs"/> /// </param> private void chbTrialDefault_CheckedChanged(object sender, EventArgs e) { var chbSender = (CheckBox)sender; var var = (TrialVariable)this.defaultVariables[chbSender.Name]; this.InsertOrRemoveColumn(chbSender.Checked, var); if (chbSender.Checked) { this.trialParams |= var.Flag; } else { this.trialParams &= ~var.Flag; } }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the Statistic class. /// Initializes variables to calculate by setting the flag members /// of this Statistics object. /// </summary> /// <param name="newSubjectParams">A <see cref="SubjectParams"/> with the flags set to the /// subject variables that should be calculated.</param> /// <param name="newTrialParams">A <see cref="TrialParams"/> with the flags set to the /// trial variables that should be calculated.</param> /// <param name="newGazeParams">A <see cref="GazeParams"/> with the flags set to the /// gaze variables that should be calculated.</param> /// <param name="newGazeCustomParams">A <see cref="List{CustomVariable}"/> with /// custom defined gaze variables. Will only be used, when <see cref="GazeParams.Custom"/> /// is set.</param> /// <param name="newMouseParams">A <see cref="MouseParams"/> with the flags set to the /// mouse variables that should be calculated.</param> /// <param name="newMouseCustomParams">A <see cref="List{CustomVariable}"/> with /// custom defined mouse variables. Will only be used, when <see cref="MouseParams.Custom"/> /// is set.</param> /// <param name="newTolerance">A <see cref="int"/> tolerance value for /// widening areas of interest to get a better hit rate in pixel.</param> public Statistic( SubjectParams newSubjectParams, TrialParams newTrialParams, GazeParams newGazeParams, List<CustomVariable> newGazeCustomParams, MouseParams newMouseParams, List<CustomVariable> newMouseCustomParams, int newTolerance) { this.subjectParams = newSubjectParams; this.trialParams = newTrialParams; this.gazeParams = newGazeParams; this.gazeCustomParams = newGazeCustomParams != null ? newGazeCustomParams : new List<CustomVariable>(); this.mouseParams = newMouseParams; this.mouseCustomParams = newMouseCustomParams != null ? newMouseCustomParams : new List<CustomVariable>(); tolerance = newTolerance; }