-
- @($"{NumGray}%")
-
-
- @($"{NumGreen}%")
-
-
- @($"{NumYellow}%")
-
-
- @($"{NumGray}%")
+ if (SeqStatus != null && SeqStatus.Count() > 0)
+ {
+
+
+ @foreach (var item in SeqStatus)
+ {
+
+
@item.Title
+
@($"{item.Value:N0}min")
+
+
+ }
+
+ @*
+ @($"{NumGray}%")
+
+
+ @($"{NumGreen}%")
+
+
+ @($"{NumYellow}%")
+
+
+ @($"{NumGray}%")
+
*@
-
+ }
}
else
{
diff --git a/MP-TAB3/Components/InsManual.razor.cs b/MP-TAB3/Components/InsManual.razor.cs
index a9551076..4a336202 100644
--- a/MP-TAB3/Components/InsManual.razor.cs
+++ b/MP-TAB3/Components/InsManual.razor.cs
@@ -48,22 +48,15 @@ namespace MP_TAB3.Components
// filtra dati odierni x tab editabile...
if (ListPeriod != null && ListPeriod.Count > 0)
{
+ // calcolo eventi giorno
ListDay = ListPeriod
.Where(x => x.InizioStato.Date == dtSel)
.OrderBy(x => x.IdxInsMan)
.ToList();
+
+ // ora calcolo il sequencer x mostrare dettaglio orario...
+ SeqStatus = TabDServ.SeqDayStatus(ListDay);
}
-#if false
- MService.targetDate = dtSel;
- MService.targetDateMancTimb = dtCurr;
- // se sono in calendario --> mostro dettagli...
- if (currMode == CalendarModeEnum.modoControllo.showCalendar)
- {
- setModeDetail();
- }
- updateDetail();
- MService.ReportDateChange();
-#endif
}
private void CloseDet()
@@ -82,8 +75,14 @@ namespace MP_TAB3.Components
#endif
await Task.Delay(1);
}
- private Dictionary
DateCFF = new Dictionary();
+ ///
+ /// Lista date + css associato x display calendario
+ ///
private Dictionary DateCheck = new Dictionary();
+ private Dictionary DateCFF = new Dictionary();
+
+ private List SeqStatus = new List();
+
private bool showDetail { get; set; } = false;
protected override async Task OnParametersSetAsync()
@@ -104,7 +103,7 @@ namespace MP_TAB3.Components
ListPeriod = TabDServ.InsManFilt(RecMSE.IdxMacchina, MeseStart, MeseEnd);
ListDTO = TabDServ.InsManDayDto(ListPeriod);
DateCheck = new Dictionary();
- DateCFF = new Dictionary();
+ DateCFF = new Dictionary();
string cssOkComm = "bg-success text-light rounded-circle p-2";
string cssOkLav = "bg-warning text-light rounded-circle p-2";
string cssToday = "bg-info text-dark rounded-circle p-2";
diff --git a/MP-TAB3/MP-TAB3.csproj b/MP-TAB3/MP-TAB3.csproj
index d2b9dc7f..211ff96b 100644
--- a/MP-TAB3/MP-TAB3.csproj
+++ b/MP-TAB3/MP-TAB3.csproj
@@ -3,7 +3,7 @@
net6.0
enable
- 6.16.2504.115
+ 6.16.2504.116
enable
MP_TAB3
diff --git a/MP-TAB3/Resources/ChangeLog.html b/MP-TAB3/Resources/ChangeLog.html
index 4433f261..3ba7b8b5 100644
--- a/MP-TAB3/Resources/ChangeLog.html
+++ b/MP-TAB3/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo MAPOSPEC
- Versione: 6.16.2504.115
+ Versione: 6.16.2504.116
Note di rilascio:
-
diff --git a/MP-TAB3/Resources/VersNum.txt b/MP-TAB3/Resources/VersNum.txt
index 6c9ce85a..f0f45c6a 100644
--- a/MP-TAB3/Resources/VersNum.txt
+++ b/MP-TAB3/Resources/VersNum.txt
@@ -1 +1 @@
-6.16.2504.115
+6.16.2504.116
diff --git a/MP-TAB3/Resources/manifest.xml b/MP-TAB3/Resources/manifest.xml
index 2b7e9360..d5b43f6f 100644
--- a/MP-TAB3/Resources/manifest.xml
+++ b/MP-TAB3/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 6.16.2504.115
+ 6.16.2504.116
https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip
https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html
false
diff --git a/MP.Core/DTO/ManualStatusDTO.cs b/MP.Core/DTO/ManualStatusDTO.cs
new file mode 100644
index 00000000..aa2b044d
--- /dev/null
+++ b/MP.Core/DTO/ManualStatusDTO.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace MP.Core.DTO
+{
+ public class ManualStatusDTO
+ {
+ public int IdxTipo { get; set; } = 0;
+ public double Value { get; set; } = 0;
+ public double ValueMax { get; set; } = 1440;
+ public double ValuePerc
+ {
+ get => Value / ValueMax;
+ }
+ public string Title { get; set; } = "";
+ public string CssBlock { get; set; } = "";
+ }
+}
diff --git a/MP.Data/Services/TabDataService.cs b/MP.Data/Services/TabDataService.cs
index 729148a8..5aab3ccd 100644
--- a/MP.Data/Services/TabDataService.cs
+++ b/MP.Data/Services/TabDataService.cs
@@ -918,6 +918,87 @@ namespace MP.Data.Services
}
return result;
}
+ ///
+ /// Elenco DTO x plotting seq stati giornaliero
+ ///
+ /// Dettagli
+ ///
+ public List SeqDayStatus(List listDetail)
+ {
+ List? result = new List();
+ if (listDetail.Count > 0)
+ {
+ DateTime periodStart = listDetail.FirstOrDefault().InizioStato;
+ DateTime periodEnd = listDetail.FirstOrDefault().FineStato.Value;
+ double duration = 0;
+ int lastIdxTipo = -1;
+ ManualStatusDTO currRec = new ManualStatusDTO();
+ // se NON parte da mezzanotte metto un "pad iniziale"...
+ if (periodStart.TimeOfDay > new TimeSpan(0))
+ {
+ lastIdxTipo = 0;
+ currRec = new ManualStatusDTO
+ {
+ IdxTipo = lastIdxTipo,
+ CssBlock = "bg-light text-dark",
+ Title = "missing",
+ Value = periodStart.TimeOfDay.TotalMinutes,
+ ValueMax = 1440
+ };
+ }
+ // ciclo tutti i record, verificando idxTipo...
+ foreach (var item in listDetail)
+ {
+ if (item.IdxTipoEv != lastIdxTipo)
+ {
+ // aggiungo rec precedente... se > 0
+ if (currRec.Value > 0)
+ {
+ result.Add(currRec);
+ }
+ lastIdxTipo = item.IdxTipoEv;
+ periodStart = item.InizioStato;
+ periodEnd = item.FineStato.Value;
+ duration = (double)item.MinProd;
+ }
+ else
+ {
+ duration += (double)item.MinProd;
+ periodEnd = item.FineStato.Value;
+ currRec = new ManualStatusDTO
+ {
+ IdxTipo = lastIdxTipo,
+ // fare da DB --> anagEventi
+ CssBlock = item.IdxTipoEv == 1 ? "bg-success text-light" : "bg-secondary text-light",
+ Title = $"{periodStart:HH:mm}-{periodEnd:HH:mm}",
+ Value = duration,
+ ValueMax = 1440
+ };
+ }
+ }
+ // aggiungo rec precedente... se > 0
+ if (currRec.Value > 0)
+ {
+ result.Add(currRec);
+ }
+ // se non arrivo a mezzanotte aggiungo "pad finale"
+ var deltaFin = TimeSpan.FromHours(24).Subtract(periodEnd.TimeOfDay);
+ if (deltaFin.TotalMinutes > 1)
+ {
+ lastIdxTipo = 0;
+ currRec = new ManualStatusDTO
+ {
+ IdxTipo = lastIdxTipo,
+ CssBlock = "bg-light text-dark",
+ Title = "missing",
+ Value = deltaFin.TotalMinutes,
+ ValueMax = 1440
+ };
+ result.Add(currRec);
+ }
+ }
+ return result;
+ }
///
/// Elenco insManuali macchina