tangxu
2022-10-31 8ea88fedd51e4961d0fd0aec6c2873a579fb6db8
Calculation/IStation.Calculation.Dispatch/custom/shys/station/³¤Ð˵º/OptAna.cs
@@ -11,7 +11,7 @@
    /// <summary>
    /// é•¿å…´æ³µç«™è°ƒåº¦æ–¹æ¡ˆè®¡ç®—器(最优方案)
    /// </summary>
    public  class Calculator_OptAna_SHYS_长兴岛: CalculatorOptAnaBase, IOptAnaCalc
    public  class Calculator_OptAna_SHYS_长兴岛: CalculatorBase_SHYS_长兴岛, IOptAnaCalc
    {
        /// <summary>
        /// /
@@ -138,11 +138,11 @@
                }
            }
            double water_level = 0;//水位
            if (complex_request_paras.WaterLevelPara != null && complex_request_paras.WaterLevelPara.Count > 0)
            if (complex_request_paras.InletPipePara != null && complex_request_paras.InletPipePara.Count > 0)
            {
                //var inletLevel = paras.MonitorPointInfoList.Find(x => x.SignalType == IStation.SignalType.水位);
                //Elevation = inletLevel?.Elevation != null ? inletLevel.Elevation.Value : 0;//获取测点的标高
                water_level = complex_request_paras.WaterLevelPara.First().Value;
                water_level = complex_request_paras.InletPipePara.First().Value;
            }
            //中间阀门状态
@@ -178,10 +178,10 @@
                Common.DispatchAnaGeneralHelper压力 calc_pipe_helper = new Common.DispatchAnaGeneralHelper压力();
                calc_pipe_helper.InitialParas(
                    pipe1_TargetFlow + pipe2_TargetFlow,
                    water_level,
                  (pipe1_TargetPess + pipe2_TargetPess) / 2,
                  null, null,
                  _allMachineList, machine_run_status.MachineRunFilter);
                    water_level,true ,
                   (pipe1_TargetPess + pipe2_TargetPess) / 2,false   ,
                   null, null,
                   _allMachineList, machine_run_status==null?null: machine_run_status.MachineRunFilter);
                return calc_pipe_helper.CalcOptList(complex_request_paras.SchemeSortType, 3);
                #endregion
@@ -189,10 +189,6 @@
            else //阀门关的状态下  ä¸¤ç®¡ç›¸è¿žæ•°æ®ç›¸åŠ 
            {
                #region ä¸­é—´é˜€é—¨å…³çš„状态下
                var pipe1_machineIds = new List<long>() { 19, 22 };//1号泵,2号泵
                var pipe2_machineIds = new List<long>() { 25, 28 };//3号泵,4号泵
                Common.DispatchAnaGeneralHelper压力 calc_pipe1_helper =
         new Common.DispatchAnaGeneralHelper压力();
@@ -203,8 +199,8 @@
                {//只开一号泵二号泵
                    calc_pipe1_helper.InitialParas(
                        pipe1_TargetFlow,
                        water_level,
                        pipe1_TargetPess,
                        water_level,true ,
                        pipe1_TargetPess,false ,
                        null, null,
                        (from x in _allMachineList where pipe1_machineIds.Contains(x.MachineID) select x).ToList(),
                       machine_run_status ==null?null: machine_run_status.MachineRunFilter);
@@ -215,36 +211,44 @@
                {
                    calc_pipe2_helper.InitialParas(
                        pipe2_TargetFlow,
                        water_level,
                      pipe2_TargetPess,
                      null, null,
                     (from x in _allMachineList where pipe2_machineIds.Contains(x.MachineID) select x).ToList(),
                        water_level, true,
                        pipe2_TargetPess, false,
                        null, null,
                        (from x in _allMachineList where pipe2_machineIds.Contains(x.MachineID) select x).ToList(),
                     machine_run_status == null ? null : machine_run_status.MachineRunFilter);
                    return calc_pipe2_helper.CalcOptList(complex_request_paras.SchemeSortType, 3);
                }
                calc_pipe1_helper.InitialParas(
                    pipe1_TargetFlow,
                    water_level,
                    pipe1_TargetPess,
                    water_level, true,
                    pipe1_TargetPess, false,
                  null, null,
                 (from x in _allMachineList where pipe1_machineIds.Contains(x.MachineID) select x).ToList(),
                machine_run_status == null ? null : machine_run_status.MachineRunFilter);
                var pipe1_result = calc_pipe1_helper.CalcOptList(complex_request_paras.SchemeSortType, 3);
                if (pipe1_result == null)
                {
                    error_info = String.Format("管路一调度方案无法计算,请确认数据是否合理,液位:{0}m,出口压力:{1}MPa,流量要求:{2}",
                 water_level, pipe1_TargetPess, pipe1_TargetFlow);
                    return null;
                }
                calc_pipe2_helper.InitialParas(
                    pipe2_TargetFlow,
                    water_level,
                  pipe2_TargetPess,
                    water_level,true ,
                  pipe2_TargetPess,false ,
                  null, null,
                 (from x in _allMachineList where pipe2_machineIds.Contains(x.MachineID) select x).ToList(),
                machine_run_status == null ? null : machine_run_status.MachineRunFilter);
                var pipe2_result = calc_pipe2_helper.CalcOptList(complex_request_paras.SchemeSortType, 3);
                if (pipe1_result == null || pipe2_result == null)
                    return default;
                if (pipe2_result == null)
                {
                    error_info = String.Format("管路二调度方案无法计算,请确认数据是否合理,液位:{0}m,出口压力:{1}MPa,流量要求:{2}",
                 water_level, pipe2_TargetPess, pipe2_TargetFlow);
                    return null;
                }
                var result_1 = pipe1_result.First();
                var result_2 = pipe2_result.First();
@@ -360,8 +364,7 @@
            else //阀门关的状态下  ä¸¤ç®¡ç›¸è¿žæ•°æ®ç›¸åŠ 
            {
                #region ä¸­é—´é˜€é—¨å…³çš„状态下
                var pipe1_machineIds = new List<long>() { 19, 22 };//1号泵,2号泵
                var pipe2_machineIds = new List<long>() { 25, 28 };//3号泵,4号泵
                Common.DispatchAnaGeneralHelper扬程 calc_pipe1_helper =
@@ -419,7 +422,7 @@
                var plan = new Model.AnaScheme();
                plan.ID = 1;
                plan.TotalWrkQ = result_1.TotalWrkQ + result_2.TotalWrkQ;
                plan.TotalWrkH = result_1.TotalWrkH + result_2.TotalWrkH;
                plan.TotalWrkH = (result_1.TotalWrkH + result_2.TotalWrkH)/2;
                plan.TotalWrkP = result_1.TotalWrkP + result_2.TotalWrkP;
                plan.TotalWrkE = IStation.Common.PumpParaHelper.CalculateE(plan.TotalWrkQ, plan.TotalWrkH, plan.TotalWrkP);
                plan.UWP = CalculateUWP(plan.TotalWrkP, plan.TotalWrkQ, plan.TotalWrkH);