Skip to content

Commit

Permalink
Fix inconsistent formatting of MS vs MS/MS resolution values in Trans…
Browse files Browse the repository at this point in the history
…ition Settings > Full Scan dialog (#3313)
  • Loading branch information
bspratt authored Jan 4, 2025
1 parent ba52cca commit bea602a
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit bea602a

Please sign in to comment.