155 lines
3.7 KiB
C#
155 lines
3.7 KiB
C#
using static CMS_CORE_Library.Models.DataStructures;
|
|
|
|
namespace Thermo.Active.Model.DTOModels
|
|
{
|
|
public class DTOHeadModel
|
|
{
|
|
public uint Id;
|
|
public string Type;
|
|
public bool inWarning;
|
|
public bool inAlarm;
|
|
public bool OverrideEditable;
|
|
public byte Override;
|
|
public byte Process;
|
|
public bool IsActive;
|
|
public bool IsSelected;
|
|
public bool AbrasiveIsActive;
|
|
public uint WorkedTime;
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
|
|
// Object is not a DTOHeadModel instance or a child
|
|
if (!(obj is DTOHeadModel item))
|
|
return false;
|
|
|
|
if (Id != item.Id)
|
|
return false;
|
|
|
|
if (Process != item.Process)
|
|
return false;
|
|
|
|
if (Override != item.Override)
|
|
return false;
|
|
|
|
if (OverrideEditable != item.OverrideEditable)
|
|
return false;
|
|
|
|
if (IsActive != item.IsActive)
|
|
return false;
|
|
|
|
if (IsSelected != item.IsSelected)
|
|
return false;
|
|
|
|
if (AbrasiveIsActive != item.AbrasiveIsActive)
|
|
return false;
|
|
|
|
if (WorkedTime != item.WorkedTime)
|
|
return false;
|
|
|
|
|
|
return true;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return base.GetHashCode();
|
|
}
|
|
}
|
|
|
|
public class DTOSpindleModel : DTOHeadModel
|
|
{
|
|
public int ActualSpeed;
|
|
public short Load;
|
|
public bool Configured;
|
|
public ROTATION Rotation;
|
|
public bool FixedHead;
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
// Object is not a DTOSpindleModel
|
|
if (!(obj is DTOSpindleModel item))
|
|
return false;
|
|
|
|
// Compare the fields
|
|
if (ActualSpeed != item.ActualSpeed)
|
|
return false;
|
|
|
|
if (Load != item.Load)
|
|
return false;
|
|
|
|
if (Configured != item.Configured)
|
|
return false;
|
|
|
|
if (Rotation != item.Rotation)
|
|
return false;
|
|
|
|
// Call Parent equals
|
|
return base.Equals(item);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return base.GetHashCode();
|
|
}
|
|
}
|
|
|
|
public class DTOAbrasiveWaterJet : DTOHeadModel
|
|
{
|
|
public int ActualPressure;
|
|
public ushort Abrasive;
|
|
public float Vacum;
|
|
public bool FixedHead;
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
// Object is not a DTOSpindleModel
|
|
if (!(obj is DTOAbrasiveWaterJet item))
|
|
return false;
|
|
|
|
// Compare the fields
|
|
if (ActualPressure != item.ActualPressure)
|
|
return false;
|
|
|
|
if (Abrasive != item.Abrasive)
|
|
return false;
|
|
|
|
if (Vacum != item.Vacum)
|
|
return false;
|
|
|
|
// Call Parent equals
|
|
return base.Equals(item);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return base.GetHashCode();
|
|
}
|
|
}
|
|
|
|
public class DTOWaterJet : DTOHeadModel
|
|
{
|
|
public int ActualPressure;
|
|
public bool FixedHead;
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
|
|
// Object is not a DTOSpindleModel
|
|
if (!(obj is DTOWaterJet item))
|
|
return false;
|
|
|
|
// Compare the fields
|
|
if (ActualPressure != item.ActualPressure)
|
|
return false;
|
|
|
|
// Call Parent equals
|
|
return base.Equals(item);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return base.GetHashCode();
|
|
}
|
|
}
|
|
} |