Hydro.Inp/NetWork.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Test/Program.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Test/Test.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
out/CommonBase.dll | 补丁 | 查看 | 原始文档 | blame | 历史 | |
out/HydraulicModel.dll | 补丁 | 查看 | 原始文档 | blame | 历史 | |
out/Hydro.ConfigModel.dll | 补丁 | 查看 | 原始文档 | blame | 历史 | |
out/Hydro.Core.dll | 补丁 | 查看 | 原始文档 | blame | 历史 | |
out/Hydro.HydraulicOptimizer.dll | 补丁 | 查看 | 原始文档 | blame | 历史 |
Hydro.Inp/NetWork.cs
@@ -2,6 +2,7 @@ //using Hydro.HydraulicModel; using System; using System.Collections.Generic; using System.Data; using System.Drawing; using System.IO; using System.IO.Ports; @@ -465,7 +466,7 @@ #region 优化方案 int k1 = 0; int k2 = 0; Nodes.Sort((a, b) => string.Compare(a.ID, b.ID)); points.Sort((a, b) => string.Compare(a.ID, b.ID)); @@ -493,7 +494,7 @@ } #endregion //建立点线关系链表StartNode,先将管线以Node1(节点1的ID)排序,再将Nodes按ID排序,建立两个游标k1、k2,正向一次循环,建立链表关系 //时间复杂度 O(n) @@ -564,7 +565,7 @@ } if (!File.Exists(tempPath)) { throw new Exception("模板文件不存在"); throw new Exception("模板文件不存在," + tempPath); } if (!File.Exists(InpPath)) File.Create(InpPath).Close(); @@ -954,9 +955,15 @@ HydraulicModel.Epanet epanet = new HydraulicModel.Epanet(); var result = new List<TimePoint>(); var err = epanet.open(InpPath, "d:\\5.log", ""); if (err != 0) { throw new Exception($"计算失败:{err}"); throw new Exception($"打开计算文件失败:{err}"); } var errCal = epanet.solveH(); if (errCal != 0) { throw new Exception($"计算失败:{errCal}"); } int nodeCount = 0, linkCount = 0; epanet.getcount((int)CountType.Node, ref nodeCount); @@ -1007,7 +1014,7 @@ /// <returns></returns> public virtual List<TimePoint> Calc() { var inpPath = Path.Combine(Directory.GetCurrentDirectory(), @"data\inp\calc.inp"); var inpPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"data\inp\calc.inp"); BuildToInp(inpPath); return Calc(inpPath); } Test/Program.cs
@@ -138,7 +138,7 @@ static void Test3() { var nw = new NetWorkMapModel(); var result = nw.Calc(); var result = nw.Calc("d:\\revitinp.inp"); Console.WriteLine(result); Console.ReadLine(); } @@ -146,7 +146,7 @@ static void Test4() { var nw = new NetWork(); var result = nw.Calc(inpPath); var result = nw.Calc(); Console.WriteLine(JsonConvert.SerializeObject(result)); Console.ReadLine(); } Test/Test.csproj
@@ -14,7 +14,7 @@ <Deterministic>true</Deterministic> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>x64</PlatformTarget> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> out/CommonBase.dllBinary files differ
out/HydraulicModel.dllBinary files differ
out/Hydro.ConfigModel.dllBinary files differ
out/Hydro.Core.dllBinary files differ
out/Hydro.HydraulicOptimizer.dllBinary files differ