feat(rebar): 코핑 배근 입력 12개 · CP01·CP02 검사 · 적용 버튼
- core/rebar/coping-settings.ts: 입력 정의, 기본값(코핑철근.md), 범위(코핑_입력범위_제안.md), 검사 함수 - 다리 수는 4·6·8 목록으로 두고 홀수는 CP02로 막음 - 값은 적용 버튼을 누를 때만 draft에 쓰고 다시 생성 (범위 밖이면 반영하지 않음) - PierInput.copingRebar, 모델 copingRebar, 변경 추적 키 추가 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ec402e22d7
commit
9c93a6aa01
6 files changed
+212
-1
No files matched your search
+81
@@ -27,6 +27,7 @@ import { blockRebarPlanSvg } from './view/block-rebar-plan-svg';
|
||||
import { copingEndStation, copingFrontSvg, copingSectionSvg } from './view/coping-rebar-svg';
|
||||
import { BLOCK_REBAR_RANGES } from './core/rebar/block-check';
|
||||
import { DEFAULT_BLOCK_REBAR, type BlockRebarSettings } from './core/rebar/bearing-block';
|
||||
import { COPING_REBAR_RANGES, copingSettingsIssues, type CopingRebarSettings, DEFAULT_COPING_REBAR } from './core/rebar/coping-settings';
|
||||
import { groundSectionSvg } from './view/ground-svg';
|
||||
import { parseBearingElevationTable, parseSolplateTable, readDxfTexts } from './core/dxf-table';
|
||||
import { columnDiameterIssues } from './core/column-check';
|
||||
@@ -1073,6 +1074,85 @@ function renderBlockRebarSettings(box: HTMLDivElement, pier: Pier): void {
|
||||
/** 코핑 배근 (승인 2026-10-26, 추천): 정면, and the 단면·폐합 at a station the user chooses (default mid-length). */
|
||||
let copingView: 'front' | 'section' = 'front';
|
||||
|
||||
/** 코핑 배근 입력 (승인 2026-10-26, 제안 = RAG/코핑_입력범위_제안.md). Order follows the ③ 코핑 배근 panel. */
|
||||
const COPING_REBAR_FIELDS: { key: keyof CopingRebarSettings; label: string }[] = [
|
||||
{ key: 'cover', label: '피복 (철근 중심, mm)' },
|
||||
{ key: 'mainSpacing', label: '주철근 기본간격 (mm)' },
|
||||
{ key: 'mainEndGap', label: '주철근 끝단 최소 여유 (mm)' },
|
||||
{ key: 'mainLayerGap', label: '상면 주철근 단 간격 (mm)' },
|
||||
{ key: 'firstShearGap', label: '첫 전단철근 최소 여유 (피복 다음, mm)' },
|
||||
{ key: 'shearLegs', label: '전단철근 다리 수' },
|
||||
{ key: 'spacingS', label: '전단철근 간격 · 경사 (mm)' },
|
||||
{ key: 'spacingL', label: '전단철근 간격 · Level (mm)' },
|
||||
{ key: 'sideSpacing', label: '측면 수평 간격 (mm)' },
|
||||
{ key: 'sideEndGap', label: '측면 위 끝 아래 최소 여유 (mm)' },
|
||||
{ key: 'c14UpperSpacing', label: 'C14 간격 위 2줄 (mm)' },
|
||||
{ key: 'c14LowerSpacing', label: 'C14 간격 아래 줄 (mm)' },
|
||||
];
|
||||
|
||||
/** 적용: the values go to the draft and the model is rebuilt only when every check passes (CP01·CP02). */
|
||||
function applyCopingRebar(name: string, next: CopingRebarSettings): void {
|
||||
const p = state.piers.find((q) => q.input.name === name);
|
||||
if (!p) return;
|
||||
p.draft = { ...p.draft, copingRebar: next };
|
||||
regenerateOne(name);
|
||||
}
|
||||
|
||||
function renderCopingSettings(box: HTMLDivElement, pier: Pier): void {
|
||||
if (!pier.model) return;
|
||||
const wrap = el('div', undefined, 'bearing-ref');
|
||||
const current: CopingRebarSettings = { ...DEFAULT_COPING_REBAR, ...pier.draft.copingRebar };
|
||||
wrap.appendChild(el('p', '코핑 배근 입력 (기본값 = 코핑철근.md · 적용을 눌러야 반영)', 'lbl'));
|
||||
const grid = el('div', undefined, 'edit-fields');
|
||||
const controls = new Map<keyof CopingRebarSettings, HTMLInputElement | HTMLSelectElement>();
|
||||
for (const f of COPING_REBAR_FIELDS) {
|
||||
const row = el('div', undefined, 'edit-row');
|
||||
const label = el('label', f.label);
|
||||
let control: HTMLInputElement | HTMLSelectElement;
|
||||
if (f.key === 'shearLegs') {
|
||||
// 다리 수는 짝수만 고르도록 목록으로 둔다 (CP02).
|
||||
const sel = el('select');
|
||||
for (const n of [4, 6, 8]) {
|
||||
const opt = el('option', String(n));
|
||||
opt.value = String(n);
|
||||
sel.appendChild(opt);
|
||||
}
|
||||
sel.value = String(current.shearLegs);
|
||||
control = sel;
|
||||
} else {
|
||||
const input = el('input');
|
||||
input.type = 'number';
|
||||
input.step = 'any';
|
||||
input.value = String(current[f.key]);
|
||||
control = input;
|
||||
}
|
||||
control.id = `coping-${f.key}`;
|
||||
label.htmlFor = control.id;
|
||||
controls.set(f.key, control);
|
||||
const [lo, hi] = COPING_REBAR_RANGES[f.key];
|
||||
const changed = current[f.key] !== DEFAULT_COPING_REBAR[f.key] ? ' · 기본과 다름' : '';
|
||||
row.append(label, control, el('span', `범위 ${lo}–${hi} · 기본 ${DEFAULT_COPING_REBAR[f.key]}${changed}`, 'muted small'));
|
||||
grid.appendChild(row);
|
||||
}
|
||||
wrap.appendChild(grid);
|
||||
const msg = el('p', undefined, 'muted small');
|
||||
const apply = el('button', '적용', 'btn small');
|
||||
apply.type = 'button';
|
||||
apply.addEventListener('click', () => {
|
||||
const next = { ...current };
|
||||
for (const f of COPING_REBAR_FIELDS) next[f.key] = Number(controls.get(f.key)?.value);
|
||||
const issues = copingSettingsIssues(next);
|
||||
if (issues.length > 0) {
|
||||
msg.textContent = issues.map((i) => i.message).join(' · ');
|
||||
setError('코핑 배근 입력을 확인하세요. 값은 반영되지 않았습니다.');
|
||||
return;
|
||||
}
|
||||
applyCopingRebar(pier.input.name, next);
|
||||
});
|
||||
wrap.append(msg, apply);
|
||||
box.appendChild(wrap);
|
||||
}
|
||||
|
||||
function renderCopingDrawings(box: HTMLDivElement, pier: Pier): void {
|
||||
if (!pier.model || !rebar3d) return;
|
||||
const L = pier.model.copingL;
|
||||
@@ -1147,6 +1227,7 @@ function renderRebar(): void {
|
||||
$('rebar-note').textContent = `${pier.input.name} · 형상 기준 계산 · 값은 기본값 기준 문서 규칙`;
|
||||
if (state.rebarMember === 'bearing') renderBlockRebarSettings(box, pier);
|
||||
if (state.rebarMember === 'coping' && rebar3d) renderCopingDrawings(box, pier);
|
||||
if (state.rebarMember === 'coping') renderCopingSettings(box, pier);
|
||||
const shown = rows.filter((r) => r.member === state.rebarMember);
|
||||
box.appendChild(rebarSelectBar(shown.map((r) => r.name)));
|
||||
const table = el('table', undefined, 'grid-table rebar-table');
|
||||
|
||||
Reference in new issue
Block a user