using SkiaSharp;
namespace HC_APTBS.ViewModels
{
///
/// Container ViewModel holding two real-time pressure traces:
/// one for P1 (bench oil pressure) and one for P2 (analogue sensor 2).
/// Reuses — the chart primitive is
/// identical, only the series colours and titles differ.
///
public sealed class PressureTraceChartViewModel
{
/// Chart for P1 (red line).
public SingleFlowChartViewModel P1 { get; }
= new("P1 (bar)", new SKColor(0xD6, 0x28, 0x28));
/// Chart for P2 (cyan line).
public SingleFlowChartViewModel P2 { get; }
= new("P2 (bar)", new SKColor(0x00, 0xB4, 0xD8));
///
/// Appends a sample pair to both traces.
/// Must be called on the UI thread.
///
public void AddSamples(double p1, double p2)
{
P1.AddValue(p1);
P2.AddValue(p2);
}
/// Clears both traces.
public void Clear()
{
P1.Clear();
P2.Clear();
}
}
}