모듈 최대 단수 계산 추가

This commit is contained in:
hyojun.choi 2025-01-31 15:56:52 +09:00
parent 10bfc1d389
commit a11867a49d

View File

@ -182,6 +182,8 @@ export const useTrestle = () => {
const horizontal = ['south', 'north'].includes(direction) ? surface.trestleDetail.moduleIntvlHor : surface.trestleDetail.moduleIntvlVer const horizontal = ['south', 'north'].includes(direction) ? surface.trestleDetail.moduleIntvlHor : surface.trestleDetail.moduleIntvlVer
const vertical = ['south', 'north'].includes(direction) ? surface.trestleDetail.moduleIntvlVer : surface.trestleDetail.moduleIntvlHor const vertical = ['south', 'north'].includes(direction) ? surface.trestleDetail.moduleIntvlVer : surface.trestleDetail.moduleIntvlHor
let mostRowsModule = 0 // 가장 많은 모듈의 줄 수
// 가대 설치를 위한 가장 아래 모듈로부터 위로 몇단인지 계산 // 가대 설치를 위한 가장 아래 모듈로부터 위로 몇단인지 계산
// 오른쪽,왼쪽 둘 다 아래에 아무것도 없는, 처마 커버를 필요로 하는 모듈 // 오른쪽,왼쪽 둘 다 아래에 아무것도 없는, 처마 커버를 필요로 하는 모듈
exposedBottomModules.forEach((module) => { exposedBottomModules.forEach((module) => {
@ -299,7 +301,7 @@ export const useTrestle = () => {
return rack.value.moduleRows === centerRows return rack.value.moduleRows === centerRows
})?.value.racks })?.value.racks
moduleRowsTotCnt = Math.max(leftRows, rightRows, centerRows) mostRowsModule = Math.max(leftRows, rightRows, centerRows, mostRowsModule)
if (rackYn === 'Y') { if (rackYn === 'Y') {
drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn) drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn)
@ -361,7 +363,7 @@ export const useTrestle = () => {
const leftRacks = rackInfos.find((rack) => { const leftRacks = rackInfos.find((rack) => {
return rack.value.moduleRows === leftRows return rack.value.moduleRows === leftRows
})?.value.racks })?.value.racks
moduleRowsTotCnt = Math.max(leftRows, moduleRowsTotCnt) mostRowsModule = Math.max(leftRows, mostRowsModule)
if (rackYn === 'Y') { if (rackYn === 'Y') {
drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn) drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn)
} }
@ -415,7 +417,7 @@ export const useTrestle = () => {
return rack.value.moduleRows === rightRows return rack.value.moduleRows === rightRows
})?.value.racks })?.value.racks
moduleRowsTotCnt = Math.max(rightRows, moduleRowsTotCnt) mostRowsModule = Math.max(rightRows, mostRowsModule)
// 해당 rack으로 그려준다. // 해당 rack으로 그려준다.
if (rackYn === 'Y') { if (rackYn === 'Y') {
drawRacks(rightRacks, rackQty, rackIntvlPct, module, direction, 'R', rackYn) drawRacks(rightRacks, rackQty, rackIntvlPct, module, direction, 'R', rackYn)
@ -424,7 +426,7 @@ export const useTrestle = () => {
module.set({ rightRows }) module.set({ rightRows })
}) })
surface.set({ moduleRowsTotCnt }) surface.set({ moduleRowsTotCnt: mostRowsModule })
if (rackYn === 'N') { if (rackYn === 'N') {
// rack이 없을경우 // rack이 없을경우
@ -1642,6 +1644,7 @@ export const useTrestle = () => {
if (cvrPlvrYn === 'Y') { if (cvrPlvrYn === 'Y') {
moduleRowResultData.eavesHalfCnt++ moduleRowResultData.eavesHalfCnt++
if (bottomLeftModule || bottomRightModule || halfBottomLeftModule || halfBottomRightModule) { if (bottomLeftModule || bottomRightModule || halfBottomLeftModule || halfBottomRightModule) {
//처마커버 한개 노출 추가
moduleRowResultData.exposedSideEavesCnt++ moduleRowResultData.exposedSideEavesCnt++
} }
} }
@ -1649,10 +1652,10 @@ export const useTrestle = () => {
moduleRowResultData.exposedBottomCnt++ moduleRowResultData.exposedBottomCnt++
if (isEaveBar) { if (isEaveBar) {
moduleRowResultData.eavesCnt++ moduleRowResultData.eavesCnt++
} if ((rightModule && !leftModule) || (!rightModule && leftModule)) {
// 둘중 하나가 없는경우는 처마커버 노출 추가
if (!(leftModule && rightModule)) { moduleRowResultData.exposedSideEavesCnt++
moduleRowResultData.exposedSideEavesCnt++ }
} }
} }
} }