feat(core,view): per-row pile counts 열별 본수 (plan C4)

- A 열 is one row across the footing width; each has its own count along the
  length. Default floor((L − 1400) / 2250) + 1 per 열, as in spec §4.6.
- Counts are validated: one per 열, whole numbers 2–30. Spacing below the
  2250 mm minimum is shown as a warning, not refused (the plan's 6본 → 5@1800
  example).
- PierInput gains an optional pileRows; absent means the defaults, so existing
  files and the P1 results are unchanged.
- Change tracking compares arrays by value; 열별 본수 can be reverted and
  copied (copy item off by default).
- The footing card has −/+ per 열 with spacing, total, and the display string.
- Tests: defaults 4열 × 5본 = 20 and the 1단계 text; 6본 → 5@1800; limits;
  model-level 21 piles.
- Not verified in a browser.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-10-22 10:34:39 +09:00
1 parent 5b162c2441
commit 17b5b24682
9 files changed
+256 -39

No files matched your search

+7 -6
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';
export type CopyItem = 'coping-width' | 'coping-length' | 'pile-length' | 'pile-rows';
interface ItemRule {
label: string;
@@ -20,14 +20,15 @@ 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 },
'pile-length': { label: '말뚝 길이', keys: ['pileLengthMm'], defaultOn: false, pileItem: true },
'pile-rows': { label: '열별 본수', keys: ['pileRows'], defaultOn: false, pileItem: true },
};
export const DEFAULT_COPY_ITEMS: CopyItem[] = (Object.keys(COPY_ITEMS) as CopyItem[]).filter((k) => COPY_ITEMS[k].defaultOn);
export interface CopyChange {
key: EditableKey;
from: number;
to: number;
from: unknown;
to: unknown;
}
export interface CopyPlan {
@@ -47,7 +48,7 @@ export function planCopy(source: PierInput, target: PierInput, items: CopyItem[]
continue;
}
for (const key of rule.keys) {
if (source[key] === target[key]) continue;
if (JSON.stringify(source[key]) === JSON.stringify(target[key])) continue;
changes.push({ key, from: target[key], to: source[key] });
}
}
@@ -56,7 +57,7 @@ export function planCopy(source: PierInput, target: PierInput, items: CopyItem[]
/** Applies a plan to a target input. Only the planned keys change. */
export function applyCopy(target: PierInput, plan: CopyPlan): PierInput {
const next = { ...target };
const next: Record<string, unknown> = { ...target };
for (const c of plan.changes) next[c.key] = c.to;
return next;
return next as unknown as PierInput;
}