tangxu
2022-10-31 8ea88fedd51e4961d0fd0aec6c2873a579fb6db8
Application/IStation.Application.OpenApi/shys/plan/shys/shys³ÂÐжþÊä.cs
@@ -1,4 +1,5 @@
using System;
using IStation.Calculation.DispatchAna;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -11,17 +12,24 @@
        public shys陈行二输()
        {
            this._corpID = 4;
            this._dispatchAnaCalc = new IStation.Calculation.DispatchAna.Calculator_OptAna_General();
            this._dispatchAnaCalc = new IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_陈行二输();
        }
        /// <summary>
        /// æµ‹ç‚¹å­—å…¸(这个每个泵站都不一样)
        /// </summary>
        private Tuple<string, long> monitor出水总管1压力 = new Tuple<string, long>("_0402010201090105004", 917);
        private Tuple<string, long> monitor出水总管1瞬时流量 = new Tuple<string, long>("_0402010201090103020", 918);
        private Tuple<string, long> monitor出水总管2压力 = new Tuple<string, long>("_0402010201090105003", 920);
        private Tuple<string, long> monitor出水总管2瞬时流量 = new Tuple<string, long>("_0402010201090103017", 921);
        private Tuple<string, long> monitor进水前池液位 = new Tuple<string, long>("_0402010201080204002", 916);
        private Tuple<string, long> monitor出水总管1压力 = new Tuple<string, long>("_0402010201090105004",
            IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_陈行二输._monitor_id_一号管压力);
        private Tuple<string, long> monitor出水总管1瞬时流量 = new Tuple<string, long>("_0402010201090103020",
            IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_陈行二输._monitor_id_一号管流量);
        private Tuple<string, long> monitor出水总管2压力 = new Tuple<string, long>("_0402010201090105003",
            IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_陈行二输._monitor_id_二号管压力);
        private Tuple<string, long> monitor出水总管2瞬时流量 = new Tuple<string, long>("_0402010201090103017",
            IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_陈行二输._monitor_id_二号管流量);
        private Tuple<string, long> monitor进水前池液位 = new Tuple<string, long>("_0402010201080204002",
            IStation.Calculation.DispatchAna.Calculator_OptAna_SHYS_陈行二输._monitor_id_液位);
        public override bool Is液位Monitor(string tagname)
        {
@@ -40,6 +48,8 @@
                return "出水总管2压力";
            if (monitor出水总管2瞬时流量.Item1 == tagname)
                return "出水总管2瞬时流量";
            if (monitor进水前池液位.Item1 == tagname)
                return "进水前池液位";
            return "未知测点";
        }
@@ -55,50 +65,70 @@
        {
            if (allRecords_hour == null || allRecords_hour.Count == 0)
            {
                error_info = "五号沟凌桥方向测点数据为空";
                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出水总管瞬时流量.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;
            //}
            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.WaterLevelPara = new List<DispatchAna.Model.WaterLevelPara>()
            complex_dispatch_request.InletPipePara = new List<DispatchAna.Model.InletPipePara>()
                        {
                            //new DispatchAna.Model.WaterLevelPara(){ Name="æ°´æ± ", Value = water_level.RecordValue}
                            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,
                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 });