using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace IStation.Dto.DispatchAna { /// /// 简单计算 /// public class CalcBySimple_Request { /// /// 机泵运行状态 /// public class RunStatus { /// /// /// public long MachineID { get; set; } = 0; /// /// -1 表示任意 0 关机 1开机 /// public int Status { get; set; } = -1; } /// /// /// public long CorpID { get; set; } /// /// /// public long StationID { get; set; } /// /// 管路参数 /// public class PipeParas { /// /// /// public double TargetFlow { get; set; } /// /// 如果是压力就是出口压力 /// public double TargetPress { get; set; } /// /// /// public string TargetFlowMinQ { get; set; } /// /// /// public string TargetFlowMaxQ { get; set; } } /// /// 阀门参数 /// public class ValveParas { /// /// /// public string Name { get; set; } /// /// / /// public int Status { get; set; } } /// /// 水位参数 /// public List WaterLevelList { get; set; } /// /// 管路参数 /// public List PipeList { get; set; } /// /// 阀门参数 /// public List ValveList { get; set; } /// /// 机泵运行参数 /// public List RunStatusList { get; set; } /// /// 排序方法: 0 功率 1 流量间隔 /// public int SortType { get; set; } /// /// 压力值类型 0:表示压力 1:表示扬程 /// public int PressValueType { get; set; } /// /// 能效分析记录 /// public StationEtaAnaRecord EtaAnaRecord { get; set; } /// /// 构建成复合参数 /// /// /// public IStation.Calculation.DispatchAna.Model.RequestParasComplex BuildRequestComplex(out string error_info) { error_info = null; var complex_request_paras = new Calculation.DispatchAna.Model.RequestParasComplex(); complex_request_paras.InletPipePara = new List(); complex_request_paras.CorpID = this.CorpID; complex_request_paras.StationID = this.StationID; if (this.PressValueType == 1) {//1:表示扬程 complex_request_paras.PressValueType = Calculation.DispatchAna.Model.RequestParasComplex.ePressValueType.扬程; complex_request_paras.InletPipePara = new List(); complex_request_paras.InletPipePara.Add(new Calculation.DispatchAna.Model.InletPipePara(0)); } else {//压力 complex_request_paras.PressValueType = Calculation.DispatchAna.Model.RequestParasComplex.ePressValueType.压力; if (WaterLevelList != null && WaterLevelList.Count > 0) { complex_request_paras.InletPipePara = new List(); foreach (var wl in WaterLevelList) { complex_request_paras.InletPipePara.Add(new Calculation.DispatchAna.Model.InletPipePara(wl)); } } } if (this.PipeList != null&& this.PipeList.Count > 0) { complex_request_paras.OutletPipePara = new List(); foreach (var pipe in this.PipeList) { var pipe_model = new Calculation.DispatchAna.Model.OutletPipePara(); pipe_model.InitialFlowInfo(pipe.TargetFlow, pipe.TargetFlowMinQ, pipe.TargetFlowMaxQ); pipe_model.TargetPress = pipe.TargetPress; complex_request_paras.OutletPipePara.Add(pipe_model); } } if (this.ValveList != null && this.ValveList.Count > 0) { complex_request_paras.ValvePara = new List(); foreach (var valve in this.ValveList) { complex_request_paras.ValvePara.Add( new Calculation.DispatchAna.Model.ValvePara() { Name = valve.Name, OpenStatus = valve.Status }); } } complex_request_paras.SchemeSortType = (Calculation.DispatchAna.Model.eAnaSchemeSortType)this.SortType; return complex_request_paras; } /// /// /// /// public IStation.Calculation.DispatchAna.Model.MachineRunPara BuildMachineRunPara(out string error_info) { error_info = null; List machine_run_filter_list = null; if (this.RunStatusList == null) { // IStation.LogHelper.Info("RunStatusList none"); } else if (this.RunStatusList.Count() == 0) { // IStation.LogHelper.Info("RunStatusList Count==0"); } else //if (request.Setting.OpenStatus != null && request.Setting.OpenStatus.Count > 0) { machine_run_filter_list = new List(); foreach (var d in this.RunStatusList) { var binding_list = new Service.PipeLineBinding().GetByPipeLineID(this.CorpID, d.MachineID); machine_run_filter_list.Add(new IStation.Calculation.DispatchAna.Model.MachineRunFilter() { MachineID = binding_list.First().ID, RunStatus = d.Status, MaxFlow = -1 }); } } return new IStation.Calculation.DispatchAna.Model.MachineRunPara() { MachineRunFilter = machine_run_filter_list }; } /// /// /// /// /// public IStation.Calculation.DispatchAna.Model.EtaAnaRecord4Station BuildEtaAnaRecord(out string error_info) { error_info = null; if (EtaAnaRecord == null) return null; return EtaAnaRecord.Build(out error_info); } } /// /// 查看详细图表 /// internal class CurveItem { public int Type { get; set; }//0表示单泵曲线 1表示并联曲线 public string Name { get; set; } public List> PointQH { get; set; } public List> PointQP { get; set; } } }