From 5f316195e0f9206247c7600c21b4bb724c99f1e2 Mon Sep 17 00:00:00 2001 From: ysCha Date: Thu, 2 Jul 2026 17:48:56 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[2332]=20=E6=9D=B1/=E8=A5=BF=20=ED=9D=90?= =?UTF-8?q?=EB=A6=84=20=E6=89=8B=E5=8B=95=EB=B0=B0=EC=B9=98=C2=B7=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20=EA=B2=8C=EC=9D=B4=ED=8A=B8=20=E7=B8=A6/=E6=A8=AA?= =?UTF-8?q?=20=EA=B0=84=EA=B2=A9=20=EC=B6=95=20=EC=8A=A4=EC=99=91=20?= =?UTF-8?q?=EB=88=84=EB=9D=BD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 작업내용 : - isTooCloseToOtherModules(배치·이동 게이트)가 flowDirection 에 무관하게 항상 moduleIntvlVer=세로간격, moduleIntvlHor=가로간격으로 고정해 東/西 흐름 설치면에서 스냅이 横(3mm)으로 붙인 정상 배치를 縦(7mm) 기준으로 오판 거부하던 버그 수정 - 스냅 배치 로직(:824-831)과 동일하게 direction east/west 일 때 gapVer=moduleIntvlHor, gapHor=moduleIntvlVer 로 스왑 적용 - useModuleBasicSetting.js(手動배치), useModule.js(이동) 동기 수정 --- src/hooks/module/useModule.js | 10 ++++++++-- src/hooks/module/useModuleBasicSetting.js | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/hooks/module/useModule.js b/src/hooks/module/useModule.js index d72f43a6..1aa0e1ba 100644 --- a/src/hooks/module/useModule.js +++ b/src/hooks/module/useModule.js @@ -1072,8 +1072,14 @@ export function useModule() { // 정상 격자(정확히 30/3mm)도 측정 간격이 축소돼 위반 오판 → 모든 방향 이동 차단(회귀) 발생. const isTooCloseToOtherModules = (module, otherModules, surface) => { if (!otherModules || otherModules.length === 0) return false - const gapVer = Number(surface?.trestleDetail?.moduleIntvlVer ?? 0) / 10 // mm → canvas unit - const gapHor = Number(surface?.trestleDetail?.moduleIntvlHor ?? 0) / 10 + // [PLACE-CLEARANCE-SWAP 2026-07-02] 스냅 배치와 동일하게 flowDirection 으로 縦/横 간격을 캔버스 축에 매핑. + // 東/西 흐름에선 縦(moduleIntvlVer)이 캔버스 x축, 横(moduleIntvlHor)이 캔버스 y축이라 축이 뒤바뀐다. + // 스왑 없이 세로(캔버스 y) 적재에 항상 moduleIntvlVer 를 요구하면, 스냅이 moduleIntvlHor 로 붙인 정상 배치를 오판 거부한다. + const isEastWest = surface?.direction === 'east' || surface?.direction === 'west' + const intvlVerMm = Number(surface?.trestleDetail?.moduleIntvlVer ?? 0) + const intvlHorMm = Number(surface?.trestleDetail?.moduleIntvlHor ?? 0) + const gapVer = (isEastWest ? intvlHorMm : intvlVerMm) / 10 // 세로(캔버스 y) 적재 요구 간격 + const gapHor = (isEastWest ? intvlVerMm : intvlHorMm) / 10 // 가로(캔버스 x) 적재 요구 간격 if (gapVer <= 0 && gapHor <= 0) return false const EPS = 0.05 // 0.5mm — 좌표 반올림 잔차(±0.02) 흡수, 의미있는 위반은 통과 못함 const bboxOf = (o) => { diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index 19afa043..7907f79e 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -303,8 +303,14 @@ export function useModuleBasicSetting(tabNum) { // ⚠ 간격은 stroke 를 뺀 실제 정점(getCurrentPoints)으로 잰다. getBoundingRect 는 strokeWidth 팽창 → 정상 격자도 위반 오판. const isTooCloseToOtherModules = (module, otherModules, surface) => { if (!otherModules || otherModules.length === 0) return false - const gapVer = Number(surface?.trestleDetail?.moduleIntvlVer ?? 0) / 10 // mm → canvas unit - const gapHor = Number(surface?.trestleDetail?.moduleIntvlHor ?? 0) / 10 + // [PLACE-CLEARANCE-SWAP 2026-07-02] 스냅 배치(:824-831)와 동일하게 flowDirection 으로 縦/横 간격을 캔버스 축에 매핑. + // 東/西 흐름에선 縦(moduleIntvlVer)이 캔버스 x축, 横(moduleIntvlHor)이 캔버스 y축이라 축이 뒤바뀐다. + // 스왑 없이 세로(캔버스 y) 적재에 항상 moduleIntvlVer 를 요구하면, 스냅이 moduleIntvlHor 로 붙인 정상 배치를 오판 거부한다. + const isEastWest = surface?.direction === 'east' || surface?.direction === 'west' + const intvlVerMm = Number(surface?.trestleDetail?.moduleIntvlVer ?? 0) + const intvlHorMm = Number(surface?.trestleDetail?.moduleIntvlHor ?? 0) + const gapVer = (isEastWest ? intvlHorMm : intvlVerMm) / 10 // 세로(캔버스 y) 적재 요구 간격 + const gapHor = (isEastWest ? intvlVerMm : intvlHorMm) / 10 // 가로(캔버스 x) 적재 요구 간격 if (gapVer <= 0 && gapHor <= 0) return false const EPS = 0.05 // 0.5mm — 좌표 반올림 잔차(±0.02) 흡수 const bboxOf = (o) => { -- 2.47.2 From 38d04918a2aaea398cabea2ca331cc72565a7531 Mon Sep 17 00:00:00 2001 From: ysCha Date: Thu, 2 Jul 2026 17:52:00 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[=EB=AA=A8=EB=93=88=EB=B0=B0=EC=B9=98]=20PC?= =?UTF-8?q?S=20=EC=A7=84=EC=9E=85=20=EC=8B=9C=20=EB=9E=99=20=ED=81=AC?= =?UTF-8?q?=EA=B8=B0=EC=88=9C=EC=84=9C=20=EA=B2=80=EC=A6=9D=20=EC=98=A4?= =?UTF-8?q?=ED=8C=90=20=EC=88=98=EC=A0=95=20=E2=80=94=20=EB=AA=A8=EB=93=88?= =?UTF-8?q?=20=EB=A9=B4=EC=A0=81=EC=9D=84=20=EC=8A=A4=ED=8E=99=20=EC=B9=98?= =?UTF-8?q?=EC=88=98=EB=A1=9C=20=EC=82=B0=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 작업내용 : - validateModuleSizeForRack 내 centerPoints area 산출을 캔버스 측정치(Math.round(width×height))에서 모듈 스펙(longAxis×shortAxis, moduleInfo 경유)으로 변경 - 같은 모듈이라도 캔버스 반올림으로 width 가 73/74 로 갈려 area 가 161 만큼 벌어져 랙 크기순서 위반 오판 → PCS 진입 즉시 에러 유발 - 스펙 치수는 동일 제품이면 항상 동일하므로 diff=0 → 오판 제거 - gap 계산(인접 판정)용 width/height 는 캔버스 측정치 유지 (기하 정확도 보존) --- .../modal/circuitTrestle/CircuitTrestleSetting.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 9f1baec0..333bc0e7 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -147,12 +147,17 @@ export default function CircuitTrestleSetting({ id }) { const centerPoints = modules.map((module) => { const { x, y } = module.getCenterPoint() const { width, height } = module + // [RACK-AREA-SPEC 2026-07-02] 면적은 캔버스 측정치(Math.round(width/height)) 대신 모듈 스펙(longAxis×shortAxis)으로 산출. + // 측정치는 좌표 반올림으로 같은 모듈도 width 가 73/74 로 갈려 area 가 161 만큼 벌어져(=가짜 크기차) 랙 순서 위반 오판을 유발한다. + // 스펙 치수는 배치·회전과 무관해 동일 제품이면 항상 area 동일 → 반올림 잔차 제거. (gap 계산용 width/height 는 그대로 유지) + const specLong = Number(module.longAxis ?? module.moduleInfo?.longAxis ?? 0) / 10 + const specShort = Number(module.shortAxis ?? module.moduleInfo?.shortAxis ?? 0) / 10 return { x, y, width: Math.round(width), height: Math.round(height), - area: Math.round(width) * Math.round(height), + area: specLong * specShort, } }) -- 2.47.2