using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace IStation.Calculation.DispatchAna
|
{
|
/// <summary>
|
/// 泰和泵站调度方案计算器
|
/// </summary>
|
internal class Calculator_Current_SHYS_泰和泵站: CalculatorBase_SHYS_泰和泵站, IGetCurrentRecord
|
{
|
public Calculator_Current_SHYS_泰和泵站()
|
{
|
|
}
|
/// <summary>
|
/// 获取当前调度信息
|
/// </summary>
|
/// <param name="CorpID"></param>
|
/// <param name="StationID"></param>
|
/// <param name="error_info"></param>
|
/// <returns></returns>
|
public Model.CurrentRecordBundle GetCurrentRecord(long CorpID, long StationID, out string error_info)
|
{
|
error_info = null;
|
var monitor_ids = new List<long>() {
|
_montiro_id_inlet_press,
|
_monitor_id_pipe_press1, _monitor_id_pipe_flow1,
|
_monitor_id_pipe_press2, _monitor_id_pipe_flow2 };
|
var monitor_records = new Service.MonitorRecord().GetLastRecord(_corpID, monitor_ids);
|
|
Model.CurrentRecordBundle bundle = new Model.CurrentRecordBundle();
|
|
var inlet_press = monitor_records.Find(x => x.MonitorPointID == _montiro_id_inlet_press);
|
if (inlet_press != null)
|
{
|
bundle.WaterLevelList = new List<Model.CurrentRecordBundle.RecordValue>();
|
bundle.WaterLevelList.Add(new Model.CurrentRecordBundle.RecordValue("进水管路压力", inlet_press, 4));
|
}
|
|
var pipe_press1 = monitor_records.Find(x => x.MonitorPointID == _monitor_id_pipe_press1);
|
var pipe_press2 = monitor_records.Find(x => x.MonitorPointID == _monitor_id_pipe_press2);
|
if (pipe_press1 != null && pipe_press2 != null)
|
{
|
bundle.PressList = new List<Model.CurrentRecordBundle.RecordValue>();
|
bundle.PressList.Add(new Model.CurrentRecordBundle.RecordValue("一号管", pipe_press1, 4));
|
bundle.PressList.Add(new Model.CurrentRecordBundle.RecordValue("二号管", pipe_press2, 4));
|
}
|
|
var pipe_flow1 = monitor_records.Find(x => x.MonitorPointID == _monitor_id_pipe_flow1);
|
var pipe_flow2 = monitor_records.Find(x => x.MonitorPointID == _monitor_id_pipe_flow2);
|
if (pipe_flow1 != null && pipe_flow2 != null)
|
{
|
bundle.FlowList = new List<Model.CurrentRecordBundle.RecordValue>();
|
bundle.FlowList.Add(new Model.CurrentRecordBundle.RecordValue("一号管", pipe_flow1, 0));
|
bundle.FlowList.Add(new Model.CurrentRecordBundle.RecordValue("二号管", pipe_flow2, 0));
|
}
|
|
|
return bundle;
|
}
|
|
|
|
}
|
}
|