118 lines
4.8 KiB
C#
118 lines
4.8 KiB
C#
using CMS_CORE_Library.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Thermo.Active.Model.DTOModels.ThProd
|
|
{
|
|
public class DTOProdInfo
|
|
{
|
|
#region Public Constructors
|
|
|
|
public DTOProdInfo()
|
|
{
|
|
}
|
|
|
|
public DTOProdInfo(ThermoModels.ProdInfoModel pimRawData)
|
|
{
|
|
this.DtEvent = pimRawData.DtEvent;
|
|
this.NumDone = pimRawData.NumDone;
|
|
this.NumTarget = pimRawData.NumTarget;
|
|
this.ThermoImage = pimRawData.ThermoImage;
|
|
this.TimeCycleGross = Math.Round((double)pimRawData.TimeCycleGross / this.ScaleFactor, 2);
|
|
this.TimeCycleNet = Math.Round((double)pimRawData.TimeCycleNet / this.ScaleFactor, 2);
|
|
this.TimeVacuum = Math.Round((double)pimRawData.TimeVacuum / this.ScaleFactor, 2);
|
|
this.TimeVent = Math.Round((double)pimRawData.TimeVent / this.ScaleFactor, 2);
|
|
this.TimeWarm = Math.Round((double)pimRawData.TimeWarm / this.ScaleFactor, 2);
|
|
this.MaterialTempEndWarm = pimRawData.MaterialTempEndWarm;
|
|
this.MaterialTempEndVent = pimRawData.MaterialTempEndVent;
|
|
this.MoldTemp = pimRawData.MoldTemp;
|
|
this.VacuumReadVal = pimRawData.VacuumReadVal;
|
|
this.MouldEnergyIN = pimRawData.MouldEnergyIN;
|
|
this.MouldEnergyOUT = pimRawData.MouldEnergyOUT;
|
|
this.IsScrap = pimRawData.IsScrap;
|
|
this.NumPreHot = pimRawData.NumPreHot;
|
|
}
|
|
|
|
#endregion Public Constructors
|
|
|
|
#region Public Properties
|
|
|
|
public DateTime DtEvent { get; set; }
|
|
public bool IsScrap { get; set; } = false;
|
|
public double MaterialTempEndVent { get; set; } = 0;
|
|
public double MaterialTempEndWarm { get; set; } = 0;
|
|
public double MoldTemp { get; set; } = 0;
|
|
public double MouldEnergyIN { get; set; } = 0;
|
|
public double MouldEnergyOUT { get; set; } = 0;
|
|
public int NumDec { get; set; } = 1;
|
|
public short NumDone { get; set; } = 0;
|
|
public short NumPreHot { get; set; } = 0;
|
|
public short NumTarget { get; set; } = 0;
|
|
public int ScaleFactor { get; set; } = 1000;
|
|
public string ThermoImage { get; set; } = "";
|
|
public double TimeCycleGross { get; set; } = 0;
|
|
public double TimeCycleNet { get; set; } = 0;
|
|
public double TimeVacuum { get; set; } = 0;
|
|
public double TimeVent { get; set; } = 0;
|
|
public double TimeWarm { get; set; } = 0;
|
|
public double VacuumReadVal { get; set; } = 0;
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Public Methods
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
// Object is not a GaugeModel instance
|
|
if (!(obj is DTOProdInfo item))
|
|
return false;
|
|
|
|
if (DtEvent != item.DtEvent)
|
|
return false;
|
|
if (NumTarget != item.NumTarget)
|
|
return false;
|
|
if (NumDone != item.NumDone)
|
|
return false;
|
|
if (ThermoImage != item.ThermoImage)
|
|
return false;
|
|
if (Math.Round(Math.Abs(TimeWarm - item.TimeWarm), 1) >= Constants.EPSILON)
|
|
return false;
|
|
if (Math.Round(Math.Abs(TimeVent - item.TimeVent), 1) >= Constants.EPSILON)
|
|
return false;
|
|
if (Math.Round(Math.Abs(TimeVacuum - item.TimeVacuum), 1) >= Constants.EPSILON)
|
|
return false;
|
|
if (Math.Round(Math.Abs(TimeCycleGross - item.TimeCycleGross), 1) >= Constants.EPSILON)
|
|
return false;
|
|
if (Math.Round(Math.Abs(TimeCycleNet - item.TimeCycleNet), 1) >= Constants.EPSILON)
|
|
return false;
|
|
if (Math.Round(Math.Abs(MaterialTempEndWarm - item.MaterialTempEndWarm), 1) >= Constants.EPSILON)
|
|
return false;
|
|
if (Math.Round(Math.Abs(MaterialTempEndVent - item.MaterialTempEndVent), 1) >= Constants.EPSILON)
|
|
return false;
|
|
if (Math.Round(Math.Abs(MoldTemp - item.MoldTemp), 1) >= Constants.EPSILON)
|
|
return false;
|
|
if (Math.Round(Math.Abs(VacuumReadVal - item.VacuumReadVal), 1) >= Constants.EPSILON)
|
|
return false;
|
|
if (Math.Round(Math.Abs(MouldEnergyOUT - item.MouldEnergyOUT), 1) >= Constants.EPSILON)
|
|
return false;
|
|
if (Math.Round(Math.Abs(MouldEnergyIN - item.MouldEnergyIN), 1) >= Constants.EPSILON)
|
|
return false;
|
|
if (IsScrap != item.IsScrap)
|
|
return false;
|
|
if (NumPreHot != item.NumPreHot)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return base.GetHashCode();
|
|
}
|
|
|
|
#endregion Public Methods
|
|
}
|
|
} |