From d9f0427d4e079d866d1b17dfc204fee9aaa69b1b Mon Sep 17 00:00:00 2001
From: tangxu <76880903@qq.com>
Date: 星期一, 24 十月 2022 14:29:39 +0800
Subject: [PATCH] 增加 shys五号沟严桥方向 水位分析

---
 Calculation/IStation.Calculation.Dispatch/general/OptAna.cs                           |    4 
 Component/IStation.Epanet/EpanetHelper.cs                                             |   10 
 /dev/null                                                                             |   42 -----
 Application/IStation.Application.OpenApi/shys/plan/helper/PlanAnaCalculatorFactory.cs |   22 --
 Application/IStation.Application.OpenApi/shys/plan/PlanAna_ShysController.cs          |   44 +++-
 Application/IStation.Application.OpenApi/shys/plan/helper/PlanAnaBaseCalculator.cs    |   10 +
 Calculation/IStation.Calculation.Dispatch/helper/DispatchAnaGeneralHelper压力.cs        |   10 
 Application/IStation.Application.OpenApi/shys/plan/shys/ShysHelper.cs                 |   91 +++++++++++
 Application/IStation.Application.OpenApi/shys/plan/shys/shys五号沟严桥方向2.cs               |  102 ++++++++++++
 Calculation/IStation.Calculation.Dispatch/general/Current.cs                          |    2 
 Application/IStation.Application.OpenApi/shys/plan/shys/shys五号沟凌桥方向.cs                |  104 +++++++++++++
 11 files changed, 350 insertions(+), 91 deletions(-)

diff --git a/Application/IStation.Application.OpenApi/shys/plan/PlanAna_ShysController.cs b/Application/IStation.Application.OpenApi/shys/plan/PlanAna_ShysController.cs
index 7c745a8..d8436ef 100644
--- a/Application/IStation.Application.OpenApi/shys/plan/PlanAna_ShysController.cs
+++ b/Application/IStation.Application.OpenApi/shys/plan/PlanAna_ShysController.cs
@@ -56,7 +56,7 @@
         [HttpGet]
         public List<PlanAnaDto> Calculate_debug()
         {
-            var responseText = System.IO.File.ReadAllText(@"E:\WorkData\IStation\result.txt");//(娴嬭瘯鐢ㄧ殑)
+            var responseText = System.IO.File.ReadAllText(@"D:\WorkData\IStation\result_1021.json");//(娴嬭瘯鐢ㄧ殑)
             var planDataList = JsonHelper.Json2Object<List<PlanAnaData>>(responseText);
             return CalculateCore(planDataList);
         }
@@ -79,29 +79,33 @@
                 return default;
             }
 
-            var factoryIds = planDataList.SelectMany(x => x.datas).Select(x => x.factory).Distinct().ToList();
+            var sg_factoryIds = planDataList.SelectMany(x => x.datas).Select(x => x.factory).Distinct().ToList();
             var vmList = new List<PlanAnaDto>();
