Merge pull request '배치면의 경우 실제 길이 계산 시 통일 제거, 모듈 설치 시 영역 검사 spare 엄격하게 적용' (#641) from dev into dev-deploy
Reviewed-on: #641
This commit is contained in:
commit
a7c1bbac62
@ -8,7 +8,7 @@ export const useTurf = () => {
|
|||||||
* @param spare
|
* @param spare
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const checkModuleDisjointSurface = (module, surface, spare = 1) => {
|
const checkModuleDisjointSurface = (module, surface, spare = 0) => {
|
||||||
// 표면 영역을 spare만큼 수동 확장
|
// 표면 영역을 spare만큼 수동 확장
|
||||||
const expandedSurface = {
|
const expandedSurface = {
|
||||||
type: 'Polygon',
|
type: 'Polygon',
|
||||||
|
|||||||
@ -2229,7 +2229,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
//첫번재 모듈 설치 후 두번째 모듈을 몇개까지 설치 할 수 있는지 계산
|
//첫번재 모듈 설치 후 두번째 모듈을 몇개까지 설치 할 수 있는지 계산
|
||||||
if (installedModuleHeightCount > 0) {
|
if (installedModuleHeightCount > 0) {
|
||||||
// moduleMaxRows = totalModuleMaxRows - installedModuleHeightCount //두번째 모듈일때
|
// moduleMaxRows = totalModuleMaxRows - installedModuleHeightCount //두번째 모듈일때
|
||||||
isChidoriLine = installedModuleHeightCount % 2 != 0 ? true : false //첫번째에서 짝수에서 끝났으면 홀수는 치도리가 아님 짝수는 치도리
|
isChidoriLine = installedModuleHeightCount % 2 !== 0 //첫번째에서 짝수에서 끝났으면 홀수는 치도리가 아님 짝수는 치도리
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < calcModuleHeightCount; i++) {
|
for (let i = 0; i < calcModuleHeightCount; i++) {
|
||||||
@ -2249,7 +2249,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
widthMargin = j === 0 ? 0 : intvHor * j // 가로 마진값
|
widthMargin = j === 0 ? 0 : intvHor * j // 가로 마진값
|
||||||
chidoriLength = 0 //치도리가 아니여도 기본값을 5정도 준다
|
chidoriLength = 0 //치도리가 아니여도 기본값을 5정도 준다
|
||||||
if (isChidori) {
|
if (isChidori) {
|
||||||
chidoriLength = installedModuleHeightCount % 2 == 0 ? 0 : width / 2 - intvHor
|
chidoriLength = installedModuleHeightCount % 2 === 0 ? 0 : width / 2 - intvHor
|
||||||
}
|
}
|
||||||
|
|
||||||
//치도리 일때 는 짝수(1 기준) 일때만 치도리 라인으로 본다
|
//치도리 일때 는 짝수(1 기준) 일때만 치도리 라인으로 본다
|
||||||
|
|||||||
@ -241,6 +241,7 @@ export function usePlacementShapeDrawing(id) {
|
|||||||
originY: 'center',
|
originY: 'center',
|
||||||
direction: 'south',
|
direction: 'south',
|
||||||
pitch: globalPitch,
|
pitch: globalPitch,
|
||||||
|
from: 'surface',
|
||||||
})
|
})
|
||||||
|
|
||||||
setSurfaceShapePattern(roof, roofDisplay.column)
|
setSurfaceShapePattern(roof, roofDisplay.column)
|
||||||
|
|||||||
@ -1045,6 +1045,7 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
|||||||
newPolygon.set({
|
newPolygon.set({
|
||||||
originWidth: width,
|
originWidth: width,
|
||||||
originHeight: height,
|
originHeight: height,
|
||||||
|
from: 'surface',
|
||||||
})
|
})
|
||||||
|
|
||||||
// 캔버스에 추가
|
// 캔버스에 추가
|
||||||
|
|||||||
@ -1950,25 +1950,32 @@ export const usePolygon = () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// createdRoofs들의 모든 lines를 확인해서 length값이 1이하인 차이가 있으면 통일 시킨다.
|
// 배치면으로 그린 내용은 업데이트를 해준다.
|
||||||
const allRoofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
if (polygon.from === 'surface') {
|
||||||
const allRoofLines = allRoofs.flatMap((roof) => roof.lines)
|
forceUpdate = true
|
||||||
for (let i = 0; i < allRoofLines.length; i++) {
|
}
|
||||||
for (let j = i + 1; j < allRoofLines.length; j++) {
|
|
||||||
const line1 = allRoofLines[i]
|
if (polygon.from !== 'surface') {
|
||||||
const line2 = allRoofLines[j]
|
// createdRoofs들의 모든 lines를 확인해서 length값이 1이하인 차이가 있으면 통일 시킨다.
|
||||||
const diff = Math.abs(line1.length - line2.length)
|
const allRoofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||||
if (diff > 0 && diff <= 2) {
|
const allRoofLines = allRoofs.flatMap((roof) => roof.lines)
|
||||||
const maxLength = Math.max(line1.length, line2.length)
|
for (let i = 0; i < allRoofLines.length; i++) {
|
||||||
line1.setLengthByValue(maxLength * 10)
|
for (let j = i + 1; j < allRoofLines.length; j++) {
|
||||||
line2.setLengthByValue(maxLength * 10)
|
const line1 = allRoofLines[i]
|
||||||
// attributes도 통일
|
const line2 = allRoofLines[j]
|
||||||
const maxPlaneSize = Math.max(line1.attributes.planeSize || 0, line2.attributes.planeSize || 0)
|
const diff = Math.abs(line1.length - line2.length)
|
||||||
const maxActualSize = Math.max(line1.attributes.actualSize || 0, line2.attributes.actualSize || 0)
|
if (diff > 0 && diff <= 2) {
|
||||||
line1.attributes.planeSize = maxPlaneSize
|
const maxLength = Math.max(line1.length, line2.length)
|
||||||
line1.attributes.actualSize = maxActualSize
|
line1.setLengthByValue(maxLength * 10)
|
||||||
line2.attributes.planeSize = maxPlaneSize
|
line2.setLengthByValue(maxLength * 10)
|
||||||
line2.attributes.actualSize = maxActualSize
|
// attributes도 통일
|
||||||
|
const maxPlaneSize = Math.max(line1.attributes.planeSize || 0, line2.attributes.planeSize || 0)
|
||||||
|
const maxActualSize = Math.max(line1.attributes.actualSize || 0, line2.attributes.actualSize || 0)
|
||||||
|
line1.attributes.planeSize = maxPlaneSize
|
||||||
|
line1.attributes.actualSize = maxActualSize
|
||||||
|
line2.attributes.planeSize = maxPlaneSize
|
||||||
|
line2.attributes.actualSize = maxActualSize
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user