using System.ComponentModel.DataAnnotations; namespace IStation.Win.View.ViewModel { public class RealTimePumpScheduleViewModel { [Display(Name = "泵")] public int Flag { get; set; } [Display(Name = "运行状态")] public double? RunStatus { get; set; } [Display(Name = "进口水位")] public double? InletWaterLevel { get; set; } [Display(Name = "泵压力")] public double? OutletPressure { get; set; } [Display(Name = "出口压力")] public double? OutletPressureAddWL { get; set; } [Display(Name = "曲线偏差(r)")] public double? ScadaCorrectionFactor { get; set; } [Display(Name = "模型偏差(r)")] public double? ModelCorrectionFactor { get; set; } [Display(Name = "流量")] public double? InstantaneousFlow { get; set; } [Display(Name = "功率")] public double? ActivePower { get; set; } [Display(Name = "转速")] public double? RotateSpeed { get; set; } [Display(Name = "功率偏差")] public double? ActivePowerDiff { get; set; } [Display(Name = "转速偏差")] public double? RotateSpeedDiif { get; set; } [Display(Name = "流量偏差")] public double? InstantaneousFlowDiif { get; set; } public void Set(RealTimePumpScadaViewModel vm) { this.InletWaterLevel = vm.InletWaterLevel; this.OutletPressureAddWL =Curve.PumpCalculateHelper.M2Mpa(this.InletWaterLevel??0) + this.OutletPressure; this.OutletPressureAddWL = Round(this.OutletPressureAddWL, 3); } public void Round() { this.OutletPressure = Round(this.OutletPressure, 3); this.OutletPressureAddWL = Round(this.OutletPressureAddWL, 3); this.InstantaneousFlow = Round(this.InstantaneousFlow, 1); this.ActivePower = Round(this.ActivePower, 1); this.RotateSpeed = Round(this.RotateSpeed, 1); this.ActivePowerDiff = Round(this.ActivePowerDiff, 2); this.RotateSpeedDiif = Round(this.RotateSpeedDiif, 2); this.InstantaneousFlowDiif = Round(this.InstantaneousFlowDiif, 2); } private double? Round(double? value, int le) { if (value == null) { return null; } return Math.Round(value.Value, le); } } }