补充test_mql气动拓扑候选发现

This commit is contained in:
huojiarong committed 2026-07-16 09:42:25 +00:00
1 parent 95ebca89f6
commit c0f28520b4
3 files changed
+89

No files matched your search

+43
View File
@@ -3915,6 +3915,49 @@ class TestMqlSystem:
source=source,
)
def discover_pneumatic_branch_topology(self):
from PythonModels.systems.test_mql_closure import (
TestMqlPneumaticTopologyCandidate,
TestMqlPneumaticTopologyDiscovery,
)
typed_aliases = set(self._pneumatic_components_by_alias())
blocked_candidates = []
for spec in CONNECTION_SPECS:
source_component = str(spec["source_component"])
target_component = str(spec["target_component"])
source_is_typed = source_component in typed_aliases
target_is_typed = target_component in typed_aliases
if not (source_is_typed or target_is_typed):
continue
line_submodel = str(spec["submodel"])
if source_is_typed and target_is_typed:
reason = "direct typed pneumatic connection is not a complete volume-orifice-volume branch"
elif line_submodel == "DIRECT":
reason = "requires AMESim boundary component interpretation before closure construction"
else:
reason = "requires AMESim node/line submodel interpretation before closure construction"
blocked_candidates.append(
TestMqlPneumaticTopologyCandidate(
connection_alias=str(spec["alias"]),
line_submodel=line_submodel,
source_component=source_component,
source_port=str(spec["source_port"]),
target_component=target_component,
target_port=str(spec["target_port"]),
source_is_typed_pneumatic=source_is_typed,
target_is_typed_pneumatic=target_is_typed,
reason=reason,
)
)
return TestMqlPneumaticTopologyDiscovery(
branch_specs=(),
blocked_candidates=tuple(blocked_candidates),
)
def pneumatic_branch_closure_from_spec(self, spec):
return self.pneumatic_branch_closure(
name=spec.name,