终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

126 lines
4.8 KiB

  1. using SqlSugar;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Diagnostics.Metrics;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace BPASmartClient.Academy._50L
  9. {
  10. [SplitTable(SplitType.Day)]//按月分表
  11. [SugarTable("SamplingData_{year}{month}{day}")]
  12. public class SamplingData
  13. {
  14. [SplitField]//分表字段特性,标注之后在插入或者删除的时候都会根据这个创建时间来查找对应的表进行修改
  15. public DateTime Createtime { get; set; }
  16. public string Id { get; set; }
  17. public string ProductNumberId { get; set; }
  18. /// <summary>
  19. /// 反应釜温度
  20. /// </summary>
  21. public float Temperature { get; set; }
  22. /// <summary>
  23. /// 反应釜蒸汽压力
  24. /// </summary>
  25. public float SteamPressure { get; set; }
  26. /// <summary>
  27. /// 反应釜蒸汽流量
  28. /// </summary>
  29. public float SteamFlowRate { get; set; }
  30. /// <summary>
  31. /// 冷凝水罐温度
  32. /// </summary>
  33. public float CondensateWaterTemperature { get; set; }
  34. /// <summary>
  35. /// 冷凝水罐湿度
  36. /// </summary>
  37. public float CondensateWaterHumidity { get; set; }
  38. /// <summary>
  39. /// 负压流量
  40. /// </summary>
  41. public float NegativePressureFlowRate { get; set; }
  42. /// <summary>
  43. /// 称重水罐重量
  44. /// </summary>
  45. public float WeighingWaterTankWeight { get; set; }
  46. /// <summary>
  47. /// 反应釜编码器值
  48. /// </summary>
  49. public float ReactEncoderValue { get; set; }
  50. /// <summary>
  51. /// 蒸汽比例阀实际开度
  52. /// </summary>
  53. public float ProportionalValveOpening { get; set; }
  54. /// <summary>
  55. /// 卤水配制罐重量
  56. /// </summary>
  57. public float BrineTankWeight { get; set; }
  58. /// <summary>
  59. /// 反应釜压力
  60. /// </summary>
  61. public float ReactPressure { get; set; }
  62. public SamplingData()
  63. {
  64. Createtime = DateTime.Now;
  65. Id = Guid.NewGuid().ToString();
  66. }
  67. /// <summary>
  68. /// 50L反应釜数据
  69. /// </summary>
  70. /// <param name="t">反应釜温度</param>
  71. /// <param name="sp">反应釜蒸汽压力</param>
  72. /// <param name="sfr">反应釜蒸汽流量</param>
  73. /// <param name="cwt">冷凝水罐温度</param>
  74. /// <param name="cwh">冷凝水罐湿度</param>
  75. /// <param name="npfr">负压流量</param>
  76. /// <param name="wwtw">称重水罐重量</param>
  77. /// <param name="pvo">蒸汽比例阀实际开度</param>
  78. /// <param name="pid">产品id</param>
  79. /// <param name="reactEncoderValue">反应釜编码器实际值</param>
  80. /// <param name="brineTankWeight">卤水罐重量</param>
  81. public SamplingData(float t, float sp, float sfr, float cwt, float cwh, float npfr, float wwtw, float pvo, string pid, float reactEncoderValue, float brineTankWeight, float reactPressure)
  82. {
  83. Createtime = DateTime.Now;
  84. Temperature = t;
  85. SteamPressure = sp;
  86. SteamFlowRate = sfr;
  87. CondensateWaterTemperature = cwt;
  88. CondensateWaterHumidity = cwh;
  89. NegativePressureFlowRate = npfr;
  90. WeighingWaterTankWeight = wwtw;
  91. ProportionalValveOpening = pvo;
  92. ReactEncoderValue = reactEncoderValue;
  93. BrineTankWeight = brineTankWeight;
  94. ProductNumberId = pid;
  95. Id = Guid.NewGuid().ToString();
  96. ReactPressure = reactPressure;
  97. }
  98. /// <summary>
  99. /// 生成测试数据
  100. /// </summary>
  101. /// <param name="pid"></param>
  102. public SamplingData(string pid)
  103. {
  104. Random random = new Random();
  105. Createtime = DateTime.Now;
  106. Temperature = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  107. SteamPressure = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  108. SteamFlowRate = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  109. CondensateWaterTemperature = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  110. CondensateWaterHumidity = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  111. NegativePressureFlowRate = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  112. WeighingWaterTankWeight = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  113. ProportionalValveOpening = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  114. ProductNumberId = pid;
  115. Id = Guid.NewGuid().ToString();
  116. }
  117. }
  118. }