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;
|
this._dispatchAnaCalc = new IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_金海泵站();
|
}
|
|
/// <summary>
|
/// 测点字典(这个每个泵站都不一样)
|
/// </summary>
|
private Tuple<string, long> monitor出水南汇1压力 = new Tuple<string, long>("_0402010502090105011",
|
IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_金海泵站._monitor_id_一号管压力_南汇1);
|
private Tuple<string, long> monitor出水南汇1流量 = new Tuple<string, long>("_0402010502090103013",
|
IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_金海泵站._monitor_id_一号管流量_南汇1);
|
|
private Tuple<string, long> monitor出水南汇2压力 = new Tuple<string, long>("_0402010502090105012",
|
IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_金海泵站._monitor_id_二号管压力_南汇2);
|
private Tuple<string, long> monitor出水南汇2流量 = new Tuple<string, long>("_0402010502090103014",
|
IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_金海泵站._monitor_id_二号管流量_南汇2);
|
|
private Tuple<string, long> monitor出水川沙压力 = new Tuple<string, long>("_0402010502090105013",
|
IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_金海泵站._monitor_id_三号管压力_川沙);
|
private Tuple<string, long> monitor出水川沙流量 = new Tuple<string, long>("_0402010502090103015",
|
IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_金海泵站._monitor_id_三号管流量_川沙);
|
|
//private Tuple<string, long> monitor出水川沙总管进水压力 = new Tuple<string, long>("_0402010502090105013", 613);
|
private Tuple<string, long> monitor进水总管压力1 = new Tuple<string, long>("_0402010502090105001",
|
IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_金海泵站._monitor_id_一号进口管_压力);
|
private Tuple<string, long> monitor进水总管压力2 = new Tuple<string, long>("_0402010502090205001",
|
IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_金海泵站._monitor_id_二号进口管_压力);
|
|
public override bool Is液位Monitor(string tagname)
|
{
|
return false;
|
}
|
public override string GetMonitorNameByTag(string tagname)
|
{
|
if (monitor出水南汇1压力.Item1 == tagname)
|
return "出水南汇1压力";
|
if (monitor出水南汇1流量.Item1 == tagname)
|
return "出水南汇1流量";
|
if (monitor出水南汇2压力.Item1 == tagname)
|
return "出水南汇2压力";
|
if (monitor出水南汇2流量.Item1 == tagname)
|
return "出水南汇2流量";
|
if (monitor出水川沙压力.Item1 == tagname)
|
return "出水川沙压力";
|
if (monitor出水川沙流量.Item1 == tagname)
|
return "出水川沙流量";
|
if (monitor进水总管压力1.Item1 == tagname)
|
return "进水总管压力1";
|
if (monitor进水总管压力2.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 inlet_press1 = allRecords_hour.Find(x => x.MonitorTag == monitor进水总管压力1.Item1);
|
if (inlet_press1 == null)
|
{
|
error_info = "进水总管压力1测点未找到";
|
return null;
|
}
|
var inlet_press2 = allRecords_hour.Find(x => x.MonitorTag == monitor进水总管压力2.Item1);
|
if (inlet_press2 == null)
|
{
|
error_info = "进水总管压力2测点未找到";
|
return null;
|
}
|
|
|
|
var pipe1_flow = allRecords_hour.Find(x => x.MonitorTag == monitor出水南汇1流量.Item1);
|
if (pipe1_flow == null)
|
{
|
error_info = "金海泵站水管道南汇1流量测点未找到";
|
return null;
|
}
|
|
var pipe1_press = allRecords_hour.Find(x => x.MonitorTag == monitor出水南汇1压力.Item1);
|
if (pipe1_press == null)
|
{
|
error_info = "金海泵站水管道南汇1压力测点未找到";
|
return null;
|
}
|
|
var pipe2_flow = allRecords_hour.Find(x => x.MonitorTag == monitor出水南汇2流量.Item1);
|
if (pipe2_flow == null)
|
{
|
error_info = "金海泵站水管道南汇2流量测点未找到";
|
return null;
|
}
|
|
var pipe2_press = allRecords_hour.Find(x => x.MonitorTag == monitor出水南汇2压力.Item1);
|
if (pipe2_press == null)
|
{
|
error_info = "金海泵站水管道南汇2压力测点未找到";
|
return null;
|
}
|
|
var pipe3_flow = allRecords_hour.Find(x => x.MonitorTag == monitor出水川沙流量.Item1);
|
if (pipe3_flow == null)
|
{
|
error_info = "金海泵站水管道川沙流量测点未找到";
|
return null;
|
}
|
|
var pipe3_press = allRecords_hour.Find(x => x.MonitorTag == monitor出水川沙压力.Item1);
|
if (pipe3_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 = inlet_press1.RecordValue},
|
new DispatchAna.Model.InletPipePara(){ Name="二号进口管压力", Value = inlet_press2.RecordValue}
|
};
|
complex_dispatch_request.OutletPipePara = new List<DispatchAna.Model.OutletPipePara>();
|
complex_dispatch_request.OutletPipePara.Add(new DispatchAna.Model.OutletPipePara()
|
{
|
Name = "管路1",
|
TargetFlow = pipe1_flow.RecordValue,
|
TargetPress = pipe1_press.RecordValue,
|
});
|
|
complex_dispatch_request.OutletPipePara.Add(new DispatchAna.Model.OutletPipePara()
|
{
|
Name = "管路2",
|
TargetFlow = pipe2_flow.RecordValue,
|
TargetPress = pipe2_press.RecordValue,
|
});
|
|
complex_dispatch_request.OutletPipePara.Add(new DispatchAna.Model.OutletPipePara()
|
{
|
Name = "管路3",
|
TargetFlow = pipe3_flow.RecordValue,
|
TargetPress = pipe3_press.RecordValue,
|
});
|
|
|
|
error_info = null;
|
return complex_dispatch_request;
|
}
|
|
|
}
|
}
|