Spaces:
Sleeping
Sleeping
Update app/components.py
Browse files- app/components.py +10 -7
app/components.py
CHANGED
|
@@ -151,6 +151,7 @@ def display_component_tab(comp_type: str):
|
|
| 151 |
name = st.text_input(
|
| 152 |
"Name",
|
| 153 |
value=editor_state.get("name", ""),
|
|
|
|
| 154 |
help="Enter a unique name for this component."
|
| 155 |
)
|
| 156 |
|
|
@@ -344,17 +345,19 @@ def display_component_tab(comp_type: str):
|
|
| 344 |
component_data["fenestration"] = fenestration
|
| 345 |
component_data["parent_component"] = parent_component
|
| 346 |
component_data["function_type"] = function_type
|
| 347 |
-
|
|
|
|
| 348 |
if fenestration in available_items:
|
| 349 |
-
|
| 350 |
-
component_data["shgc"] =
|
| 351 |
-
component_data["
|
| 352 |
-
component_data["
|
|
|
|
| 353 |
else:
|
| 354 |
-
component_data["u_value"] = 0.0
|
| 355 |
component_data["shgc"] = 0.7
|
|
|
|
|
|
|
| 356 |
component_data["visible_transmittance"] = 0.7
|
| 357 |
-
component_data["shading_coefficient"] = shading_coefficient
|
| 358 |
|
| 359 |
# Handle edit mode
|
| 360 |
if is_edit:
|
|
|
|
| 151 |
name = st.text_input(
|
| 152 |
"Name",
|
| 153 |
value=editor_state.get("name", ""),
|
| 154 |
+
|
| 155 |
help="Enter a unique name for this component."
|
| 156 |
)
|
| 157 |
|
|
|
|
| 345 |
component_data["fenestration"] = fenestration
|
| 346 |
component_data["parent_component"] = parent_component
|
| 347 |
component_data["function_type"] = function_type
|
| 348 |
+
component_data["shading_coefficient"] = shading_coefficient
|
| 349 |
+
# Get fenestration properties (SHGC, U-Value, h_o) if available
|
| 350 |
if fenestration in available_items:
|
| 351 |
+
fenestration_data = available_items[fenestration]
|
| 352 |
+
component_data["shgc"] = fenestration_data.get("shgc", 0.7)
|
| 353 |
+
component_data["u_value"] = fenestration_data.get("u_value", 5.0)
|
| 354 |
+
component_data["h_o"] = fenestration_data.get("h_o", DEFAULT_WINDOW_PROPERTIES["h_o"])
|
| 355 |
+
component_data["visible_transmittance"] = fenestration_data.get("visible_transmittance", 0.7)
|
| 356 |
else:
|
|
|
|
| 357 |
component_data["shgc"] = 0.7
|
| 358 |
+
component_data["u_value"] = 5.0
|
| 359 |
+
component_data["h_o"] = DEFAULT_WINDOW_PROPERTIES["h_o"]
|
| 360 |
component_data["visible_transmittance"] = 0.7
|
|
|
|
| 361 |
|
| 362 |
# Handle edit mode
|
| 363 |
if is_edit:
|