발전 시뮬레이션 각도 계산 수정
This commit is contained in:
parent
bab752ebe5
commit
010b34f5fb
@ -710,7 +710,7 @@ export const useTrestle = () => {
|
|||||||
slope,
|
slope,
|
||||||
classType: currentAngleType === 'slope' ? '0' : '1',
|
classType: currentAngleType === 'slope' ? '0' : '1',
|
||||||
angle: getDegreeByChon(slope),
|
angle: getDegreeByChon(slope),
|
||||||
azimuth: surfaceCompass ?? moduleCompass ?? 0,
|
azimuth: getAzimuth(surface),
|
||||||
moduleList,
|
moduleList,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -726,6 +726,70 @@ export const useTrestle = () => {
|
|||||||
return { itemList, northArrangement, roofSurfaceList, circuitItemList }
|
return { itemList, northArrangement, roofSurfaceList, circuitItemList }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getAzimuth = (surface) => {
|
||||||
|
const { moduleCompass, surfaceCompass, direction } = surface
|
||||||
|
|
||||||
|
if (surfaceCompass) {
|
||||||
|
if (surfaceCompass > 180) {
|
||||||
|
return surfaceCompass - 360
|
||||||
|
}
|
||||||
|
return surfaceCompass
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (direction) {
|
||||||
|
case 'south': {
|
||||||
|
if (moduleCompass < 0) {
|
||||||
|
return -1 * moduleCompass
|
||||||
|
} else if (moduleCompass === 0) {
|
||||||
|
return 0
|
||||||
|
} else if (moduleCompass < 180) {
|
||||||
|
return -1 * moduleCompass
|
||||||
|
} else if (moduleCompass === 180) {
|
||||||
|
return 180
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 'north': {
|
||||||
|
if (moduleCompass < 0) {
|
||||||
|
return -1 * (180 + moduleCompass)
|
||||||
|
} else if (moduleCompass === 0) {
|
||||||
|
return 180
|
||||||
|
} else if (moduleCompass < 180) {
|
||||||
|
return 180 - moduleCompass
|
||||||
|
} else if (moduleCompass === 180) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 'west': {
|
||||||
|
if (moduleCompass > -180 && moduleCompass < -90) {
|
||||||
|
return -180 - (90 + moduleCompass)
|
||||||
|
} else if (moduleCompass < 0) {
|
||||||
|
return 180 - (90 + moduleCompass)
|
||||||
|
} else if (moduleCompass === 0) {
|
||||||
|
return 90
|
||||||
|
} else if (moduleCompass < 180) {
|
||||||
|
return 90 - moduleCompass
|
||||||
|
} else if (moduleCompass === 180) {
|
||||||
|
return -90
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 'east': {
|
||||||
|
if (moduleCompass < 0) {
|
||||||
|
return -(90 + moduleCompass)
|
||||||
|
} else if (moduleCompass === 0) {
|
||||||
|
return -90
|
||||||
|
} else if (moduleCompass < 90) {
|
||||||
|
return -180 + (90 - moduleCompass)
|
||||||
|
} else if (moduleCompass < 180) {
|
||||||
|
return 180 + (90 - moduleCompass)
|
||||||
|
} else if (moduleCompass === 180) {
|
||||||
|
return 90
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
const getNorthArrangement = () => {
|
const getNorthArrangement = () => {
|
||||||
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||||
let northArrangement = '0'
|
let northArrangement = '0'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user