Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Samuele Locatelli
2022-03-09 20:01:14 +01:00
5 changed files with 63 additions and 5 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
<ul class="list-group">
@foreach (var item in ListRecords)
{
<li class="list-group-item list-group-item-action" @onclick="() => raiseSelect(item.Title)">
<li class="list-group-item list-group-item-action @cssActive(item.Title)" @onclick="() => raiseSelect(item.Title)">
<div class="row" title="click to show graph">
<div class="col-4">
@if (!string.IsNullOrEmpty(item.CssIcon))
+12 -1
View File
@@ -15,13 +15,22 @@ namespace MP.MONO.UI.Components
#region Private Methods
private string SelVal = "";
[Parameter]
public EventCallback<string> EC_SelValue { get; set; }
protected List<chartJsData.chartJsTSerie> LevelVal = new List<chartJsData.chartJsTSerie>();
protected string cssActive(string ParamName)
{
string answ = ParamName == SelVal ? "bg-dark text-light": "";
return answ;
}
private void ParametersPipe_EA_NewMessage(object? sender, EventArgs e)
{
@@ -53,6 +62,7 @@ namespace MP.MONO.UI.Components
protected async Task ReloadData()
{
SelVal = "";
ListRecords = await MMDataService.MachineParameters();
}
@@ -67,6 +77,7 @@ namespace MP.MONO.UI.Components
protected void raiseSelect(string SelectedValue)
{
SelVal = SelectedValue;
EC_SelValue.InvokeAsync(SelectedValue);
}
+29 -2
View File
@@ -1,12 +1,39 @@
@using MP.MONO.UI.Components
@using MP.MONO.Core.DTO
@using MP.MONO.UI.Data
@using Microsoft.Extensions.Configuration;
@inject IConfiguration Configuration;
@inject CurrentDataService MMDataService
<div class="row">
<div class="col-12">
<div class="col-12" align="center">
<b>@SelectedParam</b> - <i>@(LevelVal.Count) rec</i>
<div align="right">
<button class="btn btn-primary" @onclick="() => toggleParam()">
@if (showParam)
{
<i class="fa-solid fa-chevron-right"></i>
}
else
{
<i class="fa-solid fa-chevron-left"></i>
}
@if (showParam)
{
<div>
<b>Num rec</b> <input @bind="@maxRecord" /> <b>Sample sec time</b> <input @bind="@sampleSecMin" />
</div>
}
</button>
@*@if (showParam)
{
<div>
<b>Num Val</b> <input @bind="@maxRecord" /> <b>Sample sec time</b> <input @bind="@sampleSecMin" />
</div>
}*@
</div>
</div>
<div class="col-12">
@if (LevelVal == null || LevelVal.Count == 0)
@@ -15,7 +42,7 @@
}
else
{
<MP.MONO.UI.Components.Chart.Line AspRatio="2" DataTS="@LevelVal" lineColor="@getLineColors("0.75")" backColor="@getFillColors("0.25")" pointColor="@getPointColors("1")" lTens="0"></MP.MONO.UI.Components.Chart.Line>
<MP.MONO.UI.Components.Chart.Line AspRatio="4" DataTS="@LevelVal" lineColor="@getLineColors("0.75")" backColor="@getFillColors("0.25")" pointColor="@getPointColors("1")" lTens="0"></MP.MONO.UI.Components.Chart.Line>
}
</div>
</div>
+20 -1
View File
@@ -3,6 +3,7 @@ using MP.MONO.Core.DTO;
using MP.MONO.Data;
using Newtonsoft.Json;
namespace MP.MONO.UI.Components
{
public partial class ParamPlot
@@ -12,8 +13,14 @@ namespace MP.MONO.UI.Components
protected DateTime lastRec = DateTime.Now.AddMinutes(-1);
protected int sampleSecMin = 2;
protected int sampleSecMin = 1;
//protected string cssSel(string ParamName)
//{
// string answ = ParamName == SelVal ? "fa-solid fa-chevron-right" : "";
// return answ;
//}
protected string _selParam { get; set; } = "";
@@ -64,7 +71,15 @@ namespace MP.MONO.UI.Components
await Task.Delay(1);
MMDataService.parametersPipe.EA_NewMessage += ParametersPipe_EA_NewMessage;
}
private int maxRecord = 10;
private bool showParam = false;
private void toggleParam()
{
showParam = !showParam;
}
//private int inputValue = 123;
private void ParametersPipe_EA_NewMessage(object? sender, EventArgs e)
{
DateTime adesso = DateTime.Now;
@@ -84,6 +99,10 @@ namespace MP.MONO.UI.Components
if (newData != null)
{
LevelVal.Add(new chartJsData.chartJsTSerie() { x = adesso, y = newData.ValueNum });
if (LevelVal.Count > maxRecord)
{
LevelVal.RemoveRange(0, LevelVal.Count - maxRecord);
}
}
}
}
+1
View File
@@ -18,6 +18,7 @@
"nKey": "MONO",
"sKey": "M3T@n0-CH4"
},
"maxRecord": 15,
"ExternalProviders": {
"MailKit": {
"SMTP": {