前端进度条性能优化、仿真结束后后处理优化;后端C代码生成流程优化:先识别来源,再按照已知未知量需求排序,最后局部求解
This commit is contained in:
1 parent
0dcb465d84
commit
91bd9fb252
77 files changed
+11223
-551
No files matched your search
+10
-1
@@ -1151,7 +1151,8 @@ def build_reactflow_system_xml(project: ReactFlowProjectPayload) -> bytes:
|
||||
edge.targetHandle,
|
||||
edge.id,
|
||||
)
|
||||
validate_compatible_ports(first, second, edge.id)
|
||||
validate_compatible_ports(first, second, edge.id,
|
||||
f"{edge.source}.{first.name}", f"{edge.target}.{second.name}")
|
||||
|
||||
connection_node = ET.SubElement(
|
||||
connections_node,
|
||||
@@ -1203,11 +1204,18 @@ def validate_compatible_ports(
|
||||
first: "PortDefinition",
|
||||
second: "PortDefinition",
|
||||
connection_id: str,
|
||||
first_label: str | None = None,
|
||||
second_label: str | None = None,
|
||||
) -> None:
|
||||
from app.simulation.core.port_computation import PortSupplyError, port_supply_issue
|
||||
|
||||
if first.kind != second.kind:
|
||||
raise ValueError(f"Connection {connection_id} mixes physical and signal ports.")
|
||||
if first.domain != second.domain:
|
||||
raise ValueError(f"Connection {connection_id} connects incompatible domains.")
|
||||
supply_issue = port_supply_issue(first, second, first_label, second_label)
|
||||
if supply_issue:
|
||||
raise PortSupplyError(supply_issue)
|
||||
if first.kind == "signal" and {first.nominal_role, second.nominal_role} != {
|
||||
"input",
|
||||
"output",
|
||||
@@ -1422,6 +1430,7 @@ def _compile_solver_network(
|
||||
edge.endpoint_b_port,
|
||||
connection_id=edge.id,
|
||||
)
|
||||
network.validate_port_supplies()
|
||||
return network
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user