feat(copy): 코핑의 끝단 높이 h1, 테이퍼 높이 h2, Level 폭을 복사 항목에 추가

- COPY_ITEMS에 coping-h1, coping-h2, level-width 추가 (기본 해제)
- 코핑 부재의 복사 항목에 포함, 바뀐 값이 있으면 기본으로 체크
- 테스트 갱신 및 h1·Level 폭 기본 체크 테스트 추가

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-10-27 16:56:12 +09:00
1 parent 7314da639b
commit 5f3ea8d56f
3 files changed
+11 -4

No files matched your search

+1 -1
View File
@@ -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<MemberId, CopyItem[]> = {
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'],
+4 -1
View File
@@ -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<CopyItem, ItemRule> = {
'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 },
+6 -2
View File
@@ -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([]);
});