using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
|
namespace IStation.Dto.DispatchAna
|
{
|
/// <summary>
|
/// 简单计算
|
/// </summary>
|
public class CalcBySimple_Request
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public class RunStatus
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public long MachineID { get; set; } = 0;
|
/// <summary>
|
/// -1 表示任意 0 关机 1开机
|
/// </summary>
|
public int Status { get; set; } = -1;
|
}
|
/// <summary>
|
///
|
/// </summary>
|
public class PipeParas
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public double TargetFlow { get; set; }
|
/// <summary>
|
/// 如果是压力就是出口压力
|
/// </summary>
|
public double TargetPress { get; set; }
|
/// <summary>
|
///
|
/// </summary>
|
public string TargetFlowMinQ { get; set; }
|
/// <summary>
|
///
|
/// </summary>
|
public string TargetFlowMaxQ { get; set; }
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public class ValveParas
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public string Name { get; set; }
|
/// <summary>
|
/// /
|
/// </summary>
|
public int Status { get; set; }
|
}
|
/// <summary>
|
///
|
/// </summary>
|
public long CorpID { get; set; }
|
/// <summary>
|
///
|
/// </summary>
|
public long StationID { get; set; }
|
|
/// <summary>
|
/// 水位参数
|
/// </summary>
|
public List<double> WaterLevelList { get; set; }
|
|
/// <summary>
|
///
|
/// </summary>
|
public List<PipeParas> PipeList { get; set; }
|
|
/// <summary>
|
///
|
/// </summary>
|
public List<ValveParas> ValveList { get; set; }
|
|
/// <summary>
|
///
|
/// </summary>
|
public List<RunStatus> RunStatusList { get; set; }
|
|
/// <summary>
|
/// 排序方法: 0 功率 1 流量间隔
|
/// </summary>
|
public int SortType { get; set; }
|
|
/// <summary>
|
/// 压力值类型 0:表示压力 1:表示扬程
|
/// </summary>
|
public int PressValueType { get; set; }
|
|
/// <summary>
|
/// /
|
/// </summary>
|
/// <param name="error_info"></param>
|
/// <returns></returns>
|
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.WaterLevelPara = new List<Calculation.DispatchAna.Model.WaterLevelPara>();
|
complex_request_paras.CorpID = this.CorpID;
|
complex_request_paras.StationID = this.StationID;
|
|
if(WaterLevelList != null && WaterLevelList.Count > 0)
|
{
|
complex_request_paras.WaterLevelPara = new List<Calculation.DispatchAna.Model.WaterLevelPara>();
|
foreach(var wl in WaterLevelList)
|
{
|
complex_request_paras.WaterLevelPara.Add(new Calculation.DispatchAna.Model.WaterLevelPara(wl));
|
}
|
}
|
else if (this.PressValueType == 1)
|
{// 1:表示扬程
|
complex_request_paras.WaterLevelPara = new List<Calculation.DispatchAna.Model.WaterLevelPara>();
|
complex_request_paras.WaterLevelPara.Add(new Calculation.DispatchAna.Model.WaterLevelPara(0));
|
}
|
|
|
if (this.PipeList != null&& this.PipeList.Count > 0)
|
{
|
complex_request_paras.OutletPipePara = new List<Calculation.DispatchAna.Model.OutletPipePara>();
|
foreach (var pipe in this.PipeList)
|
{
|
var pipe_model = new Calculation.DispatchAna.Model.OutletPipePara();
|
pipe_model.InitialFlowInfo(pipe.TargetFlow, pipe.TargetFlowMinQ , pipe.TargetFlowMaxQ);
|
|
if(this.PressValueType == 0)
|
{// 0:表示压力
|
pipe_model.TargetPress = pipe.TargetPress;
|
}
|
if (this.PressValueType == 1)
|
{// 1:表示扬程
|
pipe_model.TargetPress = pipe.TargetPress / 102;
|
}
|
complex_request_paras.OutletPipePara.Add(pipe_model);
|
}
|
}
|
|
if (this.ValveList != null && this.ValveList.Count > 0)
|
{
|
complex_request_paras.ValvePara = new List<Calculation.DispatchAna.Model.ValvePara>();
|
foreach (var valve in this.ValveList)
|
{
|
complex_request_paras.ValvePara.Add(
|
new Calculation.DispatchAna.Model.ValvePara() { Name = valve.Name, OpenStatus = valve.Status });
|
}
|
}
|
return complex_request_paras;
|
}
|
}
|
|
|
/// <summary>
|
/// 查看详细图表
|
/// </summary>
|
internal class CurveItem
|
{
|
public int Type { get; set; }//0表示单泵曲线 1表示并联曲线
|
public string Name { get; set; }
|
public List<List<double>> PointQH { get; set; }
|
public List<List<double>> PointQP { get; set; }
|
}
|
}
|