feat(investigations): add event impact and work-order feedback flows
Add isolated burst and pollution impact evidence, parallel work-order workflows, persisted notifications and graph updates. Checkpoint current code. Known follow-ups remain for large pollution result previews and graceful geometry failure.
This commit is contained in:
@@ -29,6 +29,7 @@ from app.native.wndb.model.sources import (
|
||||
)
|
||||
from app.native.wndb.model.times import get_time, set_time
|
||||
from app.domain.time import parse_clock_duration_seconds
|
||||
from app.infra.db.postgresql.scada import ScadaElementMappings
|
||||
|
||||
|
||||
def _isolated_analysis(purpose: str):
|
||||
@@ -79,6 +80,7 @@ def burst_analysis(
|
||||
username: str | None = None,
|
||||
persist_results: bool = True,
|
||||
_temporary_project: str | None = None,
|
||||
scada_mappings: ScadaElementMappings | None = None,
|
||||
) -> dict | None:
|
||||
"""
|
||||
爆管模拟
|
||||
@@ -123,6 +125,7 @@ def burst_analysis(
|
||||
name=new_name,
|
||||
simulation_type="manually_temporary",
|
||||
modify_pattern_start_time=modify_pattern_start_time,
|
||||
scada_mappings=scada_mappings,
|
||||
)
|
||||
print(
|
||||
datetime.now(pytz.timezone("Asia/Shanghai")).strftime("%Y-%m-%d %H:%M:%S")
|
||||
@@ -203,6 +206,7 @@ def burst_analysis(
|
||||
modify_variable_pump_pattern=modify_variable_pump_pattern,
|
||||
modify_valve_opening=modify_valve_opening,
|
||||
scheme_type="burst_analysis",
|
||||
scada_mappings=scada_mappings,
|
||||
scheme_name=scheme_name,
|
||||
result_db_name=name,
|
||||
scheme_username=username,
|
||||
@@ -469,6 +473,7 @@ def contaminant_simulation(
|
||||
username: str | None = None,
|
||||
_temporary_project: str | None = None,
|
||||
persist_results: bool = True,
|
||||
scada_mappings: ScadaElementMappings | None = None,
|
||||
) -> dict | str | None:
|
||||
"""
|
||||
污染模拟
|
||||
@@ -591,6 +596,7 @@ def contaminant_simulation(
|
||||
scheme_username=username,
|
||||
scheme_detail=scheme_detail,
|
||||
persist_results=persist_results,
|
||||
scada_mappings=scada_mappings,
|
||||
)
|
||||
return result if not persist_results else None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user