From faf0ab2365800585b0b013e75180bfb3c1b0078b Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 25 Feb 2025 14:57:38 +0900 Subject: [PATCH] =?UTF-8?q?alert=20=3D>=20swal=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=EB=B0=8F=20=EC=A3=BC=EC=84=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useTrestle.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 2e40dab5..38c56f84 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -53,7 +53,7 @@ export const useTrestle = () => { } const construction = moduleSelectionData?.roofConstructions?.find((construction) => construction.roofIndex === roofMaterialIndex).construction if (!construction) { - alert('앞에서 셋팅 안됨') + swalFire({ text: 'construction 존재안함', icon: 'error' }) return } @@ -78,6 +78,7 @@ export const useTrestle = () => { }) } + // 모듈들의 centerPoint들을 이용해 각 모듈의 정보(가장 아랫라인 모듈, 가장 윗라인 모듈, 접면, 반접면 등 계산) const result = calculateForApi(surface) if (!result) { @@ -122,11 +123,10 @@ export const useTrestle = () => { rightExposedHalfBottomPoints.length > 0 || leftExposedHalfTopModules.length > 0 || rightExposedHalfTopPoints.length > 0 - surface.isChidory = isChidory if (plvrYn === 'N' && isChidory) { - alert('치조불가공법입니다.') + swalFire({ text: '치조불가공법입니다.', icon: 'error' }) clear() throw new Error('치조불가공법입니다.') } @@ -732,6 +732,7 @@ export const useTrestle = () => { return { itemList, northArrangement, roofSurfaceList, circuitItemList } } + // 발전 시뮬레이션 용 각도 재계산 const getAzimuth = (parent) => { const { moduleCompass, surfaceCompass, direction } = parent @@ -796,6 +797,7 @@ export const useTrestle = () => { return 0 } + // 북면설치가 한개라도 되어있는지 확인 const getNorthArrangement = () => { const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) let northArrangement = '0' @@ -814,6 +816,7 @@ export const useTrestle = () => { return northArrangement } + // 다음 윗 모듈을 찾는다. const findNextModule = (currentPoint, centerPoints, direction) => { let { x, y, horizontal, vertical } = { ...currentPoint } let { widthArr, heightArr } = centerPoints[0] @@ -860,6 +863,7 @@ export const useTrestle = () => { return result } + // 다음 왼쪽 모듈을 찾는다. const findNextLeftModule = (currentPoint, centerPoints, direction) => { let { x, y, horizontal, vertical } = { ...currentPoint } let { widthArr, heightArr } = centerPoints[0] @@ -923,6 +927,8 @@ export const useTrestle = () => { return result } + + // 다음 오른쪽 모듈을 찾는다. const findNextRightModule = (currentPoint, centerPoints, direction) => { let { x, y, horizontal, vertical } = { ...currentPoint } let { widthArr, heightArr } = centerPoints[0] @@ -1357,6 +1363,7 @@ export const useTrestle = () => { } } + //파라미터로 받은 배치면의 rack을 가지고 지지금구를 그린다. const installBracket = (surface) => { const modules = surface.modules const racks = [] @@ -1555,6 +1562,7 @@ export const useTrestle = () => { } } + // 랙 없음의 지지금구를 그린다. const drawBracketWithOutRack = (module, rackIntvlPct, count, l, direction, moduleIntvlHor, moduleIntvlVer) => { let { width, height, left, top } = module let startPointX