mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
31 lines
1006 B
C#
31 lines
1006 B
C#
using System.Collections.ObjectModel;
|
|
using System.Linq;
|
|
using Artemis.Core;
|
|
using Artemis.UI.Shared;
|
|
|
|
namespace Artemis.UI.Screens.Debugger.Performance
|
|
{
|
|
public class PerformanceDebugProfilerViewModel : ViewModelBase
|
|
{
|
|
public PerformanceDebugProfilerViewModel(Profiler profiler)
|
|
{
|
|
Profiler = profiler;
|
|
}
|
|
|
|
public Profiler Profiler { get; }
|
|
|
|
public ObservableCollection<PerformanceDebugMeasurementViewModel> Measurements { get; } = new();
|
|
|
|
public void Update()
|
|
{
|
|
foreach ((string _, ProfilingMeasurement measurement) in Profiler.Measurements)
|
|
{
|
|
if (Measurements.All(m => m.Measurement != measurement))
|
|
Measurements.Add(new PerformanceDebugMeasurementViewModel(measurement));
|
|
}
|
|
|
|
foreach (PerformanceDebugMeasurementViewModel profilingMeasurementViewModel in Measurements)
|
|
profilingMeasurementViewModel.Update();
|
|
}
|
|
}
|
|
} |