From 6ca217d76ea2dd8a67eb4b5cf9e4b2d2f26f7a67 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 11 Mar 2025 17:39:29 +0100 Subject: [PATCH 1/4] Inizio update MON --- MP.Mon/MP.Mon.csproj | 2 +- MP.Mon/Pages/Index.razor | 34 +++++++++++++--- MP.Mon/Pages/Index.razor.cs | 49 +++++++++++++++++++++--- MP.Mon/Resources/ChangeLog.html | 2 +- MP.Mon/Resources/VersNum.txt | 2 +- MP.Mon/Resources/manifest.xml | 2 +- MP.Stats/Components/ChartTrends.razor.cs | 4 +- MP.Stats/MP.Stats.csproj | 4 +- MP.Stats/Resources/ChangeLog.html | 2 +- MP.Stats/Resources/VersNum.txt | 2 +- MP.Stats/Resources/manifest.xml | 2 +- 11 files changed, 83 insertions(+), 22 deletions(-) diff --git a/MP.Mon/MP.Mon.csproj b/MP.Mon/MP.Mon.csproj index 3f659728..e8b9ccba 100644 --- a/MP.Mon/MP.Mon.csproj +++ b/MP.Mon/MP.Mon.csproj @@ -4,7 +4,7 @@ net6.0 enable enable - 6.16.2411.1209 + 6.16.2503.1117 diff --git a/MP.Mon/Pages/Index.razor b/MP.Mon/Pages/Index.razor index 29bdbd95..d6508259 100644 --- a/MP.Mon/Pages/Index.razor +++ b/MP.Mon/Pages/Index.razor @@ -5,13 +5,13 @@ MP MON
- @if (listMSE == null) + @if (ListMSE == null) {
} - else if (listMSE.Count == 0) + else if (ListMSE.Count == 0) {
@@ -21,22 +21,46 @@ } else { + int mseIdx = 0; + for (int i = 0; i < mapNRow; i++) + { +
+ @for (int j = 0; j < mapNCol; j++) + { + var currMse = MseById(mseIdx); + mseIdx++; + if (currMse != null) + { + + } + else + { +
 
+ } + } +
+ } + +
+ int currIdx = 0; - foreach (var recordIob in listMSE) + foreach (var recordIob in ListMSE) { currIdx++; if (currIdx >= maxCol) { currIdx = 0; - @((MarkupString)"
"); + @((MarkupString)"
") + ; } } // controllo se devo "chiudere riga... int currNum = (currIdx % maxCol); while (currNum < (maxCol)) { - @((MarkupString)"
 
"); + @((MarkupString)"
 
") + ; currNum++; } diff --git a/MP.Mon/Pages/Index.razor.cs b/MP.Mon/Pages/Index.razor.cs index af3b1c78..bb1b1402 100644 --- a/MP.Mon/Pages/Index.razor.cs +++ b/MP.Mon/Pages/Index.razor.cs @@ -24,7 +24,7 @@ namespace MP.Mon.Pages public async void ElapsedSlowTimer(object? source, System.Timers.ElapsedEventArgs e) { - listMSE = null; + ListMSE = null; await Task.Delay(10); Log.Info("Elapsed Slow Timer --> full page reload"); // dispongo i vari timers... @@ -181,12 +181,49 @@ namespace MP.Mon.Pages private static System.Timers.Timer slowTimer = new System.Timers.Timer(300000); private List? CurrConfig = null; private bool doBlink = false; - private List? listMSE = null; + private List? ListMSE = null; private List listMacchine = new List(); private Random rnd = new Random(); #endregion Private Fields + /// + /// Numero righe mappa: calcolato da num elementi e numMax x riga... + /// + protected int mapNRow + { + get + { + int answ = 1; + int numElems = ListMSE != null ? ListMSE.Count : 1; + answ = (int)Math.Ceiling((double)numElems / mapNCol); + return answ; + } + } + + /// + /// restituisce MSE dato indice + /// + /// Indice MSE richiesto + /// + protected MappaStatoExpl? MseById(int mseIdx) + { + MappaStatoExpl? answ = null; + if (ListMSE != null && ListMSE.Count > mseIdx) + { + answ = ListMSE[mseIdx]; + } + return answ; + } + + /// + /// Numero colonne mappa: calcolato larghezza riga... + /// + protected int mapNCol + { + get => maxCol; + } + #region Private Methods /// @@ -249,16 +286,16 @@ namespace MP.Mon.Pages dataList = listaFilt; } -#if DEBUG +#if DEBUG && false // hack: legge 3 volte i dati x stressare sistema var singleData = dataList; - listMSE = new List(); + ListMSE = new List(); for (int i = 0; i < 3; i++) { - listMSE.AddRange(singleData); + ListMSE.AddRange(singleData); } #else - listMSE = dataList; + ListMSE = dataList; #endif } } diff --git a/MP.Mon/Resources/ChangeLog.html b/MP.Mon/Resources/ChangeLog.html index 8c06e1df..869437af 100644 --- a/MP.Mon/Resources/ChangeLog.html +++ b/MP.Mon/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MON MAPO -

Versione: 6.16.2411.1209

+

Versione: 6.16.2503.1117


Note di rilascio:
  • diff --git a/MP.Mon/Resources/VersNum.txt b/MP.Mon/Resources/VersNum.txt index b33ab69a..99a76fa9 100644 --- a/MP.Mon/Resources/VersNum.txt +++ b/MP.Mon/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2411.1209 +6.16.2503.1117 diff --git a/MP.Mon/Resources/manifest.xml b/MP.Mon/Resources/manifest.xml index e1ea8be7..71077bb5 100644 --- a/MP.Mon/Resources/manifest.xml +++ b/MP.Mon/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2411.1209 + 6.16.2503.1117 https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/MP.Mon.zip https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/ChangeLog.html false diff --git a/MP.Stats/Components/ChartTrends.razor.cs b/MP.Stats/Components/ChartTrends.razor.cs index 451e8e9f..db2bfb6f 100644 --- a/MP.Stats/Components/ChartTrends.razor.cs +++ b/MP.Stats/Components/ChartTrends.razor.cs @@ -386,10 +386,10 @@ namespace MP.Stats.Components private string CssBtn(PeriodoSel reqMode) { - string answ = "btn-outline-dark"; + string answ = "btn-outline-primary"; if (reqMode == pSel) { - answ = "btn-dark text-light"; + answ = "btn-primary text-light"; } return answ; } diff --git a/MP.Stats/MP.Stats.csproj b/MP.Stats/MP.Stats.csproj index f4201016..d64f6818 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.2503.1019 - 6.16.2503.1019 + 6.16.2503.1116 + 6.16.2503.1116 true $(NoWarn);1591 en diff --git a/MP.Stats/Resources/ChangeLog.html b/MP.Stats/Resources/ChangeLog.html index bd38fc2e..c83e58b2 100644 --- a/MP.Stats/Resources/ChangeLog.html +++ b/MP.Stats/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo statistiche MAPO -

    Versione: 6.16.2503.1019

    +

    Versione: 6.16.2503.1116


    Note di rilascio:
      diff --git a/MP.Stats/Resources/VersNum.txt b/MP.Stats/Resources/VersNum.txt index 502b1e44..fc6ae71e 100644 --- a/MP.Stats/Resources/VersNum.txt +++ b/MP.Stats/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2503.1019 +6.16.2503.1116 diff --git a/MP.Stats/Resources/manifest.xml b/MP.Stats/Resources/manifest.xml index a89a1b90..00d77763 100644 --- a/MP.Stats/Resources/manifest.xml +++ b/MP.Stats/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2503.1019 + 6.16.2503.1116 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 From 51d8d563b8b40ceecc40040b2ca657217a832e72 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 11 Mar 2025 17:44:35 +0100 Subject: [PATCH 2/4] MON: - Fix paginazione blocchi con metodo come TAB3 --- MP.Mon/Components/DetailMSE.razor | 248 +++++++++++++++--------------- MP.Mon/Pages/Index.razor | 106 +++++++------ MP.Mon/Pages/Index.razor.cs | 84 +++++----- 3 files changed, 216 insertions(+), 222 deletions(-) diff --git a/MP.Mon/Components/DetailMSE.razor b/MP.Mon/Components/DetailMSE.razor index 8a655bf8..75748717 100644 --- a/MP.Mon/Components/DetailMSE.razor +++ b/MP.Mon/Components/DetailMSE.razor @@ -1,141 +1,139 @@ -
      - @if (CurrRecord == null || !dataLoaded) - { - - } - else - { -
      -
      -
      - @CurrRecord.Nome -
      +@if (CurrRecord == null || !dataLoaded) +{ + +} +else +{ +
      +
      +
      + @CurrRecord.Nome
      - @if (hasRow(1)) - { -
      - @foreach (var item in rowValues(1)) +
      + @if (hasRow(1)) + { +
      + @foreach (var item in rowValues(1)) + { +
      @item.TagName: @currVal(item.TagLocation)
      + } +
      + } + else + { +
      +
      Art
      +
      + @if (showArt == "CodArticolo") { -
      @item.TagName: @currVal(item.TagLocation)
      + @CurrRecord.CodArticolo } -
      - } - else - { -
      -
      Art
      -
      - @if (showArt == "CodArticolo") + else + { + if (string.IsNullOrEmpty(CurrRecord.Disegno)) { - @CurrRecord.CodArticolo + [@CurrRecord.CodArticolo] } else { - if (string.IsNullOrEmpty(CurrRecord.Disegno)) - { - [@CurrRecord.CodArticolo] - } - else - { - @CurrRecord.Disegno - } + @CurrRecord.Disegno } -
      -
      - } - @if (hasRow(2)) - { -
      - @foreach (var item in rowValues(2)) - { -
      @item.TagName: @currVal(item.TagLocation)
      }
      - } - else - { -
      -
      @(CurrRecord.IdxPOdl > 0 ? $"PODL{CurrRecord.IdxPOdl:00000000}" : "-")
      -
      @(CurrRecord.IdxOdl > 0 ? $"ODL{CurrRecord.IdxOdl:00000000}" : "-")
      -
      - } - @if (hasRow(3)) - { -
      - @foreach (var item in rowValues(3)) - { -
      @item.TagName: @currVal(item.TagLocation)
      - } -
      - } - else - { -
      -
      @CurrRecord.DescrizioneStato
      -
      @getMinSec(getDecimal(@CurrRecord.Durata))
      -
      - } - @if (hasRow(4)) - { -
      - @foreach (var item in rowValues(4)) - { -
      @item.TagName: @currVal(item.TagLocation)
      - } -
      - } - else - { -
      -
      TCiclo
      -
      std: @getMinSec(@CurrRecord.TCAssegnato)
      -
      act: @getMinSec(@CurrRecord.TCLavRT)
      -
      - } - @if (hasRow(5)) - { -
      - @foreach (var item in rowValues(5)) - { -
      @item.TagName: @currVal(item.TagLocation)
      - } -
      - } - else - { -
      -
      Pezzip/o
      -
      @CurrRecord.PezziProd / @CurrRecord.NumPezzi
      -
      - } - @if (hasRow(6)) - { -
      - @foreach (var item in rowValues(6)) - { -
      @item.TagName: @currVal(item.TagLocation)
      - } -
      - } -
      -
      -
      -
      - +} \ No newline at end of file diff --git a/MP.Mon/Pages/Index.razor b/MP.Mon/Pages/Index.razor index d6508259..3590ae71 100644 --- a/MP.Mon/Pages/Index.razor +++ b/MP.Mon/Pages/Index.razor @@ -4,65 +4,75 @@ MP MON -
      - @if (ListMSE == null) - { +@if (ListMSE == null) +{ +
      - } - else if (ListMSE.Count == 0) - { +
      +} +else if (ListMSE.Count == 0) +{ + +
      No data found
      - } - else +
      +} +else +{ + int mseIdx = 0; + for (int i = 0; i < mapNRow; i++) { - int mseIdx = 0; - for (int i = 0; i < mapNRow; i++) - { -
      - @for (int j = 0; j < mapNCol; j++) - { - var currMse = MseById(mseIdx); - mseIdx++; - if (currMse != null) - { - - } - else - { -
       
      - } - } -
      - } - -
      - - int currIdx = 0; - foreach (var recordIob in ListMSE) - { - - currIdx++; - if (currIdx >= maxCol) +
      + @for (int j = 0; j < maxCol; j++) { - currIdx = 0; - @((MarkupString)"
      ") + var currMse = MseById(mseIdx); + mseIdx++; + if (currMse != null) + { +
      + +
      + } + else + { +
       
      + } + } +
      + } + +@*
      + @{ + int currIdx = 0; + foreach (var recordIob in ListMSE) + { +
      + +
      + currIdx++; + if (currIdx >= maxCol) + { + currIdx = 0; + @((MarkupString)"
      ") + ; + } + } + // controllo se devo "chiudere riga... + int currNum = (currIdx % maxCol); + while (currNum < (maxCol)) + { + @((MarkupString)"
       
      ") ; + currNum++; + } } - // controllo se devo "chiudere riga... - int currNum = (currIdx % maxCol); - while (currNum < (maxCol)) - { - @((MarkupString)"
       
      ") - ; - currNum++; +
      *@ - } - } -
      +} diff --git a/MP.Mon/Pages/Index.razor.cs b/MP.Mon/Pages/Index.razor.cs index bb1b1402..17c548b7 100644 --- a/MP.Mon/Pages/Index.razor.cs +++ b/MP.Mon/Pages/Index.razor.cs @@ -58,9 +58,26 @@ namespace MP.Mon.Pages #region Protected Properties + /// + /// Numero righe mappa: calcolato da num elementi e numMax x riga... + /// + protected int mapNRow + { + get + { + int answ = 1; + int numElems = ListMSE != null ? ListMSE.Count : 1; + answ = (int)Math.Ceiling((double)numElems / mapNCol); + return answ; + } + } + [Inject] protected MonDataFeeder MMDataService { get; set; } = null!; + [Inject] + protected NavigationManager NavMan { get; set; } = null!; + [Inject] protected NavigationManager NavManager { get; set; } = null!; @@ -159,7 +176,20 @@ namespace MP.Mon.Pages return answ; } - private string CodGruppo = ""; + /// + /// restituisce MSE dato indice + /// + /// Indice MSE richiesto + /// + protected MappaStatoExpl? MseById(int mseIdx) + { + MappaStatoExpl? answ = null; + if (ListMSE != null && ListMSE.Count > mseIdx) + { + answ = ListMSE[mseIdx]; + } + return answ; + } protected override async Task OnInitializedAsync() { @@ -179,51 +209,15 @@ namespace MP.Mon.Pages private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); private static System.Timers.Timer slowTimer = new System.Timers.Timer(300000); + private string CodGruppo = ""; private List? CurrConfig = null; private bool doBlink = false; - private List? ListMSE = null; private List listMacchine = new List(); + private List? ListMSE = null; private Random rnd = new Random(); #endregion Private Fields - /// - /// Numero righe mappa: calcolato da num elementi e numMax x riga... - /// - protected int mapNRow - { - get - { - int answ = 1; - int numElems = ListMSE != null ? ListMSE.Count : 1; - answ = (int)Math.Ceiling((double)numElems / mapNCol); - return answ; - } - } - - /// - /// restituisce MSE dato indice - /// - /// Indice MSE richiesto - /// - protected MappaStatoExpl? MseById(int mseIdx) - { - MappaStatoExpl? answ = null; - if (ListMSE != null && ListMSE.Count > mseIdx) - { - answ = ListMSE[mseIdx]; - } - return answ; - } - - /// - /// Numero colonne mappa: calcolato larghezza riga... - /// - protected int mapNCol - { - get => maxCol; - } - #region Private Methods /// @@ -284,9 +278,9 @@ namespace MP.Mon.Pages } } dataList = listaFilt; - } + } -#if DEBUG && false +#if DEBUG // hack: legge 3 volte i dati x stressare sistema var singleData = dataList; ListMSE = new List(); @@ -304,11 +298,6 @@ namespace MP.Mon.Pages } InvokeAsync(() => { -#if false - // attesa random 0-50ms... - Random rnd = new Random(); - Task.Delay(rnd.Next(5, 50)); -#endif StateHasChanged(); }); } @@ -345,9 +334,6 @@ namespace MP.Mon.Pages } } - [Inject] - protected NavigationManager NavMan { get; set; } = null!; - #endregion Private Methods } } \ No newline at end of file From 1295c593aca1aaab704fe7a6b441e0989154bee3 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 11 Mar 2025 17:44:54 +0100 Subject: [PATCH 3/4] Correzione calcolo maxCol --- MP.Mon/Pages/Index.razor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MP.Mon/Pages/Index.razor.cs b/MP.Mon/Pages/Index.razor.cs index 17c548b7..19aeb312 100644 --- a/MP.Mon/Pages/Index.razor.cs +++ b/MP.Mon/Pages/Index.razor.cs @@ -67,7 +67,7 @@ namespace MP.Mon.Pages { int answ = 1; int numElems = ListMSE != null ? ListMSE.Count : 1; - answ = (int)Math.Ceiling((double)numElems / mapNCol); + answ = (int)Math.Ceiling((double)numElems / maxCol); return answ; } } From 77834c0268918de69b881da1a5bc8c0432977559 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 11 Mar 2025 18:52:58 +0100 Subject: [PATCH 4/4] Fix MON x gestione display resized --- MP.Data/Services/StatusData.cs | 48 +++++ MP.Mon/Components/DetailMSE.razor | 252 ++++++++++++++------------- MP.Mon/Components/DetailMSE.razor.cs | 4 +- MP.Mon/MP.Mon.csproj | 2 +- MP.Mon/Pages/ForceReload.razor | 6 + MP.Mon/Pages/ForceReload.razor.cs | 22 +++ MP.Mon/Pages/Index.razor | 2 +- MP.Mon/Pages/Index.razor.cs | 1 - MP.Mon/Resources/ChangeLog.html | 2 +- MP.Mon/Resources/VersNum.txt | 2 +- MP.Mon/Resources/manifest.xml | 2 +- MP.Mon/wwwroot/css/site.css | 43 ++++- MP.Mon/wwwroot/css/site.less | 51 +++++- MP.Mon/wwwroot/css/site.min.css | 2 +- 14 files changed, 293 insertions(+), 146 deletions(-) create mode 100644 MP.Mon/Pages/ForceReload.razor create mode 100644 MP.Mon/Pages/ForceReload.razor.cs diff --git a/MP.Data/Services/StatusData.cs b/MP.Data/Services/StatusData.cs index 143f2a1f..951a0123 100644 --- a/MP.Data/Services/StatusData.cs +++ b/MP.Data/Services/StatusData.cs @@ -119,6 +119,28 @@ namespace MP.Data.Services redisDb = null; } + /// + /// Pulizia cache Redis (tutta) + /// + /// + public async Task FlushCache() + { + RedisValue pattern = new RedisValue($"{redisBaseKey}:*"); + bool answ = await ExecFlushRedisPattern(pattern); + return answ; + } + + /// + /// Pulizia cache Redis per chiave specifica (da redisBaseKey...) + /// + /// + public async Task FlushCache(string KeyReq) + { + RedisValue pattern = new RedisValue($"{redisBaseKey}:{KeyReq}:*"); + bool answ = await ExecFlushRedisPattern(pattern); + return answ; + } + /// /// Elenco setup dei tag conf correnti /// @@ -375,6 +397,32 @@ namespace MP.Data.Services #region Private Methods + /// + /// Esegue flush memoria redis dato pattern + /// + /// + /// + private async Task ExecFlushRedisPattern(RedisValue pattern) + { + bool answ = false; + var listEndpoints = redisConn.GetEndPoints(); + foreach (var endPoint in listEndpoints) + { + //var server = redisConnAdmin.GetServer(listEndpoints[0]); + var server = redisConn.GetServer(endPoint); + if (server != null) + { + var keyList = server.Keys(redisDb.Database, pattern); + foreach (var item in keyList) + { + await redisDb.KeyDeleteAsync(item); + } + answ = true; + } + } + return answ; + } + /// /// Prova a caricare da file la conf degli IOB se presente /// diff --git a/MP.Mon/Components/DetailMSE.razor b/MP.Mon/Components/DetailMSE.razor index 75748717..bc653ef3 100644 --- a/MP.Mon/Components/DetailMSE.razor +++ b/MP.Mon/Components/DetailMSE.razor @@ -1,139 +1,145 @@ -@if (CurrRecord == null || !dataLoaded) -{ - -} -else -{ -
      -
      -
      - @CurrRecord.Nome +
      + @if (CurrRecord == null || !dataLoaded) + { + + } + else + { +
      +
      +
      + @CurrRecord.Nome +
      -
      - @if (hasRow(1)) - { -
      - @foreach (var item in rowValues(1)) - { -
      @item.TagName: @currVal(item.TagLocation)
      - } -
      - } - else - { -
      -
      Art
      -
      - @if (showArt == "CodArticolo") + @if (hasRow(1)) + { +
      + @foreach (var item in rowValues(1)) { - @CurrRecord.CodArticolo +
      @item.TagName: @currVal(item.TagLocation)
      } - else - { - if (string.IsNullOrEmpty(CurrRecord.Disegno)) +
      + } + else + { +
      +
      Art
      +
      + @if (showArt == "CodArticolo") { - [@CurrRecord.CodArticolo] + @CurrRecord.CodArticolo } else { - @CurrRecord.Disegno + if (string.IsNullOrEmpty(CurrRecord.Disegno)) + { + [@CurrRecord.CodArticolo] + } + else + { + @CurrRecord.Disegno + } } +
      +
      + } + @if (hasRow(2)) + { +
      + @foreach (var item in rowValues(2)) + { +
      @item.TagName: @currVal(item.TagLocation)
      }
      -
      - } - @if (hasRow(2)) - { -
      - @foreach (var item in rowValues(2)) - { -
      @item.TagName: @currVal(item.TagLocation)
      - } -
      - } - else - { -
      -
      @(CurrRecord.IdxPOdl > 0 ? $"PODL{CurrRecord.IdxPOdl:00000000}" : "-")
      -
      @(CurrRecord.IdxOdl > 0 ? $"ODL{CurrRecord.IdxOdl:00000000}" : "-")
      -
      - } - @if (hasRow(3)) - { -
      - @foreach (var item in rowValues(3)) - { -
      @item.TagName: @currVal(item.TagLocation)
      - } -
      - } - else - { -
      -
      @CurrRecord.DescrizioneStato
      -
      @getMinSec(getDecimal(@CurrRecord.Durata))
      -
      - } - @if (hasRow(4)) - { -
      - @foreach (var item in rowValues(4)) - { -
      @item.TagName: @currVal(item.TagLocation)
      - } -
      - } - else - { -
      -
      TCiclo
      -
      std: @getMinSec(@CurrRecord.TCAssegnato)
      -
      act: @getMinSec(@CurrRecord.TCLavRT)
      -
      - } - @if (hasRow(5)) - { -
      - @foreach (var item in rowValues(5)) - { -
      @item.TagName: @currVal(item.TagLocation)
      - } -
      - } - else - { -
      -
      Pezzip/o
      -
      @CurrRecord.PezziProd / @CurrRecord.NumPezzi
      -
      - } - @if (hasRow(6)) - { -
      - @foreach (var item in rowValues(6)) - { -
      @item.TagName: @currVal(item.TagLocation)
      - } -
      - } -
      -
      -
      -
      -