@kruschdev/pascal-plugin-plumbing 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +123 -2
- package/docs/AGENT-TOOLS.md +12 -0
- package/docs/ARCHITECTURE.md +15 -0
- package/docs/CAD-CATALOG.md +10 -0
- package/docs/IPC-REFERENCE.md +17 -0
- package/package.json +89 -4
- package/src/agent-operations.ts +854 -0
- package/src/agent-tools.ts +258 -0
- package/src/cad/catalog.ts +151 -0
- package/src/cad/equipment.ts +172 -0
- package/src/cad/fittings.ts +322 -0
- package/src/cad/fixtures.ts +255 -0
- package/src/cad/index.ts +6 -0
- package/src/cad/manifold-interior.ts +248 -0
- package/src/cad/materials.ts +122 -0
- package/src/index.ts +156 -0
- package/src/ipc/audit.ts +927 -0
- package/src/ipc/autopopulate.ts +5071 -0
- package/src/ipc/framing-interop.ts +843 -0
- package/src/ipc/index.ts +9 -0
- package/src/ipc/pricing.ts +571 -0
- package/src/ipc/routing.ts +2410 -0
- package/src/ipc/rules.ts +271 -0
- package/src/ipc/schedule.ts +653 -0
- package/src/ipc/sizing.ts +663 -0
- package/src/ipc/tables.ts +780 -0
- package/src/nodes/equipment.ts +330 -0
- package/src/nodes/fixture.ts +245 -0
- package/src/nodes/manifold.ts +194 -0
- package/src/nodes/parametrics.ts +170 -0
- package/src/nodes/pipe-run.ts +393 -0
- package/src/render.ts +64 -0
- package/src/ui/chat-card.tsx +209 -0
- package/src/ui/inspector-card.tsx +243 -0
- package/src/ui/manifold-cutaway-view.tsx +297 -0
- package/src/ui/plumbing-panel.tsx +812 -0
- package/src/ui/schedule-view.tsx +523 -0
- package/src/ui/store.ts +98 -0
|
@@ -0,0 +1,812 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Left-rail EditorHostPanel for `krusch:plumbing`.
|
|
5
|
+
* Uses scoped inline styles and Pascal CSS variables so zero global CSS leaks.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { type AnyNode, runAsSingleSceneHistoryStep } from '@pascal-app/core'
|
|
9
|
+
import { openEditorView, useScene, useViewer } from '@pascal-app/editor'
|
|
10
|
+
import { useMemo, useState } from 'react'
|
|
11
|
+
import { plumbingAgentOperations } from '../agent-operations'
|
|
12
|
+
import { auditScenePlumbing } from '../ipc/audit'
|
|
13
|
+
import { type BonesIngestionMode, countDetectedFurnishingFixtures } from '../ipc/autopopulate'
|
|
14
|
+
import {
|
|
15
|
+
type SceneNodeLike,
|
|
16
|
+
belongsToLevel,
|
|
17
|
+
extractBonesPlumbingContext,
|
|
18
|
+
} from '../ipc/framing-interop'
|
|
19
|
+
import { buildPlumbingSchedule } from '../ipc/schedule'
|
|
20
|
+
import {
|
|
21
|
+
type EquipmentKind,
|
|
22
|
+
FIXTURE_SPECS,
|
|
23
|
+
type FixtureKind,
|
|
24
|
+
type ManifoldKind,
|
|
25
|
+
PLUMBING_SYSTEM_COLORS,
|
|
26
|
+
type PlumbingSystem,
|
|
27
|
+
} from '../ipc/tables'
|
|
28
|
+
import { usePlumbingUi } from './store'
|
|
29
|
+
|
|
30
|
+
export const PLUMBING_SCHEDULE_VIEW_ID = 'krusch:plumbing:schedule'
|
|
31
|
+
|
|
32
|
+
function activeLevelOf(nodes: Readonly<Record<string, AnyNode>>, selectedLevelId: string | null): string | null {
|
|
33
|
+
if (selectedLevelId && nodes[selectedLevelId]?.type === 'level') return selectedLevelId
|
|
34
|
+
for (const n of Object.values(nodes)) {
|
|
35
|
+
if (n.type === 'level') return n.id
|
|
36
|
+
}
|
|
37
|
+
return null
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const QUICK_EQUIPMENT: ReadonlyArray<{ kind: EquipmentKind; label: string }> = [
|
|
41
|
+
{ kind: 'water-heater-tank-electric', label: '50 gal Electric Water Heater (30A)' },
|
|
42
|
+
{ kind: 'water-heater-tank-gas', label: '50 gal Gas Water Heater (40 kBTU)' },
|
|
43
|
+
{ kind: 'water-heater-tankless-gas', label: 'Tankless Gas WH (199 kBTU)' },
|
|
44
|
+
{ kind: 'water-heater-hpwh', label: 'Hybrid Heat Pump WH (HPWH)' },
|
|
45
|
+
{ kind: 'main-shutoff-prv', label: 'Main Shutoff + PRV + Gauge' },
|
|
46
|
+
{ kind: 'expansion-tank', label: 'Thermal Expansion Tank (IPC 607.3)' },
|
|
47
|
+
{ kind: 'water-softener', label: 'Whole-House Water Softener' },
|
|
48
|
+
{ kind: 'sump-pump', label: 'Sump Pump + Basin (20A GFCI)' },
|
|
49
|
+
{ kind: 'sewage-ejector', label: 'Sewage Ejector Basin (20A GFCI)' },
|
|
50
|
+
{ kind: 'recirc-pump', label: 'Hot Water Recirculation Pump' },
|
|
51
|
+
{ kind: 'gas-meter', label: 'Natural Gas Utility Meter' },
|
|
52
|
+
{ kind: 'backwater-valve', label: 'Mainline Backwater Valve' },
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
const QUICK_MANIFOLDS: ReadonlyArray<{ kind: ManifoldKind; label: string }> = [
|
|
56
|
+
{ kind: 'pex-homerun', label: 'PEX Home-Run Manifold (12-Port)' },
|
|
57
|
+
{ kind: 'copper-header', label: 'Type L Copper Header (12-Port)' },
|
|
58
|
+
{ kind: 'gas-csst', label: 'CSST Fuel-Gas Manifold (8-Port)' },
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
const QUICK_FIXTURES: ReadonlyArray<{ kind: FixtureKind; label: string }> = [
|
|
62
|
+
{ kind: 'water-closet', label: 'Water Closet (3 DFU)' },
|
|
63
|
+
{ kind: 'lavatory', label: 'Vanity Lavatory (1 DFU)' },
|
|
64
|
+
{ kind: 'kitchen-sink', label: 'Kitchen Sink (2 DFU)' },
|
|
65
|
+
{ kind: 'bathtub', label: 'Alcove Bathtub (2 DFU)' },
|
|
66
|
+
{ kind: 'shower', label: 'Walk-In Shower (2 DFU)' },
|
|
67
|
+
{ kind: 'tub-shower-combo', label: 'Tub / Shower Combo (2 DFU)' },
|
|
68
|
+
{ kind: 'dishwasher', label: 'Dishwasher Hookup (20A GFCI)' },
|
|
69
|
+
{ kind: 'clothes-washer', label: 'Washer Box + 2" Standpipe' },
|
|
70
|
+
{ kind: 'laundry-sink', label: 'Laundry / Utility Sink (2 DFU)' },
|
|
71
|
+
{ kind: 'bar-sink', label: 'Wet-Bar Sink (1 DFU)' },
|
|
72
|
+
{ kind: 'floor-drain', label: '2" Floor Drain (2 DFU)' },
|
|
73
|
+
{ kind: 'hose-bibb', label: 'Frost-Proof Hose Bibb (Vacuum Breaker)' },
|
|
74
|
+
{ kind: 'bidet', label: 'Heated Bidet (15A Dedicated GFCI)' },
|
|
75
|
+
{ kind: 'garbage-disposal', label: 'Garbage Disposal (20A GFCI)' },
|
|
76
|
+
{ kind: 'urinal', label: 'Commercial Wall-Hung Urinal' },
|
|
77
|
+
{ kind: 'mop-sink', label: 'Commercial Mop Basin (3" Drain)' },
|
|
78
|
+
{ kind: 'drinking-fountain', label: 'Commercial Drinking Fountain' },
|
|
79
|
+
{ kind: 'grease-interceptor', label: 'Commercial Grease Interceptor (50 GPM)' },
|
|
80
|
+
]
|
|
81
|
+
|
|
82
|
+
function defaultEquipmentPlacementY(kind: EquipmentKind): number {
|
|
83
|
+
switch (kind) {
|
|
84
|
+
case 'main-shutoff-prv':
|
|
85
|
+
return 0.75
|
|
86
|
+
case 'expansion-tank':
|
|
87
|
+
return 1.65
|
|
88
|
+
case 'recirc-pump':
|
|
89
|
+
return 1.25
|
|
90
|
+
case 'gas-meter':
|
|
91
|
+
return 0.9
|
|
92
|
+
case 'backwater-valve':
|
|
93
|
+
return 0.12
|
|
94
|
+
default:
|
|
95
|
+
return 0
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function findOpenPlacementSlot(
|
|
100
|
+
record: Readonly<Record<string, SceneNodeLike>>,
|
|
101
|
+
levelId: string,
|
|
102
|
+
baseX: number,
|
|
103
|
+
baseZ: number,
|
|
104
|
+
stepX: number,
|
|
105
|
+
stepZ: number,
|
|
106
|
+
): [number, number] {
|
|
107
|
+
const occupied: Array<[number, number]> = []
|
|
108
|
+
for (const n of Object.values(record)) {
|
|
109
|
+
if (
|
|
110
|
+
(n.type === 'plumbing:equipment' || n.type === 'plumbing:manifold' || n.type === 'plumbing:fixture') &&
|
|
111
|
+
belongsToLevel(record, n, levelId) &&
|
|
112
|
+
Array.isArray(n.position) &&
|
|
113
|
+
n.position.length >= 3 &&
|
|
114
|
+
Number.isFinite(n.position[0]) &&
|
|
115
|
+
Number.isFinite(n.position[2])
|
|
116
|
+
) {
|
|
117
|
+
occupied.push([n.position[0] as number, n.position[2] as number])
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
for (let slot = 0; slot < 200; slot++) {
|
|
121
|
+
const ox = Math.round((baseX + (slot % 5) * stepX) * 100) / 100
|
|
122
|
+
const oz = Math.round((baseZ + Math.floor(slot / 5) * stepZ) * 100) / 100
|
|
123
|
+
if (!occupied.some(([x, z]) => Math.hypot(x - ox, z - oz) < 0.45)) {
|
|
124
|
+
return [ox, oz]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const fallbackSlot = occupied.length
|
|
128
|
+
return [
|
|
129
|
+
Math.round((baseX + (fallbackSlot % 5) * stepX) * 100) / 100,
|
|
130
|
+
Math.round((baseZ + Math.floor(fallbackSlot / 5) * stepZ) * 100) / 100,
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export default function PlumbingHostPanel() {
|
|
135
|
+
const nodes = useScene((s) => s.nodes)
|
|
136
|
+
const createNodes = useScene((s) => s.createNodes)
|
|
137
|
+
const deleteNodes = useScene((s) => s.deleteNodes)
|
|
138
|
+
const updateNodes = useScene((s) => s.updateNodes)
|
|
139
|
+
const selectedLevelId = useViewer((s) => s.selection.levelId)
|
|
140
|
+
const wallMode = useViewer((s) => s.wallMode)
|
|
141
|
+
const setWallMode = useViewer((s) => s.setWallMode)
|
|
142
|
+
const xrayFamily = useViewer((s) => s.xrayFamily)
|
|
143
|
+
const setXrayFamily = useViewer((s) => s.setXrayFamily)
|
|
144
|
+
|
|
145
|
+
const {
|
|
146
|
+
occupancy,
|
|
147
|
+
setOccupancy,
|
|
148
|
+
codeEdition,
|
|
149
|
+
setCodeEdition,
|
|
150
|
+
supplyTopology,
|
|
151
|
+
setSupplyTopology,
|
|
152
|
+
supplyMaterial,
|
|
153
|
+
setSupplyMaterial,
|
|
154
|
+
dwvMaterial,
|
|
155
|
+
setDwvMaterial,
|
|
156
|
+
foundationType,
|
|
157
|
+
setFoundationType,
|
|
158
|
+
waterHeaterKind,
|
|
159
|
+
setWaterHeaterKind,
|
|
160
|
+
includeFuelGas,
|
|
161
|
+
setIncludeFuelGas,
|
|
162
|
+
includeDryerVent,
|
|
163
|
+
setIncludeDryerVent,
|
|
164
|
+
includeHotRecirc,
|
|
165
|
+
setIncludeHotRecirc,
|
|
166
|
+
setActiveTab,
|
|
167
|
+
} = usePlumbingUi()
|
|
168
|
+
|
|
169
|
+
const [selectedEq, setSelectedEq] = useState<EquipmentKind>('water-heater-hpwh')
|
|
170
|
+
const [selectedMan, setSelectedMan] = useState<ManifoldKind>('pex-homerun')
|
|
171
|
+
const [selectedFix, setSelectedFix] = useState<FixtureKind>('water-closet')
|
|
172
|
+
const [autoConnectOnPlace, setAutoConnectOnPlace] = useState(true)
|
|
173
|
+
const [statusMsg, setStatusMsg] = useState<string | null>(null)
|
|
174
|
+
|
|
175
|
+
const record = nodes as unknown as Readonly<Record<string, SceneNodeLike>>
|
|
176
|
+
const levelId = activeLevelOf(nodes, selectedLevelId)
|
|
177
|
+
const activeLevelName =
|
|
178
|
+
levelId && typeof record[levelId]?.name === 'string' && record[levelId]?.name
|
|
179
|
+
? String(record[levelId]?.name)
|
|
180
|
+
: levelId ?? 'No Level'
|
|
181
|
+
const codePrefix = codeEdition.startsWith('UPC') ? 'UPC' : 'IPC'
|
|
182
|
+
|
|
183
|
+
const subSlabXrayActive = useMemo(() => {
|
|
184
|
+
let subSlabTotal = 0
|
|
185
|
+
let subSlabEnabled = 0
|
|
186
|
+
for (const raw of Object.values(record)) {
|
|
187
|
+
if (raw.type !== 'plumbing:pipe-run' || !belongsToLevel(record, raw, levelId)) continue
|
|
188
|
+
const p = raw.path as ReadonlyArray<readonly [number, number, number]> | undefined
|
|
189
|
+
if (!Array.isArray(p) || !p.some((pt) => pt[1] < -0.005)) continue
|
|
190
|
+
if (raw.system === 'dwv-vent') continue
|
|
191
|
+
subSlabTotal += 1
|
|
192
|
+
if (raw.xraySubSlab === true) subSlabEnabled += 1
|
|
193
|
+
}
|
|
194
|
+
return subSlabTotal > 0 && subSlabEnabled === subSlabTotal
|
|
195
|
+
}, [record, levelId])
|
|
196
|
+
|
|
197
|
+
const setSubSlabXray = (enabled: boolean) => {
|
|
198
|
+
const updates: Array<{ id: AnyNode['id']; data: Record<string, unknown> }> = []
|
|
199
|
+
for (const raw of Object.values(record)) {
|
|
200
|
+
if (raw.type !== 'plumbing:pipe-run' || !belongsToLevel(record, raw, levelId)) continue
|
|
201
|
+
const p = raw.path as ReadonlyArray<readonly [number, number, number]> | undefined
|
|
202
|
+
if (!Array.isArray(p) || !p.some((pt) => pt[1] < -0.005)) continue
|
|
203
|
+
if (raw.system === 'dwv-vent') continue
|
|
204
|
+
if (Boolean(raw.xraySubSlab) !== enabled) {
|
|
205
|
+
updates.push({ id: raw.id as AnyNode['id'], data: { xraySubSlab: enabled } })
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (updates.length > 0) {
|
|
209
|
+
runAsSingleSceneHistoryStep(useScene, () => {
|
|
210
|
+
updateNodes(updates as Parameters<typeof updateNodes>[0])
|
|
211
|
+
})
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const derivedHiddenSystems = useMemo(() => {
|
|
216
|
+
const counts: Record<PlumbingSystem, { total: number; hidden: number }> = {
|
|
217
|
+
'cold-water': { total: 0, hidden: 0 },
|
|
218
|
+
'hot-water': { total: 0, hidden: 0 },
|
|
219
|
+
'hot-recirc': { total: 0, hidden: 0 },
|
|
220
|
+
'dwv-drain': { total: 0, hidden: 0 },
|
|
221
|
+
'dwv-vent': { total: 0, hidden: 0 },
|
|
222
|
+
'fuel-gas': { total: 0, hidden: 0 },
|
|
223
|
+
condensate: { total: 0, hidden: 0 },
|
|
224
|
+
'dryer-vent': { total: 0, hidden: 0 },
|
|
225
|
+
}
|
|
226
|
+
for (const n of Object.values(record)) {
|
|
227
|
+
if (n.type !== 'plumbing:pipe-run' || !belongsToLevel(record, n, levelId)) continue
|
|
228
|
+
const sys = n.system as PlumbingSystem
|
|
229
|
+
const bucket = counts[sys]
|
|
230
|
+
if (bucket) {
|
|
231
|
+
bucket.total += 1
|
|
232
|
+
if (n.visible === false) bucket.hidden += 1
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const result = {} as Record<PlumbingSystem, boolean>
|
|
236
|
+
for (const sys of Object.keys(counts) as PlumbingSystem[]) {
|
|
237
|
+
result[sys] = counts[sys].total > 0 && counts[sys].hidden === counts[sys].total
|
|
238
|
+
}
|
|
239
|
+
return result
|
|
240
|
+
}, [record, levelId])
|
|
241
|
+
|
|
242
|
+
const audit = useMemo(
|
|
243
|
+
() => auditScenePlumbing(record, { codeEdition, occupancy }),
|
|
244
|
+
[record, codeEdition, occupancy],
|
|
245
|
+
)
|
|
246
|
+
const schedule = useMemo(
|
|
247
|
+
() => buildPlumbingSchedule(record, { codeEdition, occupancy, supplyMaterial }),
|
|
248
|
+
[record, codeEdition, occupancy, supplyMaterial],
|
|
249
|
+
)
|
|
250
|
+
const bones = useMemo(() => extractBonesPlumbingContext(record, levelId), [record, levelId])
|
|
251
|
+
const furnishingStats = useMemo(() => countDetectedFurnishingFixtures(record, levelId), [record, levelId])
|
|
252
|
+
const hasExistingPlumbing = useMemo(
|
|
253
|
+
() => Object.values(record).some((n) => n.type.startsWith('plumbing:') && belongsToLevel(record, n, levelId)),
|
|
254
|
+
[record, levelId],
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
const unwiredPowerCount = schedule.electricalCoordination.filter((c) => !c.wired).length
|
|
258
|
+
|
|
259
|
+
const runAutoPopulate = (bonesMode: BonesIngestionMode, syncOnly = false) => {
|
|
260
|
+
if (!levelId) {
|
|
261
|
+
setStatusMsg('Create a building level first before auto-populating plumbing.')
|
|
262
|
+
return
|
|
263
|
+
}
|
|
264
|
+
const outcome = plumbingAgentOperations.plumbing_autopopulate(
|
|
265
|
+
nodes,
|
|
266
|
+
{
|
|
267
|
+
levelId,
|
|
268
|
+
occupancy,
|
|
269
|
+
codeEdition,
|
|
270
|
+
supplyTopology,
|
|
271
|
+
supplyMaterial,
|
|
272
|
+
dwvMaterial,
|
|
273
|
+
foundationType,
|
|
274
|
+
waterHeaterKind,
|
|
275
|
+
includeFuelGas,
|
|
276
|
+
includeDryerVent,
|
|
277
|
+
includeHotRecirc,
|
|
278
|
+
bonesMode,
|
|
279
|
+
clearExisting: !syncOnly,
|
|
280
|
+
syncOnly,
|
|
281
|
+
},
|
|
282
|
+
{ activeLevelId: levelId },
|
|
283
|
+
)
|
|
284
|
+
const hasDeletes = (outcome.changes?.delete?.length ?? 0) > 0
|
|
285
|
+
const hasCreates = (outcome.changes?.create?.length ?? 0) > 0
|
|
286
|
+
const subSlabXray = subSlabXrayActive || xrayFamily === 'other'
|
|
287
|
+
if (hasDeletes || hasCreates) {
|
|
288
|
+
runAsSingleSceneHistoryStep(useScene, () => {
|
|
289
|
+
if (hasDeletes) {
|
|
290
|
+
deleteNodes(outcome.changes!.delete as never)
|
|
291
|
+
}
|
|
292
|
+
if (hasCreates) {
|
|
293
|
+
const toCreate = subSlabXray
|
|
294
|
+
? outcome.changes!.create!.map((item) => {
|
|
295
|
+
const n = item.node as unknown as Record<string, unknown>
|
|
296
|
+
if (
|
|
297
|
+
n.type === 'plumbing:pipe-run' &&
|
|
298
|
+
n.system !== 'dwv-vent' &&
|
|
299
|
+
Array.isArray(n.path) &&
|
|
300
|
+
(n.path as ReadonlyArray<readonly [number, number, number]>).some((pt) => pt[1] < -0.005)
|
|
301
|
+
) {
|
|
302
|
+
return { ...item, node: { ...n, xraySubSlab: true } }
|
|
303
|
+
}
|
|
304
|
+
return item
|
|
305
|
+
})
|
|
306
|
+
: outcome.changes!.create!
|
|
307
|
+
createNodes(toCreate as never)
|
|
308
|
+
}
|
|
309
|
+
})
|
|
310
|
+
}
|
|
311
|
+
setStatusMsg(String(outcome.result.summary))
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
const clearPlumbing = () => {
|
|
315
|
+
const ids = Object.values(record)
|
|
316
|
+
.filter((n) => n.type.startsWith('plumbing:') && belongsToLevel(record, n, levelId))
|
|
317
|
+
.map((n) => n.id)
|
|
318
|
+
if (ids.length === 0) return
|
|
319
|
+
runAsSingleSceneHistoryStep(useScene, () => {
|
|
320
|
+
deleteNodes(ids as never)
|
|
321
|
+
})
|
|
322
|
+
setStatusMsg(`Cleared ${ids.length} plumbing node(s) on active level.`)
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
const toggleSystem = (sys: PlumbingSystem) => {
|
|
326
|
+
const willHide = !derivedHiddenSystems[sys]
|
|
327
|
+
const updates = Object.values(record)
|
|
328
|
+
.filter((n) => n.type === 'plumbing:pipe-run' && n.system === sys && belongsToLevel(record, n, levelId))
|
|
329
|
+
.map((n) => ({ id: n.id, data: { visible: !willHide } }))
|
|
330
|
+
if (updates.length > 0) {
|
|
331
|
+
runAsSingleSceneHistoryStep(useScene, () => {
|
|
332
|
+
updateNodes(updates as never)
|
|
333
|
+
})
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const placeEquipment = () => {
|
|
338
|
+
if (!levelId) {
|
|
339
|
+
setStatusMsg('Create a building level first before placing equipment.')
|
|
340
|
+
return
|
|
341
|
+
}
|
|
342
|
+
const [ox, oz] = findOpenPlacementSlot(record, levelId, 0.8, 0.8, 0.65, 0.65)
|
|
343
|
+
const oy = defaultEquipmentPlacementY(selectedEq)
|
|
344
|
+
const outcome = plumbingAgentOperations.plumbing_place_equipment(
|
|
345
|
+
nodes,
|
|
346
|
+
{ levelId, equipmentKind: selectedEq, position: [ox, oy, oz] },
|
|
347
|
+
{ activeLevelId: levelId },
|
|
348
|
+
)
|
|
349
|
+
if (outcome.changes?.create && outcome.changes.create.length > 0) {
|
|
350
|
+
runAsSingleSceneHistoryStep(useScene, () => {
|
|
351
|
+
createNodes(outcome.changes.create as never)
|
|
352
|
+
})
|
|
353
|
+
setStatusMsg(`Placed ${String(outcome.result.name)}.`)
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
const placeManifold = () => {
|
|
358
|
+
if (!levelId) {
|
|
359
|
+
setStatusMsg('Create a building level first before placing manifolds.')
|
|
360
|
+
return
|
|
361
|
+
}
|
|
362
|
+
const [ox, oz] = findOpenPlacementSlot(record, levelId, 1.0, 0.5, 0.6, 0.6)
|
|
363
|
+
const portCount = selectedMan === 'gas-csst' ? 8 : 12
|
|
364
|
+
const outcome = plumbingAgentOperations.plumbing_place_manifold(
|
|
365
|
+
nodes,
|
|
366
|
+
{ levelId, manifoldKind: selectedMan, portCount, position: [ox, 1.35, oz] },
|
|
367
|
+
{ activeLevelId: levelId },
|
|
368
|
+
)
|
|
369
|
+
if (outcome.changes?.create && outcome.changes.create.length > 0) {
|
|
370
|
+
runAsSingleSceneHistoryStep(useScene, () => {
|
|
371
|
+
createNodes(outcome.changes.create as never)
|
|
372
|
+
})
|
|
373
|
+
setStatusMsg(`Placed ${String(outcome.result.name)}.`)
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
const placeFixture = () => {
|
|
378
|
+
if (!levelId) {
|
|
379
|
+
setStatusMsg('Create a building level first before placing fixtures.')
|
|
380
|
+
return
|
|
381
|
+
}
|
|
382
|
+
const [ox, oz] = findOpenPlacementSlot(record, levelId, 1.2, 1.2, 0.75, 0.75)
|
|
383
|
+
const roughInY = FIXTURE_SPECS[selectedFix]?.roughInHeightM ?? 0.5
|
|
384
|
+
const outcome = plumbingAgentOperations.plumbing_place_fixture(
|
|
385
|
+
nodes,
|
|
386
|
+
{
|
|
387
|
+
levelId,
|
|
388
|
+
fixtureKind: selectedFix,
|
|
389
|
+
position: [ox, roughInY, oz],
|
|
390
|
+
codeEdition,
|
|
391
|
+
autoConnect: autoConnectOnPlace,
|
|
392
|
+
occupancy,
|
|
393
|
+
supplyMaterial,
|
|
394
|
+
dwvMaterial,
|
|
395
|
+
foundationType,
|
|
396
|
+
},
|
|
397
|
+
{ activeLevelId: levelId },
|
|
398
|
+
)
|
|
399
|
+
const subSlabXray = subSlabXrayActive || xrayFamily === 'other'
|
|
400
|
+
if (outcome.changes?.create && outcome.changes.create.length > 0) {
|
|
401
|
+
runAsSingleSceneHistoryStep(useScene, () => {
|
|
402
|
+
const toCreate = subSlabXray
|
|
403
|
+
? outcome.changes!.create!.map((item) => {
|
|
404
|
+
const n = item.node as unknown as Record<string, unknown>
|
|
405
|
+
if (
|
|
406
|
+
n.type === 'plumbing:pipe-run' &&
|
|
407
|
+
n.system !== 'dwv-vent' &&
|
|
408
|
+
Array.isArray(n.path) &&
|
|
409
|
+
(n.path as ReadonlyArray<readonly [number, number, number]>).some((pt) => pt[1] < -0.005)
|
|
410
|
+
) {
|
|
411
|
+
return { ...item, node: { ...n, xraySubSlab: true } }
|
|
412
|
+
}
|
|
413
|
+
return item
|
|
414
|
+
})
|
|
415
|
+
: outcome.changes!.create!
|
|
416
|
+
createNodes(toCreate as never)
|
|
417
|
+
})
|
|
418
|
+
const connCount = outcome.result.connectedPipeRunCount ?? 0
|
|
419
|
+
const noCoreHint =
|
|
420
|
+
autoConnectOnPlace && connCount === 0 && !outcome.result.hasSupplySource && !outcome.result.hasDwvStack
|
|
421
|
+
? ' (run Auto-Populate or place a manifold/stack first to auto-connect)'
|
|
422
|
+
: ''
|
|
423
|
+
setStatusMsg(
|
|
424
|
+
connCount > 0
|
|
425
|
+
? `Placed ${String(outcome.result.name)} + routed ${connCount} supply/DWV/vent line(s).`
|
|
426
|
+
: `Placed ${String(outcome.result.name)}${noCoreHint}.`,
|
|
427
|
+
)
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
return (
|
|
432
|
+
<div style={{ padding: 12, display: 'flex', flexDirection: 'column', gap: 10, fontSize: 12 }}>
|
|
433
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 6 }}>
|
|
434
|
+
<div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
435
|
+
<strong style={{ fontSize: 13 }}>Plumbing ({codeEdition})</strong>
|
|
436
|
+
<span style={{ fontSize: 10, opacity: 0.75 }}>Level: {activeLevelName}</span>
|
|
437
|
+
</div>
|
|
438
|
+
<button
|
|
439
|
+
type="button"
|
|
440
|
+
onClick={() => openEditorView(PLUMBING_SCHEDULE_VIEW_ID, { beside: true })}
|
|
441
|
+
style={primaryBtnStyle}
|
|
442
|
+
>
|
|
443
|
+
Open Schedule
|
|
444
|
+
</button>
|
|
445
|
+
</div>
|
|
446
|
+
|
|
447
|
+
<div style={sectionStyle}>
|
|
448
|
+
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 6 }}>
|
|
449
|
+
<select value={codeEdition} onChange={(e) => setCodeEdition(e.target.value as 'IPC-2021' | 'UPC-2021')} style={selectStyle}>
|
|
450
|
+
<option value="IPC-2021">IPC 2021</option>
|
|
451
|
+
<option value="UPC-2021">UPC 2021</option>
|
|
452
|
+
</select>
|
|
453
|
+
<select value={occupancy} onChange={(e) => setOccupancy(e.target.value as 'residential' | 'commercial')} style={selectStyle}>
|
|
454
|
+
<option value="residential">Residential</option>
|
|
455
|
+
<option value="commercial">Commercial</option>
|
|
456
|
+
</select>
|
|
457
|
+
<select value={supplyTopology} onChange={(e) => setSupplyTopology(e.target.value as 'manifold' | 'trunk-and-branch')} style={selectStyle}>
|
|
458
|
+
<option value="manifold">PEX Home-Run Manifold</option>
|
|
459
|
+
<option value="trunk-and-branch">Trunk & Branch</option>
|
|
460
|
+
</select>
|
|
461
|
+
<select value={foundationType} onChange={(e) => setFoundationType(e.target.value as 'slab' | 'crawlspace' | 'basement')} style={selectStyle}>
|
|
462
|
+
<option value="crawlspace">Crawlspace (Under Joists)</option>
|
|
463
|
+
<option value="slab">Slab-on-Grade (Under Slab)</option>
|
|
464
|
+
<option value="basement">Basement (Below Joists)</option>
|
|
465
|
+
</select>
|
|
466
|
+
<select value={supplyMaterial} onChange={(e) => setSupplyMaterial(e.target.value as 'pex-a' | 'pex-b' | 'copper-l' | 'cpvc')} style={selectStyle}>
|
|
467
|
+
<option value="pex-a">PEX-A (Expansion)</option>
|
|
468
|
+
<option value="pex-b">PEX-B (Crimp)</option>
|
|
469
|
+
<option value="copper-l">Type L Copper</option>
|
|
470
|
+
<option value="cpvc">CPVC</option>
|
|
471
|
+
</select>
|
|
472
|
+
<select value={dwvMaterial} onChange={(e) => setDwvMaterial(e.target.value as 'pvc-dwv' | 'abs-dwv' | 'cast-iron')} style={selectStyle}>
|
|
473
|
+
<option value="pvc-dwv">PVC Sch-40 DWV</option>
|
|
474
|
+
<option value="abs-dwv">ABS DWV</option>
|
|
475
|
+
<option value="cast-iron">Cast Iron (Quiet)</option>
|
|
476
|
+
</select>
|
|
477
|
+
</div>
|
|
478
|
+
|
|
479
|
+
<select
|
|
480
|
+
value={waterHeaterKind}
|
|
481
|
+
onChange={(e) =>
|
|
482
|
+
setWaterHeaterKind(
|
|
483
|
+
e.target.value as
|
|
484
|
+
| 'water-heater-tank-electric'
|
|
485
|
+
| 'water-heater-tank-gas'
|
|
486
|
+
| 'water-heater-tankless-gas'
|
|
487
|
+
| 'water-heater-hpwh',
|
|
488
|
+
)
|
|
489
|
+
}
|
|
490
|
+
style={selectStyle}
|
|
491
|
+
>
|
|
492
|
+
<option value="water-heater-tank-electric">Water Heater: 50 gal Electric Tank (30A 240V)</option>
|
|
493
|
+
<option value="water-heater-tank-gas">Water Heater: 50 gal Gas Tank (40 kBTU)</option>
|
|
494
|
+
<option value="water-heater-tankless-gas">Water Heater: Condensing Tankless Gas</option>
|
|
495
|
+
<option value="water-heater-hpwh">Water Heater: Hybrid Heat Pump (HPWH)</option>
|
|
496
|
+
</select>
|
|
497
|
+
|
|
498
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 10, fontSize: 11 }}>
|
|
499
|
+
<label style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
|
500
|
+
<input type="checkbox" checked={includeFuelGas} onChange={(e) => setIncludeFuelGas(e.target.checked)} />
|
|
501
|
+
Fuel Gas (IFGC)
|
|
502
|
+
</label>
|
|
503
|
+
<label style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
|
504
|
+
<input type="checkbox" checked={includeDryerVent} onChange={(e) => setIncludeDryerVent(e.target.checked)} />
|
|
505
|
+
Dryer Vent
|
|
506
|
+
</label>
|
|
507
|
+
<label style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
|
508
|
+
<input type="checkbox" checked={includeHotRecirc} onChange={(e) => setIncludeHotRecirc(e.target.checked)} />
|
|
509
|
+
Hot Recirc
|
|
510
|
+
</label>
|
|
511
|
+
</div>
|
|
512
|
+
|
|
513
|
+
<div style={{ display: 'flex', gap: 6 }}>
|
|
514
|
+
<button type="button" onClick={() => runAutoPopulate('auto')} style={{ ...primaryBtnStyle, flex: 1 }}>
|
|
515
|
+
Auto-Populate Plumbing
|
|
516
|
+
</button>
|
|
517
|
+
<button type="button" onClick={clearPlumbing} style={ghostBtnStyle}>
|
|
518
|
+
Clear
|
|
519
|
+
</button>
|
|
520
|
+
</div>
|
|
521
|
+
|
|
522
|
+
{(hasExistingPlumbing || furnishingStats.total > 0) && (
|
|
523
|
+
<button
|
|
524
|
+
type="button"
|
|
525
|
+
onClick={() => runAutoPopulate('auto', true)}
|
|
526
|
+
style={{ ...ghostBtnStyle, width: '100%', borderColor: 'rgba(16,185,129,0.5)' }}
|
|
527
|
+
>
|
|
528
|
+
Sync Furnishings & Route Pipes
|
|
529
|
+
{furnishingStats.unlinked > 0 ? ` (${furnishingStats.unlinked} new)` : ''}
|
|
530
|
+
</button>
|
|
531
|
+
)}
|
|
532
|
+
|
|
533
|
+
{bones.hasPlumbingSchematic && (
|
|
534
|
+
<button
|
|
535
|
+
type="button"
|
|
536
|
+
onClick={() => runAutoPopulate('import-only')}
|
|
537
|
+
style={{ ...ghostBtnStyle, width: '100%', borderColor: 'rgba(14,165,233,0.5)' }}
|
|
538
|
+
>
|
|
539
|
+
Import & Route Bones Anchors
|
|
540
|
+
</button>
|
|
541
|
+
)}
|
|
542
|
+
</div>
|
|
543
|
+
|
|
544
|
+
<div style={sectionStyle}>
|
|
545
|
+
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
546
|
+
<span>DWV / Supply Loads</span>
|
|
547
|
+
<strong>
|
|
548
|
+
{schedule.loads.totalDfu} DFU · {schedule.loads.peakDemandGpm} GPM
|
|
549
|
+
</strong>
|
|
550
|
+
</div>
|
|
551
|
+
{furnishingStats.total > 0 && (
|
|
552
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 11 }}>
|
|
553
|
+
<span>Furnishing / SKU Fixtures</span>
|
|
554
|
+
<span style={{ color: furnishingStats.unlinked > 0 ? '#f59e0b' : '#22c55e', fontWeight: 600 }}>
|
|
555
|
+
{furnishingStats.total - furnishingStats.unlinked}/{furnishingStats.total} Plumbed
|
|
556
|
+
</span>
|
|
557
|
+
</div>
|
|
558
|
+
)}
|
|
559
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 11, opacity: 0.85 }}>
|
|
560
|
+
<span>Main Drain / Stack</span>
|
|
561
|
+
<span>
|
|
562
|
+
{schedule.loads.recommendedBuildingDrain} / {schedule.loads.recommendedVentStack}
|
|
563
|
+
</span>
|
|
564
|
+
</div>
|
|
565
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 11 }}>
|
|
566
|
+
<span>{codePrefix} / IFGC Audit</span>
|
|
567
|
+
<button
|
|
568
|
+
type="button"
|
|
569
|
+
onClick={() => {
|
|
570
|
+
setActiveTab('audit')
|
|
571
|
+
openEditorView(PLUMBING_SCHEDULE_VIEW_ID, { beside: true })
|
|
572
|
+
}}
|
|
573
|
+
style={{
|
|
574
|
+
background: 'transparent',
|
|
575
|
+
border: 'none',
|
|
576
|
+
padding: 0,
|
|
577
|
+
cursor: 'pointer',
|
|
578
|
+
color: audit.errorCount > 0 ? '#ef4444' : '#22c55e',
|
|
579
|
+
fontWeight: 600,
|
|
580
|
+
fontSize: 11,
|
|
581
|
+
}}
|
|
582
|
+
>
|
|
583
|
+
{audit.errorCount} Err · {audit.warningCount} Warn
|
|
584
|
+
</button>
|
|
585
|
+
</div>
|
|
586
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 11 }}>
|
|
587
|
+
<span>Electrical Power Loads</span>
|
|
588
|
+
<span style={{ color: unwiredPowerCount > 0 ? '#f59e0b' : '#22c55e', fontWeight: 600 }}>
|
|
589
|
+
{schedule.electricalCoordination.length - unwiredPowerCount}/{schedule.electricalCoordination.length} Wired
|
|
590
|
+
</span>
|
|
591
|
+
</div>
|
|
592
|
+
</div>
|
|
593
|
+
|
|
594
|
+
<div style={sectionStyle}>
|
|
595
|
+
<div style={{ fontWeight: 600, fontSize: 11 }}>3D Pipe & Sub-Slab Inspection</div>
|
|
596
|
+
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 5 }}>
|
|
597
|
+
<button
|
|
598
|
+
type="button"
|
|
599
|
+
onClick={() => {
|
|
600
|
+
setXrayFamily(null)
|
|
601
|
+
setWallMode('up')
|
|
602
|
+
setSubSlabXray(false)
|
|
603
|
+
}}
|
|
604
|
+
style={{
|
|
605
|
+
...ghostBtnStyle,
|
|
606
|
+
background: xrayFamily === null && wallMode === 'up' ? 'rgba(56,189,248,0.2)' : 'transparent',
|
|
607
|
+
borderColor: xrayFamily === null && wallMode === 'up' ? 'rgba(56,189,248,0.6)' : undefined,
|
|
608
|
+
fontWeight: xrayFamily === null && wallMode === 'up' ? 600 : 400,
|
|
609
|
+
}}
|
|
610
|
+
>
|
|
611
|
+
Full Walls
|
|
612
|
+
</button>
|
|
613
|
+
<button
|
|
614
|
+
type="button"
|
|
615
|
+
onClick={() => {
|
|
616
|
+
setXrayFamily(null)
|
|
617
|
+
setWallMode('cutaway')
|
|
618
|
+
setSubSlabXray(false)
|
|
619
|
+
}}
|
|
620
|
+
style={{
|
|
621
|
+
...ghostBtnStyle,
|
|
622
|
+
background: xrayFamily === null && wallMode === 'cutaway' ? 'rgba(56,189,248,0.2)' : 'transparent',
|
|
623
|
+
borderColor: xrayFamily === null && wallMode === 'cutaway' ? 'rgba(56,189,248,0.6)' : undefined,
|
|
624
|
+
fontWeight: xrayFamily === null && wallMode === 'cutaway' ? 600 : 400,
|
|
625
|
+
}}
|
|
626
|
+
>
|
|
627
|
+
Cutaway
|
|
628
|
+
</button>
|
|
629
|
+
<button
|
|
630
|
+
type="button"
|
|
631
|
+
onClick={() => {
|
|
632
|
+
setXrayFamily(null)
|
|
633
|
+
setWallMode('down')
|
|
634
|
+
setSubSlabXray(false)
|
|
635
|
+
}}
|
|
636
|
+
style={{
|
|
637
|
+
...ghostBtnStyle,
|
|
638
|
+
background: xrayFamily === null && wallMode === 'down' ? 'rgba(56,189,248,0.2)' : 'transparent',
|
|
639
|
+
borderColor: xrayFamily === null && wallMode === 'down' ? 'rgba(56,189,248,0.6)' : undefined,
|
|
640
|
+
fontWeight: xrayFamily === null && wallMode === 'down' ? 600 : 400,
|
|
641
|
+
}}
|
|
642
|
+
>
|
|
643
|
+
Low Walls
|
|
644
|
+
</button>
|
|
645
|
+
<button
|
|
646
|
+
type="button"
|
|
647
|
+
onClick={() => {
|
|
648
|
+
const nextOn = xrayFamily !== 'other'
|
|
649
|
+
setXrayFamily(nextOn ? 'other' : null)
|
|
650
|
+
setSubSlabXray(nextOn)
|
|
651
|
+
}}
|
|
652
|
+
style={{
|
|
653
|
+
...ghostBtnStyle,
|
|
654
|
+
background: xrayFamily === 'other' ? 'rgba(16,185,129,0.22)' : 'transparent',
|
|
655
|
+
borderColor: xrayFamily === 'other' ? 'rgba(16,185,129,0.65)' : undefined,
|
|
656
|
+
fontWeight: xrayFamily === 'other' ? 600 : 400,
|
|
657
|
+
}}
|
|
658
|
+
>
|
|
659
|
+
X-Ray Plumbing
|
|
660
|
+
</button>
|
|
661
|
+
</div>
|
|
662
|
+
<button
|
|
663
|
+
type="button"
|
|
664
|
+
onClick={() => setSubSlabXray(!subSlabXrayActive)}
|
|
665
|
+
style={{
|
|
666
|
+
...ghostBtnStyle,
|
|
667
|
+
width: '100%',
|
|
668
|
+
background: subSlabXrayActive ? 'rgba(56,189,248,0.22)' : 'transparent',
|
|
669
|
+
borderColor: subSlabXrayActive ? 'rgba(56,189,248,0.65)' : 'rgba(148,163,184,0.35)',
|
|
670
|
+
color: subSlabXrayActive ? '#38bdf8' : 'inherit',
|
|
671
|
+
fontWeight: subSlabXrayActive ? 600 : 400,
|
|
672
|
+
}}
|
|
673
|
+
title="Render sub-slab DWV drains and below-grade pipes through the ground plane and floor slab"
|
|
674
|
+
>
|
|
675
|
+
{subSlabXrayActive ? 'Sub-Slab Drains: X-Ray Ground ON' : 'Sub-Slab Drains (X-Ray Ground)'}
|
|
676
|
+
</button>
|
|
677
|
+
</div>
|
|
678
|
+
|
|
679
|
+
<div style={sectionStyle}>
|
|
680
|
+
<div style={{ fontWeight: 600, fontSize: 11 }}>System Layers (Toggle Visibility)</div>
|
|
681
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 5 }}>
|
|
682
|
+
{(Object.keys(PLUMBING_SYSTEM_COLORS) as PlumbingSystem[]).map((sys) => {
|
|
683
|
+
const meta = PLUMBING_SYSTEM_COLORS[sys]
|
|
684
|
+
const hidden = derivedHiddenSystems[sys]
|
|
685
|
+
return (
|
|
686
|
+
<button
|
|
687
|
+
key={sys}
|
|
688
|
+
type="button"
|
|
689
|
+
onClick={() => toggleSystem(sys)}
|
|
690
|
+
style={{
|
|
691
|
+
padding: '3px 7px',
|
|
692
|
+
borderRadius: 999,
|
|
693
|
+
fontSize: 10,
|
|
694
|
+
cursor: 'pointer',
|
|
695
|
+
border: `1px solid ${meta.hex}`,
|
|
696
|
+
background: hidden ? 'transparent' : `${meta.hex}26`,
|
|
697
|
+
opacity: hidden ? 0.45 : 1,
|
|
698
|
+
color: 'inherit',
|
|
699
|
+
display: 'flex',
|
|
700
|
+
alignItems: 'center',
|
|
701
|
+
gap: 4,
|
|
702
|
+
}}
|
|
703
|
+
>
|
|
704
|
+
<span style={{ width: 7, height: 7, borderRadius: '50%', background: meta.hex }} />
|
|
705
|
+
{meta.label}
|
|
706
|
+
</button>
|
|
707
|
+
)
|
|
708
|
+
})}
|
|
709
|
+
</div>
|
|
710
|
+
</div>
|
|
711
|
+
|
|
712
|
+
<div style={sectionStyle}>
|
|
713
|
+
<div style={{ fontWeight: 600, fontSize: 11 }}>Catalog Placement</div>
|
|
714
|
+
<div style={{ display: 'flex', gap: 6 }}>
|
|
715
|
+
<select value={selectedEq} onChange={(e) => setSelectedEq(e.target.value as EquipmentKind)} style={{ ...selectStyle, flex: 1 }}>
|
|
716
|
+
{QUICK_EQUIPMENT.map((item) => (
|
|
717
|
+
<option key={item.kind} value={item.kind}>
|
|
718
|
+
{item.label}
|
|
719
|
+
</option>
|
|
720
|
+
))}
|
|
721
|
+
</select>
|
|
722
|
+
<button type="button" onClick={placeEquipment} style={ghostBtnStyle}>
|
|
723
|
+
+ Eq
|
|
724
|
+
</button>
|
|
725
|
+
</div>
|
|
726
|
+
<div style={{ display: 'flex', gap: 6 }}>
|
|
727
|
+
<select value={selectedMan} onChange={(e) => setSelectedMan(e.target.value as ManifoldKind)} style={{ ...selectStyle, flex: 1 }}>
|
|
728
|
+
{QUICK_MANIFOLDS.map((item) => (
|
|
729
|
+
<option key={item.kind} value={item.kind}>
|
|
730
|
+
{item.label}
|
|
731
|
+
</option>
|
|
732
|
+
))}
|
|
733
|
+
</select>
|
|
734
|
+
<button type="button" onClick={placeManifold} style={ghostBtnStyle}>
|
|
735
|
+
+ Man
|
|
736
|
+
</button>
|
|
737
|
+
</div>
|
|
738
|
+
<div style={{ display: 'flex', gap: 6 }}>
|
|
739
|
+
<select value={selectedFix} onChange={(e) => setSelectedFix(e.target.value as FixtureKind)} style={{ ...selectStyle, flex: 1 }}>
|
|
740
|
+
{QUICK_FIXTURES.map((item) => (
|
|
741
|
+
<option key={item.kind} value={item.kind}>
|
|
742
|
+
{item.label}
|
|
743
|
+
</option>
|
|
744
|
+
))}
|
|
745
|
+
</select>
|
|
746
|
+
<button type="button" onClick={placeFixture} style={ghostBtnStyle}>
|
|
747
|
+
+ Fix
|
|
748
|
+
</button>
|
|
749
|
+
</div>
|
|
750
|
+
<label style={{ display: 'flex', alignItems: 'center', gap: 5, fontSize: 11, opacity: 0.9 }}>
|
|
751
|
+
<input
|
|
752
|
+
type="checkbox"
|
|
753
|
+
checked={autoConnectOnPlace}
|
|
754
|
+
onChange={(e) => setAutoConnectOnPlace(e.target.checked)}
|
|
755
|
+
/>
|
|
756
|
+
Auto-connect water, DWV & vent pipes on place
|
|
757
|
+
</label>
|
|
758
|
+
<button
|
|
759
|
+
type="button"
|
|
760
|
+
onClick={() => {
|
|
761
|
+
setActiveTab('manifold')
|
|
762
|
+
openEditorView(PLUMBING_SCHEDULE_VIEW_ID, { beside: true })
|
|
763
|
+
}}
|
|
764
|
+
style={{ ...ghostBtnStyle, width: '100%' }}
|
|
765
|
+
>
|
|
766
|
+
Inspect 3D Manifold & Wet-Wall Cutaway
|
|
767
|
+
</button>
|
|
768
|
+
</div>
|
|
769
|
+
|
|
770
|
+
{statusMsg && <div style={{ fontSize: 11, opacity: 0.8 }}>{statusMsg}</div>}
|
|
771
|
+
</div>
|
|
772
|
+
)
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
const sectionStyle = {
|
|
776
|
+
padding: 8,
|
|
777
|
+
borderRadius: 8,
|
|
778
|
+
border: '1px solid var(--border, rgba(255,255,255,0.14))',
|
|
779
|
+
display: 'flex',
|
|
780
|
+
flexDirection: 'column' as const,
|
|
781
|
+
gap: 6,
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
const selectStyle = {
|
|
785
|
+
padding: '4px 6px',
|
|
786
|
+
borderRadius: 6,
|
|
787
|
+
border: '1px solid var(--border, rgba(255,255,255,0.18))',
|
|
788
|
+
background: 'var(--background, rgba(15,23,42,0.75))',
|
|
789
|
+
color: 'inherit',
|
|
790
|
+
fontSize: 11,
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
const primaryBtnStyle = {
|
|
794
|
+
padding: '5px 9px',
|
|
795
|
+
borderRadius: 6,
|
|
796
|
+
border: '1px solid rgba(37,99,235,0.6)',
|
|
797
|
+
background: 'rgba(37,99,235,0.22)',
|
|
798
|
+
color: 'inherit',
|
|
799
|
+
cursor: 'pointer',
|
|
800
|
+
fontSize: 11,
|
|
801
|
+
fontWeight: 600,
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
const ghostBtnStyle = {
|
|
805
|
+
padding: '5px 8px',
|
|
806
|
+
borderRadius: 6,
|
|
807
|
+
border: '1px solid var(--border, rgba(255,255,255,0.2))',
|
|
808
|
+
background: 'transparent',
|
|
809
|
+
color: 'inherit',
|
|
810
|
+
cursor: 'pointer',
|
|
811
|
+
fontSize: 11,
|
|
812
|
+
}
|