feat(roof-shape): PDF 지붕형상 descriptor atom 저장 배선
[작업내용] : - pdfRoofShapeDescriptorState atom 추가(outerLineAtom) - analyzePdfAndApply: 분석 시작 시 리셋 + payload.roofShape 저장 - 소비(매칭·pre-select)는 다음 task Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
9d60948e64
commit
28ea1e9b8e
@ -24,6 +24,7 @@ import { usePlan } from '@/hooks/usePlan'
|
|||||||
import { normalizeDecimal } from '@/util/input-utils'
|
import { normalizeDecimal } from '@/util/input-utils'
|
||||||
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
import { CalculatorInput } from '@/components/common/input/CalcInput'
|
||||||
import { usePdfImport } from '@/hooks/pdf-import/usePdfImport'
|
import { usePdfImport } from '@/hooks/pdf-import/usePdfImport'
|
||||||
|
import { pdfRoofShapeDescriptorState } from '@/store/outerLineAtom'
|
||||||
import { logger } from '@/util/logger'
|
import { logger } from '@/util/logger'
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
// [LOW-PITCH-WARN 2026-05-06] 저구배 + 특정 기와 사용 시 시공 매뉴얼 안내 alert
|
// [LOW-PITCH-WARN 2026-05-06] 저구배 + 특정 기와 사용 시 시공 매뉴얼 안내 alert
|
||||||
@ -87,6 +88,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
|||||||
const { setPolygonLinesActualSize } = usePolygon()
|
const { setPolygonLinesActualSize } = usePolygon()
|
||||||
const { setSelectedMenu } = useCanvasMenu()
|
const { setSelectedMenu } = useCanvasMenu()
|
||||||
const setCurrentMenu = useSetRecoilState(currentMenuState)
|
const setCurrentMenu = useSetRecoilState(currentMenuState)
|
||||||
|
const setPdfRoofShapeDescriptor = useSetRecoilState(pdfRoofShapeDescriptorState)
|
||||||
|
|
||||||
const roofRef = {
|
const roofRef = {
|
||||||
roofCd: useRef(null),
|
roofCd: useRef(null),
|
||||||
@ -174,6 +176,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
|||||||
formData.append('floorPages', pdfFloorPages.trim())
|
formData.append('floorPages', pdfFloorPages.trim())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setPdfRoofShapeDescriptor(null) // 이전 분석 잔여 제거(cross-run staleness 방지)
|
||||||
setPdfAnalyzing(true)
|
setPdfAnalyzing(true)
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
const controller = new AbortController()
|
const controller = new AbortController()
|
||||||
@ -239,6 +242,8 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setPdfRoofShapeDescriptor(payload.roofShape ?? null) // 지붕형상 자동 선택용(C)
|
||||||
|
|
||||||
// 외벽선은 항상 미확정(autoFix:false)으로만 그린다 — 확정 여부는 이후 '외벽선 자동 확정' 팝업에서 분기한다.
|
// 외벽선은 항상 미확정(autoFix:false)으로만 그린다 — 확정 여부는 이후 '외벽선 자동 확정' 팝업에서 분기한다.
|
||||||
const applied = await applyOuterline(payload.outerline, { unit: payload.unit || 'mm', autoFix: false })
|
const applied = await applyOuterline(payload.outerline, { unit: payload.unit || 'mm', autoFix: false })
|
||||||
if (!applied) {
|
if (!applied) {
|
||||||
|
|||||||
@ -77,3 +77,12 @@ export const autoOuterLineFixState = atom({
|
|||||||
key: 'autoOuterLineFixState',
|
key: 'autoOuterLineFixState',
|
||||||
default: true,
|
default: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PDF 분석이 산출한 지붕형상 서술자(RoofShapeDescriptor | null).
|
||||||
|
* analyzePdfAndApply 가 저장 → useRoofShapeSetting 마운트 시 매칭·소비(consume-once).
|
||||||
|
*/
|
||||||
|
export const pdfRoofShapeDescriptorState = atom({
|
||||||
|
key: 'pdfRoofShapeDescriptorState',
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user