2026-03-17 00:43:15 +00:00
|
|
|
|
using OperationControl.ViewModels.Views.Operacao.Monitoramento.Diagnostico;
|
2026-03-11 20:11:17 +00:00
|
|
|
|
|
2026-03-17 00:43:15 +00:00
|
|
|
|
namespace OperationControl.Views.Operacao.Monitoramento
|
2026-03-11 20:11:17 +00:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Interaction logic for DiagnosticoView.xaml
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public partial class DiagnosticoView : System.Windows.Controls.UserControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public DiagnosticoViewModel _vm;
|
|
|
|
|
|
public DiagnosticoView()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
_vm = new DiagnosticoViewModel();
|
|
|
|
|
|
DataContext = _vm;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void AtualizarGraficos()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (pltSaude_Acompanhamento == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
var plot = pltSaude_Acompanhamento.Plot;
|
|
|
|
|
|
plot.Clear();
|
|
|
|
|
|
|
|
|
|
|
|
bool temSeries = false;
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var serie in _vm.SeriesGrafico)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (serie.Valores.Count == 0)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
double[] ys = serie.Valores.ToArray();
|
|
|
|
|
|
double[] xs = Enumerable.Range(0, ys.Length).Select(i => (double)i).ToArray();
|
|
|
|
|
|
|
|
|
|
|
|
var scatter = plot.Add.Scatter(xs, ys);
|
|
|
|
|
|
scatter.LegendText = string.IsNullOrWhiteSpace(serie.Unidade)
|
|
|
|
|
|
? serie.Label
|
|
|
|
|
|
: $"{serie.Label} ({serie.Unidade})";
|
|
|
|
|
|
|
|
|
|
|
|
temSeries = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (temSeries)
|
|
|
|
|
|
plot.ShowLegend(ScottPlot.Alignment.UpperLeft);
|
|
|
|
|
|
|
|
|
|
|
|
plot.Axes.AutoScale();
|
|
|
|
|
|
pltSaude_Acompanhamento.Refresh();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|