From d77f2bfd173426ccbe06a00bcec98d23d3f34a9f Mon Sep 17 00:00:00 2001 From: ypshim Date: Mon, 26 Oct 2026 11:39:28 +0900 Subject: [PATCH] =?UTF-8?q?feat(bearing):=20=EB=B0=9B=EC=B9=A8=20=EC=A2=85?= =?UTF-8?q?=EB=A5=98=C2=B7=EC=9A=A9=EB=9F=89=20as=20a=20text=20input=20(de?= =?UTF-8?q?fault=20=ED=83=84=EC=84=B1=EB=B0=9B=EC=B9=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PierInput.bearingType: text, absent = 탄성받침. Tracked for changes, so it can be reverted. Saved in the project; no rule yet, so it does not change the model. - Shown on the ② bearing card above the 공통 규칙. Co-Authored-By: Claude Haiku 5.5 --- src/core/changes.ts | 3 ++- src/core/types.ts | 2 ++ src/main.ts | 16 +++++++++++++++- tests/ground-inputs.test.ts | 7 +++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/core/changes.ts b/src/core/changes.ts index c569eb4..4defe9c 100644 --- a/src/core/changes.ts +++ b/src/core/changes.ts @@ -23,7 +23,7 @@ export const EDITABLE_FIELDS = [ ] as const; /** Inputs tracked for overrides and pending changes: the numeric cards plus 열별 본수 (an array, compared by value). */ -export const TRACKED_KEYS = [...EDITABLE_FIELDS.map((f) => f.key), 'pileRows', 'groundPosition', 'groundWaterOn', 'groundWaterEl', 'floodLevelEl', 'scourDepthM', 'highWaterEl', 'lowWaterEl', 'strataRows'] as const; +export const TRACKED_KEYS = [...EDITABLE_FIELDS.map((f) => f.key), 'pileRows', 'groundPosition', 'groundWaterOn', 'groundWaterEl', 'floodLevelEl', 'scourDepthM', 'highWaterEl', 'lowWaterEl', 'strataRows', 'bearingType'] as const; export type EditableKey = (typeof TRACKED_KEYS)[number]; @@ -51,6 +51,7 @@ export const FIELD_LABELS: Record = { scourDepthM: '세굴 깊이', highWaterEl: '고조위 HWL', lowWaterEl: '저조위 LWL', + bearingType: '받침 종류·용량', strataRows: '지층 행', }; diff --git a/src/core/types.ts b/src/core/types.ts index f974c11..cf654b4 100644 --- a/src/core/types.ts +++ b/src/core/types.ts @@ -68,6 +68,8 @@ export interface PierInput { /** 해상 (승인 2026-10-26): 고조위 HWL and 저조위 LWL (m, MSL datum). The groundEl is the 해저면 EL for 해상. */ highWaterEl?: number; lowWaterEl?: number; + /** 받침 종류·용량 as text (승인 2026-10-26). Absent = 탄성받침 (the default). */ + bearingType?: string; strataRows?: StrataRow[]; } diff --git a/src/main.ts b/src/main.ts index 09f8a10..b5a3130 100644 --- a/src/main.ts +++ b/src/main.ts @@ -76,7 +76,7 @@ const CRS = '국토좌표계 (x = 동, y = 북)'; /** 시안 ② 부재 목록 (spec §5.2). `keys` are the inputs that exist today; the rest show values only. */ const MEMBERS: { id: MemberId; label: string; keys: EditableKey[]; note: string }[] = [ - { id: 'bearing', label: '교량받침·받침블럭·솔플레이트', keys: [], note: '받침 상세(C3)는 Q16 결정 후 추가합니다. 지금은 표시만 합니다.' }, + { id: 'bearing', label: '교량받침·받침블럭·솔플레이트', keys: ['bearingType'], note: '받침 상세(C3)는 Q16 결정 후 추가합니다. 지금은 표시만 합니다.' }, { id: 'coping', label: '코핑', keys: ['copingWidthMm', 'copingLengthMm', 'copingH1Mm', 'copingH2Mm', 'levelWidthMm'], note: '폭, 길이, 끝단 높이 h1, 테이퍼 높이 h2, Level 폭을 입력합니다. 계단 위치·단차선 입력은 다음 단계에서 추가합니다.' }, { id: 'column', label: '기둥', keys: ['columnDiameterMm'], note: '기둥 직경 D를 입력합니다 (1200–3000 mm, 50 mm 단위). 높이와 위치는 계산값입니다.' }, { id: 'footing', label: '확대기초 · 말뚝', keys: ['footingLengthMm', 'footingWidthMm', 'footingHeightMm', 'blindingMarginMm', 'blindingThicknessMm', 'pileLengthMm'], note: '확대기초 치수, 비림, 말뚝 길이와 규격을 입력합니다. 규칙 미정 항목(모따기, 경사, 복합 말뚝)은 다음 단계에서 추가합니다.' }, @@ -1762,6 +1762,20 @@ function renderBearingRef(box: HTMLDivElement, pier: Pier): void { const m = pier.model; const wrap = el('div', undefined, 'bearing-ref'); renderBearingBasis(wrap, pier); + // 받침 종류·용량 (승인 2026-10-26: 글자 입력, 기본 탄성받침). Saved in the project; no rule yet, so it does not change the model. + wrap.appendChild(el('p', '받침 종류·용량 (글자 입력 · 기본 탄성받침)', 'lbl')); + const typeInput = el('input'); + typeInput.type = 'text'; + typeInput.id = 'bearing-type'; + typeInput.value = pier.draft.bearingType ?? '탄성받침'; + typeInput.addEventListener('change', () => { + const v = typeInput.value.trim(); + const p = state.piers.find((q) => q.input.name === pier.input.name); + if (!p) return; + p.draft = { ...p.draft, bearingType: v === '' ? undefined : v }; + renderAll(); + }); + wrap.appendChild(typeInput); wrap.appendChild(el('p', '공통 규칙 (입력 · 기본값 = 도면값)', 'lbl')); const rules: [keyof BearingRules, string][] = [['h2', '모르타르 h2 (mm)'], ['h3', '받침 높이 h3 (mm)'], ['T', '솔플레이트 중심 T (mm)'], ['margin', '솔플 여유 (mm)']]; const grid = el('div', undefined, 'edit-row'); diff --git a/tests/ground-inputs.test.ts b/tests/ground-inputs.test.ts index b39c6ce..fb7def9 100644 --- a/tests/ground-inputs.test.ts +++ b/tests/ground-inputs.test.ts @@ -249,3 +249,10 @@ describe('해상 (승인 2026-10-26: MSL 기준, 고조위·저조위 두 개, expect(svg).toContain('해저면 EL 28.931'); }); }); + +describe('받침 종류·용량 (글자 입력)', () => { + it('is tracked as a change, so it can be reverted to the default', () => { + const a = withGround({}); + expect(changedKeys(a, { ...a, bearingType: '고무받침' })).toEqual(['bearingType']); + }); +});