Merge remote-tracking branch 'origin/sub_laptop_5' into main_laptop_1
This commit is contained in:
@@ -56,7 +56,8 @@ export interface SpecFormHooks {
|
||||
hint?: (c: SpecContainer, item: SpecItem, state: SpecState) => string;
|
||||
onChange?: (c: SpecContainer, item: SpecItem) => void;
|
||||
/** 선택 컨테이너 개수를 밖에서 정함(54-1 배관 흙막이 = 추가 기슭막이(단)) — 수면 그만큼 늘 보임 ·
|
||||
* [추가] · [빼기] 없음 · 줄면 끝에서부터 빠짐 · null = 모름(저장된 것 그대로) · undefined = 손 [추가]. */
|
||||
* [추가] · [빼기] 없음 · 줄면 끝에서부터 가림(값은 남음 · 54-10) · null = 모름(저장된 것 그대로) ·
|
||||
* undefined = 손 [추가]. */
|
||||
count?: (c: SpecContainer) => number | null | undefined;
|
||||
}
|
||||
|
||||
@@ -228,15 +229,18 @@ export function createSpecForm(links: SpecLinks | null, hooks: SpecFormHooks = {
|
||||
return box.root;
|
||||
};
|
||||
|
||||
/** 밖에서 정한 개수로 맞춤 — 줄면 끝 인스턴스 · 잇기를 뺌. 바뀌었으면 true. */
|
||||
/** 밖에서 정한 개수 — 모자라면 빈 인스턴스를 늘림(늘었으면 true) · 넘친 인스턴스 · 잇기는
|
||||
* 가리기만 하고 값에 남김(54-10 · 파일에 그대로). */
|
||||
const fit = (c: SpecContainer, list: Instance[]): boolean => {
|
||||
const n = hooks.count?.(c);
|
||||
if (c.required || n === undefined || n === null || n === list.length) return false;
|
||||
for (let k = n + 1; k <= list.length; k++) links?.set(linkOf(c, k), null);
|
||||
list.splice(n);
|
||||
if (c.required || n === undefined || n === null || n <= list.length) return false;
|
||||
while (list.length < n) list.push({});
|
||||
return true;
|
||||
};
|
||||
const shown = (c: SpecContainer, list: Instance[]): Instance[] => {
|
||||
const n = c.required ? null : hooks.count?.(c);
|
||||
return n === undefined || n === null ? list : list.slice(0, n);
|
||||
};
|
||||
|
||||
function paint(quiet = true): void {
|
||||
rows.length = 0;
|
||||
@@ -245,7 +249,7 @@ export function createSpecForm(links: SpecLinks | null, hooks: SpecFormHooks = {
|
||||
for (const c of spec?.containers ?? []) {
|
||||
const list = (state[c.id] ??= c.required ? [{}] : []);
|
||||
if (fit(c, list)) fitted.push(c);
|
||||
list.forEach((values, index) => boxes.push(instanceBox(c, values, index)));
|
||||
shown(c, list).forEach((values, index) => boxes.push(instanceBox(c, values, index)));
|
||||
if (c.required || (c.max && list.length >= c.max) || hooks.count?.(c) !== undefined) continue;
|
||||
const add = document.createElement("button");
|
||||
add.type = "button";
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* 셈 · 시험 test_b06_pipe_length) 그대로 — 여기서 새로 셈하지 않음 · 화면에 보이기만(저장 안 함).
|
||||
* 높이 = 손 입력 · 횡단도 조정 높이는 B06 `withSpecDefaults` 가 같은 키(`*_revet_height_m`)에 실음 ·
|
||||
* 빈 칸 안내 = 관경 기준 최소 높이(`pipeWallMinHeightM` ↔ 파이썬 `pipe_wall_min_height_m` 짝).
|
||||
* 흙막이 개수 = 주인 측점 유출 「추가 기슭막이(단)」(횡단 설계 patch `extra_wall_counts` · 54-1) — 읽기만.
|
||||
* 흙막이 개수 = 주인 측점 유출 「추가 기슭막이(단)」(횡단 설계 patch `extra_wall_counts` · 54-1) 중 지형이 세운 단(54-10) — 읽기만.
|
||||
* ========================================================================== */
|
||||
|
||||
import { pipeWallMinHeightM } from "../../common_util/common_util_culvert_sets";
|
||||
@@ -51,11 +51,17 @@ export function pipeLengthM(chainageM: number | null): number | null {
|
||||
return typeof length === "number" && length > 0 ? length : null;
|
||||
}
|
||||
|
||||
/** 흙막이 개수 = 주인 측점 유출 「추가 기슭막이(단)」 — 횡단 자료가 없으면 null(모름). */
|
||||
/** 흙막이 개수 = 주인 측점 유출 「추가 기슭막이(단)」 중 지형이 세운 단(54-10) — 횡단 자료가 없으면
|
||||
* null(모름). 저장 단 수가 더 커도 넘친 단은 컨테이너를 안 세움(값은 파일에 그대로). */
|
||||
export function pipeExtraCount(chainageM: number | null): number | null {
|
||||
const owner = ownerSection(chainageM)?.owner;
|
||||
if (!owner) return null;
|
||||
return extraCountSource?.(owner) ?? owner.design?.extra_wall_counts?.outlet ?? 0;
|
||||
const found = ownerSection(chainageM);
|
||||
if (!found) return null;
|
||||
const { owner, sections } = found;
|
||||
const outlet = extraCountSource?.(owner) ?? owner.design?.extra_wall_counts?.outlet ?? 0;
|
||||
if (!outlet || !owner.design) return outlet;
|
||||
const counts = { basin: 0, ...owner.design.extra_wall_counts, outlet };
|
||||
const probe = { ...owner, design: { ...owner.design, extra_wall_counts: counts } };
|
||||
return computeStoredLayouts(probe, sections)?.culvert?.extraWalls.length ?? outlet;
|
||||
}
|
||||
|
||||
/** 흙막이 높이 빈 칸 안내 — 관경 기준 최소 높이(엔진이 빈 칸을 이 값으로 그림). */
|
||||
|
||||
@@ -41,7 +41,7 @@ import { NO_SELECTION, PIPE_MATCH_M, selectDesign } from "./design_selection";
|
||||
import { readPendingPipes } from "../../B05_Profile/B05_Profile_Api_Pipes_Draft";
|
||||
import { applyStructurePick } from "../../B06_Section/B06_Section_UI_Page_Structure_Pick";
|
||||
import { createSectionView } from "../../B06_Section/B06_Section_UI_Section_View";
|
||||
import { revetWallSpec } from "../../B06_Section/B06_Section_UI_Cross_Culvert_Const";
|
||||
import { revetFormOf, revetWallSpec } from "../../B06_Section/B06_Section_UI_Cross_Culvert_Const";
|
||||
import {
|
||||
applyPipeOptionsToCache,
|
||||
replayDraftPipeOptions,
|
||||
@@ -73,7 +73,11 @@ import {
|
||||
createStandardSlot,
|
||||
} from "../../B06_Section/B06_Section_UI_Page_Panel";
|
||||
import type { DesignPageHost } from "./design_page";
|
||||
import { setPipeExtraCountSource, setPipeSectionsSource } from "./design_structure_pipe_calc";
|
||||
import {
|
||||
pipeExtraCount,
|
||||
setPipeExtraCountSource,
|
||||
setPipeSectionsSource,
|
||||
} from "./design_structure_pipe_calc";
|
||||
import {
|
||||
bindDesignView,
|
||||
bindPipeOptions,
|
||||
@@ -152,6 +156,7 @@ export async function mountCrossView(
|
||||
// 조작(조정창 높이)이 있을 때만 — 없으면 그려진 높이는 관경 기준 제안이라 옵션에 안 적음
|
||||
// (2026-09-14 브레인 판정 ④ 「기본값을 몰래 확정으로 안 바꿈」).
|
||||
if (adjust?.h == null) return null;
|
||||
if (role !== "inlet" && role !== "outlet") return adjust.h; // 다단 = 기하가 되받은 적용 높이(54-10)
|
||||
return revetWallSpec(spec, adjust, culvert.hidden_pipe === true, culvert.diameter_m)
|
||||
.pureHeight;
|
||||
},
|
||||
@@ -164,6 +169,7 @@ export async function mountCrossView(
|
||||
const spec = role === "outlet" ? culvert.outlet : culvert.inlet;
|
||||
const adjust = stationControls.revetOffset.adjustFor(owner, role);
|
||||
if (!adjust?.m) return null; // 조작한 형태만 — 기본 형태는 제안(판정 ④)
|
||||
if (role !== "inlet" && role !== "outlet") return revetFormOf(adjust.m); // 다단(54-10)
|
||||
return revetWallSpec(spec, adjust, culvert.hidden_pipe === true, culvert.diameter_m).form;
|
||||
},
|
||||
// 좌·우 이름표 — +offset이 좌측이고 유입 벽은 오르막(계류) 쪽에 선다.
|
||||
@@ -333,6 +339,8 @@ export async function mountCrossView(
|
||||
ford: stationControls.ford,
|
||||
box: stationControls.box,
|
||||
revetOffset: stationControls.revetOffset,
|
||||
structureSpan: stationControls.structureSpan,
|
||||
soilTiers: pipeExtraCount,
|
||||
overrideOptions: (chainageM, values) => structuresPanel.overrideOptions(chainageM, values),
|
||||
refreshCard: (chainageM) => sectionView.refreshCard(chainageM),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user