-            foreach (var factoryId in factoryIds)
+            foreach (var sg_factoryId in sg_factoryIds)
             {
                 //鎵惧埌鐩稿叧娉电珯锛屽苟杩涜璁$畻
-                if (!PlanAnaConstant.FactoryDict.ContainsKey(factoryId))
+                var stationInfo = ShysPlanHelper.GetStationInfo(sg_factoryId);
+                if (stationInfo == null)
                 {
-                    LogHelper.Error("鏈壘鍒癷d:{factoryId},瀵瑰簲鐨勬车绔�");
-                    return default;
+                   // LogHelper.Error("鏈壘鍒癷d:{factoryId},瀵瑰簲鐨勬车绔�");
+                    continue;
                 }
-                var stationId = PlanAnaConstant.FactoryDict[factoryId];
+ 
+                var stationId = stationInfo.ID;
                 var station = new Service.Station().GetByID(_corpId, stationId);
                 if (station == null)
                 {
                     LogHelper.Error($"涓婃捣鍘熸按鑳借�楄鍒掑垎鏋愯绠椾腑锛� 娉电珯id:{stationId}, 鏁版嵁搴撲腑鏈壘鍒版娉电珯");
                     continue;
                 }
-                var calculator = PlanAnaCalculatorFactory.CreateCalculator(_corpId, ObjectType.Station, stationId);
+                var calculator = stationInfo.Calculator;
                 if (calculator == null)
                 {
                     LogHelper.Error($"涓婃捣鍘熸按鑳借�楄鍒掑垎鏋愯绠椾腑锛� 娉电珯id:{stationId}, 鏈瀯寤鸿绠楀櫒");
                     continue;
                 }
+                calculator.SetStationID(4, stationInfo.ID);//璁剧疆ID
+
                 //鏋勯�犺绠楀叆鍙�
                 var sumRecordList = new List<MonthSumRecord>();
                 foreach (var planData in planDataList)
@@ -109,7 +113,7 @@
                     var sumRecord = new MonthSumRecord();
                     sumRecord.Month = planData.timeflag;
                     sumRecord.HourRecords = new List<HourSumRecord>();
-                    var factoryData = planData.datas.Find(t => t.factory == factoryId);
+                    var factoryData = planData.datas.Find(t => t.factory == sg_factoryId);
                     for (int i = 0; i <= 23; i++)
                     {
                         var hourSumRecord = new HourSumRecord();
@@ -124,10 +128,22 @@
                                 var ff = scadaItem.values.Find(t => t.GetHour() ==  i );
                                 if(ff == null)
                                 {
-                                    LogHelper.Error($"涓婃捣鍘熸按鑳借�楄鍒掑垎鏋愯绠椾腑锛� 娉电珯id:{stationId}, {scadaItem.tagname} 鏃堕棿鐐箋i}, 鏈壘鍒版暟鎹�" );
-                                    return default;
+                                    if (calculator.Is娑蹭綅Monitor(scadaItem.tagname))
+                                    {
+                                        scadaRecord.RecordValue = 0;
+                                    }
+                                    else
+                                    {
+                                        LogHelper.Error($"涓婃捣鍘熸按鑳借�楄鍒掑垎鏋愯绠椾腑锛� 娉电珯id:{stationId}, {scadaItem.tagname} 鏃堕棿鐐箋i}, 鏈壘鍒版暟鎹�");
+                                        return default;
+                                    }
+
                                 }
-                                scadaRecord.RecordValue = ff.value;
+                                else
+                                {
+                                    scadaRecord.RecordValue = ff.value;
+                                }
+                              
                                 hourSumRecord.Records.Add(scadaRecord);
                             }
                         }
@@ -147,7 +163,7 @@
                 }
 
                 string error_info="";
