Files
cms_thermo_active/Step.Model/DTOModels/ToolModels/DTONcFamilyModel.cs
T
2018-06-26 17:21:58 +02:00

124 lines
3.6 KiB
C#

using Step.Model.DatabaseModels;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Step.Model.DTOModels.ToolModels
{
public class DTONcFamilyModel
{
public int Id { get; set; }
[Required]
public string Name { get; set; }
[Required]
public byte Type { get; set; }
[Required]
public byte RightSize { get; set; }
[Required]
public byte LeftSize { get; set; }
[Required]
public byte TcpTable { get; set; }
[Required]
public byte Gamma { get; set; }
[Required]
public byte RotationType { get; set; }
[Required]
public byte CoolingByte { get; set; }
[Required]
public short MaxSpeed { get; set; }
[Required]
public byte MaxLoad { get; set; }
[Required]
public byte MinLoadPctAutoload { get; set; }
[Required]
public byte MaxLoadPctAutoload { get; set; }
[Required]
public byte DynamicCompensation { get; set; }
[Required]
public byte MinLoadDynamicCompensation { get; set; }
[Required]
public byte MaxLoadDynamicCompensation { get; set; }
[Required]
public byte LifeType { get; set; }
[Required]
public int NominalLife { get; set; }
[Required]
public short ReviveDelta { get; set; }
public List<NcToolModel> Tools;
public static explicit operator DTONcFamilyModel(NcFamilyModel obj)
{
return new DTONcFamilyModel()
{
Id = obj.FamilyId,
Name = obj.Name,
Type = obj.Type,
RightSize = obj.RightSize,
LeftSize = obj.LeftSize,
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,
};
}
public static explicit operator NcFamilyModel(DTONcFamilyModel obj)
{
return new NcFamilyModel()
{
FamilyId = obj.Id,
Name = obj.Name,
Type = obj.Type,
RightSize = obj.RightSize,
LeftSize = obj.LeftSize,
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,
};
}
}
}