diff --git a/src/core/copy-targets.ts b/src/core/copy-targets.ts index 7400dbb..b73103b 100644 --- a/src/core/copy-targets.ts +++ b/src/core/copy-targets.ts @@ -34,7 +34,7 @@ export function selectedTargets(piers: CopyCandidate[], sourceName: string, same /** 부재 → 복사 항목. A member with no copy items (기둥, 받침) copies nothing yet. */ export const MEMBER_COPY_ITEMS: Record = { bearing: [], - coping: ['coping-width', 'coping-length'], + coping: ['coping-width', 'coping-length', 'coping-h1', 'coping-h2', 'level-width'], column: [], footing: ['pile-length', 'pile-rows'], ground: ['ground-position'], diff --git a/src/core/copy.ts b/src/core/copy.ts index d432c26..8109146 100644 --- a/src/core/copy.ts +++ b/src/core/copy.ts @@ -5,7 +5,7 @@ import type { PierInput } from './types'; * 속성 복사 (spec §9 · plan C7). Copies chosen attributes from one pier to others. * Values the spec never copies (coordinates, IP, elevations, names) are not in any item, so they cannot be copied. */ -export type CopyItem = 'coping-width' | 'coping-length' | 'pile-length' | 'pile-rows' | 'ground-position'; +export type CopyItem = 'coping-width' | 'coping-length' | 'coping-h1' | 'coping-h2' | 'level-width' | 'pile-length' | 'pile-rows' | 'ground-position'; interface ItemRule { label: string; @@ -19,6 +19,9 @@ interface ItemRule { export const COPY_ITEMS: Record = { 'coping-width': { label: '코핑 폭', keys: ['copingWidthMm'], defaultOn: true, pileItem: false }, 'coping-length': { label: '코핑 길이 L', keys: ['copingLengthMm'], defaultOn: false, pileItem: false }, + 'coping-h1': { label: '끝단 높이 h1', keys: ['copingH1Mm'], defaultOn: false, pileItem: false }, + 'coping-h2': { label: '테이퍼 높이 h2', keys: ['copingH2Mm'], defaultOn: false, pileItem: false }, + 'level-width': { label: 'Level 폭', keys: ['levelWidthMm'], defaultOn: false, pileItem: false }, 'pile-length': { label: '말뚝 길이', keys: ['pileLengthMm'], defaultOn: false, pileItem: true }, 'pile-rows': { label: '열별 본수', keys: ['pileRows'], defaultOn: false, pileItem: true }, 'ground-position': { label: '지반 위치·지하수위', keys: ['groundPosition', 'groundWaterOn', 'groundWaterEl', 'floodLevelEl', 'highWaterEl', 'lowWaterEl'], defaultOn: false, pileItem: false }, diff --git a/tests/copy-targets.test.ts b/tests/copy-targets.test.ts index 8b5960d..75d1279 100644 --- a/tests/copy-targets.test.ts +++ b/tests/copy-targets.test.ts @@ -43,7 +43,7 @@ describe('selectedTargets (선택한 대상만)', () => { describe('copyItemsFor (부재 선택에 해당하는 복사 항목)', () => { it('coping copies only the coping items', () => { - expect(copyItemsFor('coping')).toEqual(['coping-width', 'coping-length']); + expect(copyItemsFor('coping')).toEqual(['coping-width', 'coping-length', 'coping-h1', 'coping-h2', 'level-width']); }); it('확대기초 · 말뚝 copies only the pile items', () => { @@ -61,7 +61,7 @@ describe('copyItemsFor (부재 선택에 해당하는 복사 항목)', () => { it('every copy item belongs to exactly one member', () => { const all = (['bearing', 'coping', 'column', 'footing', 'ground'] as const).flatMap((m) => copyItemsFor(m)); - expect([...all].sort()).toEqual(['coping-length', 'coping-width', 'ground-position', 'pile-length', 'pile-rows']); + expect([...all].sort()).toEqual(['coping-h1', 'coping-h2', 'coping-length', 'coping-width', 'ground-position', 'level-width', 'pile-length', 'pile-rows']); }); }); @@ -81,6 +81,10 @@ describe('copyItemsWithOverrides (기준 교각에서 되돌리기가 표시된 expect(copyItemsWithOverrides(source({ pileLengthMm: base.pileLengthMm + 100 }))).toEqual(['pile-length']); }); + it('selects the coping h1, h2 and Level 폭 items when those values changed', () => { + expect(copyItemsWithOverrides(source({ copingH1Mm: base.copingH1Mm + 1, levelWidthMm: base.levelWidthMm + 1 }))).toEqual(['coping-h1', 'level-width']); + }); + it('ignores a changed value that no copy item carries (groundEl)', () => { expect(copyItemsWithOverrides(source({ groundEl: base.groundEl + 0.5 }))).toEqual([]); });