对齐test_mql保存时刻与PNVO事件边界

This commit is contained in:
huojiarong committed 2026-07-21 07:56:25 +00:00
1 parent 7c68caed27
commit a0855018d5
5 files changed
+345 -35

No files matched your search

+27 -1
View File
@@ -3909,7 +3909,14 @@ def _default_full_state_data_paths() -> tuple[str, ...]:
for signal in ("x1", "v1", "acc1")
]
return tuple(
[*chamber_paths, *piston_paths, *mass_paths, "dm1@pneumatic_69"]
[
*chamber_paths,
*piston_paths,
*mass_paths,
"dm1@pneumatic_69",
"xv@pn_morifice_1",
"dm2@pn_morifice_1",
]
)
@@ -3973,6 +3980,10 @@ _PNL0001_MASS_FLOW_DIAGNOSTIC_FIELDS = {
"pneumatic_69": "p4_port3_remote_chamber_to_line_flow",
}
_VARIABLE_ORIFICE_MASS_FLOW_DIAGNOSTIC_FIELDS = {
"pn_morifice_1": "p4_port3_remote_orifice_to_node_flow",
}
class TestMqlFullStateClosure:
def __init__(
@@ -4162,6 +4173,21 @@ class TestMqlFullStateClosure:
_PNL0001_MASS_FLOW_DIAGNOSTIC_FIELDS[alias],
)
values_by_data_path[data_path] = -canonical_flow_kg_s * 1.0e3
elif alias in self.pneumatic_assembly.variable_orifices:
orifice = self.pneumatic_assembly.variable_orifices[alias]
if signal == "xv":
values_by_data_path[data_path] = orifice.opening
elif (
signal == "dm2"
and alias in _VARIABLE_ORIFICE_MASS_FLOW_DIAGNOSTIC_FIELDS
):
flow_kg_s = getattr(
snapshot.pneumatic,
_VARIABLE_ORIFICE_MASS_FLOW_DIAGNOSTIC_FIELDS[alias],
)
values_by_data_path[data_path] = flow_kg_s * 1.0e3
else:
raise KeyError(data_path)
elif alias in chamber_properties_by_alias:
chamber_properties = chamber_properties_by_alias[alias]
chamber = chamber_by_alias[alias]