refactor(abut): 교량받침 카드에서 받침 종류 · 용량 입력 삭제
- 받침 종류 · 용량 입력칸과 받침 규칙의 kind 값을 제거 - 예전 프로젝트 파일에 저장된 kind 값은 읽을 때 무시 (불러오기 오류 없음) - 테스트 갱신. 전체 651건 통과, 타입 검사·빌드 통과 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6b969f4a7c
commit
796a267205
5 files changed
+7
-29
No files matched your search
@@ -18,12 +18,10 @@ export interface AbutBearingRule {
|
|||||||
widthMm: number;
|
widthMm: number;
|
||||||
/** 종단 기울기 S (%). */
|
/** 종단 기울기 S (%). */
|
||||||
slopePct: number;
|
slopePct: number;
|
||||||
/** 받침 종류 · 용량 (글자 입력). */
|
|
||||||
kind: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 기본값: 교각 솔플레이트 규칙과 같은 1000 × 1100 · −0.5 % (가정, QA-15). 받침 종류는 탄성받침 (Task yaml 응답). */
|
/** 기본값: 교각 솔플레이트 규칙과 같은 1000 × 1100 · −0.5 % (QA-15, 사용자 결정 2026-11-03). */
|
||||||
export const ABUT_BEARING_RULE_DEFAULT: AbutBearingRule = { lengthMm: 1000, widthMm: 1100, slopePct: -0.5, kind: '탄성받침' };
|
export const ABUT_BEARING_RULE_DEFAULT: AbutBearingRule = { lengthMm: 1000, widthMm: 1100, slopePct: -0.5 };
|
||||||
/** 받침블럭 평면 (mm, 정사각) and 몰탈패드 평면 (mm), spec_abut §4.2. */
|
/** 받침블럭 평면 (mm, 정사각) and 몰탈패드 평면 (mm), spec_abut §4.2. */
|
||||||
export const ABUT_BLOCK_MM = 1200;
|
export const ABUT_BLOCK_MM = 1200;
|
||||||
export const ABUT_PAD_PLAN_MM = 1000;
|
export const ABUT_PAD_PLAN_MM = 1000;
|
||||||
|
|||||||
@@ -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
|
* 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 {
|
export function applyBearingRule(rec: AbutRecord, key: keyof AbutBearingRule, value: number): AbutRecord {
|
||||||
if (key === 'kind') {
|
|
||||||
const kind = String(value).trim();
|
|
||||||
if (!kind) throw new Error('받침 종류 · 용량을 입력하세요.');
|
|
||||||
return { ...rec, bearingRule: { ...(rec.bearingRule ?? {}), kind } };
|
|
||||||
}
|
|
||||||
const n = Number(value);
|
const n = Number(value);
|
||||||
if (!Number.isFinite(n)) throw new Error('솔플레이트 규칙 값은 숫자여야 합니다.');
|
if (!Number.isFinite(n)) throw new Error('솔플레이트 규칙 값은 숫자여야 합니다.');
|
||||||
const bearingRule = { ...(rec.bearingRule ?? {}), [key]: n };
|
const bearingRule = { ...(rec.bearingRule ?? {}), [key]: n };
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ export function checkStoredAbutments(list: unknown): void {
|
|||||||
}
|
}
|
||||||
if (a.bearingRule !== undefined) {
|
if (a.bearingRule !== undefined) {
|
||||||
for (const [key, v] of Object.entries(a.bearingRule)) {
|
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}이(가) 맞지 않습니다.`);
|
if (key === 'kind' ? typeof v !== 'string' : !finite(v)) throw new Error(`${who}: 받침 규칙 ${key}이(가) 맞지 않습니다.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-15
@@ -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'));
|
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'));
|
box.append(el('p', `검사 · ${abutBearingChecks(model, members, rule, H).join(' · ')}`, 'muted small abut-checks'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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', () => {
|
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');
|
const edited = applyBearingRule(applyBearingRule(rec, 'lengthMm', 900), 'widthMm', 1000);
|
||||||
expect(edited.bearingRule).toEqual({ lengthMm: 900, kind: '포트받침 3000 kN' });
|
expect(edited.bearingRule).toEqual({ lengthMm: 900, widthMm: 1000 });
|
||||||
expect(() => applyBearingRule(rec, 'lengthMm', 0)).toThrow('0보다');
|
expect(() => applyBearingRule(rec, 'lengthMm', 0)).toThrow('0보다');
|
||||||
expect(() => applyBearingRule(rec, 'slopePct', 60)).toThrow('받침높이');
|
expect(() => applyBearingRule(rec, 'slopePct', 60)).toThrow('받침높이');
|
||||||
expect(() => applyBearingRule(rec, 'kind', ' ')).toThrow('받침 종류');
|
|
||||||
expect(() => checkStoredAbutments([edited])).not.toThrow();
|
expect(() => checkStoredAbutments([edited])).not.toThrow();
|
||||||
expect(() => checkStoredAbutments([{ ...edited, bearingRule: { lengthMm: 'x' } }])).toThrow('받침 규칙');
|
expect(() => checkStoredAbutments([{ ...edited, bearingRule: { lengthMm: 'x' } }])).toThrow('받침 규칙');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user