tangxu
2022-11-02 05f522e321a742f03bf1e3e26edaeb5147da42f4
Application/IStation.Application.OpenApi/shys/plan/shys/shys½ðÔó±ÃÕ¾.cs
@@ -42,6 +42,12 @@
                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>
@@ -56,33 +62,43 @@
        {
            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 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_press = allRecords_hour.Find(x => x.MonitorTag == monitor出水总管压力.Item1);
            //if (pipe1_press == null)
            //{
            //    error_info = "五号沟凌桥方向水管道1压力测点未找到";
            //    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;
            }
            complex_dispatch_request.CorpID = this._corpID;
@@ -91,14 +107,14 @@
            complex_dispatch_request.PressValueType = DispatchAna.Model.RequestParasComplex.ePressValueType.压力;
            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}
                        };
            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,
                TargetFlow = pipe1_flow.RecordValue,
                TargetPress = pipe1_press.RecordValue,
            });