-                var resultList = calculator.Calc(station, factoryId, sumRecordList, out error_info);
+                var resultList = calculator.Calc(station, sg_factoryId, sumRecordList, out error_info);
                 if (resultList == null || resultList.Count() < 1)
                 {
                     LogHelper.Error($"涓婃捣鍘熸按鑳借�楄鍒掑垎鏋愯绠椾腑锛屾车绔欏悕绉�:{station.Name} 娉电珯id:{stationId},璁$畻閿欒,鍘熷洜鏄�:{error_info}"  );
@@ -156,7 +172,7 @@
 
                 //鐢熸垚杩斿洖缁撴灉
                 var vmItem = new PlanAnaDto();
-                vmItem.factory = factoryId;
+                vmItem.factory = sg_factoryId;
                 vmItem.name = station.Name;
                 vmItem.values = new List<List<double>>();
                 for (int i = 1; i <= 12; i++)
diff --git a/Application/IStation.Application.OpenApi/shys/plan/dto/PlanAnaConstant.cs b/Application/IStation.Application.OpenApi/shys/plan/dto/PlanAnaConstant.cs
deleted file mode 100644
index 42e1240..0000000
--- a/Application/IStation.Application.OpenApi/shys/plan/dto/PlanAnaConstant.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace IStation.Application
-{
-    /// <summary>
-    /// 璁″垝鍒嗘瀽甯搁噺
-    /// </summary>
-    public class PlanAnaConstant
-    {
-        /// <summary>
-        /// 绔欑偣瀛楀吀
-        /// </summary>
-        public static Dictionary<int, long> FactoryDict = new Dictionary<int, long>()
-        {
-            {1,2},//闀垮叴娉电珯
-            {2,12},//浜斿彿娌熷噷妗ユ柟鍚�
-            {3,9},//浜斿彿娌熼噾娴锋柟鍚�
-            {4,3},//浜斿彿娌熶弗妗ユ柟鍚�1
-            {5,5},//浜斿彿娌熶弗妗ユ柟鍚�2
-            {6,4},//涓ユˉ娉电珯
-            {7,6},//涓存睙1#娉电珯
-            {8,7},//涓存睙2#娉电珯
-            {9,8},//寰愭尘娉电珯
-            {10,10},//閲戞捣娉电珯
-            {11,11},//鍗楁眹鍖楁车绔�
-            {12,15},//闄堣涓�杈�
-            {13,16},//闄堣浜岃緭
-            {14,17},//娉板拰娉电珯
-            {15,19},//閲戞辰娉电珯
-            {16,20},//鏉炬睙娉电珯
-            {17,21},//澶фˉ娉电珯
-        };
-
-
- 
-
-    }
-}
diff --git a/Application/IStation.Application.OpenApi/shys/plan/helper/PlanAnaBaseCalculator.cs b/Application/IStation.Application.OpenApi/shys/plan/helper/PlanAnaBaseCalculator.cs
index a02cac2..82ed383 100644
--- a/Application/IStation.Application.OpenApi/shys/plan/helper/PlanAnaBaseCalculator.cs
+++ b/Application/IStation.Application.OpenApi/shys/plan/helper/PlanAnaBaseCalculator.cs
@@ -40,6 +40,16 @@
         /// <summary>
         /// 
         /// </summary>
+        /// <param name="tagname"></param>
+        /// <returns></returns>
+        public virtual bool Is娑蹭綅Monitor(string tagname)
+        {
+            return false;
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
         public virtual List<Dto.MonthCalcuResult> Calc (
             Model.Station station,int factoryId, 
             List<Dto.MonthSumRecord> allMonthSumRecord,
diff --git a/Application/IStation.Application.OpenApi/shys/plan/helper/PlanAnaCalculatorFactory.cs b/Application/IStation.Application.OpenApi/shys/plan/helper/PlanAnaCalculatorFactory.cs
index 9cef9da..562154e 100644
--- a/Application/IStation.Application.OpenApi/shys/plan/helper/PlanAnaCalculatorFactory.cs
+++ b/Application/IStation.Application.OpenApi/shys/plan/helper/PlanAnaCalculatorFactory.cs
@@ -5,29 +5,7 @@
 {
     internal class PlanAnaCalculatorFactory 
     {
-        /// <summary>
-        /// 鍒涘缓璁$畻鍣�
-        /// </summary>
-        public static  PlanAnaBaseCalculator CreateCalculator(long corpId, string objectType, long objectId)
-        {
-             PlanAnaBaseCalculator calculator = null;
-            if (objectType == ObjectType.Station)
-            {
-                switch (objectId)
-                {
-                    case 2:
-                        calculator = new IStation.Calculation.shys闀垮叴娉电珯();
-                        break;
 
-                    default: break;
-                }
-            }
-            if(calculator != null)
-            {
-                calculator.SetStationID(corpId, objectId);
-            }
-            return calculator;
-        }
 
 
 
diff --git a/Application/IStation.Application.OpenApi/shys/plan/shys/ShysHelper.cs b/Application/IStation.Application.OpenApi/shys/plan/shys/ShysHelper.cs
new file mode 100644
index 0000000..9c1c6fd
--- /dev/null
+++ b/Application/IStation.Application.OpenApi/shys/plan/shys/ShysHelper.cs
@@ -0,0 +1,91 @@
+锘縰sing IStation.Calculation;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace IStation.Application 
+{
+    /// <summary>
+    /// 璁″垝鍒嗘瀽甯搁噺
+    /// </summary>
+    public class ShysPlanHelper
+    {
+        /// <summary>
+        /// 绔欑偣瀛楀吀
+        /// </summary>
+        public static StationInfo GetStationInfo(int SgFactoryId)
+        {
+            if (_dict == null)
+                Inital();
+        
+            if (!_dict.ContainsKey(SgFactoryId))
+            {
+                return null;
+            }
+
+            return  _dict[SgFactoryId];
+        }
+
+        static Dictionary<int, StationInfo> _dict;
+        private static void Inital()
+        {
+            _dict = new Dictionary<int, StationInfo>();
+            //_dict.Add(1, new StationInfo(2, new  IStation.Calculation.shys闀垮叴娉电珯()));
+            //_dict.Add(2, new StationInfo(12, new IStation.Calculation.shys浜斿彿娌熷噷妗ユ柟鍚�()));
+
+
+            _dict.Add(5, new StationInfo(5, new shys浜斿彿娌熶弗妗ユ柟鍚�2()));
+            //{
+            //    {1,2},//闀垮叴娉电珯
+            //    {2,12},//浜斿彿娌熷噷妗ユ柟鍚�
+            //    {3,9},//浜斿彿娌熼噾娴锋柟鍚�
+            //    {4,3},//浜斿彿娌熶弗妗ユ柟鍚�1
+            //    {5,5},//浜斿彿娌熶弗妗ユ柟鍚�2
+            //    {6,4},//涓ユˉ娉电珯
+            //    {7,6},//涓存睙1#娉电珯
+            //    {8,7},//涓存睙2#娉电珯
+            //    {9,8},//寰愭尘娉电珯
+            //    {10,10},//閲戞捣娉电珯
+            //    {11,11},//鍗楁眹鍖楁车绔�
+            //    {12,15},//闄堣涓�杈�
+            //    {13,16},//闄堣浜岃緭
+            //    {14,17},//娉板拰娉电珯
+            //    {15,19},//閲戞辰娉电珯
+            //    {16,20},//鏉炬睙娉电珯
+            //    {17,21},//澶фˉ娉电珯
+            //};
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public class StationInfo
+        {
+            /// <summary>
+            /// 
+            /// </summary>
+            /// <param name="id"></param>
+            /// <param name="calc"></param>
+            public StationInfo(long id, PlanAnaBaseCalculator calc)
+            {
+                ID = id;
+                Calculator = calc;
+            }
+
+
+            /// <summary>
+            /// 
+            /// </summary>
+            public long ID { get; set; }
+
+            /// <summary>
+            /// 
+            /// </summary>
+            public PlanAnaBaseCalculator Calculator { get; set; }
+        }
+
+
+    }
+}
diff --git "a/Application/IStation.Application.OpenApi/shys/plan/shys/shys\344\272\224\345\217\267\346\262\237\344\270\245\346\241\245\346\226\271\345\220\2212.cs" "b/Application/IStation.Application.OpenApi/shys/plan/shys/shys\344\272\224\345\217\267\346\262\237\344\270\245\346\241\245\346\226\271\345\220\2212.cs"
new file mode 100644
index 0000000..0cee6c5
--- /dev/null
+++ "b/Application/IStation.Application.OpenApi/shys/plan/shys/shys\344\272\224\345\217\267\346\262\237\344\270\245\346\241\245\346\226\271\345\220\2212.cs"
@@ -0,0 +1,102 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;  
+
+namespace IStation.Calculation
+{
+    internal class shys浜斿彿娌熶弗妗ユ柟鍚�2 : PlanAnaBaseCalculator
+    { 
+        public shys浜斿彿娌熶弗妗ユ柟鍚�2( )
+        {
+            this._corpID = 4;
+            this._dispatchAnaCalc = new IStation.Calculation.DispatchAna.Calculator_OptAna_General();
+        }
+
+        /// <summary>
+        /// 娴嬬偣瀛楀吀(杩欎釜姣忎釜娉电珯閮戒笉涓�鏍�)
+        /// </summary>
+        private Tuple<string, long> monitor鍑烘按鎬荤鍘嬪姏 = new Tuple<string, long>("_0402010501080204002", 126);
+        private Tuple<string, long> monitor鍑烘按鎬荤鐬椂娴侀噺 = new Tuple<string, long>("_0402010501080202003", 127);
+        private Tuple<string, long> monitor鍓嶆睜娑蹭綅 = new Tuple<string, long>("_0402010501080203003", 122);
+ 
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="tagname"></param>
+        /// <returns></returns>
+        public override bool Is娑蹭綅Monitor(string tagname)
+        {
+            if (tagname == monitor鍓嶆睜娑蹭綅.Item1)
+                return true;
+            else
+                return false;
+        }
+
+        /// <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 = "浜斿彿娌熶弗妗ユ柟鍚�2娴嬬偣鏁版嵁涓虹┖";
+                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)
+            {
+             
+                    error_info = "浜斿彿娌熶弗妗ユ柟鍚�2姘村簱娑蹭綅娴嬬偣鏈壘鍒�";
+                    return null;
+                
+            }
+            var pipe1_flow = allRecords_hour.Find(x => x.MonitorTag == monitor鍑烘按鎬荤鐬椂娴侀噺.Item1);
+            if (pipe1_flow == null)
+            {
+                error_info = "浜斿彿娌熶弗妗ユ柟鍚�2姘寸閬�1娴侀噺娴嬬偣鏈壘鍒�";
+                return null;
+            }
+
+            var pipe1_press = allRecords_hour.Find(x => x.MonitorTag == monitor鍑烘按鎬荤鍘嬪姏.Item1);
+            if (pipe1_press == null)
+            {
+                error_info = "浜斿彿娌熶弗妗ユ柟鍚�2姘寸閬�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.WaterLevelPara = new List<DispatchAna.Model.WaterLevelPara>()
+                        {
+                            new DispatchAna.Model.WaterLevelPara(){ 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,
+            });
+ 
+
+ 
+
+
+            error_info = null;
+            return complex_dispatch_request;
+        }
+
+
+    }
+}
diff --git "a/Application/IStation.Application.OpenApi/shys/plan/shys/shys\344\272\224\345\217\267\346\262\237\345\207\214\346\241\245\346\226\271\345\220\221.cs" "b/Application/IStation.Application.OpenApi/shys/plan/shys/shys\344\272\224\345\217\267\346\262\237\345\207\214\346\241\245\346\226\271\345\220\221.cs"
new file mode 100644
index 0000000..3aa786e
--- /dev/null
+++ "b/Application/IStation.Application.OpenApi/shys/plan/shys/shys\344\272\224\345\217\267\346\262\237\345\207\214\346\241\245\346\226\271\345\220\221.cs"
@@ -0,0 +1,104 @@
+锘縰sing 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>("_0402010501080204002", 126);
+        private Tuple<string, long> monitor鍑烘按鎬荤鐬椂娴侀噺 = new Tuple<string, long>("_0402010501080202003", 127);
+        private Tuple<string, long> monitor鍓嶆睜娑蹭綅 = new Tuple<string, long>("_0402010501080203003", 122);
+ 
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="tagname"></param>
+        /// <returns></returns>
+        public override bool Is娑蹭綅Monitor(string tagname)
+        {
+            if (tagname == monitor鍓嶆睜娑蹭綅.Item1)
+                return true;
+            else
+                return false;
+        }
+
+        /// <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鍑烘按鎬荤鐬椂娴侀噺.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.WaterLevelPara = new List<DispatchAna.Model.WaterLevelPara>()
+                        {
+                            new DispatchAna.Model.WaterLevelPara(){ 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,
+            });
+ 
+
+ 
+
+
+            error_info = null;
+            return complex_dispatch_request;
+        }
+
+
+    }
+}
diff --git a/Calculation/IStation.Calculation.Dispatch/general/Current.cs b/Calculation/IStation.Calculation.Dispatch/general/Current.cs
index 58ac265..0a7732b 100644
--- a/Calculation/IStation.Calculation.Dispatch/general/Current.cs
+++ b/Calculation/IStation.Calculation.Dispatch/general/Current.cs
@@ -10,7 +10,7 @@
     /// <summary>
     /// 甯歌
     /// </summary> 
-    internal class Calculator_Current_Gneral : CalculatorBase, IGetCurrentRecord
+    public  class Calculator_Current_Gneral : CalculatorBase, IGetCurrentRecord
     {
         /// <summary>
         /// 鑾峰彇褰撳墠璋冨害淇℃伅
diff --git a/Calculation/IStation.Calculation.Dispatch/general/OptAna.cs b/Calculation/IStation.Calculation.Dispatch/general/OptAna.cs
index 7f5b92f..bf4a6e1 100644
--- a/Calculation/IStation.Calculation.Dispatch/general/OptAna.cs
+++ b/Calculation/IStation.Calculation.Dispatch/general/OptAna.cs
@@ -10,7 +10,7 @@
     /// <summary>
     /// 甯歌
     /// </summary> 
-    internal class Calculator_OptAna_General : CalculatorOptAnaBase, IOptAnaCalc
+    public  class Calculator_OptAna_General : CalculatorOptAnaBase, IOptAnaCalc
     {
         List<IStation.Calculation.DispatchAna.Model.MachineDetail> allMachineList = null;
         #region 璁$畻 鏈�浼樻柟妗� 
@@ -137,7 +137,7 @@
                 complex_request_paras.OutletPipePara[0].TargetFlowRangeMin,
                 complex_request_paras.OutletPipePara[0].TargetFlowRangeMax,
                 allMachineList,
-                machine_run_status.MachineRunFilter);
+                machine_run_status==null?null: machine_run_status.MachineRunFilter);
 
             return calc_pipe_helper.CalcOptList(complex_request_paras.SchemeSortType, complex_request_paras.SchemeNumber);
         }
diff --git "a/Calculation/IStation.Calculation.Dispatch/helper/DispatchAnaGeneralHelper\345\216\213\345\212\233.cs" "b/Calculation/IStation.Calculation.Dispatch/helper/DispatchAnaGeneralHelper\345\216\213\345\212\233.cs"
index bb814e0..a3d5ad0 100644
--- "a/Calculation/IStation.Calculation.Dispatch/helper/DispatchAnaGeneralHelper\345\216\213\345\212\233.cs"
+++ "b/Calculation/IStation.Calculation.Dispatch/helper/DispatchAnaGeneralHelper\345\216\213\345\212\233.cs"
@@ -1191,11 +1191,11 @@
                 AddMultiFreqPumpPrj4(null, freqPumpAnaList, 0);
             }
 
