Files
lux/EgwCoreLib.Lux.Core/RestPayload/MachineCalcResultDTO.cs
T
2025-12-05 18:34:16 +01:00

101 lines
2.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.PortableExecutable;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Core.RestPayload
{
/// <summary>
/// Classe per deserializzazione risposta stima lavorabilità e tempi x macchina
/// </summary>
public class MachineCalcResultDTO
{
#region Public Properties
/// <summary>
/// Nome macchina
/// </summary>
public string Name { get; set; } = "";
/// <summary>
/// Numero di parts totali
/// </summary>
public int NumParts
{
get => PartList.Count;
}
/// <summary>
/// Numero di Parts con errori di calcolo
/// </summary>
public int NumPartsCalcFail
{
get => PartListCalcFail.Count();
}
/// <summary>
/// Numero di Parts NON OK (errori calcolo o non lavorabili)
/// </summary>
public int NumPartsKo
{
get => PartListKo.Count();
}
/// <summary>
/// Numero di Parts NON lavorabili
/// </summary>
public int NumPartsNotMach
{
get => PartListNotMach.Count();
}
/// <summary>
/// Numero di Parts lavorabili dalla macchina
/// </summary>
public int NumPartsOk
{
get => PartListOk.Count();
}
/// <summary>
/// Elenco delle parts ed esito stima lavorabilità
/// </summary>
public List<PartCalcDTO> PartList { get; set; } = new List<PartCalcDTO>();
/// <summary>
/// Elenco parts con errori calcolo
/// </summary>
public List<PartCalcDTO> PartListCalcFail
{
get => PartList.Where(x => x.CalcResult == Enums.PartVerificationResult.CALCULATIONFAILED).ToList();
}
/// <summary>
/// Elenco delle parts KO / non "healthy" (non lavorabili o errore calcolo)
/// </summary>
public List<PartCalcDTO> PartListKo
{
get => PartList.Where(x => x.CalcResult != Enums.PartVerificationResult.MACHINABLE).ToList();
}
/// <summary>
/// Elenco parts NON lavorabili
/// </summary>
public List<PartCalcDTO> PartListNotMach
{
get => PartList.Where(x => x.CalcResult == Enums.PartVerificationResult.NOTMACHINABLE).ToList();
}
/// <summary>
/// Elenco parts lavorabili
/// </summary>
public List<PartCalcDTO> PartListOk
{
get => PartList.Where(x => x.CalcResult == Enums.PartVerificationResult.MACHINABLE).ToList();
}
#endregion Public Properties
}
}