public MetricDisplay(string name, SchedulingMetrics metrics = (SchedulingMetrics)(-1)) { Name = name; Metrics = metrics; }
public override void UpdateGraph(bool selectionChanged) { SrmDocument document = !_exportMethodDlg ? GraphSummary.DocumentUIContainer.DocumentUI : Program.MainWindow.DocumentUI; var windows = ScheduleWindows; var brukerTemplate = BrukerTemplateFile; var brukerMetricType = BrukerMetricType; // No need to re-graph for a selection change if (ReferenceEquals(document, _documentShowing) && ArrayUtil.EqualsDeep(windows, _windowsShowing) && Equals(BrukerTemplateFile, _brukerTemplate) && Equals(BrukerMetricType, _brukerMetricType)) { return; } _documentShowing = document; _windowsShowing = windows; _brukerTemplate = brukerTemplate; _brukerMetricType = brukerMetricType; // TODO: Make it possible to see transition scheduling when full-scan enabled. if (string.IsNullOrEmpty(brukerTemplate)) { XAxis.Title.Text = Resources.RTScheduleGraphPane_RTScheduleGraphPane_Scheduled_Time; YAxis.Title.Text = document.Settings.TransitionSettings.FullScan.IsEnabledMsMs ? Resources.RTScheduleGraphPane_UpdateGraph_Concurrent_Precursors : Resources.RTScheduleGraphPane_UpdateGraph_Concurrent_Transitions; } else if (BrukerMetrics == null) { XAxis.Title.Text = Resources.RTScheduleGraphPane_RTScheduleGraphPane_Scheduled_Time; YAxis.Title.Text = Resources.RTScheduleGraphPane_UpdateGraph_Concurrent_Accumulations; } else { switch (brukerMetricType) { case SchedulingMetrics.CONCURRENT_FRAMES: XAxis.Title.Text = Resources.RTScheduleGraphPane_RTScheduleGraphPane_Scheduled_Time; YAxis.Title.Text = Resources.RTScheduleGraphPane_UpdateGraph_Concurrent_frames; break; case SchedulingMetrics.MAX_SAMPLING_TIMES: XAxis.Title.Text = Resources.RTScheduleGraphPane_UpdateGraph_Target; YAxis.Title.Text = Resources.RTScheduleGraphPane_UpdateGraph_Max_sampling_times; break; case SchedulingMetrics.MEAN_SAMPLING_TIMES: XAxis.Title.Text = Resources.RTScheduleGraphPane_UpdateGraph_Target; YAxis.Title.Text = Resources.RTScheduleGraphPane_UpdateGraph_Mean_sampling_times; break; case SchedulingMetrics.REDUNDANCY_OF_TARGETS: XAxis.Title.Text = Resources.RTScheduleGraphPane_RTScheduleGraphPane_Scheduled_Time; YAxis.Title.Text = Resources.RTScheduleGraphPane_UpdateGraph_Redundancy_of_targets; break; case SchedulingMetrics.TARGETS_PER_FRAME: XAxis.Title.Text = Resources.RTScheduleGraphPane_RTScheduleGraphPane_Scheduled_Time; YAxis.Title.Text = Resources.RTScheduleGraphPane_UpdateGraph_Targets_per_frame; break; } } CurveList.Clear(); using (var longWait = new LongWaitDlg()) { longWait.PerformWork(null, 800, progressMonitor => { AddCurve(document, Color.Blue, progressMonitor); for (int i = 0; i < windows.Length; i++) { double window = windows[i]; // Do not show the window used by the current document twice. if (window == GetSchedulingWindow(document)) { continue; } var settings = document.Settings.ChangePeptidePrediction(p => p.ChangeMeasuredRTWindow(window)); if (settings.PeptideSettings.Prediction.RetentionTime != null) { settings = settings.ChangePeptidePrediction(p => p.ChangeRetentionTime(p.RetentionTime.ChangeTimeWindow(window))); } var docWindow = document.ChangeSettings(settings); AddCurve(docWindow, COLORS_WINDOW[(i + 1) % COLORS_WINDOW.Count], progressMonitor); } }); } AxisChange(); }