|
- using SqlSugar;
- using System;
- using System.Collections.Generic;
- using System.Diagnostics.Metrics;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.Academy._50L
- {
- [SplitTable(SplitType.Day)]//按月分表
- [SugarTable("SamplingData_{year}{month}{day}")]
- public class SamplingData
- {
- [SplitField]//分表字段特性,标注之后在插入或者删除的时候都会根据这个创建时间来查找对应的表进行修改
- public DateTime Createtime { get; set; }
-
- public string Id { get; set; }
-
- public string ProductNumberId { get; set; }
-
- /// <summary>
- /// 反应釜温度
- /// </summary>
- public float Temperature { get; set; }
- /// <summary>
- /// 反应釜蒸汽压力
- /// </summary>
- public float SteamPressure { get; set; }
- /// <summary>
- /// 反应釜蒸汽流量
- /// </summary>
- public float SteamFlowRate { get; set; }
- /// <summary>
- /// 冷凝水罐温度
- /// </summary>
- public float CondensateWaterTemperature { get; set; }
- /// <summary>
- /// 冷凝水罐湿度
- /// </summary>
- public float CondensateWaterHumidity { get; set; }
- /// <summary>
- /// 负压流量
- /// </summary>
- public float NegativePressureFlowRate { get; set; }
- /// <summary>
- /// 称重水罐重量
- /// </summary>
- public float WeighingWaterTankWeight { get; set; }
- /// <summary>
- /// 反应釜编码器值
- /// </summary>
- public float ReactEncoderValue { get; set; }
- /// <summary>
- /// 蒸汽比例阀实际开度
- /// </summary>
- public float ProportionalValveOpening { get; set; }
- /// <summary>
- /// 卤水配制罐重量
- /// </summary>
- public float BrineTankWeight { get; set; }
- /// <summary>
- /// 反应釜压力
- /// </summary>
- public float ReactPressure { get; set; }
-
- public SamplingData()
- {
- Createtime = DateTime.Now;
- Id = Guid.NewGuid().ToString();
- }
-
- /// <summary>
- /// 50L反应釜数据
- /// </summary>
- /// <param name="t">反应釜温度</param>
- /// <param name="sp">反应釜蒸汽压力</param>
- /// <param name="sfr">反应釜蒸汽流量</param>
- /// <param name="cwt">冷凝水罐温度</param>
- /// <param name="cwh">冷凝水罐湿度</param>
- /// <param name="npfr">负压流量</param>
- /// <param name="wwtw">称重水罐重量</param>
- /// <param name="pvo">蒸汽比例阀实际开度</param>
- /// <param name="pid">产品id</param>
- /// <param name="reactEncoderValue">反应釜编码器实际值</param>
- /// <param name="brineTankWeight">卤水罐重量</param>
- 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)
- {
- Createtime = DateTime.Now;
- Temperature = t;
- SteamPressure = sp;
- SteamFlowRate = sfr;
- CondensateWaterTemperature = cwt;
- CondensateWaterHumidity = cwh;
- NegativePressureFlowRate = npfr;
- WeighingWaterTankWeight = wwtw;
- ProportionalValveOpening = pvo;
- ReactEncoderValue = reactEncoderValue;
- BrineTankWeight = brineTankWeight;
- ProductNumberId = pid;
- Id = Guid.NewGuid().ToString();
- ReactPressure = reactPressure;
- }
-
- /// <summary>
- /// 生成测试数据
- /// </summary>
- /// <param name="pid"></param>
- public SamplingData(string pid)
- {
- Random random = new Random();
- Createtime = DateTime.Now;
- Temperature = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
- SteamPressure = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
- SteamFlowRate = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
- CondensateWaterTemperature = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
- CondensateWaterHumidity = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
- NegativePressureFlowRate = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
- WeighingWaterTankWeight = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
- ProportionalValveOpening = Convert.ToSingle((random.NextSingle() * 100f).ToString("0.00"));
- ProductNumberId = pid;
- Id = Guid.NewGuid().ToString();
- }
- }
- }
|