-            //鏈�5鍙板彉棰戞车
-            if (freqPumpAnaList.Count() >= 5)
-            {
-                AddMultiFreqPumpPrj5(null, freqPumpAnaList, 0);
-            }
+            //鏈�5鍙板彉棰戞车: 绋嬪簭杩愯鏃堕棿杩囦箙, 鏆傛椂涓嶇敤
+            //if (freqPumpAnaList.Count() >= 5)
+            //{
+            //    AddMultiFreqPumpPrj5(null, freqPumpAnaList, 0);
+            //}
 
             //鏈�6鍙板彉棰戞车
             //if (freqPumpAnaList.Count >= 6)
diff --git a/Component/IStation.Epanet/EpanetHelper.cs b/Component/IStation.Epanet/EpanetHelper.cs
index 0a91958..ae7265b 100644
--- a/Component/IStation.Epanet/EpanetHelper.cs
+++ b/Component/IStation.Epanet/EpanetHelper.cs
@@ -986,20 +986,20 @@
     }
     public class Pump
     {
-        public string ID;
+        public string ID = null;
         public int index;
         public float value;
 
     }
     public class calcParms
     {
-        public List<bool> list_isfrequence;
-        public List<int> flowPointIndex;
-        public List<double> demandPress;
+        public List<bool> list_isfrequence = null;
+        public List<int> flowPointIndex = null;
+        public List<double> demandPress = null;
     }
     public class ResultCombine
     {
-        public double[] arrayHz;
+        public double[] arrayHz ;
         public double totalEnerge;
     }
     #endregion

--
Gitblit v1.9.3