调整epanet工具目录结构;联通前端水质分析模块功能;新建 readme.md
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -21,8 +21,12 @@ import app.services.globals as globals
|
||||
import uuid
|
||||
import app.services.project_info as project_info
|
||||
from app.native.api.postgresql_info import get_pgconn_string
|
||||
from app.infra.db.timescaledb.internal_queries import InternalQueries as TimescaleInternalQueries
|
||||
from app.infra.db.timescaledb.internal_queries import InternalStorage as TimescaleInternalStorage
|
||||
from app.infra.db.timescaledb.internal_queries import (
|
||||
InternalQueries as TimescaleInternalQueries,
|
||||
)
|
||||
from app.infra.db.timescaledb.internal_queries import (
|
||||
InternalStorage as TimescaleInternalStorage,
|
||||
)
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"
|
||||
@@ -679,8 +683,8 @@ def run_simulation(
|
||||
modify_fixed_pump_pattern: dict[str, list] = None,
|
||||
modify_variable_pump_pattern: dict[str, list] = None,
|
||||
modify_valve_opening: dict[str, float] = None,
|
||||
scheme_Type: str = None,
|
||||
scheme_Name: str = None,
|
||||
scheme_type: str = None,
|
||||
scheme_name: str = None,
|
||||
) -> None:
|
||||
"""
|
||||
传入需要修改的参数,改变数据库中对应位置的值,然后计算,返回结果
|
||||
@@ -695,8 +699,8 @@ def run_simulation(
|
||||
:param modify_fixed_pump_pattern: dict中包含多个水泵模式,str为工频水泵的id,list为修改后的pattern
|
||||
:param modify_variable_pump_pattern: dict中包含多个水泵模式,str为变频水泵的id,list为修改后的pattern
|
||||
:param modify_valve_opening: dict中包含多个阀门开启度,str为阀门的id,float为修改后的阀门开启度
|
||||
:param scheme_Type: 模拟方案类型
|
||||
:param scheme_Name:模拟方案名称
|
||||
:param scheme_type: 模拟方案类型
|
||||
:param scheme_name:模拟方案名称
|
||||
:return:
|
||||
"""
|
||||
# 记录开始时间
|
||||
@@ -1235,8 +1239,8 @@ def run_simulation(
|
||||
)
|
||||
elif simulation_type.upper() == "EXTENDED":
|
||||
TimescaleInternalStorage.store_scheme_simulation(
|
||||
scheme_Type,
|
||||
scheme_Name,
|
||||
scheme_type,
|
||||
scheme_name,
|
||||
node_result,
|
||||
link_result,
|
||||
modify_pattern_start_time,
|
||||
|
||||
Reference in New Issue
Block a user