public void RemoveAllComparisonItems(bool manageVisibility = true, bool resetSortMode = false) { if (resetSortMode) { _comparisonColorManager.FreeAllColors(); } ComparisonRecords.Clear(); UpdateCharts(); if (resetSortMode) { IsSortModeAscending = false; } if (manageVisibility) { HasComparisonItems = false; } // Manage game name header HasUniqueGameNames = false; CurrentGameName = string.Empty; RemainingRecordingTime = "0.0 s"; UpdateRangeSliderParameter(); ComparisonModel.InvalidatePlot(true); }
private void OnComparisonContextChanged() { ChartLabel[] GetLabels() { return(ComparisonRecords.Select(record => GetChartLabel(record.WrappedRecordInfo)).ToArray()); } void SetLabels(ChartLabel[] labels) { ComparisonRowChartLabels = labels.Select(label => GetHasUniqueGameNames() ? label.Context : $"{label.GameName}{Environment.NewLine}{label.Context}").Reverse().ToArray(); if (IsContextLegendActive) { if (ComparisonModel.Series.Count == ComparisonRecords.Count) { for (int i = 0; i < ComparisonRecords.Count; i++) { ComparisonModel.Series[i].Title = labels[i].Context; } } } } if (ComparisonModel == null) { InitializePlotModel(); } SetLabels(GetLabels()); ComparisonModel.InvalidatePlot(true); }
private void UpdateAxesMinMax(bool invalidatePlot) { if (ComparisonRecords == null || !ComparisonRecords.Any()) { return; } var xAxis = ComparisonModel.GetAxisOrDefault("xAxis", null); var yAxis = ComparisonModel.GetAxisOrDefault("yAxis", null); if (xAxis == null || yAxis == null) { return; } double xMin = 0; double xMax = 0; double yMin = 0; double yMax = 0; double startTime = FirstSeconds; double endTime = _maxRecordingTime - LastSeconds; var sessionParallelQuery = ComparisonRecords.Select(record => record.WrappedRecordInfo.Session).AsParallel(); xMin = sessionParallelQuery.Min(session => { return(session.GetFrametimePointsTimeWindow(startTime, endTime).First().X); }); xMax = sessionParallelQuery.Max(session => { return(session.GetFrametimePointsTimeWindow(startTime, endTime).Last().X); }); yMin = sessionParallelQuery.Min(session => { return(session.GetFrametimePointsTimeWindow(startTime, endTime).Min(pnt => pnt.Y));; }); yMax = sessionParallelQuery.Max(session => { return(session.GetFrametimePointsTimeWindow(startTime, endTime).Max(pnt => pnt.Y)); }); xAxis.Minimum = xMin; xAxis.Maximum = xMax; yAxis.Minimum = yMin - (yMax - yMin) / 6; yAxis.Maximum = yMax + (yMax - yMin) / 6; if (invalidatePlot) { ComparisonModel.InvalidatePlot(true); } }
// partial void xyz -> initialize private void OnShowContextLegendChanged() { if (!ComparisonRecords.Any()) { return; } if (!IsContextLegendActive) { ComparisonModel.Series.ForEach(series => series.Title = null); } else { OnComparisonContextChanged(); } ComparisonModel.InvalidatePlot(true); }
// partial void xyz -> initialize private void OnShowContextLegendChanged() { if (!ComparisonRecords.Any()) { return; } if (!IsContextLegendActive) { ComparisonModel.Series.ForEach(series => series.Title = null); } else { switch (_selectedComparisonContext) { case EComparisonContext.DateTime: SetLabelDateTimeContext(); break; case EComparisonContext.CPU: SetLabelCpuContext(); break; case EComparisonContext.GPU: SetLabelGpuContext(); break; case EComparisonContext.SystemRam: SetLabelSystemRamContext(); break; case EComparisonContext.Custom: SetLabelCustomContext(); break; default: SetLabelDateTimeContext(); break; } } ComparisonModel.InvalidatePlot(true); }
public void RemoveComparisonItem(ComparisonRecordInfoWrapper wrappedComparisonRecordInfo) { _comparisonColorManager.FreeColor(wrappedComparisonRecordInfo.Color); ComparisonRecords.Remove(wrappedComparisonRecordInfo); HasComparisonItems = ComparisonRecords.Any(); UpdateRangeSliderParameter(); UpdateCharts(); UpdateBarChartHeight(); // Manage game name header HasUniqueGameNames = GetHasUniqueGameNames(); if (HasUniqueGameNames) { CurrentGameName = ComparisonRecords.First().WrappedRecordInfo.Game; } ComparisonModel.InvalidatePlot(true); }
private void OnDateTimeContext() { SetLabelDateTimeContext(); ComparisonModel?.InvalidatePlot(true); }
private void OnCpuContext() { SetLabelCpuContext(); ComparisonModel?.InvalidatePlot(true); }
private void OnSystemRamContex() { SetLabelSystemRamContext(); ComparisonModel?.InvalidatePlot(true); }
private void UpdateAxesMinMax() { if (ComparisonRecords == null || !ComparisonRecords.Any()) { return; } var xAxis = ComparisonModel.GetAxisOrDefault("xAxis", null); var yAxis = ComparisonModel.GetAxisOrDefault("yAxis", null); if (xAxis == null || yAxis == null) { return; } xAxis.Reset(); double xMin = 0; double xMax = 0; double yMin = 0; double yMax = 0; double startTime = FirstSeconds; double endTime = LastSeconds; var sessionParallelQuery = ComparisonRecords.Select(record => record.WrappedRecordInfo.Session).AsParallel(); xMin = sessionParallelQuery.Min(session => { var window = session.GetFrametimePointsTimeWindow(startTime, endTime, _appConfiguration); if (window.Any()) { return(window.First().X); } else { return(double.MaxValue); } }); xMax = sessionParallelQuery.Max(session => { var window = session.GetFrametimePointsTimeWindow(startTime, endTime, _appConfiguration); if (window.Any()) { return(window.Last().X); } else { return(double.MinValue); } }); yMin = sessionParallelQuery.Min(session => { var window = session.GetFrametimePointsTimeWindow(startTime, endTime, _appConfiguration); if (window.Any()) { return(window.Min(pnt => pnt.Y)); } else { return(double.MaxValue); } }); yMax = sessionParallelQuery.Max(session => { var window = session.GetFrametimePointsTimeWindow(startTime, endTime, _appConfiguration); if (window.Any()) { return(window.Max(pnt => pnt.Y)); } else { return(double.MinValue); } }); xAxis.Minimum = xMin; xAxis.Maximum = xMax; yAxis.Minimum = yMin - (yMax - yMin) / 6; yAxis.Maximum = yMax + (yMax - yMin) / 6; ComparisonModel.InvalidatePlot(true); }
private void OnDateTimeContext() { _comparisonContext = EComparisonContext.DateTime; SetLabelDateTimeContext(); ComparisonModel.InvalidatePlot(true); }
private void OnCpuContext() { _comparisonContext = EComparisonContext.CPU; SetLabelCpuContext(); ComparisonModel.InvalidatePlot(true); }
private void OnCustomContex() { _comparisonContext = EComparisonContext.Custom; SetLabelCustomContext(); ComparisonModel.InvalidatePlot(true); }
private void OnShowContextLegendChanged() { if (!ComparisonRecords.Any()) { return; } if (!IsContextLegendActive) { ComparisonModel.Series.ForEach(series => series.Title = null); } else { switch (_comparisonContext) { case EComparisonContext.DateTime: if (ComparisonModel.Series.Count == ComparisonRecords.Count) { for (int i = 0; i < ComparisonRecords.Count; i++) { ComparisonModel.Series[i].Title = GetLabelDateTimeContext(ComparisonRecords[i]); } } break; case EComparisonContext.CPU: if (ComparisonModel.Series.Count == ComparisonRecords.Count) { for (int i = 0; i < ComparisonRecords.Count; i++) { ComparisonModel.Series[i].Title = GetLabelCpuContext(ComparisonRecords[i]); } } break; case EComparisonContext.GPU: if (ComparisonModel.Series.Count == ComparisonRecords.Count) { for (int i = 0; i < ComparisonRecords.Count; i++) { ComparisonModel.Series[i].Title = GetLabelGpuContext(ComparisonRecords[i]); } } break; case EComparisonContext.Custom: if (ComparisonModel.Series.Count == ComparisonRecords.Count) { for (int i = 0; i < ComparisonRecords.Count; i++) { ComparisonModel.Series[i].Title = GetLabelCustomContext(ComparisonRecords[i]); } } break; default: if (ComparisonModel.Series.Count == ComparisonRecords.Count) { for (int i = 0; i < ComparisonRecords.Count; i++) { ComparisonModel.Series[i].Title = GetLabelDateTimeContext(ComparisonRecords[i]); } } break; } } ComparisonModel.InvalidatePlot(false); }