Add prima versione sequencer
This commit is contained in:
@@ -6,22 +6,34 @@
|
||||
{
|
||||
if (EditRecord == null)
|
||||
{
|
||||
<div class="col-12">
|
||||
<div class="progress" style="height: 3rem;">
|
||||
<div runat="server" id="divGray" class="progress-bar bg-secondary" style="width: @(NumGray)%">
|
||||
@($"{NumGray}%")
|
||||
</div>
|
||||
<div runat="server" id="divGreen" class="progress-bar bg-success" style="width: @(NumGreen)%">
|
||||
@($"{NumGreen}%")
|
||||
</div>
|
||||
<div runat="server" id="divYellow" class="progress-bar bg-warning text-dark" style="width: @(NumYellow)%">
|
||||
@($"{NumYellow}%")
|
||||
</div>
|
||||
<div runat="server" id="divGray" class="progress-bar bg-secondary" style="width: @(NumGray)%">
|
||||
@($"{NumGray}%")
|
||||
if (SeqStatus != null && SeqStatus.Count() > 0)
|
||||
{
|
||||
<div class="col-12">
|
||||
<div class="progress" style="height: 4rem;">
|
||||
@foreach (var item in SeqStatus)
|
||||
{
|
||||
<div class="progress-bar @item.CssBlock" style="width: @($"{item.ValuePerc:P0}");">
|
||||
<div>@item.Title</div>
|
||||
<small>@($"{item.Value:N0}min")</small>
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
@* <div runat="server" id="divGray" class="progress-bar bg-secondary" style="width: @(NumGray)%">
|
||||
@($"{NumGray}%")
|
||||
</div>
|
||||
<div runat="server" id="divGreen" class="progress-bar bg-success" style="width: @(NumGreen)%">
|
||||
@($"{NumGreen}%")
|
||||
</div>
|
||||
<div runat="server" id="divYellow" class="progress-bar bg-warning text-dark" style="width: @(NumYellow)%">
|
||||
@($"{NumYellow}%")
|
||||
</div>
|
||||
<div runat="server" id="divGray" class="progress-bar bg-secondary" style="width: @(NumGray)%">
|
||||
@($"{NumGray}%")
|
||||
</div> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -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<DateTime, string> DateCFF = new Dictionary<DateTime, string>();
|
||||
/// <summary>
|
||||
/// Lista date + css associato x display calendario
|
||||
/// </summary>
|
||||
private Dictionary<DateTime, string> DateCheck = new Dictionary<DateTime, string>();
|
||||
private Dictionary<DateTime, string> DateCFF = new Dictionary<DateTime, string>();
|
||||
|
||||
private List<ManualStatusDTO> SeqStatus = new List<ManualStatusDTO>();
|
||||
|
||||
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<DateTime, string>();
|
||||
DateCFF = new Dictionary<DateTime, string>();
|
||||
DateCFF = new Dictionary<DateTime, string>();
|
||||
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";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2504.115</Version>
|
||||
<Version>6.16.2504.116</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB3</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2504.115</h4>
|
||||
<h4>Versione: 6.16.2504.116</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2504.115
|
||||
6.16.2504.116
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2504.115</version>
|
||||
<version>6.16.2504.116</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -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; } = "";
|
||||
}
|
||||
}
|
||||
@@ -918,6 +918,87 @@ namespace MP.Data.Services
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// Elenco DTO x plotting seq stati giornaliero
|
||||
/// </summary>
|
||||
/// <param name="listDetail">Dettagli</param>
|
||||
/// <returns></returns>
|
||||
public List<ManualStatusDTO> SeqDayStatus(List<InsManualiModel> listDetail)
|
||||
{
|
||||
List<ManualStatusDTO>? result = new List<ManualStatusDTO>();
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco insManuali macchina
|
||||
|
||||
Reference in New Issue
Block a user