-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.py
More file actions
129 lines (99 loc) · 4.49 KB
/
Copy pathui.py
File metadata and controls
129 lines (99 loc) · 4.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# ============================================================================
# FILE: ui.py
# PURPOSE: Define UI panels that appear in Blender interface
# ============================================================================
import bpy
from bpy.types import Panel
class BIM_PT_mep_engineering(Panel):
"""MEP Engineering panel in Blender UI"""
bl_label = "MEP Engineering"
bl_idname = "BIM_PT_mep_engineering"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "scene"
bl_parent_id = "BIM_PT_tab_quality_control" # ← Check this line
# bl_parent_id = "BIM_PT_tab_geometric_relationships" # Commented out for testing
def draw(self, context):
"""Draw the panel UI"""
layout = self.layout
props = context.scene.BIMmepEngineeringProperties
# Add a header
layout.label(text="MEP Analysis Tools - DEVELOPMENT MODE", icon='MODIFIER')
# Project settings section
box = layout.box()
box.label(text="Project Settings")
box.prop(props, "project_number")
# Calculation settings section
box = layout.box()
box.label(text="Calculation Settings")
box.prop(props, "enable_clash_detection")
box.prop(props, "min_clearance_mm")
# Test button
layout.separator()
layout.operator("bim.test_mep_operator", icon='PLAY')
# ================================================================
# ROUTING SECTION (Phase 1)
# ================================================================
layout.separator()
layout.separator()
box = layout.box()
box.label(text="Conduit Routing", icon='CURVE_PATH')
# Start Point
row = box.row(align=True)
row.label(text="Start Point:")
row.operator("bim.set_route_start_point", text="Set from Cursor", icon='CURSOR')
row = box.row()
row.prop(props, "route_start_point", text="")
# End Point
row = box.row(align=True)
row.label(text="End Point:")
row.operator("bim.set_route_end_point", text="Set from Cursor", icon='CURSOR')
row = box.row()
row.prop(props, "route_end_point", text="")
# Settings
box.separator()
row = box.row()
row.prop(props, "clearance_distance")
row = box.row()
row.prop(props, "conduit_diameter")
row = box.row()
row.prop(props, "target_disciplines")
# Route Button
box.separator()
row = box.row()
row.scale_y = 1.5
# Check if federation loaded to enable/disable button
fed_props = context.scene.BIMFederationProperties
row.enabled = fed_props.index_loaded
row.operator("bim.route_mep_conduit", text="Route Conduit", icon='ANIM')
if not fed_props.index_loaded:
box.label(text="⚠ Load Federation Index first", icon='ERROR')
# ================================================================
# DEBUG TOOLS SECTION (NEW)
# ================================================================
layout.separator()
box = layout.box()
box.label(text="Debug Tools", icon='VIEWZOOM')
row = box.row(align=True)
row.enabled = fed_props.index_loaded
row.operator("bim.visualize_routing_obstacles", text="Visualize Conduit", icon='HIDE_OFF')
row.operator("bim.clear_routing_debug", text="Clear", icon='X')
if not fed_props.index_loaded:
box.label(text="⚠ Load Federation Index first", icon='ERROR')
# ================================================================
# VALIDATION SECTION (Phase 2B)
# ================================================================
layout.separator()
box = layout.box()
box.label(text="Clash Validation", icon='CHECKMARK')
row = box.row()
row.prop(props, "export_bcf")
row = box.row()
row.prop(props, "show_clash_details")
# Validate button
row = box.row()
row.scale_y = 1.5
row.enabled = fed_props.index_loaded
row.operator("bim.validate_conduit_route", text="Validate Route", icon='CHECKMARK')
if not fed_props.index_loaded:
box.label(text="⚠ Load Federation Index first", icon='ERROR')