From b94da76188b834922d2f13365b22208a4bc4049a Mon Sep 17 00:00:00 2001 From: Shuxia Ning <NingShuxia0927@outlook.com> Date: 星期六, 12 十月 2024 11:33:40 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0 --- Hydro/Yw.EPAnet.Calcu.Core/04-Inp/InpInteropHelper.cs | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/Hydro/Yw.EPAnet.Calcu.Core/04-Inp/InpInteropHelper.cs b/Hydro/Yw.EPAnet.Calcu.Core/04-Inp/InpInteropHelper.cs index 46a8475..3a59a13 100644 --- a/Hydro/Yw.EPAnet.Calcu.Core/04-Inp/InpInteropHelper.cs +++ b/Hydro/Yw.EPAnet.Calcu.Core/04-Inp/InpInteropHelper.cs @@ -73,7 +73,8 @@ var pTemp = o.DemandPattern; if (string.IsNullOrEmpty(pTemp) || pTemp == ";" || pTemp == "_") pTemp = ""; junctionStringBuilder.AppendLine($"{o.Id}\t{o.Elev}\t{o.Demand}\t{pTemp}\t;\t" + $"0\tNozzle\t{o.Coefficient}"); - emitterStringBuilder.AppendLine(o.Id + " " + o.Coefficient); + double Coe = o.Coefficient * Math.Pow(10 / 101.972, 0.5) / 1000 * 60; + emitterStringBuilder.AppendLine(o.Id + " " + Coe); coorStringBuilder.AppendLine(o.Id + " " + o.Position.X + " " + o.Position.Y); }); @@ -256,6 +257,7 @@ var net = new Network(); if (InpPath == null || !File.Exists(InpPath)) return null; List<InpCoor> points = new List<InpCoor>(); + StreamReader sr = new StreamReader(InpPath); //try { @@ -428,6 +430,16 @@ } } break; + case "EMITTERS": + { + string id = parts[0]; + if (double.TryParse(parts[1], out double x)) + { + double Coefficient = x / Math.Pow(10 / 101.972, 0.5) * 1000 / 60; + net.Nozzles.Find(o => o.Id == id).Coefficient = Coefficient; + } + } + break; } } } -- Gitblit v1.9.3