2023-12-17 17:09:39 +00:00
|
|
|
@using ApexCharts
|
|
|
|
@using UI_SequentMicrosystems.Components
|
|
|
|
@using UI_SequentMicrosystems.Services
|
|
|
|
@using UI_SequentMicrosystems.Models
|
|
|
|
|
|
|
|
@inject RTD8TMService _RTD8TMService
|
2024-01-12 08:30:42 +00:00
|
|
|
<ApexChart TItem="RTD8TMPointModel"
|
2023-12-17 17:09:39 +00:00
|
|
|
Title="Temperature"
|
|
|
|
Options="chartOptions"
|
|
|
|
@ref="chart">
|
|
|
|
|
|
|
|
@foreach (byte stack in _RTD8TMService.GetActualData().Keys)
|
|
|
|
{
|
|
|
|
for (byte chanel = 0; chanel < 8; chanel++)
|
|
|
|
{
|
|
|
|
if (_RTD8TMService.GetChanelName(stack, chanel) != "----------")
|
|
|
|
{
|
2024-01-12 08:30:42 +00:00
|
|
|
<ApexPointSeries TItem="RTD8TMPointModel"
|
2023-12-17 17:09:39 +00:00
|
|
|
Items="@_RTD8TMService.GetChartData(stack, chanel)"
|
|
|
|
Name="@(_RTD8TMService.GetChanelName(stack, chanel))"
|
|
|
|
SeriesType="SeriesType.Line"
|
|
|
|
XValue="@(e => e.Time.ToString("HH:mm:ss"))"
|
|
|
|
YValue="@(e => (decimal)e.Value)"
|
|
|
|
OrderBy="e=>e.X" />
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</ApexChart>
|
|
|
|
|
|
|
|
@code {
|
2024-01-12 08:30:42 +00:00
|
|
|
private ApexChart<RTD8TMPointModel> chart;
|
|
|
|
private ApexChartOptions<RTD8TMPointModel> chartOptions;
|
2023-12-17 17:09:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
protected override void OnInitialized()
|
|
|
|
{
|
|
|
|
_RTD8TMService.EventUpdateGraph += UpdateChart;
|
|
|
|
|
|
|
|
|
2024-01-12 08:30:42 +00:00
|
|
|
chartOptions = new ApexChartOptions<RTD8TMPointModel>
|
2023-12-17 17:09:39 +00:00
|
|
|
{
|
|
|
|
Theme = new Theme
|
|
|
|
{
|
|
|
|
Mode = Mode.Dark,
|
|
|
|
},
|
|
|
|
Legend = new Legend
|
|
|
|
{
|
|
|
|
Position = LegendPosition.Bottom,
|
|
|
|
FontSize = "20px",
|
|
|
|
HorizontalAlign = Align.Center
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public async Task UpdateChart(object? o, bool b)
|
|
|
|
{
|
|
|
|
await InvokeAsync(() =>
|
|
|
|
{
|
|
|
|
chart.UpdateSeriesAsync(false);
|
|
|
|
|
|
|
|
StateHasChanged();
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|