MachineOutPutPerHour.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations.Schema;
  4. using System.Text;
  5. namespace ProductionLineMonitor.Core.Models
  6. {
  7. /// <summary>
  8. /// 机台小时产能表
  9. /// </summary>
  10. [Table("MachineOutPutPerHours")]
  11. public class MachineOutPutPerHour : Base
  12. {
  13. /// <summary>
  14. /// 机台Id
  15. /// </summary>
  16. public string MachineId { get; set; }
  17. /// <summary>
  18. /// 机种
  19. /// </summary>
  20. public string ModuleType { get; set; }
  21. /// <summary>
  22. /// 数据时间
  23. /// </summary>
  24. public DateTime? DataTime { get; set; }
  25. /// <summary>
  26. /// 运行时间
  27. /// </summary>
  28. public int? AutoRunTime { get; set; }
  29. /// <summary>
  30. /// 报警时间
  31. /// </summary>
  32. public int? AlarmTime { get; set; }
  33. /// <summary>
  34. /// 待料时间
  35. /// </summary>
  36. public int? IdleTime { get; set; }
  37. /// <summary>
  38. /// 上游待料时间
  39. /// </summary>
  40. public int? IdleTimeUpstream { get; set; }
  41. /// <summary>
  42. /// 下游待料时间
  43. /// </summary>
  44. public int? IdleTimeDownstream { get; set; }
  45. /// <summary>
  46. /// 自身待料时间
  47. /// </summary>
  48. public int? IdleTimeSelf { get; set; }
  49. /// <summary>
  50. /// 产能
  51. /// </summary>
  52. public int? OutPut { get; set; }
  53. /// <summary>
  54. /// 目标TT
  55. /// </summary>
  56. public int? TargetTT { get; set; }
  57. /// <summary>
  58. /// 实际TT
  59. /// </summary>
  60. public double? ActualTT { get; set; }
  61. /// <summary>
  62. /// 报警次数
  63. /// </summary>
  64. public int? AlarmSum { get; set; }
  65. /// <summary>
  66. /// 换料次数
  67. /// </summary>
  68. public int? LoadMATSum { get; set; }
  69. /// <summary>
  70. /// 换料时间
  71. /// </summary>
  72. public int? LoadMATTime { get; set; }
  73. public double TT
  74. {
  75. get
  76. {
  77. if (OutPut == 0)
  78. {
  79. return 0;
  80. }
  81. return (double)Math.Round((decimal)(AutoRunTime.Value * 1.0 / OutPut), 2);
  82. }
  83. }
  84. public string Period
  85. {
  86. get
  87. {
  88. int hour = DataTime.Value.Hour;
  89. return $"{hour}:00~{hour + 1}:00";
  90. }
  91. }
  92. }
  93. }