COmpletato display x integrazione dichiarazioni operatore

This commit is contained in:
Samuele Locatelli
2022-02-26 18:16:21 +01:00
parent efa11f9452
commit 2e2639b94f
17 changed files with 197 additions and 316 deletions
@@ -14,75 +14,6 @@ namespace MP.Stats.Components
protected const string EsitoOK = "Esito: OK";
protected object lineChartOptions = new
{
Scales = new
{
XAxes = new object[]
{
new {
Display = true
}
},
YAxes = new object[]
{
new {
Display = true,
ticks= new {
suggestedMin = 0
}
}
}
},
Tooltips = new
{
Mode = "nearest",
Intersect = false
},
Hover = new
{
Mode = "nearest",
Intersect = false
},
Animation = false,
AspectRatio = 4.9
};
protected object pieChartOptions = new
{
Scales = new
{
XAxes = new object[]
{
new {
Display = false
}
},
YAxes = new object[]
{
new {
Display = false
}
}
},
Legend = new
{
Display = false
},
Tooltips = new
{
Mode = "nearest",
Intersect = false
},
Hover = new
{
Mode = "nearest",
Intersect = false
},
Animation = false,
AspectRatio = 1
};
#endregion Protected Fields
#region Private Properties
+55 -57
View File
@@ -1,19 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components;
using MP.Data;
using MP.Stats.Data;
using System;
using System.Collections.Generic;
using System.Linq;
namespace MP.Stats.Components
{
public partial class ChartOEE
{
#region Protected Fields
#region Private Properties
private List<double> DatiParetoOee
{
get => ParetoData.Select(x => x.value).ToList();
}
#endregion Protected Fields
private List<chartJsData.chartJsTSerie> DatiTrs
{
get => TSData;
}
private List<string> LabelParetoOee
{
get => ParetoData.Select(x => x.label).ToList();
}
private List<string> LabelTrs
{
get => TSData.Select(r => $"{r.x:yyyy-MM-dd}").ToList();
}
#endregion Private Properties
#region Protected Properties
@@ -21,6 +39,36 @@ namespace MP.Stats.Components
protected List<MP.Data.DatabaseModels.TurniOee> _rawData { get; set; } = new List<MP.Data.DatabaseModels.TurniOee>();
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> bgColors
{
get => semaphColors(ParetoData.Count, "0.3");
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> lineColor
{
get => solidColors("1");
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> lineColors
{
get => semaphColors(ParetoData.Count, "1");
}
[Inject]
protected MessageService MessageService { get; set; }
@@ -55,25 +103,6 @@ namespace MP.Stats.Components
#region Private Methods
private List<double> DatiParetoOee
{
get => ParetoData.Select(x => x.value).ToList();
}
private List<string> LabelParetoOee
{
get => ParetoData.Select(x => x.label).ToList();
}
private List<chartJsData.chartJsTSerie> DatiTrs
{
get => TSData;
}
private List<string> LabelTrs
{
get => TSData.Select(r => $"{r.x:yyyy-MM-dd}").ToList();
}
private Dictionary<DateTime, double> calcTSData(DateTime inizio, List<double> yData)
{
Dictionary<DateTime, double> answ = new Dictionary<DateTime, double>();
@@ -88,7 +117,6 @@ namespace MP.Stats.Components
return answ;
}
private void recalcData()
{
if (RawData != null)
@@ -149,36 +177,6 @@ namespace MP.Stats.Components
return answ;
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> lineColor
{
get => solidColors("1");
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> lineColors
{
get => semaphColors(ParetoData.Count, "1");
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> bgColors
{
get => semaphColors(ParetoData.Count, "0.3");
}
#endregion Protected Methods
}
}
+57 -131
View File
@@ -1,10 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components;
using MP.Data;
using MP.Stats.Data;
using System.Collections.Generic;
using System.Linq;
namespace MP.Stats.Components
{
@@ -16,88 +14,68 @@ namespace MP.Stats.Components
protected const string EsitoOK = "Esito: OK";
protected object lineChartOptions = new
{
Scales = new
{
XAxes = new object[]
{
new {
Display = true
}
},
YAxes = new object[]
{
new {
Display = true,
ticks= new {
suggestedMin = 0
}
}
}
},
Tooltips = new
{
Mode = "nearest",
Intersect = false
},
Hover = new
{
Mode = "nearest",
Intersect = false
},
Animation = false,
AspectRatio = 4.9
};
protected object pieChartOptions = new
{
Scales = new
{
XAxes = new object[]
{
new {
Display = false
}
},
YAxes = new object[]
{
new {
Display = false
}
}
},
Legend = new
{
Display = false
},
Tooltips = new
{
Mode = "nearest",
Intersect = false
},
Hover = new
{
Mode = "nearest",
Intersect = false
},
Animation = false,
AspectRatio = 1
};
#if false
protected PieChart<double> PieVC = new PieChart<double>();
protected LineChart<double> TimeSerieVC = new LineChart<double>();
#endif
#endregion Protected Fields
#region Private Properties
private List<double> DatiPareto
{
get => ParetoData.Select(x => x.value).ToList();
}
private List<chartJsData.chartJsTSerie> DatiPlot
{
get => TSData;
}
private List<string> LabelPareto
{
get => ParetoData.Select(x => x.label).ToList();
}
private List<string> LabelPlot
{
get => TSData.Select(r => $"{r.x:yyyy-MM-dd}").ToList();
}
#endregion Private Properties
#region Protected Properties
protected SelectData _currFilter { get; set; } = new SelectData();
protected List<MP.Data.DatabaseModels.UserActionLog> _rawData { get; set; } = new List<MP.Data.DatabaseModels.UserActionLog>();
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> bgColors
{
get => semaphColors(ParetoData.Count, "0.3");
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> lineColor
{
get => solidColors("1");
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> lineColors
{
get => semaphColors(ParetoData.Count, "1");
}
[Inject]
protected MessageService MessageService { get; set; }
@@ -132,7 +110,6 @@ namespace MP.Stats.Components
#region Private Methods
private List<string> GetLineChartLabels()
{
var answ = TSData.Select(x => x.x.ToString("ddd dd.MM")).ToList();
@@ -161,7 +138,6 @@ namespace MP.Stats.Components
#region Protected Methods
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
@@ -199,56 +175,6 @@ namespace MP.Stats.Components
return answ;
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> bgColors
{
get => semaphColors(ParetoData.Count, "0.3");
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> lineColor
{
get => solidColors("1");
}
/// <summary>
/// Genera colori sfondo 33% rosso / arancione / giallo
/// </summary>
/// <param name="numRecords"></param>
/// <returns></returns>
protected List<string> lineColors
{
get => semaphColors(ParetoData.Count, "1");
}
private List<double> DatiPareto
{
get => ParetoData.Select(x => x.value).ToList();
}
private List<chartJsData.chartJsTSerie> DatiPlot
{
get => TSData;
}
private List<string> LabelPareto
{
get => ParetoData.Select(x => x.label).ToList();
}
private List<string> LabelPlot
{
get => TSData.Select(r => $"{r.x:yyyy-MM-dd}").ToList();
}
#endregion Protected Methods
}
}
+15 -1
View File
@@ -34,7 +34,7 @@
<div class="col">
<div class="form-group mb-0">
<label for="idxMacc" class="small">macchina:</label>
<InputSelect @bind-Value="@IdxMacchina" id="maccSel" class="form-control form-control-sm" title="idxMacc">
<InputSelect @bind-Value="@IdxMacchina" id="maccSel" class="form-control form-control-sm" title="Macchina">
@foreach (var item in ddlMacchine)
{
<option value="@item.ValueField">@item.LabelField</option>
@@ -42,6 +42,20 @@
</InputSelect>
</div>
</div>
@if (ActionsEnabled)
{
<div class="col">
<div class="form-group mb-0">
<label for="idxMacc" class="small">azione:</label>
<InputSelect @bind-Value="@Azione" id="azioneSel" class="form-control form-control-sm" title="Azione">
@foreach (var item in ddlAzioni)
{
<option value="@item.ValueField">@item.LabelField</option>
}
</InputSelect>
</div>
</div>
}
<div class="col">
<div class="form-group mb-0">
<div class="input-group input-group-sm">
+28 -5
View File
@@ -1,10 +1,9 @@
using System;
using Microsoft.AspNetCore.Components;
using MP.Stats.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using MP.Stats.Components;
using MP.Stats.Data;
namespace MP.Stats.Components
{
@@ -23,12 +22,29 @@ namespace MP.Stats.Components
private List<AutocompleteModel> ddlArticoli { get; set; }
private List<AutocompleteModel> ddlCommesse { get; set; }
private List<AutocompleteModel> ddlMacchine { get; set; }
private List<AutocompleteModel> ddlAzioni { get; set; }
private string selectedSearchValue { get; set; } = "*";
#endregion Private Properties
#region Protected Properties
protected string Azione
{
get
{
return SelFilter.Azione;
}
set
{
if (!SelFilter.Azione.Equals(value))
{
SelFilter.Azione = value;
reportChange();
}
}
}
protected string CodArticolo
{
get
@@ -170,6 +186,12 @@ namespace MP.Stats.Components
[Parameter]
public bool CommessaEnabled { get; set; } = true;
/// <summary>
/// Indica se filtrare ANCHE le azioni (x tab UL)
/// </summary>
[Parameter]
public bool ActionsEnabled { get; set; } = false;
[Parameter]
public EventCallback<SelectData> filterChanged { get; set; }
@@ -190,9 +212,10 @@ namespace MP.Stats.Components
private async Task reloadData()
{
ddlMacchine = await StatService.MachineList();
ddlArticoli = await StatService.ArticoliGetSearch(-1, SearchArt);
ddlAzioni = await StatService.AzioniList();
ddlCommesse = await StatService.CommesseGetSearch(-1, SearchArt);
ddlMacchine = await StatService.MachineList();
}
private void reportChange()