完善仿真交互、结果展示与模型元数据
This commit is contained in:
1 parent
f1256a121d
commit
f7f1078911
26 files changed
+9042
-575
No files matched your search
@@ -16,12 +16,22 @@ class PortVariableDefinition:
|
||||
name: str
|
||||
role: VariableRole
|
||||
connection_rule: ConnectionRule
|
||||
label: str = field(default="", compare=False)
|
||||
quantity: str = field(default="", compare=False)
|
||||
unit: str = field(default="", compare=False)
|
||||
result_visible: bool = field(default=True, compare=False)
|
||||
order: int = field(default=0, compare=False)
|
||||
|
||||
def as_interface_dict(self) -> dict[str, str]:
|
||||
def as_interface_dict(self) -> dict[str, object]:
|
||||
return {
|
||||
"name": self.name,
|
||||
"role": self.role,
|
||||
"connectionRule": self.connection_rule,
|
||||
"label": self.label or self.name,
|
||||
"quantity": self.quantity or self.name,
|
||||
"unit": self.unit,
|
||||
"resultVisible": self.result_visible,
|
||||
"order": self.order,
|
||||
}
|
||||
|
||||
|
||||
@@ -50,9 +60,33 @@ class PortDefinition:
|
||||
nominal_role=nominal_role,
|
||||
positive_flow_direction="intoComponent",
|
||||
variables=(
|
||||
PortVariableDefinition("p", "effort", "equal"),
|
||||
PortVariableDefinition("m_flow", "flow", "sumToZero"),
|
||||
PortVariableDefinition("h_outflow", "stream", "streamMix"),
|
||||
PortVariableDefinition(
|
||||
"p",
|
||||
"effort",
|
||||
"equal",
|
||||
label="压力",
|
||||
quantity="pressure",
|
||||
unit="Pa",
|
||||
order=10,
|
||||
),
|
||||
PortVariableDefinition(
|
||||
"m_flow",
|
||||
"flow",
|
||||
"sumToZero",
|
||||
label="质量流量",
|
||||
quantity="mass_flow",
|
||||
unit="kg/s",
|
||||
order=20,
|
||||
),
|
||||
PortVariableDefinition(
|
||||
"h_outflow",
|
||||
"stream",
|
||||
"streamMix",
|
||||
label="流出比焓",
|
||||
quantity="specific_enthalpy",
|
||||
unit="J/kg",
|
||||
order=30,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user