private void comboAcquisitionMethod_SelectedIndexChanged(object sender, EventArgs e) { var acquisitionMethod = AcquisitionMethod; if (acquisitionMethod == FullScanAcquisitionMethod.None) { EnableIsolationScheme(false); // Selection change should set filter m/z textbox correctly comboProductAnalyzerType.SelectedIndex = -1; comboProductAnalyzerType.Enabled = false; comboIsolationScheme.SelectedIndex = -1; comboIsolationScheme.Enabled = false; } else { EnableIsolationScheme(acquisitionMethod == FullScanAcquisitionMethod.DIA); // If the combo is being set to the type it started with, use the starting values if (acquisitionMethod == FullScan.AcquisitionMethod) { if (!comboProductAnalyzerType.Enabled) { comboProductAnalyzerType.SelectedItem = TransitionFullScan.MassAnalyzerToString(FullScan.ProductMassAnalyzer); } } else { if (!comboProductAnalyzerType.Enabled) { comboProductAnalyzerType.SelectedItem = comboPrecursorAnalyzerType.SelectedItem != null ? comboPrecursorAnalyzerType.SelectedItem.ToString() : TransitionFullScan.MassAnalyzerToString(FullScanMassAnalyzerType.centroided); } } comboProductAnalyzerType.Enabled = true; } FullScanEnabledChanged?.Invoke(new FullScanEnabledChangeEventArgs(null, comboProductAnalyzerType.Enabled));// Fire event so Filter iontypes settings can update as needed UpdateRetentionTimeFilterUi(); }
private void comboPrecursorIsotopes_SelectedIndexChanged(object sender, EventArgs e) { var precursorIsotopes = PrecursorIsotopesCurrent; bool percentType = (precursorIsotopes == FullScanPrecursorIsotopes.Percent); labelPrecursorIsotopeFilter.Text = percentType ? Resources.TransitionSettingsUI_comboPrecursorIsotopes_SelectedIndexChanged_Min_percent_of_base_peak : Resources.TransitionSettingsUI_comboPrecursorIsotopes_SelectedIndexChanged_Peaks; labelPrecursorIsotopeFilterPercent.Visible = percentType; if (precursorIsotopes == FullScanPrecursorIsotopes.None) { textPrecursorIsotopeFilter.Text = string.Empty; textPrecursorIsotopeFilter.Enabled = false; comboEnrichments.SelectedIndex = -1; comboEnrichments.Enabled = false; // Selection change should set filter m/z textbox correctly comboPrecursorAnalyzerType.SelectedIndex = -1; comboPrecursorAnalyzerType.Enabled = false; } else { // If the combo is being set to the type it started with, use the starting values if (precursorIsotopes == FullScan.PrecursorIsotopes) { textPrecursorIsotopeFilter.Text = FullScan.PrecursorIsotopeFilter.HasValue ? FullScan.PrecursorIsotopeFilter.Value.ToString(LocalizationHelper.CurrentCulture) : string.Empty; if (FullScan.IsotopeEnrichments != null) { comboEnrichments.SelectedItem = FullScan.IsotopeEnrichments.Name; } if (!comboPrecursorAnalyzerType.Enabled) { comboPrecursorAnalyzerType.SelectedItem = TransitionFullScan.MassAnalyzerToString(FullScan.PrecursorMassAnalyzer); } } else { textPrecursorIsotopeFilter.Text = (percentType ? TransitionFullScan.DEFAULT_ISOTOPE_PERCENT : TransitionFullScan.DEFAULT_ISOTOPE_COUNT).ToString(LocalizationHelper.CurrentCulture); var precursorMassAnalyzer = PrecursorMassAnalyzer; bool qitInvalid = percentType && precursorMassAnalyzer == FullScanMassAnalyzerType.qit; if (!comboPrecursorAnalyzerType.Enabled || qitInvalid) { comboPrecursorAnalyzerType.SelectedItem = comboProductAnalyzerType.SelectedItem == null || (qitInvalid && ProductMassAnalyzer == FullScanMassAnalyzerType.qit) ? TransitionFullScan.MassAnalyzerToString(FullScanMassAnalyzerType.centroided) : comboProductAnalyzerType.SelectedItem.ToString(); comboEnrichments.SelectedItem = IsotopeEnrichmentsList.GetDefault().Name; } } comboEnrichments.Enabled = (comboEnrichments.SelectedIndex != -1); textPrecursorIsotopeFilter.Enabled = true; comboPrecursorAnalyzerType.Enabled = true; } FullScanEnabledChanged?.Invoke(new FullScanEnabledChangeEventArgs(comboPrecursorAnalyzerType.Enabled, null)); // Fire event so Filter iontypes settings can update as needed UpdateRetentionTimeFilterUi(); }