wangzelong
2022-11-03 0112b8cd7b35b38f6295cde8e87be603800afcf6
泵站
已添加3个文件
396 ■■■■■ 文件已修改
Application/IStation.Application.OpenApi/shys/plan/shys/shys金泽取水.cs 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Application/IStation.Application.OpenApi/shys/plan/shys/shys陈行二取.cs 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Application/IStation.Application.OpenApi/shys/plan/shys/shys青草沙取水.cs 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Application/IStation.Application.OpenApi/shys/plan/shys/shys½ðÔóȡˮ.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,128 @@
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_General();
        }
        /// <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机泵2进口压力 = new Tuple<string, long>("_0402010701011204001", 1552172655132676096);
        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前池液位1.Item1 == tagname)
                return "前池液位1";
            if (monitor前池液位2.Item1 == tagname)
                return "前池液位2";
            if (monitor前池液位3.Item1 == tagname)
                return "前池液位3";
            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前池液位1.Item1);
            if (water_level1 == null)
            {
                error_info = "金泽泵站液位测点1未找到";
                return null;
            }
            var water_level2 = allRecords_hour.Find(x => x.MonitorTag == monitor前池液位2.Item1);
            if (water_level2 == null)
            {
                error_info = "金泽泵站液位测点2未找到";
                return null;
            }
            var water_level3 = allRecords_hour.Find(x => x.MonitorTag == monitor前池液位3.Item1);
            if (water_level3 == null)
            {
                error_info = "金泽泵站液位测点3未找到";
                return null;
            }
            double water_level = (water_level1.RecordValue + water_level2.RecordValue + water_level3.RecordValue) / 3;
            var pipe1_flow = allRecords_hour.Find(x => x.MonitorTag == monitor出水总管瞬时流量.Item1);
            if (pipe1_flow == null)
            {
                error_info = "金泽泵站水管道1流量测点未找到";
                return null;
            }
            var pipe1_press = allRecords_hour.Find(x => x.MonitorTag == monitor出水总管压力.Item1);
            if (pipe1_press == null)
            {
                error_info = "金泽泵站水管道1压力测点未找到";
                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_level}
                        };
            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;
        }
    }
}
Application/IStation.Application.OpenApi/shys/plan/shys/shys³ÂÐжþÈ¡.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,134 @@
using IStation.Calculation.DispatchAna;
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出水瞬时流量 = new Tuple<string, long>("_CHEQBZCS_flow", 1588089786529353728);
        private Tuple<string, long> monitor出水压力 = new Tuple<string, long>("_CHEQBZCS_pressure", 1588090053639409664);
        private Tuple<string, long> monitor进水前池液位 = new Tuple<string, long>("_0402010204089904009", 823);
        public override bool Is液位Monitor(string tagname)
        {
            if (monitor进水前池液位.Item1 == tagname)
                return true;
            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 "进水前池液位";
            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_level = allRecords_hour.Find(x => x.MonitorTag == monitor进水前池液位.Item1);
            if (water_level == null)
            {
                water_level = allRecords_hour.Find(x => x.MonitorTag == monitor进水前池液位.Item1);
                if (water_level == null)
                {
                    error_info = "陈行二输水库液位测点未找到";
                    return null;
                }
            }
            var pipe1_flow = allRecords_hour.Find(x => x.MonitorTag == monitor出水总管1瞬时流量.Item1);
            if (pipe1_flow == 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 pipe1_press = allRecords_hour.Find(x => x.MonitorTag == monitor出水总管1压力.Item1);
            if (pipe1_press == null)
            {
                error_info = "陈行二输水管道1压力测点未找到";
                return null;
            }
            var pipe2_press = allRecords_hour.Find(x => x.MonitorTag == monitor出水总管2压力.Item1);
            if (pipe2_press == null)
            {
                error_info = "陈行二输水管道2压力测点未找到";
                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_level.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,
            });
            complex_dispatch_request.OutletPipePara.Add(new DispatchAna.Model.OutletPipePara()
            {
                Name = "二号管路",
                TargetFlow = pipe2_flow.RecordValue,
                TargetPress = pipe2_press.RecordValue,
            });
            complex_dispatch_request.ValvePara = new List<DispatchAna.Model.ValvePara>();
            complex_dispatch_request.ValvePara.Add(new DispatchAna.Model.ValvePara() { Name = "中间阀门", OpenStatus = 1 });
            error_info = null;
            return complex_dispatch_request;
        }
    }
}
Application/IStation.Application.OpenApi/shys/plan/shys/shysÇà²Ýɳȡˮ.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,134 @@
using IStation.Calculation.DispatchAna;
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出水瞬时流量 = new Tuple<string, long>("_QCSCS_flow", 1588091482206769152);
        private Tuple<string, long> monitor出水压力 = new Tuple<string, long>("_QCSCS_pressure", 1588091605934542848);
        private Tuple<string, long> monitor进水长江水位 = new Tuple<string, long>("_0402010401010104004", 1588093883189956608);
        public override bool Is液位Monitor(string tagname)
        {
            if (monitor进水前池液位.Item1 == tagname)
                return true;
            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 "进水前池液位";
            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_level = allRecords_hour.Find(x => x.MonitorTag == monitor进水前池液位.Item1);
            if (water_level == null)
            {
                water_level = allRecords_hour.Find(x => x.MonitorTag == monitor进水前池液位.Item1);
                if (water_level == null)
                {
                    error_info = "陈行二输水库液位测点未找到";
                    return null;
                }
            }
            var pipe1_flow = allRecords_hour.Find(x => x.MonitorTag == monitor出水总管1瞬时流量.Item1);
            if (pipe1_flow == 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 pipe1_press = allRecords_hour.Find(x => x.MonitorTag == monitor出水总管1压力.Item1);
            if (pipe1_press == null)
            {
                error_info = "陈行二输水管道1压力测点未找到";
                return null;
            }
            var pipe2_press = allRecords_hour.Find(x => x.MonitorTag == monitor出水总管2压力.Item1);
            if (pipe2_press == null)
            {
                error_info = "陈行二输水管道2压力测点未找到";
                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_level.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,
            });
            complex_dispatch_request.OutletPipePara.Add(new DispatchAna.Model.OutletPipePara()
            {
                Name = "二号管路",
                TargetFlow = pipe2_flow.RecordValue,
                TargetPress = pipe2_press.RecordValue,
            });
            complex_dispatch_request.ValvePara = new List<DispatchAna.Model.ValvePara>();
            complex_dispatch_request.ValvePara.Add(new DispatchAna.Model.ValvePara() { Name = "中间阀门", OpenStatus = 1 });
            error_info = null;
            return complex_dispatch_request;
        }
    }
}