8ec2d47de1
Added Fanuc offset functions
219 lines
6.3 KiB
C#
219 lines
6.3 KiB
C#
using System;
|
|
|
|
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 class NcShankModel
|
|
{
|
|
public int ShankId { get; set; }
|
|
|
|
public int Balluf { get; set; }
|
|
|
|
public byte MagazineId { get; set; }
|
|
|
|
public byte PositionId { get; set; }
|
|
|
|
public byte MagazinePositionType { get; set; }
|
|
}
|
|
|
|
public class NcToolModel
|
|
{
|
|
[FanucOrder(1)]
|
|
[OsaiOrder(1)]
|
|
public short ToolId { get; set; }
|
|
|
|
[FanucOrder(2)]
|
|
[OsaiOrder(2)]
|
|
public short FamilyId { get; set; }
|
|
|
|
[FanucOrder(3)]
|
|
[OsaiOrder(3)]
|
|
public short ShankId { get; set; }
|
|
|
|
[FanucOrder(4)]
|
|
[OsaiOrder(4)]
|
|
public byte Status { get; set; }
|
|
|
|
[FanucOrder(5)]
|
|
[OsaiOrder(5)]
|
|
public short OffsetLength { get; set; }
|
|
|
|
[FanucOrder(6)]
|
|
[OsaiOrder(6)]
|
|
public int ResidualLife { get; set; }
|
|
|
|
[FanucOrder(7)]
|
|
[OsaiOrder(7)]
|
|
public uint ResidualRevive { get; set; }
|
|
|
|
[FanucOrder(8)]
|
|
[OsaiOrder(8)]
|
|
public ushort OffsetId1 { get; set; }
|
|
|
|
[FanucOrder(9)]
|
|
[OsaiOrder(9)]
|
|
public ushort OffsetId2 { get; set; }
|
|
|
|
[FanucOrder(10)]
|
|
[OsaiOrder(10)]
|
|
public ushort OffsetId3 { get; set; }
|
|
}
|
|
|
|
public class NcFamilyModel
|
|
{
|
|
public int 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; }
|
|
}
|
|
|
|
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 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,
|
|
MaxLoadPctAutoload = obj.MaxLoadPctAutoload,
|
|
MinLoadPctAutoload = obj.MinLoadPctAutoload,
|
|
DynamicCompensation = obj.DynamicCompensation,
|
|
LifeType = obj.LifeType,
|
|
NominalLife = obj.NominalLife,
|
|
ReviveDelta = obj.ReviveDelta
|
|
};
|
|
}
|
|
}
|
|
|
|
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 byte PositionId { get; set; }
|
|
|
|
public byte Type { get; set; }
|
|
|
|
public byte Disabled { get; set; }
|
|
}
|
|
|
|
// If u need to order properties, 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;
|
|
}
|
|
}
|
|
} |