Files
cms_thermo_active/Thermo.Active.Model/DTOModels/ThProd/DTOThermoPanelProd.cs
T
2020-10-19 18:47:20 +02:00

66 lines
2.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Model.DTOModels.ThProd
{
public class DTOThermoPanelProd
{
public short NumTarget { get; set; } = 0;
public short NumDone { get; set; } = 0;
public short NumPreHot { get; set; } = 0;
public DateTime? InizioProd { get; set; } = null;
public double StimaDurata { get; set; } = 0;
public double TempAct { get; set; } = 0;
public double TempSetpoint { get; set; } = 0;
public string NomeRicetta { get; set; } = "";
public double LastCadenza { get; set; } = 0;
public double LastTCiclo { get; set; } = 0;
public double LastTCicloNetto { get; set; } = 0;
public Dictionary<int, double> TS_Cadenza { get; set; } = new Dictionary<int, double>();
public Dictionary<int, double> TS_TCiclo { get; set; } = new Dictionary<int, double>();
public override bool Equals(object obj)
{
if (!(obj is DTOThermoPanelProd item))
return false;
if (NumTarget != item.NumTarget)
return false;
if (NumDone != item.NumDone)
return false;
if (NumPreHot != item.NumPreHot)
return false;
if (InizioProd != item.InizioProd)
return false;
if (Math.Round(Math.Abs(StimaDurata - item.StimaDurata), 1) >= Constants.EPSILON)
return false;
if (Math.Round(Math.Abs(TempAct - item.TempAct), 1) >= Constants.EPSILON)
return false;
if (Math.Round(Math.Abs(TempSetpoint - item.TempSetpoint), 1) >= Constants.EPSILON)
return false;
if (NomeRicetta != item.NomeRicetta)
return false;
if (Math.Round(Math.Abs(LastCadenza - item.LastCadenza), 1) >= Constants.EPSILON)
return false;
if (Math.Round(Math.Abs(LastTCiclo - item.LastTCiclo), 1) >= Constants.EPSILON)
return false;
if (Math.Round(Math.Abs(LastTCicloNetto - item.LastTCicloNetto), 1) >= Constants.EPSILON)
return false;
if (!Enumerable.SequenceEqual(TS_Cadenza, item.TS_Cadenza))
return false;
if (!Enumerable.SequenceEqual(TS_TCiclo, item.TS_TCiclo))
return false;
return true;
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
}