added equals methods to base thermo object
This commit is contained in:
@@ -535,7 +535,46 @@ namespace CMS_CORE_Library.Models
|
||||
|
||||
#region Thermo models
|
||||
|
||||
/// <summary>
|
||||
/// Represents thermo gauge data
|
||||
/// </summary>
|
||||
public class GaugeModel
|
||||
{
|
||||
public uint TimeAdv { get; set; } = 0;
|
||||
public int Power { get; set; } = 0;
|
||||
public int Vacuum { get; set; } = 0;
|
||||
public int Air { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is GaugeModel item))
|
||||
return false;
|
||||
|
||||
if (TimeAdv != item.TimeAdv)
|
||||
return false;
|
||||
|
||||
if (Power != item.Power)
|
||||
return false;
|
||||
|
||||
if (Vacuum != item.Vacuum)
|
||||
return false;
|
||||
|
||||
if (Air != item.Air)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recipe Parameters
|
||||
/// </summary>
|
||||
public class RecipeParam
|
||||
{
|
||||
public short Id { get; set; } = 0;
|
||||
@@ -548,20 +587,86 @@ namespace CMS_CORE_Library.Models
|
||||
public bool Enabled { get; set; } = false;
|
||||
public bool HasError { get; set; } = false;
|
||||
public double ValueAct { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is RecipeParam item))
|
||||
return false;
|
||||
|
||||
if (Id != item.Id)
|
||||
return false;
|
||||
if (SetpointHMI != item.SetpointHMI)
|
||||
return false;
|
||||
if (SetpointPLC != item.SetpointPLC)
|
||||
return false;
|
||||
if (ValMax != item.ValMax)
|
||||
return false;
|
||||
if (ValMin != item.ValMin)
|
||||
return false;
|
||||
if (UnitMeasure != item.UnitMeasure)
|
||||
return false;
|
||||
if (Visible != item.Visible)
|
||||
return false;
|
||||
if (Enabled != item.Enabled)
|
||||
return false;
|
||||
if (HasError != item.HasError)
|
||||
return false;
|
||||
if (ValueAct != item.ValueAct)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ModuleBlock
|
||||
{
|
||||
public ushort Id { get; set; } = 0;
|
||||
public uint EstimatedDuration { get; set; } = 0;
|
||||
public uint EstimatedDelay { get; set; } = 0;
|
||||
public List<ushort> PrecedingId { get; set; } = new List<ushort>();
|
||||
public uint ActualDuration { get; set; } = 0;
|
||||
public uint ActualDelay { get; set; } = 0;
|
||||
public uint ActualDuration { get; set; } = 0;
|
||||
public uint EstimatedDelay { get; set; } = 0;
|
||||
public uint EstimatedDuration { get; set; } = 0;
|
||||
public List<ushort> PrecedingId { get; set; } = new List<ushort>();
|
||||
public bool Visible { get; set; } = false;
|
||||
public bool Running { get; set; } = false;
|
||||
public bool HasError { get; set; } = false;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is ModuleBlock item))
|
||||
return false;
|
||||
|
||||
if (Id != item.Id)
|
||||
return false;
|
||||
if (ActualDelay != item.ActualDelay)
|
||||
return false;
|
||||
if (ActualDuration != item.ActualDuration)
|
||||
return false;
|
||||
if (EstimatedDelay != item.EstimatedDelay)
|
||||
return false;
|
||||
if (EstimatedDuration != item.EstimatedDuration)
|
||||
return false;
|
||||
if (PrecedingId != item.PrecedingId)
|
||||
return false;
|
||||
if (Visible != item.Visible)
|
||||
return false;
|
||||
if (Running != item.Running)
|
||||
return false;
|
||||
if (HasError != item.HasError)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public class WarmerChannel
|
||||
@@ -571,6 +676,30 @@ namespace CMS_CORE_Library.Models
|
||||
public byte SetpointPLC { get; set; } = 0;
|
||||
public byte ChStatus { get; set; } = 0;
|
||||
public byte PercAct { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is WarmerChannel item))
|
||||
return false;
|
||||
|
||||
if (IdChannel != item.IdChannel)
|
||||
return false;
|
||||
if (SetpointThermoCam != item.SetpointThermoCam)
|
||||
return false;
|
||||
if (SetpointPLC != item.SetpointPLC)
|
||||
return false;
|
||||
if (ChStatus != item.ChStatus)
|
||||
return false;
|
||||
if (PercAct != item.PercAct)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -589,6 +718,46 @@ namespace CMS_CORE_Library.Models
|
||||
public double VacuumReadVal { get; set; } = 0;
|
||||
public double MouldEnergyOUT { get; set; } = 0;
|
||||
public double MouldEnergyIN { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is ProdInfo item))
|
||||
return false;
|
||||
|
||||
if (NumTarget != item.NumTarget)
|
||||
return false;
|
||||
if (NumDone != item.NumDone)
|
||||
return false;
|
||||
if (TimeWarm != item.TimeWarm)
|
||||
return false;
|
||||
if (TimeVent != item.TimeVent)
|
||||
return false;
|
||||
if (TimeVacuum != item.TimeVacuum)
|
||||
return false;
|
||||
if (TimeCycleGross != item.TimeCycleGross)
|
||||
return false;
|
||||
if (TimeCycleNet != item.TimeCycleNet)
|
||||
return false;
|
||||
if (MaterialTempEndWarm != item.MaterialTempEndWarm)
|
||||
return false;
|
||||
if (MaterialTempEndVent != item.MaterialTempEndVent)
|
||||
return false;
|
||||
if (MoldTemp != item.MoldTemp)
|
||||
return false;
|
||||
if (VacuumReadVal != item.VacuumReadVal)
|
||||
return false;
|
||||
if (MouldEnergyOUT != item.MouldEnergyOUT)
|
||||
return false;
|
||||
if (MouldEnergyIN != item.MouldEnergyIN)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public class ProdCycle
|
||||
@@ -597,6 +766,28 @@ namespace CMS_CORE_Library.Models
|
||||
public ushort MessageId { get; set; } = 0;
|
||||
public ushort Mode { get; set; } = 0;
|
||||
public uint TimeAdv { get; set; } = 0;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
// Object is not a GaugeModel instance
|
||||
if (!(obj is ProdCycle item))
|
||||
return false;
|
||||
|
||||
if (Status != item.Status)
|
||||
return false;
|
||||
if (MessageId != item.MessageId)
|
||||
return false;
|
||||
if (Mode != item.Mode)
|
||||
return false;
|
||||
if (TimeAdv != item.TimeAdv)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user