using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.Calculation
|
{
|
internal class shys金泽取水 : PlanAnaBaseCalculator
|
{
|
public shys金泽取水()
|
{
|
this._corpID = 4;
|
var calc = new IStation.Calculation.DispatchAna.Calculator_OptAna_General();
|
|
calc.UpOutletPressCount = 5;
|
calc.UpOutletPressPercent = 3;
|
this._dispatchAnaCalc = calc;
|
}
|
|
/// <summary>
|
/// 测点字典(这个每个泵站都不一样)
|
/// </summary>
|
private Tuple<string, long> monitor出水瞬时流量 = new Tuple<string, long>("_JZQSCS_flow", 1588090894278594560);
|
private Tuple<string, long> monitor出水压力 = new Tuple<string, long>("_JZQSCS_pressure", 1588091028211109888);
|
private Tuple<string, long> monitor进水总管水库水位 = new Tuple<string, long>("_0402010701011204001", 1588341584007663616);
|
|
//public override bool Is液位Monitor(string tagname)
|
//{
|
// if (monitor前池液位1.Item1 == tagname)
|
// return true;
|
// if (monitor前池液位2.Item1 == tagname)
|
// return true;
|
// if (monitor前池液位3.Item1 == tagname)
|
// return true;
|
// return false;
|
//}
|
|
public override string GetMonitorNameByTag(string tagname)
|
{
|
if (monitor出水压力.Item1 == tagname)
|
return "出水压力";
|
if (monitor出水瞬时流量.Item1 == tagname)
|
return "出水瞬时流量";
|
if (monitor进水总管水库水位.Item1 == tagname)
|
return "机泵2进口压力";
|
return "未知测点";
|
}
|
/// <summary>
|
/// 根据三高提供的参数,构建调度分析所需的参数, (这个每个泵站都不一样)
|
/// </summary>
|
/// <param name="allRecords_hour"></param>
|
/// <param name="error_info"></param>
|
/// <returns></returns>
|
protected override DispatchAna.Model.RequestParasComplex BuildDispatchAnaRequest(
|
List<IStation.Dto.MonitorRecord4SG> allRecords_hour,
|
out string error_info)
|
{
|
if (allRecords_hour == null || allRecords_hour.Count == 0)
|
{
|
error_info = "金泽取水测点数据为空";
|
return null;
|
}
|
var complex_dispatch_request = new DispatchAna.Model.RequestParasComplex();
|
var water_level1 = allRecords_hour.Find(x => x.MonitorTag == monitor进水总管水库水位.Item1);
|
if (water_level1 == null)
|
{
|
error_info = "金泽取水 进水总管水库水位 未找到";
|
return null;
|
}
|
|
|
var pipe1_flow = allRecords_hour.Find(x => x.MonitorTag == monitor出水瞬时流量.Item1);
|
if (pipe1_flow == null)
|
{
|
error_info = "金泽取水 出水瞬时流量 测点未找到";
|
return null;
|
}
|
|
var pipe1_press = allRecords_hour.Find(x => x.MonitorTag == monitor出水压力.Item1);
|
if (pipe1_press == null)
|
{
|
error_info = "金泽取水 出水压力 测点未找到";
|
return null;
|
}
|
|
|
complex_dispatch_request.CorpID = this._corpID;
|
complex_dispatch_request.StationID = this._stationID;
|
complex_dispatch_request.SchemeNumber = 1;
|
complex_dispatch_request.PressValueType = DispatchAna.Model.RequestParasComplex.ePressValueType.压力;
|
complex_dispatch_request.InletPipePara = new List<DispatchAna.Model.InletPipePara>()
|
{
|
new DispatchAna.Model.InletPipePara(){ Name="水池", Value = water_level1.RecordValue}
|
};
|
complex_dispatch_request.OutletPipePara = new List<DispatchAna.Model.OutletPipePara>();
|
complex_dispatch_request.OutletPipePara.Add(new DispatchAna.Model.OutletPipePara()
|
{
|
Name = "总管路",
|
TargetFlow = pipe1_flow.RecordValue,
|
TargetPress = pipe1_press.RecordValue,
|
});
|
|
|
|
|
|
error_info = null;
|
return complex_dispatch_request;
|
}
|
|
|
}
|
}
|