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