using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Text; namespace ProductionLineMonitor.Core.Models { /// /// 机台小时产能表 /// [Table("MachineOutPutPerHours")] public class MachineOutPutPerHour : Base { /// /// 机台Id /// public string MachineId { get; set; } /// /// 机种 /// public string ModuleType { get; set; } /// /// 数据时间 /// public DateTime? DataTime { get; set; } /// /// 运行时间 /// public int? AutoRunTime { get; set; } /// /// 报警时间 /// public int? AlarmTime { get; set; } /// /// 待料时间 /// public int? IdleTime { get; set; } /// /// 上游待料时间 /// public int? IdleTimeUpstream { get; set; } /// /// 下游待料时间 /// public int? IdleTimeDownstream { get; set; } /// /// 自身待料时间 /// public int? IdleTimeSelf { get; set; } /// /// 产能 /// public int? OutPut { get; set; } /// /// 目标TT /// public int? TargetTT { get; set; } /// /// 实际TT /// public double? ActualTT { get; set; } /// /// 报警次数 /// public int? AlarmSum { get; set; } /// /// 换料次数 /// public int? LoadMATSum { get; set; } /// /// 换料时间 /// public int? LoadMATTime { get; set; } public double TT { get { if (OutPut == 0) { return 0; } return (double)Math.Round((decimal)(AutoRunTime.Value * 1.0 / OutPut), 2); } } public string Period { get { int hour = DataTime.Value.Hour; return $"{hour}:00~{hour + 1}:00"; } } } }