Merge remote-tracking branch 'origin/sub_laptop_7' into main_laptop_1
# Conflicts: # B08_Quantity/B08_Quantity_UI_Page.css
This commit is contained in:
@@ -569,6 +569,8 @@ export interface CrossSectionPatch {
|
||||
/** B08 하상경사 원천(110) — 관 바닥 두 끝 경사 · 박스 두 끝 원지반 경사(%) · 관 길이와 같은 길. */
|
||||
pipe_slope_pct?: number;
|
||||
box_ground_slope_pct?: number;
|
||||
/** B08 구조물 집계표 BOX 본체 길이(m · 120) — 박스 두 끝 offset 차 · 같은 길. */
|
||||
box_length_m?: number;
|
||||
inlet_structure?: "auto" | "revet" | "I" | "L" | "U";
|
||||
basin_adjust?: {
|
||||
innerWidthM: number;
|
||||
|
||||
@@ -188,6 +188,8 @@ class CrossSectionPatch(BaseModel):
|
||||
# (관 길이와 같은 길). 0 · 음수도 그대로 — 빈칸 판정은 B08 몫.
|
||||
pipe_slope_pct: float | None = None
|
||||
box_ground_slope_pct: float | None = None
|
||||
# B08 구조물 집계표 BOX 본체 길이(120) — 박스 두 끝 offset 차(m) · 같은 길.
|
||||
box_length_m: float | None = Field(default=None, ge=0)
|
||||
|
||||
|
||||
class SectionConfirmRequest(BaseModel):
|
||||
|
||||
@@ -68,6 +68,7 @@ _AREA_KEYS = (
|
||||
"pipe_length_m",
|
||||
"pipe_slope_pct",
|
||||
"box_ground_slope_pct",
|
||||
"box_length_m",
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -159,6 +159,8 @@ export const STRUCTURE_ROW_KEYS = [
|
||||
// B08 하상경사 원천(110) — 관 바닥 두 끝 경사 · 박스 두 끝 원지반 경사(%) · 같은 길로 실음.
|
||||
"pipe_slope_pct",
|
||||
"box_ground_slope_pct",
|
||||
// B08 구조물 집계표 BOX 본체 길이(120) — 박스 두 끝(구체 끝) offset 차 · 같은 길로 실음.
|
||||
"box_length_m",
|
||||
] as const;
|
||||
|
||||
/** 박스 두 끝(구체 끝) 원지반 경사(%) — 유입 − 유출 ÷ 수평거리. 본체는 늘 수평이라 원지반으로(110). */
|
||||
@@ -171,6 +173,14 @@ function boxGroundSlopePct(section: CrossSection, box: BoxLayout): number | null
|
||||
return ((groundAt(inlet.offset) - groundAt(outlet.offset)) / run) * 100;
|
||||
}
|
||||
|
||||
/** 박스 본체 길이(m) — 두 끝(구체 끝) offset 차 · 한쪽이라도 없으면 null(120). */
|
||||
function boxLengthM(box: BoxLayout): number | null {
|
||||
const inlet = box.sides.find((side) => side.wingRole === "inlet");
|
||||
const outlet = box.sides.find((side) => side.wingRole === "outlet");
|
||||
const run = inlet && outlet ? Math.abs(inlet.offset - outlet.offset) : 0;
|
||||
return run > 0 ? run : null;
|
||||
}
|
||||
|
||||
/** 폐회로 면적 입력(설계선·지반선·트림) — 트림이나 설계선이 모자라면 null. */
|
||||
function areaInputOf(section: CrossSection, layouts: StoredLayouts) {
|
||||
const trim = trimOfLayouts(layouts);
|
||||
@@ -228,6 +238,9 @@ function areaRowOf(
|
||||
? boxGroundSlopePct(section, layouts.box)
|
||||
: null;
|
||||
if (boxSlope !== null) ownRow.box_ground_slope_pct = Number(boxSlope.toFixed(4));
|
||||
const boxLength =
|
||||
layouts.box && isOwner(section.box?.chainage_m) ? boxLengthM(layouts.box) : null;
|
||||
if (boxLength !== null) ownRow.box_length_m = Number(boxLength.toFixed(4));
|
||||
const pipeRow = Object.keys(ownRow).length > 1 ? ownRow : null;
|
||||
const areaInput = areaInputOf(section, layouts);
|
||||
if (!areaInput) return pipeRow;
|
||||
|
||||
Reference in New Issue
Block a user