diff --git a/MP.Stats/Components/ChartControlli.razor b/MP.Stats/Components/ChartControlli.razor index a92144a3..cadd5525 100644 --- a/MP.Stats/Components/ChartControlli.razor +++ b/MP.Stats/Components/ChartControlli.razor @@ -1,5 +1,4 @@ -@using ChartJs - +
@if (RawData == null || RawData.Count == 0) { diff --git a/MP.Stats/Components/ChartControlli.razor.cs b/MP.Stats/Components/ChartControlli.razor.cs index af3a6685..e391103c 100644 --- a/MP.Stats/Components/ChartControlli.razor.cs +++ b/MP.Stats/Components/ChartControlli.razor.cs @@ -49,7 +49,6 @@ namespace MP.Stats.Components /// /// Genera colori sfondo 33% rosso / arancione / giallo /// - /// /// protected List bgColors { @@ -59,7 +58,6 @@ namespace MP.Stats.Components /// /// Genera colori sfondo 33% rosso / arancione / giallo /// - /// /// protected List lineColor { @@ -67,9 +65,8 @@ namespace MP.Stats.Components } /// - /// Genera colori sfondo 33% rosso / arancione / giallo + /// Genera colori linee 33% rosso / arancione / giallo /// - /// /// protected List lineColors { @@ -132,9 +129,11 @@ namespace MP.Stats.Components #region Protected Methods + /// /// Genera colori sfondo 33% rosso / arancione / giallo /// /// + /// /// protected List semaphColors(int numRecords, string alpha) { @@ -147,9 +146,9 @@ namespace MP.Stats.Components } /// - /// Genera colori sfondo 33% rosso / arancione / giallo + /// Genera colori bordo 33% rosso / arancione / giallo /// - /// + /// /// protected List solidColors(string alpha) { diff --git a/MP.Stats/Components/ChartEnergy.razor b/MP.Stats/Components/ChartEnergy.razor index 202c776f..af03a9bb 100644 --- a/MP.Stats/Components/ChartEnergy.razor +++ b/MP.Stats/Components/ChartEnergy.razor @@ -39,11 +39,11 @@
@if (DynMode) { - + } else { - + }
diff --git a/MP.Stats/Components/ChartEnergy.razor.cs b/MP.Stats/Components/ChartEnergy.razor.cs index f0adf7a3..a87ad1ce 100644 --- a/MP.Stats/Components/ChartEnergy.razor.cs +++ b/MP.Stats/Components/ChartEnergy.razor.cs @@ -14,7 +14,20 @@ namespace MP.Stats.Components #region Public Properties [Parameter] - public bool DynMode { get; set; } = false; + public bool DynMode + { + get => _dynMode; + set + { + // salvo valori + if (_dynMode != value) + { + _dynMode = value; + // ricalcolo charting data + RecalcData(); + } + } + } [Parameter] public EventCallback EC_IdxMaccRem { get; set; } @@ -46,7 +59,6 @@ namespace MP.Stats.Components #region Protected Properties protected SelectData _currFilter { get; set; } = new SelectData(); - protected List _rawData { get; set; } = new List(); /// @@ -129,15 +141,15 @@ namespace MP.Stats.Components #region Private Fields private List lineTitles = new List() { "Consumo/UM" }; - private List listMachine = new List(); - private string pieTitle = "Macchina"; #endregion Private Fields #region Private Properties + private bool _dynMode { get; set; } = false; + private List DatiPareto { get => ParetoData.Select(x => x.value).ToList(); diff --git a/MP.Stats/Components/ChartJs/Line.razor b/MP.Stats/Components/ChartJs/Line.razor index ce32fe35..43e7e55f 100644 --- a/MP.Stats/Components/ChartJs/Line.razor +++ b/MP.Stats/Components/ChartJs/Line.razor @@ -54,6 +54,11 @@ await renderChart(); } + protected override async Task OnParametersSetAsync() + { + await renderChart(); + } + /// /// Inizializzazione rendering componente /// diff --git a/MP.Stats/Components/ChartOEE.razor b/MP.Stats/Components/ChartOEE.razor index 41cd727f..1ee59157 100644 --- a/MP.Stats/Components/ChartOEE.razor +++ b/MP.Stats/Components/ChartOEE.razor @@ -1,5 +1,4 @@ -@using ChartJs - +
@if (RawData == null || RawData.Count == 0) { diff --git a/MP.Stats/Components/ChartOEE.razor.cs b/MP.Stats/Components/ChartOEE.razor.cs index b11a029e..b4424455 100644 --- a/MP.Stats/Components/ChartOEE.razor.cs +++ b/MP.Stats/Components/ChartOEE.razor.cs @@ -42,7 +42,6 @@ namespace MP.Stats.Components /// /// Genera colori sfondo 33% rosso / arancione / giallo /// - /// /// protected List bgColors { @@ -52,7 +51,6 @@ namespace MP.Stats.Components /// /// Genera colori sfondo 33% rosso / arancione / giallo /// - /// /// protected List lineColor { @@ -62,7 +60,6 @@ namespace MP.Stats.Components /// /// Genera colori sfondo 33% rosso / arancione / giallo /// - /// /// protected List lineColors { @@ -143,6 +140,7 @@ namespace MP.Stats.Components /// Genera colori sfondo 33% rosso / arancione / giallo ///
/// + /// /// protected List semaphColors(int numRecords, string alpha) { @@ -168,7 +166,7 @@ namespace MP.Stats.Components /// /// Genera colori sfondo 33% rosso / arancione / giallo /// - /// + /// /// protected List solidColors(string alpha) { diff --git a/MP.Stats/Components/ChartScarti.razor b/MP.Stats/Components/ChartScarti.razor index bd1bbd1b..afe6bf5d 100644 --- a/MP.Stats/Components/ChartScarti.razor +++ b/MP.Stats/Components/ChartScarti.razor @@ -1,5 +1,4 @@ -@using ChartJs - +
@if (RawData == null || RawData.Count == 0) { diff --git a/MP.Stats/Components/ChartScarti.razor.cs b/MP.Stats/Components/ChartScarti.razor.cs index 56b82ef7..86af4ca4 100644 --- a/MP.Stats/Components/ChartScarti.razor.cs +++ b/MP.Stats/Components/ChartScarti.razor.cs @@ -41,7 +41,6 @@ namespace MP.Stats.Components /// /// Genera colori sfondo 33% rosso / arancione / giallo /// - /// /// protected List bgColors { @@ -51,7 +50,6 @@ namespace MP.Stats.Components /// /// Genera colori sfondo 33% rosso / arancione / giallo /// - /// /// protected List lineColor { @@ -59,9 +57,8 @@ namespace MP.Stats.Components } /// - /// Genera colori sfondo 33% rosso / arancione / giallo + /// Genera colori linea 33% rosso / arancione / giallo /// - /// /// protected List lineColors { @@ -124,9 +121,11 @@ namespace MP.Stats.Components #region Protected Methods + /// /// Genera colori sfondo 33% rosso / arancione / giallo /// /// + /// /// protected List semaphColors(int numRecords, string alpha) { @@ -150,9 +149,9 @@ namespace MP.Stats.Components } /// - /// Genera colori sfondo 33% rosso / arancione / giallo + /// Genera colori bordo 33% rosso / arancione / giallo /// - /// + /// /// protected List solidColors(string alpha) { diff --git a/MP.Stats/Components/ChartTrends.razor b/MP.Stats/Components/ChartTrends.razor index a4b1dd91..3b2de389 100644 --- a/MP.Stats/Components/ChartTrends.razor +++ b/MP.Stats/Components/ChartTrends.razor @@ -1,5 +1,4 @@ -@using ChartJs - +
@@ -66,11 +65,11 @@
@pSel Detail
- +
Periodo
- +
} diff --git a/MP.Stats/Components/ChartTrends.razor.cs b/MP.Stats/Components/ChartTrends.razor.cs index 95e3b6f8..1b1576d1 100644 --- a/MP.Stats/Components/ChartTrends.razor.cs +++ b/MP.Stats/Components/ChartTrends.razor.cs @@ -195,7 +195,9 @@ namespace MP.Stats.Components private List lineTitles = new List() { "Consumo/UM" }; private List lineTitlesDet = new List() { "Consumo/UM" }; private List listMachine = new List(); - private string pieTitle = "Macchina"; +#if false + private string pieTitle = "Macchina"; +#endif /// /// Modalità selezione diff --git a/MP.Stats/Components/ChartUserLog.razor b/MP.Stats/Components/ChartUserLog.razor index 42b5cfaf..3f733aaf 100644 --- a/MP.Stats/Components/ChartUserLog.razor +++ b/MP.Stats/Components/ChartUserLog.razor @@ -1,5 +1,4 @@ -@using ChartJs - +
@if (RawData == null || RawData.Count == 0) { diff --git a/MP.Stats/Components/ChartUserLog.razor.cs b/MP.Stats/Components/ChartUserLog.razor.cs index 28175de6..fd88a8c4 100644 --- a/MP.Stats/Components/ChartUserLog.razor.cs +++ b/MP.Stats/Components/ChartUserLog.razor.cs @@ -49,7 +49,6 @@ namespace MP.Stats.Components /// /// Genera colori sfondo 33% rosso / arancione / giallo /// - /// /// protected List bgColors { @@ -59,7 +58,6 @@ namespace MP.Stats.Components /// /// Genera colori sfondo 33% rosso / arancione / giallo /// - /// /// protected List lineColor { @@ -69,7 +67,6 @@ namespace MP.Stats.Components /// /// Genera colori sfondo 33% rosso / arancione / giallo /// - /// /// protected List lineColors { @@ -138,9 +135,11 @@ namespace MP.Stats.Components #region Protected Methods + /// /// Genera colori sfondo 33% rosso / arancione / giallo /// /// + /// /// protected List semaphColors(int numRecords, string alpha) { @@ -164,9 +163,9 @@ namespace MP.Stats.Components } /// - /// Genera colori sfondo 33% rosso / arancione / giallo + /// Genera colori bordo 33% rosso / arancione / giallo /// - /// + /// /// protected List solidColors(string alpha) { diff --git a/MP.Stats/Data/MessageService.cs b/MP.Stats/Data/MessageService.cs index 21022dda..a9c66a77 100644 --- a/MP.Stats/Data/MessageService.cs +++ b/MP.Stats/Data/MessageService.cs @@ -54,6 +54,8 @@ namespace MP.Stats.Data public SelectData KRE_Filter { get; set; } = SelectData.Init(5, 7); public SelectData ODL_Filter { get; set; } = SelectData.Init(5, 7); + public SelectData EnergyOdl_Filter { get; set; } = SelectData.Init(5, 7); + public SelectData EnergyTrend_Filter { get; set; } = SelectData.Init(5, 7); public SelectData OEE_Filter { get; set; } = SelectData.Init(5, 7); public string PageIcon diff --git a/MP.Stats/MP.Stats.csproj b/MP.Stats/MP.Stats.csproj index 08c060ce..5ddbbdd2 100644 --- a/MP.Stats/MP.Stats.csproj +++ b/MP.Stats/MP.Stats.csproj @@ -4,8 +4,8 @@ net6.0 MP.Stats 826e877c-ba70-4253-84cb-d0b1cafd4440 - 6.16.2507.0809 - 6.16.2507.0809 + 6.16.2507.0818 + 6.16.2507.0818 true $(NoWarn);1591 en diff --git a/MP.Stats/Pages/Energy.razor b/MP.Stats/Pages/Energy.razor index 1f538665..cfbdc669 100644 --- a/MP.Stats/Pages/Energy.razor +++ b/MP.Stats/Pages/Energy.razor @@ -1,10 +1,8 @@ @page "/Energy" -@using MP.Stats.Components -
- +
@if (isLoading) @@ -15,10 +13,6 @@ { if (MaccSelValid) { - if (ShowCharts == true) - { - - } @if (ListRecords == null) { @@ -29,6 +23,7 @@ } else { +
@@ -39,7 +34,7 @@ - @if (dynMode) + @if (DynMode) { @if (numCount > 1) @@ -87,7 +82,7 @@ - @if (dynMode) + @if (DynMode) { @if (numCount > 1) diff --git a/MP.Stats/Pages/Energy.razor.cs b/MP.Stats/Pages/Energy.razor.cs index 433178ec..7bf013a5 100644 --- a/MP.Stats/Pages/Energy.razor.cs +++ b/MP.Stats/Pages/Energy.razor.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using MP.Data.DbModels; using MP.Data.Services; +using MP.Stats.Components; using MP.Stats.Data; using System; using System.Collections.Generic; @@ -18,6 +19,8 @@ namespace MP.Stats.Pages public void Dispose() { MServ.EA_SearchUpdated -= OnSeachUpdated; + ListRecords.Clear(); + SearchRecords.Clear(); } public async void OnSeachUpdated() @@ -47,7 +50,7 @@ namespace MP.Stats.Pages protected IJSRuntime JSRuntime { get; set; } /// - /// Verifica validità selezione macchine + /// Verifica validit� selezione macchine /// protected bool MaccSelValid { @@ -71,7 +74,7 @@ namespace MP.Stats.Pages #region Protected Methods /// - /// Verifica: se è nullo il valore pz totali --> current --> indico non confermato + /// Verifica: se � nullo il valore pz totali --> current --> indico non confermato /// /// /// @@ -112,14 +115,15 @@ namespace MP.Stats.Pages protected override async Task OnInitializedAsync() { + isLoading = true; clearFile(); - numRecord = 10; MServ.ShowSearch = false; MServ.PageName = "ENERGY"; MServ.PageIcon = "oi oi-bar-chart"; MServ.EA_SearchUpdated += OnSeachUpdated; await LoadConfData(); await ReloadData(); + isLoading = false; } protected void ResetData() @@ -161,14 +165,6 @@ namespace MP.Stats.Pages DisplayData(); } - protected async Task ToggleChart(bool doShow) - { - ShowCharts = !ShowCharts; - if (ShowCharts) - { - await ReloadData(); - } - } /// /// Traduzione lemma richeisto (lingua default="IT") @@ -193,7 +189,7 @@ namespace MP.Stats.Pages private List ConfigList; private OdlEnergyModel currRecord = null; - private bool dynMode = false; + private bool DynMode = true; private List ListRecords; private int MaxDisplay = 20; private int numCount = 1; @@ -208,11 +204,11 @@ namespace MP.Stats.Pages { get { - return MServ.ODL_Filter; + return MServ.EnergyOdl_Filter; } set { - MServ.ODL_Filter = value; + MServ.EnergyOdl_Filter = value; } } @@ -225,7 +221,6 @@ namespace MP.Stats.Pages private bool isLoading { get; set; } = false; private int numRecord { get; set; } = 10; - private bool ShowCharts { get; set; } = true; #endregion Private Properties @@ -270,11 +265,11 @@ namespace MP.Stats.Pages private async Task LoadConfData() { + isLoading = true; ConfigList = await StatService.ConfigGetAll(); ListMacchine = await StatService.MachineList(true); NumMacc = ListMacchine.Count(); - dynMode = confVal("STATS_EnergyMode") == "Dynamic"; - var sNumCount = confVal("STATS_EnergyNumCount"); + DynMode = confVal("STATS_EnergyMode") == "Dynamic"; int.TryParse(confVal("STATS_EnergyNumCount"), out numCount); int.TryParse(confVal("STATS_EnergyNumTotEn"), out numTotEn); int.TryParse(confVal("STATS_EnergyMaxSelect"), out MaxDisplay); @@ -282,6 +277,7 @@ namespace MP.Stats.Pages private async Task ReloadData() { + isLoading = true; if (SearchRecords != null) { SearchRecords.Clear(); @@ -291,11 +287,7 @@ namespace MP.Stats.Pages SearchRecords = new List(); } // se seleziona tutte... - if (currFilter.ListIdxMaccSel == null || currFilter.ListIdxMaccSel.Count == 0) - { - SearchRecords = await StatService.StatOdlEnergyGetAll(currFilter, MServ.SearchVal); - } - else + if (currFilter.ListIdxMaccSel != null && currFilter.ListIdxMaccSel.Count > 0) { foreach (var idxMacc in currFilter.ListIdxMaccSel) { @@ -307,6 +299,7 @@ namespace MP.Stats.Pages } TotalCount = SearchRecords.Count; DisplayData(); + isLoading = false; } /// @@ -315,7 +308,7 @@ namespace MP.Stats.Pages /// private async Task RemoveMachine(string idxMacc) { - // in primis se contiene spazio --> prendo prima aprte che è idxMacc... + // in primis se contiene spazio --> prendo prima aprte che � idxMacc... if (idxMacc.Contains(" ")) { var sVals = idxMacc.Split(' '); diff --git a/MP.Stats/Pages/TrendAnalysis.razor b/MP.Stats/Pages/TrendAnalysis.razor index 6c1aa347..dfa634c6 100644 --- a/MP.Stats/Pages/TrendAnalysis.razor +++ b/MP.Stats/Pages/TrendAnalysis.razor @@ -1,7 +1,6 @@ @page "/TrendAnalysis" @page "/trend-analysis" -@using MP.Stats.Components
diff --git a/MP.Stats/Pages/TrendAnalysis.razor.cs b/MP.Stats/Pages/TrendAnalysis.razor.cs index e1aafb87..a9524795 100644 --- a/MP.Stats/Pages/TrendAnalysis.razor.cs +++ b/MP.Stats/Pages/TrendAnalysis.razor.cs @@ -1,13 +1,11 @@ +using DnsClient.Protocol; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using MP.Data.DbModels; using MP.Data.Services; using MP.Stats.Data; -using NLog.Config; -using Org.BouncyCastle.Utilities; using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Threading.Tasks; @@ -40,6 +38,7 @@ namespace MP.Stats.Pages protected string CodFluxSel = "*"; protected string fileName = "TrendAnalysis.csv"; + protected List ListMacchine = new List(); protected int SelCount = 0; protected int TotalCount = 0; @@ -158,7 +157,6 @@ namespace MP.Stats.Pages MServ.ShowSearch = false; MServ.PageName = "Trend Analisys"; MServ.PageIcon = "fa-solid fa-arrow-trend-up"; - CalcFilt(); MServ.EA_SearchUpdated += OnSeachUpdated; await LoadConfData(); await ReloadData(); @@ -167,8 +165,13 @@ namespace MP.Stats.Pages protected async Task ResetFilter(SelectData newFilter) { +#if false SearchRecords = null; - CalcFilt(); + CalcFilt(); +#endif + SearchRecords = null; + PlotRecords = null; + currFilter = SelectData.Init(5, 7); await ReloadData(); } @@ -223,11 +226,11 @@ namespace MP.Stats.Pages { get { - return MServ.ODL_Filter; + return MServ.EnergyTrend_Filter; } set { - MServ.ODL_Filter = value; + MServ.EnergyTrend_Filter = value; } } @@ -237,6 +240,7 @@ namespace MP.Stats.Pages #region Private Methods +#if false /// /// Calcola il filtro alla data necessaria x arrivare al confronto x mese... /// @@ -246,6 +250,21 @@ namespace MP.Stats.Pages DateTime inizio = new DateTime(oggi.Year, oggi.Month, 1).AddMonths(-1); int numPrev = (int)oggi.Subtract(inizio).TotalDays; currFilter = SelectData.Init(5, numPrev); + } +#endif + + private string confVal(string chiave) + { + string answ = ""; + if (ConfigList != null && ConfigList.Count > 0) + { + var searchRec = ConfigList.First(x => x.Chiave == chiave); + if (searchRec != null) + { + answ = searchRec.Valore; + } + } + return answ; } /// @@ -291,21 +310,6 @@ namespace MP.Stats.Pages CodFluxList = await StatService.FluxTypeList(); ListMacchine = await StatService.MachineList(true); } - private string confVal(string chiave) - { - string answ = ""; - if (ConfigList != null && ConfigList.Count > 0) - { - var searchRec = ConfigList.First(x => x.Chiave == chiave); - if (searchRec != null) - { - answ = searchRec.Valore; - } - } - return answ; - } - - protected List ListMacchine = new List(); private async Task ReloadData() { @@ -314,14 +318,15 @@ namespace MP.Stats.Pages // ciclo caricando info x ogni macchina selezionata... if (SearchRecords != null) { - SearchRecords.Clear();// = new Dictionary>(); + SearchRecords.Clear(); } else { SearchRecords = new Dictionary>(); } - if (currFilter.ListIdxMaccSel.Count > 0) + if (currFilter.ListIdxMaccSel != null && currFilter.ListIdxMaccSel.Count > 0) { + var lastIdx = currFilter.IdxMacchina; foreach (var idxMacc in currFilter.ListIdxMaccSel) { currFilter.IdxMacchina = idxMacc; @@ -329,6 +334,7 @@ namespace MP.Stats.Pages SearchRecords.Add(idxMacc, tempRec); tempRec = null; } + currFilter.IdxMacchina = lastIdx; } TotalCount = SearchRecords.Count; diff --git a/MP.Stats/Resources/ChangeLog.html b/MP.Stats/Resources/ChangeLog.html index f2c9e813..6caa5dc2 100644 --- a/MP.Stats/Resources/ChangeLog.html +++ b/MP.Stats/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo statistiche MAPO -

Versione: 6.16.2507.0809

+

Versione: 6.16.2507.0818


Note di rilascio:
    diff --git a/MP.Stats/Resources/VersNum.txt b/MP.Stats/Resources/VersNum.txt index ec4bb5fa..793b86db 100644 --- a/MP.Stats/Resources/VersNum.txt +++ b/MP.Stats/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2507.0809 +6.16.2507.0818 diff --git a/MP.Stats/Resources/manifest.xml b/MP.Stats/Resources/manifest.xml index 42577645..0f4ebce3 100644 --- a/MP.Stats/Resources/manifest.xml +++ b/MP.Stats/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2507.0809 + 6.16.2507.0818 https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/MP.Stats.zip https://nexus.steamware.net/repository/SWS/MP-STATS/stable/LAST/ChangeLog.html false
Articolo Inizio Fine@Traduci("MP-STATS_TotCount01") @record.DataInizio @record.DataFine@($"{record.TotCount01:N0}") @GetUM("TotCount01")