using System; using System.Collections.Generic; namespace CMS_CORE_Library.Models { public class ToolManagerOptionsModel { public bool FamilyOpt { get; set; } public bool ShankOpt { get; set; } public bool MagPosTypeOpt { get; set; } public bool OffsetOpt { get; set; } public bool ReviveOpt { get; set; } public bool GammaOpt { get; set; } public bool LifeOpt { get; set; } public bool TcpOpt { get; set; } public bool CoolingOpt { get; set; } public bool MultidimensionalShankOpt { get; set; } public bool SelfAdaptivePathOpt { get; set; } public bool DynamicCompensationOpt { get; set; } public bool BallufOpt { get; set; } } public class OffsetModel { public short Id { get; set; } public double Length { get; set; } public double Radius { get; set; } public double WearLength { get; set; } public double WearRadius { get; set; } public string UnitOfMeasure { get; set; } public double RealLength { get; set; } public double RealRadius { get; set; } // Osai custom values public List CustomDouble { get; set; } public List CustomInt { get; set; } } public class NcShankModel { public ushort ShankId { get; set; } public ushort Balluf { get; set; } public byte MagazineId { get; set; } public ushort PositionId { get; set; } public byte MagazinePositionType { get; set; } public byte OriginMagazineId { get; set; } public ushort OriginPositionId { get; set; } } public class NcToolModel { public short ToolId { get; set; } public short FamilyId { get; set; } public short ShankId { get; set; } public byte Status { get; set; } public short OffsetLength { get; set; } public int ResidualLife { get; set; } public ushort OffsetId1 { get; set; } public ushort OffsetId2 { get; set; } public ushort OffsetId3 { get; set; } public uint ResidualRevive { get; set; } public uint ResidualPresetting { get; set; } } public class NcFamilyModel { public ushort FamilyId { get; set; } public byte ToolType { get; set; } public byte TcpTable { get; set; } public byte Gamma { get; set; } public byte RotationType { get; set; } public byte CoolingByte { get; set; } public ushort MaxSpeed { get; set; } public byte MaxLoad { get; set; } public byte MinLoadPctAutoload { get; set; } public byte MaxLoadPctAutoload { get; set; } public ushort DynamicCompensation { get; set; } public byte MinLoadDynamicCompensation { get; set; } public byte MaxLoadDynamicCompensation { get; set; } public byte LifeType { get; set; } public int NominalLife { get; set; } public ushort ReviveDelta { get; set; } public byte RightSize { get; set; } public byte LeftSize { get; set; } public ushort _PresettingDelta { get; set; } } internal class NcFamilyFileModel { public int Id { get; set; } public byte ToolType { get; set; } public byte TcpTable { get; set; } public byte Gamma { get; set; } public byte RotationType { get; set; } public byte CoolingByte { get; set; } public ushort MaxSpeed { get; set; } public byte MaxLoad { get; set; } public byte MinLoadPctAutoload { get; set; } public byte MaxLoadPctAutoload { get; set; } public ushort DynamicCompensation { get; set; } public byte MinLoadDynamicCompensation { get; set; } public byte MaxLoadDynamicCompensation { get; set; } public byte LifeType { get; set; } public int NominalLife { get; set; } public ushort ReviveDelta { get; set; } public ushort PresettingDelta { get; set; } public static explicit operator NcFamilyFileModel(NcFamilyModel obj) { return new NcFamilyFileModel() { Id = obj.FamilyId, ToolType = obj.ToolType, TcpTable = obj.TcpTable, Gamma = obj.Gamma, RotationType = obj.RotationType, CoolingByte = obj.CoolingByte, MaxSpeed = obj.MaxSpeed, MaxLoad = obj.MaxLoad, MinLoadDynamicCompensation = obj.MinLoadDynamicCompensation, MaxLoadDynamicCompensation = obj.MaxLoadDynamicCompensation, MinLoadPctAutoload = obj.MinLoadPctAutoload, MaxLoadPctAutoload = obj.MaxLoadPctAutoload, DynamicCompensation = obj.DynamicCompensation, LifeType = obj.LifeType, NominalLife = obj.NominalLife, ReviveDelta = obj.ReviveDelta, PresettingDelta = obj._PresettingDelta }; } } internal class NcFamilySizeFileModel { public int Id { get; set; } public byte RightSize { get; set; } public byte LeftSize { get; set; } public static explicit operator NcFamilySizeFileModel(NcFamilyModel obj) { return new NcFamilySizeFileModel() { Id = obj.FamilyId, RightSize = obj.RightSize, LeftSize = obj.LeftSize }; } } public class NcMagazinePositionModel { public byte MagazineId { get; set; } public ushort PositionId { get; set; } public byte Type { get; set; } } // If u need to order properties, u could use the code below // properties = properties.OrderBy(x => ((FanucOrderAttribute)x.GetCustomAttribute(typeof(FanucOrderAttribute))).Val).ToArray(); public class OsaiOrderAttribute : Attribute { public int Val { get; set; } public OsaiOrderAttribute(int val) { Val = val; } } public class FanucOrderAttribute : Attribute { public int Val { get; set; } public FanucOrderAttribute(int val) { Val = val; } } }