using Microsoft.AspNetCore.Components; using MP.MONO.Data; using MP.MONO.UI.Data; namespace MP.MONO.UI.Components { public partial class ToolsPlotRaw { #region Public Properties [Parameter] public List LevelVal { get; set; } = new List(); public string ToolId { get => _selTool.Replace(" ", "_"); } [Parameter] public string SelectedTool { get => _selTool; set => _selTool = value; } #endregion Public Properties #region Protected Fields protected DateTime lastRec = DateTime.Now.AddMinutes(-1); protected Dictionary listMaxVal = new Dictionary(); protected Dictionary listMinVal = new Dictionary(); #endregion Protected Fields #region Protected Properties protected DataLogFilter _SelFilter { get; set; } = new DataLogFilter(); protected string _selTool { get; set; } = ""; protected string? MaxVal { get { string answ = "0"; if (listMaxVal != null && listMaxVal.Count > 0) { answ = listMaxVal[SelectedTool] ?? "0"; } return answ; } } protected string? MinVal { get { string answ = "0"; if (listMinVal != null && listMinVal.Count > 0) { answ = listMinVal[SelectedTool] ?? "0"; } return answ; } } #endregion Protected Properties #region Protected Methods protected List getFillColors(string alpha) { List answ = new List(); answ.Add($"rgba(108, 214, 164, {alpha})"); return answ; } protected List getLineColors(string alpha) { List answ = new List(); answ.Add($"rgba(54, 204, 82, {alpha})"); return answ; } protected List getPointColors(string alpha) { List answ = new List(); answ.Add($"rgba(108, 158, 118, {alpha})"); return answ; } protected override async Task OnInitializedAsync() { isLoading = true; await Task.Delay(1); } protected override async Task OnParametersSetAsync() { await ReloadData(); await Task.Delay(1); } protected async Task ReloadData() { await Task.Delay(1); isLoading = false; } #endregion Protected Methods #region Private Properties private DateTime EndDate { get => _SelFilter.DtEnd; } private bool isLoading { get; set; } = false; private DateTime StartDate { get => _SelFilter.DtStart; } #endregion Private Properties } }