终端一体化运控平台
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.
 
 
 

109 lines
4.0 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 ProportionalValveOpening { get; set; }
  50. public SamplingData()
  51. {
  52. Createtime = DateTime.Now;
  53. Id = Guid.NewGuid().ToString();
  54. }
  55. /// <summary>
  56. /// 50L反应釜数据
  57. /// </summary>
  58. /// <param name="t">反应釜温度</param>
  59. /// <param name="sp">反应釜蒸汽压力</param>
  60. /// <param name="sfr">反应釜蒸汽流量</param>
  61. /// <param name="cwt">冷凝水罐温度</param>
  62. /// <param name="cwh">冷凝水罐湿度</param>
  63. /// <param name="npfr">负压流量</param>
  64. /// <param name="wwtw">称重水罐重量</param>
  65. /// <param name="pvo">蒸汽比例阀实际开度</param>
  66. /// <param name="pid">产品id</param>
  67. public SamplingData(float t, float sp, float sfr, float cwt, float cwh, float npfr, float wwtw, float pvo, string pid)
  68. {
  69. Createtime = DateTime.Now;
  70. Temperature = t;
  71. SteamPressure = sp;
  72. SteamFlowRate = sfr;
  73. CondensateWaterTemperature = cwt;
  74. CondensateWaterHumidity = cwh;
  75. NegativePressureFlowRate = npfr;
  76. WeighingWaterTankWeight = wwtw;
  77. ProportionalValveOpening = pvo;
  78. ProductNumberId = pid;
  79. Id = Guid.NewGuid().ToString();
  80. }
  81. /// <summary>
  82. /// 生成测试数据
  83. /// </summary>
  84. /// <param name="pid"></param>
  85. public SamplingData(string pid)
  86. {
  87. Random random = new Random();
  88. Createtime = DateTime.Now;
  89. Temperature = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  90. SteamPressure = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  91. SteamFlowRate = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  92. CondensateWaterTemperature = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  93. CondensateWaterHumidity = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  94. NegativePressureFlowRate = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  95. WeighingWaterTankWeight = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  96. ProportionalValveOpening = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
  97. ProductNumberId = pid;
  98. Id = Guid.NewGuid().ToString();
  99. }
  100. }
  101. }