调整epanet工具目录结构;联通前端水质分析模块功能;新建 readme.md

This commit is contained in:
2026-01-30 15:24:56 +08:00
parent 9d7a9fb2fd
commit 9037bf317b
12 changed files with 128 additions and 69 deletions

View File

@@ -30,11 +30,11 @@ class Output:
if platform.system() == "Windows":
self._lib = ctypes.CDLL(
os.path.join(os.getcwd(), "epanet", "epanet-output.dll")
os.path.join(os.path.dirname(__file__), "windows", "epanet-output.dll")
)
else:
self._lib = ctypes.CDLL(
os.path.join(os.getcwd(), "epanet", "linux", "libepanet-output.so")
os.path.join(os.path.dirname(__file__), "linux", "libepanet-output.so")
)
self._handle = ctypes.c_void_p()
@@ -314,9 +314,9 @@ def run_project_return_dict(name: str, readable_output: bool = False) -> dict[st
input = name + ".db"
if platform.system() == "Windows":
exe = os.path.join(os.path.join(dir, "epanet"), "runepanet.exe")
exe = os.path.join(os.path.dirname(__file__), "windows", "runepanet.exe")
else:
exe = os.path.join(os.path.join(dir, "epanet"), "linux", "runepanet")
exe = os.path.join(os.path.dirname(__file__), "linux", "runepanet")
inp = os.path.join(os.path.join(dir, "db_inp"), input + ".inp")
rpt = os.path.join(os.path.join(dir, "temp"), input + ".rpt")
opt = os.path.join(os.path.join(dir, "temp"), input + ".opt")
@@ -364,9 +364,9 @@ def run_project(name: str, readable_output: bool = False) -> str:
input = name + ".db"
if platform.system() == "Windows":
exe = os.path.join(os.path.join(dir, "epanet"), "runepanet.exe")
exe = os.path.join(os.path.dirname(__file__), "windows", "runepanet.exe")
else:
exe = os.path.join(os.path.join(dir, "epanet"), "linux", "runepanet")
exe = os.path.join(os.path.dirname(__file__), "linux", "runepanet")
inp = os.path.join(os.path.join(dir, "db_inp"), input + ".inp")
rpt = os.path.join(os.path.join(dir, "temp"), input + ".rpt")
opt = os.path.join(os.path.join(dir, "temp"), input + ".opt")
@@ -416,9 +416,9 @@ def run_inp(name: str) -> str:
dir = os.path.abspath(os.getcwd())
if platform.system() == "Windows":
exe = os.path.join(os.path.join(dir, "epanet"), "runepanet.exe")
exe = os.path.join(os.path.dirname(__file__), "windows", "runepanet.exe")
else:
exe = os.path.join(os.path.join(dir, "epanet"), "linux", "runepanet")
exe = os.path.join(os.path.dirname(__file__), "linux", "runepanet")
inp = os.path.join(os.path.join(dir, "inp"), name + ".inp")
rpt = os.path.join(os.path.join(dir, "temp"), name + ".rpt")
opt = os.path.join(os.path.join(dir, "temp"), name + ".opt")