Files
Pier_v1/src/core/changes.ts
T
ypshimandClaude Haiku 5.5 5a20a18185 feat(rebar): 확대기초 배근 입력 8개 (피복 3·여유·격자 s·s_v·e_top·n), FT01·FT02 검사
- core/rebar/footing-settings.ts: 입력 정의, 기본값(확대기초철근 (1).md), 범위(제안), 검사 (FT01 범위, FT02 n 정수)
- 확대기초 계산 함수가 설정을 인자로 받음 (기본값 = 기존 값, 기존 호출은 그대로)
- 3D 확대기초 그림의 125·100 하드코딩 제거, 철근표·3D·기둥 층 높이가 같은 설정을 씀
- 패널: 상면·측면·하면 피복을 칸 분리, s_v와 e_top 분리. 고정 규칙(k=2, Δ₂=100, 전단 4s·엇갈림 2s, cycle 교대)과
  B2·B6 디리는 읽기 전용으로 표시
- 기본값에서 P1 결과 불변 (기존 테스트 통과)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-26 16:59:08 +09:00

95 lines
4.2 KiB
TypeScript

import type { PierInput } from './types';
/**
* Inputs the user can change on the 2단계 cards (spec §5.2 · plan C2). Each one maps to a field of PierInput.
* Extend this list as more cards are enabled; the tracking below works on any of these keys.
*/
export const EDITABLE_FIELDS = [
{ key: 'copingWidthMm', label: '코핑 폭 B', unit: 'mm' },
{ key: 'copingLengthMm', label: '코핑 길이 L', unit: 'mm' },
{ key: 'columnDiameterMm', label: '기둥 직경 D', unit: 'mm' },
{ key: 'footingLengthMm', label: '확대기초 길이 L', unit: 'mm' },
{ key: 'footingWidthMm', label: '확대기초 폭 W', unit: 'mm' },
{ key: 'footingHeightMm', label: '확대기초 높이 h1', unit: 'mm' },
{ key: 'blindingMarginMm', label: '비림 여유 (한쪽)', unit: 'mm' },
{ key: 'blindingThicknessMm', label: '비림 두께', unit: 'mm' },
{ key: 'pileOuterMm', label: '말뚝 외경 D', unit: 'mm' },
{ key: 'pileThicknessMm', label: '말뚝 두께 t', unit: 'mm' },
{ key: 'copingH1Mm', label: '끝단 높이 h1', unit: 'mm' },
{ key: 'copingH2Mm', label: '테이퍼 높이 h2', unit: 'mm' },
{ key: 'levelWidthMm', label: 'Level 폭', unit: 'mm' },
{ key: 'pileLengthMm', label: '말뚝 길이', unit: 'mm' },
{ key: 'groundEl', label: '지반고 EL', unit: 'm' },
] as const;
/** Inputs tracked for overrides and pending changes: the numeric cards plus 열별 본수 (an array, compared by value). */
export const TRACKED_KEYS = [...EDITABLE_FIELDS.map((f) => f.key), 'pileRows', 'groundPosition', 'groundWaterOn', 'groundWaterEl', 'floodLevelEl', 'scourDepthM', 'highWaterEl', 'lowWaterEl', 'strataRows', 'bearingType', 'bearingLayout', 'blockRebar', 'copingRebar', 'topSplice', 'columnRebar', 'footingRebar'] as const;
export type EditableKey = (typeof TRACKED_KEYS)[number];
export const FIELD_LABELS: Record<EditableKey, string> = {
copingWidthMm: '코핑 폭 B',
copingLengthMm: '코핑 길이 L',
columnDiameterMm: '기둥 직경 D',
footingLengthMm: '확대기초 길이 L',
footingWidthMm: '확대기초 폭 W',
footingHeightMm: '확대기초 높이 h1',
blindingMarginMm: '비림 여유 (한쪽)',
blindingThicknessMm: '비림 두께',
pileOuterMm: '말뚝 외경 D',
pileThicknessMm: '말뚝 두께 t',
copingH1Mm: '끝단 높이 h1',
copingH2Mm: '테이퍼 높이 h2',
levelWidthMm: 'Level 폭',
pileLengthMm: '말뚝 길이',
groundEl: '지반고 EL',
pileRows: '열별 본수',
groundPosition: '지반 위치',
groundWaterOn: '지하수위 고려',
groundWaterEl: '지하수위 EL',
floodLevelEl: '설계홍수위 DHWL',
scourDepthM: '세굴 깊이',
highWaterEl: '고조위 HWL',
lowWaterEl: '저조위 LWL',
bearingType: '받침 종류·용량',
bearingLayout: '받침 배치',
blockRebar: '받침블럭 철근 설정',
copingRebar: '코핑 배근 입력',
topSplice: '상면 주철근 이음',
columnRebar: '기둥 배근 입력',
footingRebar: '확대기초 배근 입력',
strataRows: '지층 행',
};
/** Keys whose values differ between two inputs. Arrays are compared by value. */
export function changedKeys(a: PierInput, b: PierInput): EditableKey[] {
return TRACKED_KEYS.filter((key) => JSON.stringify(a[key]) !== JSON.stringify(b[key]));
}
/**
* The three values a pier carries while it is edited (spec §5.5, plan B1):
* - defaults: the values as imported from the sheet (기본값, shown as "기본 3100").
* - input: the values the 3D model was generated from (생성본).
* - draft: the values the user currently has in the cards (현재 입력).
*/
export interface PierValues {
defaults: PierInput;
input: PierInput;
draft: PierInput;
}
/** Overrides: draft differs from the imported default (주황 표시, "변경 n건" in the card). */
export function overrideKeys(p: PierValues): EditableKey[] {
return changedKeys(p.defaults, p.draft);
}
/** Pending: draft differs from the generated model, so the 3D view is out of date (미반영 변경). */
export function pendingKeys(p: PierValues): EditableKey[] {
return changedKeys(p.input, p.draft);
}
/** Puts one field back to its imported default in the draft. */
export function revertDraft(p: PierValues, key: EditableKey): PierInput {
return { ...p.draft, [key]: p.defaults[key] };
}