From 7250b9fe4d9cdd59c85cb7b135362771c0b5424d Mon Sep 17 00:00:00 2001 From: sepehr Date: Sun, 19 Jul 2026 16:55:29 +0200 Subject: [PATCH] Show solved calibration factors in the properties panel. Surface free actuators like z_dp after solve in Results and Calibration tabs. Co-authored-by: Cursor --- .../src/components/panels/PropertiesPanel.tsx | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/panels/PropertiesPanel.tsx b/apps/web/src/components/panels/PropertiesPanel.tsx index 43ca19e..005573f 100644 --- a/apps/web/src/components/panels/PropertiesPanel.tsx +++ b/apps/web/src/components/panels/PropertiesPanel.tsx @@ -37,7 +37,8 @@ import { type ControlObjectiveConfig, type EntropykNodeData, } from "@/lib/configBuilder"; -import { buildComponentInspector } from "@/lib/componentInspector"; +import { buildComponentInspector, getSolvedVariablesForComponent } from "@/lib/componentInspector"; +import type { SolvedVariable } from "@/lib/api"; import { ComponentIcon } from "@/components/canvas/ComponentIcon"; import ComponentDocPanel from "@/components/panels/ComponentDocPanel"; import { modelBannerForType } from "@/lib/componentDocMap"; @@ -135,6 +136,13 @@ export default function PropertiesPanel() { ); }, [node, nodes, edges, result]); + // Solver-computed unknowns owned by this component (free actuators + + // calibration factors). Empty until a solve produces them. + const solvedVars = useMemo( + () => (node ? getSolvedVariablesForComponent(result, node.data.name) : []), + [node, result], + ); + // After a successful solve, jump to Results when selecting a part (Dymola-like). useEffect(() => { if (!node) return; @@ -301,7 +309,11 @@ export default function PropertiesPanel() { )} {!isRegLoop && panelMode === "results" && ( - + )} {(isRegLoop || panelMode === "parameters") && ( @@ -529,7 +541,7 @@ export default function PropertiesPanel() { )} {activeTab === "Calibration" && ( -
+

Comment calibrer : coche Fixed sur la cible (SST/SDT), décoche Fixed sur le facteur (Z_UA). Z_UA vaut 1 par défaut (pas de @@ -538,6 +550,9 @@ export default function PropertiesPanel() {

Tu n’as pas besoin du nœud « Regulation loop » pour ça.

+ {solvedVars.length > 0 && ( + + )}
)} @@ -847,9 +862,11 @@ function controllerSelectOptions( function ModelicaResultsView({ inspector, hasResult, + solvedVariables, }: { inspector: ReturnType | null; hasResult: boolean; + solvedVariables: SolvedVariable[]; }) { if (!hasResult || !inspector) { return ( @@ -911,6 +928,10 @@ function ModelicaResultsView({ )}
+ {solvedVariables.length > 0 && ( + + )} +
Ports / variables