Example #1
0
        private void dataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            var maxQValue = 0.05;
            var mostRecentFilter = session.Query<PersistentDataFilter>().OrderByDescending(o => o.Id).FirstOrDefault();
            if (mostRecentFilter != null)
                maxQValue = mostRecentFilter.MaximumQValue;

            if (e.ColumnIndex == quantitationSettingsColumn.Index)
            {
                var row = dataGridView.Rows[e.RowIndex];
                var method = QuantitationMethodForRow(e.RowIndex);
                if (method == QuantitationMethod.None)
                    return;

                var currentXicConfig = new Embedder.XICConfiguration();
                var currentQuantitationConfig = new Embedder.QuantitationConfiguration();
                if (IsLabelFree(method))
                {
                    currentXicConfig = (row.Cells[quantitationSettingsColumn.Index].Value as Embedder.XICConfiguration) ?? currentXicConfig;

                    var quantSettingsForm = new QuantitationSettingsForm((row.Cells[quantitationSettingsColumn.Index].Value as Embedder.XICConfiguration), _defaultIsobaricConfig, maxQValue);
                    if (quantSettingsForm.ShowDialog() == DialogResult.OK)
                    {
                        row.Cells[quantitationSettingsColumn.Index].Value = quantSettingsForm.XicConfig;
                        _xicConfigBySource[e.RowIndex] = quantSettingsForm.XicConfig;
                    }
                }
                else if (IsIsobaric(method))
                {
                    currentQuantitationConfig = (row.Cells[quantitationSettingsColumn.Index].Value as Embedder.QuantitationConfiguration) ?? currentQuantitationConfig;

                    var quantSettingsForm = new QuantitationSettingsForm(_defaultXicConfig, (row.Cells[quantitationSettingsColumn.Index].Value as Embedder.QuantitationConfiguration), maxQValue);
                    if (quantSettingsForm.ShowDialog() == DialogResult.OK)
                    {
                        row.Cells[quantitationSettingsColumn.Index].Value = quantSettingsForm.IsobaricConfig;
                        _isobaricConfigBySource[e.RowIndex] = quantSettingsForm.IsobaricConfig;
                    }
                }
            }
        }
Example #2
0
        private void defaultXICSettingsButton_Click(object sender, EventArgs e)
        {
            var maxQValue = 0.05;
            var mostRecentFilter = session.Query<PersistentDataFilter>().OrderByDescending(o => o.Id).FirstOrDefault();
            if (mostRecentFilter != null)
                maxQValue = mostRecentFilter.MaximumQValue;

            var quantitationSettingsForm = new QuantitationSettingsForm(_defaultXicConfig, _defaultIsobaricConfig, maxQValue);
            if (quantitationSettingsForm.ShowDialog() == DialogResult.OK)
            {
                foreach (DataGridViewRow row in dataGridView.Rows)
                {
                    var method = QuantitationMethodForRow(row.Index);
                    if (IsLabelFree(method))
                        row.Cells[quantitationSettingsColumn.Index].Value = quantitationSettingsForm.XicConfig;
                    else if (IsIsobaric(method))
                        row.Cells[quantitationSettingsColumn.Index].Value = quantitationSettingsForm.IsobaricConfig;
                    else
                        row.Cells[quantitationSettingsColumn.Index].Value = "n/a";
                }
                _defaultIsobaricConfig = quantitationSettingsForm.IsobaricConfig;
                _defaultXicConfig = quantitationSettingsForm.XicConfig;
            }
        }