Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inconsistent formatting of MS vs MS/MS resolution values in Transition Settings > Full Scan dialog #3313

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pwiz_tools/Skyline/SettingsUI/FullScanSettingsControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public double? PrecursorRes
double precursorRes;
return double.TryParse(textPrecursorRes.Text, out precursorRes) ? (double?)precursorRes : null;
}
set { textPrecursorRes.Text = FormatPrecursorRes(value, PrecursorMassAnalyzer); }
set { textPrecursorRes.Text = FormatRes(value, PrecursorMassAnalyzer); }
}

public double? PrecursorResMz
Expand All @@ -211,7 +211,7 @@ public double? ProductRes
double productRes;
return double.TryParse(textProductRes.Text, out productRes) ? (double?)productRes : null;
}
set { textProductRes.Text = value.ToString(); }
set { textProductRes.Text = FormatRes(value, ProductMassAnalyzer); }
}

public double? ProductResMz
Expand Down Expand Up @@ -885,7 +885,7 @@ public double TimeAroundPrediction
get { return double.Parse(tbxTimeAroundPrediction.Text); }
}

private static string FormatPrecursorRes(double? resolvingPower, FullScanMassAnalyzerType analyzerType)
private static string FormatRes(double? resolvingPower, FullScanMassAnalyzerType analyzerType)
{
if (!resolvingPower.HasValue)
return string.Empty;
Expand Down Expand Up @@ -921,7 +921,7 @@ public static void SetAnalyzerType(FullScanMassAnalyzerType analyzerTypeNew,
labelTh.Visible = false;
textAt.Visible = false;
textRes.Enabled = true;
textRes.Text = FormatPrecursorRes(
textRes.Text = FormatRes(
resCurrent.HasValue && (analyzerTypeCurrent == analyzerTypeNew)
? resCurrent
: TransitionFullScan.DEFAULT_CENTROIDED_PPM,
Expand Down Expand Up @@ -951,9 +951,9 @@ public static void SetAnalyzerType(FullScanMassAnalyzerType analyzerTypeNew,
}

if (analyzerTypeNew == analyzerTypeCurrent && resCurrent.HasValue)
textRes.Text = FormatPrecursorRes(resCurrent, analyzerTypeNew);
textRes.Text = FormatRes(resCurrent, analyzerTypeNew);
else
textRes.Text = FormatPrecursorRes(TransitionFullScan.DEFAULT_RES_VALUES[(int)analyzerTypeNew], analyzerTypeNew);
textRes.Text = FormatRes(TransitionFullScan.DEFAULT_RES_VALUES[(int)analyzerTypeNew], analyzerTypeNew);

labelAt.Visible = variableRes;
textAt.Visible = variableRes;
Expand Down