Tentativo di passaggio minval maxval per plot parametri

This commit is contained in:
marco.salvi
2022-03-10 10:23:27 +01:00
parent 78d3929615
commit adcbdd7ba0
4 changed files with 70 additions and 28 deletions
+25 -17
View File
@@ -7,10 +7,12 @@
@inject CurrentDataService MMDataService
<div class="row">
<div class="col-12" align="center">
<b>@SelectedParam</b> - <i>@(LevelVal.Count) rec</i>
<div align="right">
<div class="d-flex justify-content-between mb-2">
<div class="px-1">
<b>@SelectedParam</b>
</div>
<div class="px-1">
<div class=" input-group input-group-sm">
<button class="btn btn-primary" @onclick="() => toggleParam()">
@if (showParam)
{
@@ -20,29 +22,35 @@
{
<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)
@if (showParam)
{
<div>
<b>Num Val</b> <input @bind="@maxRecord" /> <b>Sample sec time</b> <input @bind="@sampleSecMin" />
</div>
}*@
<span class="input-group-text small">Num Rec</span>
<input class="form-control" @bind="@maxRecord" />
<span class="input-group-text small">Sample Sec Time</span>
<input class="form-control" @bind="@sampleSecMin" />
}
</div>
@*@if (showParam)
{
<div>
<b>Num Val</b> <input @bind="@maxRecord" /> <b>Sample sec time</b> <input @bind="@sampleSecMin" />
</div>
}*@
</div>
<div class="col-12">
</div>
<div class="d-flex">
<div class="px-1 flex-fill">
@if (LevelVal == null || LevelVal.Count == 0)
{
<LoadingDataSmall></LoadingDataSmall>
}
else
{
<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>
<MP.MONO.UI.Components.Chart.Line AspRatio="4" DataTS="@LevelVal" lineColor="@getLineColors("0.75")" backColor="@getFillColors("0.25")" pointColor="@getPointColors("1")" lTens="0" MinValue="MInVal" MaxValue="MaxVal"></MP.MONO.UI.Components.Chart.Line>
}
</div>
</div>
+11
View File
@@ -15,6 +15,8 @@ namespace MP.MONO.UI.Components
protected int sampleSecMin = 1;
private List<DisplayDataDTO>? ListRecords { get; set; } = null;
//protected string cssSel(string ParamName)
//{
// string answ = ParamName == SelVal ? "fa-solid fa-chevron-right" : "";
@@ -79,6 +81,10 @@ namespace MP.MONO.UI.Components
showParam = !showParam;
}
protected string? MinVal { get; set; } = null;
protected string? MaxVal { get; set; } = null;
//private int inputValue = 123;
private void ParametersPipe_EA_NewMessage(object? sender, EventArgs e)
{
@@ -95,6 +101,11 @@ namespace MP.MONO.UI.Components
if (ListRecords != null)
{
var newData = ListRecords.Where(x => x.Title == SelectedParam).FirstOrDefault();
if (string.IsNullOrEmpty(MinVal) || string.IsNullOrEmpty(MaxVal))
{
MinVal = $"{newData.MinVal:N0}" ;
MaxVal = $"{newData.MaxVal:N0}";
}
// lo accodo
if (newData != null)
{
+1 -11
View File
@@ -36,14 +36,4 @@
@code {
protected string selParam { get; set; } = "";
protected void resetSel()
{
selParam = "";
}
protected void paramSelected(string paramName)
{
selParam = paramName;
}
}
+33
View File
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using MP.MONO.UI;
using MP.MONO.UI.Shared;
using MP.MONO.UI.Components;
namespace MP.MONO.UI.Pages
{
public partial class Parameters
{
protected string selParam { get; set; } = "";
protected void resetSel()
{
selParam = "";
}
protected void paramSelected(string paramName)
{
selParam = paramName;
}
}
}