现有组件功能与Amesim组件比较对齐,补全功能;仿真服务启动环境检测,旧版json工程文件适配读取

This commit is contained in:
ljz committed 2026-09-13 20:01:56 +08:00
1 parent b6c22a54f8
commit 6fc9afe41d
119 files changed
+260114 -351

No files matched your search

+9 -2
View File
@@ -16,6 +16,7 @@ import xml.etree.ElementTree as ET
from app.simulation.paths import HISTORICAL_MQL8_AME_PATH, HISTORICAL_MQL8_PROJECT_PATH, HISTORICAL_MQL8_XML_PATH
from app.simulation.registry import get_component_model_spec
from app.simulation.components.amesim.semantics import amesim_choice_to_public
from app.simulation.reporting.amesim_results import load_test_mql_amesim_results
@@ -246,6 +247,7 @@ def _expected_parameters(
entity_body: str,
model_type: str,
globals_: Mapping[str, float],
*, legacy_raw_choices: bool = False,
) -> dict[str, float]:
spec = get_component_model_spec(model_type)
fields = _value_fields(entity_body)
@@ -264,6 +266,9 @@ def _expected_parameters(
source_name=source_name,
globals_=globals_,
)
if not legacy_raw_choices:
expected[parameter.name] = amesim_choice_to_public(
model_type, parameter.name, expected[parameter.name])
elif parameter.name in fixed_defaults:
expected[parameter.name] = fixed_defaults[parameter.name]
if float(parameter.default) != expected[parameter.name]:
@@ -330,7 +335,9 @@ def _load_ame_contract(path: Path) -> AmesimContract:
_required_element_text(body, "SUB_NAME")
)
node_types[key] = model_type
parameters[key] = _expected_parameters(body, model_type, globals_)
# This loader preserves the August frozen baseline, including its old
# raw UD00 encoding. Current AME audits use the semantic default above.
parameters[key] = _expected_parameters(body, model_type, globals_, legacy_raw_choices=True)
# PORT_CONNECT=1 is an AMESim contact; line-backed ports use value 2 and
# are reconstructed from LINES_LIST below.
@@ -402,7 +409,7 @@ def _load_ame_contract(path: Path) -> AmesimContract:
model_type = _public_model_type(submodel)
node_types[key] = model_type
parameters[key] = _expected_parameters(
body, model_type, globals_
body, model_type, globals_, legacy_raw_choices=True
)
edges.extend(((start, key), (key, end)))