279 lines
6.9 KiB
C#
279 lines
6.9 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using static CMS_CORE_Library.Models.DataStructures;
|
|
|
|
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 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 DTOToolInSpindleModel
|
|
{
|
|
// Siemens data
|
|
public string ToolName;
|
|
public int ChildId;
|
|
// Fanuc-Osai
|
|
public int FamilyId;
|
|
public int ShankId;
|
|
|
|
public bool Disabled { get; set; }
|
|
public bool Broken { get; set; }
|
|
public bool Measured { get; set; }
|
|
public int ResidualLife { get; set; }
|
|
|
|
public int MaxSpeed { get; set; }
|
|
public byte MaxLoad { get; set; }
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
// Object is not a DTOSpindleModel
|
|
if (!(obj is DTOToolInSpindleModel item))
|
|
return false;
|
|
|
|
// Compare the fields
|
|
if (ToolName != item.ToolName)
|
|
return false;
|
|
|
|
if (ChildId != item.ChildId)
|
|
return false;
|
|
|
|
if (Disabled != item.Disabled)
|
|
return false;
|
|
|
|
if (Broken != item.Broken)
|
|
return false;
|
|
|
|
if (Measured != item.Measured)
|
|
return false;
|
|
|
|
if (ResidualLife != item.ResidualLife)
|
|
return false;
|
|
|
|
if (MaxSpeed != item.MaxSpeed)
|
|
return false;
|
|
|
|
if (MaxLoad != item.MaxLoad)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
}
|
|
|
|
public class DTOSpindleModel : DTOHeadModel
|
|
{
|
|
public int ActualSpeed;
|
|
public short Load;
|
|
public ushort MountedTool;
|
|
public bool Configured;
|
|
public ROTATION Rotation;
|
|
public bool FixedHead;
|
|
public DTOToolInSpindleModel ToolData;
|
|
|
|
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 (MountedTool != item.MountedTool)
|
|
return false;
|
|
|
|
if (Configured != item.Configured)
|
|
return false;
|
|
|
|
if (Rotation != item.Rotation)
|
|
return false;
|
|
|
|
if (ToolData != null && !ToolData.Equals(item.ToolData))
|
|
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();
|
|
}
|
|
}
|
|
|
|
public class DTOAdditive : DTOHeadModel
|
|
{
|
|
public int FusionTemperature;
|
|
public int ExtruderPressure;
|
|
public int NozzlePressure;
|
|
|
|
public List<DTOHistoricalArrayModel> TemperaturesArray = new List<DTOHistoricalArrayModel>();
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
|
|
// Object is not a DTOSpindleModel
|
|
if (!(obj is DTOAdditive item))
|
|
return false;
|
|
|
|
if (FusionTemperature != item.FusionTemperature)
|
|
return false;
|
|
|
|
if (ExtruderPressure != item.ExtruderPressure)
|
|
return false;
|
|
|
|
if (NozzlePressure != item.NozzlePressure)
|
|
return false;
|
|
|
|
if (!TemperaturesArray.SequenceEqual(item.TemperaturesArray))
|
|
return false;
|
|
|
|
// Call Parent equals
|
|
return base.Equals(item);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return base.GetHashCode();
|
|
}
|
|
}
|
|
|
|
public class DTOCuttingGlass : DTOHeadModel
|
|
{
|
|
public float ActualPressure;
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
|
|
// Object is not a DTOSpindleModel
|
|
if (!(obj is DTOCuttingGlass 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();
|
|
}
|
|
}
|
|
} |