From 796a2672058f65638fe1e336b8e70fc5341d211b Mon Sep 17 00:00:00 2001 From: ypshim Date: Tue, 3 Nov 2026 18:40:16 +0900 Subject: [PATCH] =?UTF-8?q?refactor(abut):=20=EA=B5=90=EB=9F=89=EB=B0=9B?= =?UTF-8?q?=EC=B9=A8=20=EC=B9=B4=EB=93=9C=EC=97=90=EC=84=9C=20=EB=B0=9B?= =?UTF-8?q?=EC=B9=A8=20=EC=A2=85=EB=A5=98=20=C2=B7=20=EC=9A=A9=EB=9F=89=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 받침 종류 · 용량 입력칸과 받침 규칙의 kind 값을 제거 - 예전 프로젝트 파일에 저장된 kind 값은 읽을 때 무시 (불러오기 오류 없음) - 테스트 갱신. 전체 651건 통과, 타입 검사·빌드 통과 Co-Authored-By: Claude Opus 5.5 --- src/core/abut/bearing-table.ts | 6 ++---- src/core/abut/edit.ts | 9 ++------- src/core/project.ts | 1 + src/main.ts | 15 --------------- tests/abut-bearing-table.test.ts | 5 ++--- 5 files changed, 7 insertions(+), 29 deletions(-) diff --git a/src/core/abut/bearing-table.ts b/src/core/abut/bearing-table.ts index 43a5066..872775c 100644 --- a/src/core/abut/bearing-table.ts +++ b/src/core/abut/bearing-table.ts @@ -18,12 +18,10 @@ export interface AbutBearingRule { widthMm: number; /** 종단 기울기 S (%). */ slopePct: number; - /** 받침 종류 · 용량 (글자 입력). */ - kind: string; } -/** 기본값: 교각 솔플레이트 규칙과 같은 1000 × 1100 · −0.5 % (가정, QA-15). 받침 종류는 탄성받침 (Task yaml 응답). */ -export const ABUT_BEARING_RULE_DEFAULT: AbutBearingRule = { lengthMm: 1000, widthMm: 1100, slopePct: -0.5, kind: '탄성받침' }; +/** 기본값: 교각 솔플레이트 규칙과 같은 1000 × 1100 · −0.5 % (QA-15, 사용자 결정 2026-11-03). */ +export const ABUT_BEARING_RULE_DEFAULT: AbutBearingRule = { lengthMm: 1000, widthMm: 1100, slopePct: -0.5 }; /** 받침블럭 평면 (mm, 정사각) and 몰탈패드 평면 (mm), spec_abut §4.2. */ export const ABUT_BLOCK_MM = 1200; export const ABUT_PAD_PLAN_MM = 1000; diff --git a/src/core/abut/edit.ts b/src/core/abut/edit.ts index 25b341c..c0d935e 100644 --- a/src/core/abut/edit.ts +++ b/src/core/abut/edit.ts @@ -96,14 +96,9 @@ export const BEARING_RULE_FIELDS: { key: 'lengthMm' | 'widthMm' | 'slopePct'; la /** * Changes one 받침 규칙 value. L and W must be greater than 0, S any number, and the rule must still build a solplate with - * the 교대 받침높이 H (the pier rule's checks). The 받침 종류 must not be empty. + * the 교대 받침높이 H (the pier rule's checks). */ -export function applyBearingRule(rec: AbutRecord, key: keyof AbutBearingRule, value: number | string): AbutRecord { - if (key === 'kind') { - const kind = String(value).trim(); - if (!kind) throw new Error('받침 종류 · 용량을 입력하세요.'); - return { ...rec, bearingRule: { ...(rec.bearingRule ?? {}), kind } }; - } +export function applyBearingRule(rec: AbutRecord, key: keyof AbutBearingRule, value: number): AbutRecord { const n = Number(value); if (!Number.isFinite(n)) throw new Error('솔플레이트 규칙 값은 숫자여야 합니다.'); const bearingRule = { ...(rec.bearingRule ?? {}), [key]: n }; diff --git a/src/core/project.ts b/src/core/project.ts index ad9c3a3..a978afd 100644 --- a/src/core/project.ts +++ b/src/core/project.ts @@ -131,6 +131,7 @@ export function checkStoredAbutments(list: unknown): void { } if (a.bearingRule !== undefined) { for (const [key, v] of Object.entries(a.bearingRule)) { + // 'kind' (받침 종류) was stored by an earlier version and is ignored now (2026-11-03). if (key === 'kind' ? typeof v !== 'string' : !finite(v)) throw new Error(`${who}: 받침 규칙 ${key}이(가) 맞지 않습니다.`); } } diff --git a/src/main.ts b/src/main.ts index f15793b..80887b6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -888,21 +888,6 @@ function fillAbutBearingCard( ), ); box.append(el('p', `블럭 평면 ${ABUT_BLOCK_MM} × ${ABUT_BLOCK_MM} (기본값) · 몰탈패드 ${ABUT_PAD_PLAN_MM} × ${ABUT_PAD_PLAN_MM} × 50 (기본값) · 블럭 높이 = min(z) − 교좌면 (계산)`, 'muted small')); - const kindId = idOf('rule-kind'); - const kindLab = el('label', '받침 종류 · 용량'); - kindLab.htmlFor = kindId; - const kind = el('input'); - kind.id = kindId; - kind.type = 'text'; - kind.value = rule.kind; - kind.addEventListener('change', () => { - try { - apply(applyBearingRule(rec, 'kind', kind.value)); - } catch (err) { - fail(err, kind, rule.kind); - } - }); - box.append(kindLab, kind, el('span', `기본 ${ABUT_BEARING_RULE_DEFAULT.kind}`, 'muted small')); box.append(el('p', `검사 · ${abutBearingChecks(model, members, rule, H).join(' · ')}`, 'muted small abut-checks')); } diff --git a/tests/abut-bearing-table.test.ts b/tests/abut-bearing-table.test.ts index 1aa044d..547bc60 100644 --- a/tests/abut-bearing-table.test.ts +++ b/tests/abut-bearing-table.test.ts @@ -71,11 +71,10 @@ describe('교대 받침 카드 (교각 솔플레이트 규칙, 받침높이 H = }); it('the rule edit keeps only changed values, refuses L 0 and a rule thicker than H, and the project file accepts it', () => { - const edited = applyBearingRule(applyBearingRule(rec, 'lengthMm', 900), 'kind', '포트받침 3000 kN'); - expect(edited.bearingRule).toEqual({ lengthMm: 900, kind: '포트받침 3000 kN' }); + const edited = applyBearingRule(applyBearingRule(rec, 'lengthMm', 900), 'widthMm', 1000); + expect(edited.bearingRule).toEqual({ lengthMm: 900, widthMm: 1000 }); expect(() => applyBearingRule(rec, 'lengthMm', 0)).toThrow('0보다'); expect(() => applyBearingRule(rec, 'slopePct', 60)).toThrow('받침높이'); - expect(() => applyBearingRule(rec, 'kind', ' ')).toThrow('받침 종류'); expect(() => checkStoredAbutments([edited])).not.toThrow(); expect(() => checkStoredAbutments([{ ...edited, bearingRule: { lengthMm: 'x' } }])).toThrow('받침 규칙'); });