diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 2b35aaf6..73fca74e 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -605,7 +605,7 @@ export const useTrestle = () => { } catch (e) { // 에러 발생시 가대 초기화 console.error(e) - // clear() + clear() setViewCircuitNumberTexts(true) setIsGlobalLoading(false) return false @@ -988,12 +988,20 @@ export const useTrestle = () => { return result } + // rack을 그린다. const drawRacks = (rackInfos, rackQty, rackIntvlPct, module, direction, l, rackYn) => { - if (!rackInfos) { - return - } const { width, height, left, top, lastX, lastY, surfaceId } = module const surface = canvas.getObjects().find((obj) => obj.id === surfaceId) + if (!rackInfos) { + const maxRows = surface.trestleDetail.moduleMaxRows + const maxCols = surface.trestleDetail.moduleMaxCols + const msg = `選択した家で設置可能 +モジュールの最大段数は${maxRows}、最大列数は${maxCols}です。 +上限より上部に取り付けたモジュールを削除してください。` + swalFire({ title: msg, type: 'alert' }) + throw new Error('rackInfos is null') + } + const roof = canvas.getObjects().find((obj) => obj.id === surface.parentId) const degree = getDegreeByChon(roof.roofMaterial.pitch)