feat(abut): 받침블럭 배근 입력 저장

- AbutRecord.rebar.block (바꾼 값만), applyBlockRebar, 프로젝트 파일 검증

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-11-05 09:37:12 +09:00
1 parent a2d0d6057f
commit 5856cfb423
4 files changed
+38 -1

No files matched your search

+11
View File
@@ -13,6 +13,7 @@ import { resolveWallRebar, wallRebarIssues, type AbutWallRebarSettings } from '.
import { parapetRebarIssues, resolveParapetRebar, type AbutParapetRebarSettings } from './rebar/parapet';
import { resolveWingRebar, wingRebarIssues, type AbutWingRebarSettings } from './rebar/wing';
import { resolveSlabRebar, slabRebarIssues, type AbutSlabRebarSettings } from './rebar/slab';
import { blockRebarIssues, resolveBlockRebar, type AbutBlockSettings } from './rebar/block';
import { abutBearingRuleIssues, resolveBearingRule, type AbutBearingRule } from './bearing-table';
export type AbutEditKey = 'seatEl' | 'foundationBottomEl' | 'groundEl' | 'pileLengthMm' | 'skewDeg' | 'slopeI';
@@ -222,6 +223,16 @@ export function applySlabRebar(rec: AbutRecord, patch: Partial<AbutSlabRebarSett
return { ...rec, rebar: { ...(rec.rebar ?? {}), slab } };
}
/** Changes ③ 받침블럭 배근 values (only the changed ones are kept; undefined clears one), refused with a Korean message. */
export function applyBlockRebar(rec: AbutRecord, patch: Partial<AbutBlockSettings>): AbutRecord {
for (const v of Object.values(patch)) if (typeof v === 'number' && !Number.isFinite(v)) throw new Error('숫자를 입력하세요.');
const block: Partial<AbutBlockSettings> = { ...(rec.rebar?.block ?? {}), ...patch };
for (const key of Object.keys(block) as (keyof AbutBlockSettings)[]) if (block[key] === undefined) delete block[key];
const issues = blockRebarIssues(resolveBlockRebar(block));
if (issues.length > 0) throw new Error(issues[0]);
return { ...rec, rebar: { ...(rec.rebar ?? {}), block } };
}
/** Changes one 접속슬래브 dim, refused with a Korean message when the slab would not build. */
export function applySlabEdit(rec: AbutRecord, key: (typeof SLAB_EDIT_FIELDS)[number]['key'], value: number): AbutRecord {
if (!Number.isFinite(value)) throw new Error('숫자를 입력하세요.');
+2 -1
View File
@@ -20,6 +20,7 @@ import type { AbutWallRebarSettings } from './rebar/wall';
import type { AbutParapetRebarSettings } from './rebar/parapet';
import type { AbutWingRebarSettings } from './rebar/wing';
import type { AbutSlabRebarSettings } from './rebar/slab';
import type { AbutBlockSettings } from './rebar/block';
type Cell = string | number | null | undefined;
type Grid = Cell[][];
@@ -71,7 +72,7 @@ export interface AbutRecord {
/** 지반·지층 입력 (② 지반·지층 카드, 교각과 같은 필드). Absent = 육상, 지하수위 없음, 지층 행 없음. */
ground?: AbutGround;
/** ③ 배근 입력 (부재별, 바꾼 값만). Absent = 엑셀 Abut 시트 기본값. */
rebar?: { footing?: Partial<AbutFootingRebarSettings>; wall?: Partial<AbutWallRebarSettings>; parapet?: Partial<AbutParapetRebarSettings>; wing?: Partial<AbutWingRebarSettings>; slab?: Partial<AbutSlabRebarSettings> };
rebar?: { footing?: Partial<AbutFootingRebarSettings>; wall?: Partial<AbutWallRebarSettings>; parapet?: Partial<AbutParapetRebarSettings>; wing?: Partial<AbutWingRebarSettings>; slab?: Partial<AbutSlabRebarSettings>; block?: Partial<AbutBlockSettings> };
/** 예전 "좌우 같게" 값 (2026-11-04 이전 파일). 지금은 읽기만 하고 쓰지 않는다. */
wingsLinked?: boolean;
}