using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace IStation.Dto.DispatchAna { /// /// 当前泵站能效分析记录 /// public class StationEtaAnaRecord { /// /// /// public StationEtaAnaRecord() { } /// /// /// public StationEtaAnaRecord(Model.EtaMultiRealRecordPure rhs) { if (rhs.Qa != null) { this.Q = Math.Round(rhs.Qa.Value, 1); } if (rhs.Ha != null) { this.H = Math.Round(rhs.Ha.Value, 1); } if (rhs.Pa != null) { this.P = Math.Round(rhs.Pa.Value, 1); } if (rhs.Ea != null) { this.E = Math.Round(rhs.Ea.Value, 1); } if (rhs.WPa != null) { this.WP = Math.Round(rhs.WPa.Value, 1); } if (rhs.UWPa != null) { this.UWP = Math.Round(rhs.UWPa.Value, 1); } this.RunStatus = rhs.RunningCount > 0 ? IStation.RunStatus.Run : IStation.RunStatus.Shut; if (rhs.RunningCount > 0) { this.Items = new List(); } } /// /// 名称 /// public string Name { get; set; } /// /// 流量 /// public double? Q { get; set; } /// /// 功率 /// public double? P { get; set; } /// /// 扬程 /// public double? H { get; set; } /// /// 效率 /// public double? E { get; set; } /// /// 千吨能耗 /// public double? WP { get; set; } /// /// 单位能耗 /// public double? UWP { get; set; } /// /// 运行状态 /// public int RunStatus { get; set; } /// /// 子项集合 /// public List Items { get; set; } /// /// /// /// /// public IStation.Calculation.DispatchAna.Model.EtaAnaRecord4Station Build(out string error_info) { error_info = null; IStation.Calculation.DispatchAna.Model.EtaAnaRecord4Station eta_ana_records = new Calculation.DispatchAna.Model.EtaAnaRecord4Station(); eta_ana_records.Name = this.Name; eta_ana_records.Q = this.Q; eta_ana_records.H = this.H; eta_ana_records.E = this.E; eta_ana_records.P = this.P; eta_ana_records.WP = this.WP; eta_ana_records.UWP = this.UWP; eta_ana_records.RunStatus = this.RunStatus; eta_ana_records.Items = new List(); foreach(var v in this.Items) { eta_ana_records.Items.Add(new Calculation.DispatchAna.Model.EtaAnaRecord4Pump() { MachineID = v.MachineID, PumpID = v.PumpID, Q = v.Q, H = v.H, E = v.E, P = v.P, WP = v.WP, UWP = v.UWP, PipeLineID = v.PipeLineID, Name = v.Name, HZ = v.HZ }); } return eta_ana_records; } } }