private void DoValidate() { TransitionFullScan.ValidateRange(Start, TransitionFullScan.MIN_PRECURSOR_MULTI_FILTER, TransitionFullScan.MAX_PRECURSOR_MULTI_FILTER, Resources.IsolationWindow_DoValidate_Isolation_window_Start_must_be_between__0__and__1__); TransitionFullScan.ValidateRange(End, TransitionFullScan.MIN_PRECURSOR_MULTI_FILTER, TransitionFullScan.MAX_PRECURSOR_MULTI_FILTER, Resources.IsolationWindow_DoValidate_Isolation_window_End_must_be_between__0__and__1__); if (Start >= End) { throw new InvalidDataException(Resources.IsolationWindow_DoValidate_Isolation_window_Start_value_is_greater_than_the_End_value); } if (Target.HasValue && (Target.Value < Start || Target.Value >= End)) { throw new InvalidDataException(Resources.IsolationWindow_DoValidate_Target_value_is_not_within_the_range_of_the_isolation_window); } if (StartMargin.HasValue) { if (StartMargin.Value < 0) { throw new InvalidDataException(Resources.IsolationWindow_DoValidate_Isolation_window_margin_must_be_non_negative); } if (EndMargin.HasValue) { if (EndMargin.Value < 0) { throw new InvalidDataException(Resources.IsolationWindow_DoValidate_Isolation_window_margin_must_be_non_negative); } } if (IsolationStart >= IsolationEnd) { // If the margins are too large, clipping at the ends of the instrument range may result in no useable window area. throw new InvalidDataException(Resources.IsolationWindow_DoValidate_Isolation_window_margins_cover_the_entire_isolation_window_at_the_extremes_of_the_instrument_range); } } }
private void DoValidate() { SpecialHandlingType.Validate(SpecialHandling); if (PrecursorFilter != null) { if (PrespecifiedIsolationWindows.Count > 0) { throw new InvalidDataException(Resources.IsolationScheme_DoValidate_Isolation_scheme_cannot_have_a_filter_and_a_prespecifed_isolation_window); } TransitionFullScan.ValidateRange(PrecursorFilter, TransitionFullScan.MIN_PRECURSOR_MULTI_FILTER, TransitionFullScan.MAX_PRECURSOR_MULTI_FILTER, Resources.IsolationScheme_DoValidate_The_precursor_m_z_filter_must_be_between__0__and__1_); if (PrecursorRightFilter.HasValue) { TransitionFullScan.ValidateRange(PrecursorRightFilter, TransitionFullScan.MIN_PRECURSOR_MULTI_FILTER, TransitionFullScan.MAX_PRECURSOR_MULTI_FILTER, Resources.IsolationScheme_DoValidate_The_precursor_m_z_filter_must_be_between__0__and__1_); } if (WindowsPerScan.HasValue) { throw new InvalidDataException(Resources.IsolationScheme_DoValidate_Isolation_scheme_can_specify_multiplexed_windows_only_for_prespecified_isolation_windows); } } else if (PrecursorRightFilter != null) { throw new InvalidDataException(Resources.IsolationScheme_DoValidate_Isolation_scheme_cannot_have_a_right_filter_without_a_left_filter); } else { if (PrespecifiedIsolationWindows.Count != 0 && IsAllIons) { throw new InvalidDataException(Resources.IsolationScheme_DoValidate_Isolation_scheme_for_all_ions_cannot_contain_isolation_windows); } if (Equals(SpecialHandling, SpecialHandlingType.MULTIPLEXED)) { if (!WindowsPerScan.HasValue || WindowsPerScan.Value < 1) { throw new InvalidDataException(Resources.IsolationScheme_DoValidate_Multiplexed_windows_require_at_least_one_window_per_scan); } if (PrespecifiedIsolationWindows.Count % WindowsPerScan.Value != 0) { throw new InvalidDataException(Resources.IsolationScheme_DoValidate_The_number_of_prespecified_isolation_windows_must_be_a_multiple_of_the_windows_per_scan_in_multiplexed_sampling); } } else { if (WindowsPerScan.HasValue) { throw new InvalidDataException(Resources.IsolationScheme_DoValidate_Windows_per_scan_requires_multiplexed_isolation_windows); } } } }