tangxu
2022-11-09 16236a00f212a96e79e17298713faff756cee9c0
Calculation/IStation.Calculation.Dispatch/custom/shys/station/ËÉÆÖ´óÇÅ/OptAna.cs
@@ -143,19 +143,34 @@
            double totalQ = 0, totalH = 0, totalP = 0;
            int pipe_count = 0;
            int ResultStatus = 1;
            string ResultStatusInfo = null;
            List<IStation.Calculation.DispatchAna.Model.AnaScheme> pipe1_results = null;
            AnaScheme pipe1_result = null;
            if (pipe1_TargetFlow > 100)
            {
                Common.DispatchAnaGeneralHelper压力 calc_pipe1_helper = new Common.DispatchAnaGeneralHelper压力();
                calc_pipe1_helper.InitialParas(
                    pipe1_TargetFlow,//假设一边输出一半
                    (inlet_wl1 + inlet_wl2) / 2, true,
                    outlet_wl1, true,
                    null, null,
                    (from x in _allMachineList where pipe1_machineIds.Contains(x.MachineID) select x).ToList(),
                    machine_run_status == null ? null : machine_run_status.MachineRunFilter, out error_info);
                var pipe1_results = calc_pipe1_helper.CalcOptList(complex_request_paras.SchemeSortType, 3);
                double outlet_wl_calc = outlet_wl1;
                for (int i = 0; i < 5; i++)
                {//扬程过低,算不出来就增加出口压力
                    calc_pipe1_helper.InitialParas(
                        pipe1_TargetFlow,//假设一边输出一半
                        (inlet_wl1 + inlet_wl2) / 2, true,
                        outlet_wl1, true,
                        null, null,
                        (from x in _allMachineList where pipe1_machineIds.Contains(x.MachineID) select x).ToList(),
                        machine_run_status == null ? null : machine_run_status.MachineRunFilter, out error_info);
                    pipe1_results = calc_pipe1_helper.CalcOptList(complex_request_paras.SchemeSortType, 3);
                    if (pipe1_results != null && pipe1_results.Count > 0)
                    {
                        break;
                    }
                    outlet_wl_calc = outlet_wl_calc * 1.05;
                    ResultStatus = 2;
                    ResultStatusInfo = "提高了一号出口管液位参数";
                }
                if (pipe1_results == null || pipe1_results.Count() == 0)
                {
                    error_info = String.Format("管路一调度方案无法计算,请确认数据是否合理,进口液位:{0}m {1}m,出口液位:{2}m,流量要求:{3}",
@@ -170,27 +185,41 @@
                pipe_count++;
            }
            AnaScheme pipe2_result = null;
            IStation.Calculation.DispatchAna.Model.AnaScheme pipe2_result = null;
            List<IStation.Calculation.DispatchAna.Model.AnaScheme> pipe2_results = null;
            if (pipe2_TargetFlow > 100)
            {
                Common.DispatchAnaGeneralHelper压力 calc_pipe2_helper = new Common.DispatchAnaGeneralHelper压力();
                calc_pipe2_helper.InitialParas(
                double outlet_wl_calc = outlet_wl2;
                int i = 0;
                for (i = 0; i < 5; i++)
                {//扬程过低,算不出来就增加出口压力
                    calc_pipe2_helper.InitialParas(
                    pipe2_TargetFlow,//假设一边输出一半
                    (inlet_wl3 + inlet_wl4) / 2, true,
                    outlet_wl2, true,
                    outlet_wl_calc, true,
                    null, null,
                 (from x in _allMachineList where pipe2_machineIds.Contains(x.MachineID) select x).ToList(),
                    (from x in _allMachineList where pipe2_machineIds.Contains(x.MachineID) select x).ToList(),
                machine_run_status == null ? null : machine_run_status.MachineRunFilter, out error_info);
                calc_pipe2_helper.IsAllowOverTargetPress = true;//是否允许超过目标压力, ä½†æœ€å°å˜é¢‘频率都比要求压力高时, æŒ‰æœ€å°é¢‘率开泵
                var pipe2_results = calc_pipe2_helper.CalcOptList(complex_request_paras.SchemeSortType, 3);
                    calc_pipe2_helper.IsAllowOverTargetPress = true;//是否允许超过目标压力, ä½†æœ€å°å˜é¢‘频率都比要求压力高时, æŒ‰æœ€å°é¢‘率开泵
                    pipe2_results = calc_pipe2_helper.CalcOptList(complex_request_paras.SchemeSortType, 3);
                    if (pipe2_results != null && pipe2_results.Count > 0)
                    {
                        break;
                    }
                    ResultStatus = 2;
                    outlet_wl_calc = outlet_wl_calc * 1.05;
                    ResultStatusInfo = "提高了二号出口管液位参数";
                }
                if (pipe2_results == null || pipe2_results.Count() == 0)
                {
                    error_info = String.Format("管路一调度方案无法计算,请确认数据是否合理,进口液位:{0}m {1}m,出口液位:{2}m,流量要求:{3}",
                 inlet_wl3, inlet_wl4, outlet_wl2, pipe2_TargetFlow);
                    return null;
                }
                pipe2_result = pipe2_results.First();
 
                totalQ += pipe2_result.TotalWrkQ;
@@ -218,9 +247,10 @@
                plan.Items.AddRange(pipe2_result.Items);
            plan.ResultStatus = ResultStatus;
            plan.ResultStatusInfo = ResultStatusInfo;
            return new List<Model.AnaScheme>() { plan };
            #endregion
        }