94 lines
2.2 KiB
C#
94 lines
2.2 KiB
C#
namespace Step.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 override bool Equals(object obj)
|
|
{
|
|
var item = obj as DTOHeadModel;
|
|
|
|
// Object is not a DTOHeadModel instance or a child
|
|
if (item == null)
|
|
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;
|
|
|
|
return true;
|
|
}
|
|
}
|
|
|
|
public class DTOSpindleModel : DTOHeadModel
|
|
{
|
|
public int ActualSpeed;
|
|
public ushort Load;
|
|
public ushort MountedTool;
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
var item = obj as DTOSpindleModel;
|
|
|
|
// Object is not a DTOSpindleModel
|
|
if (item == null)
|
|
return false;
|
|
|
|
// Compare the fields
|
|
if (ActualSpeed != item.ActualSpeed)
|
|
return false;
|
|
|
|
if (Load != item.Load)
|
|
return false;
|
|
|
|
if (MountedTool != item.MountedTool)
|
|
return false;
|
|
|
|
// Call Parent equals
|
|
return base.Equals(item);
|
|
}
|
|
}
|
|
|
|
public class DTOAbrasiveWaterJet : DTOHeadModel
|
|
{
|
|
public int ActualPressure;
|
|
public ushort Abrasive;
|
|
public float Vacum;
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
var item = obj as DTOAbrasiveWaterJet;
|
|
|
|
// Object is not a DTOSpindleModel
|
|
if (item == null)
|
|
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);
|
|
}
|
|
}
|
|
} |