feat(plan): 날개벽 형식을 좌 · 우 1행으로 요약하고 "반대쪽에도 적용" 추가
- 선택 줄을 "날개벽 형식 좌 [일반형 · 단축형 · 없음] │ 우 [일반형 · 단축형 · 없음]" 한 줄로 합침 (작은 그림 타일). "좌우" · "편집할 측" 줄과 ① 쪽 / ⑤ 쪽 표시는 없앰 (위치는 모델창에서 확인) - 타일이나 "좌" / "우" 글자를 누르면 그 측이 편집 대상이 되고, 편집 중인 묶음은 진한 테두리로 표시. 아래 치수 입력과 측면 삽도가 그 측을 따름 - "좌우 같게" 삭제: 형식과 치수는 측별로만 저장. 예전 파일의 wingsLinked 값은 읽기만 하고 쓰지 않음 - 반대쪽에도 적용 (copyWingDims): 두께 · 끝 높이 · 헌치를 한 번 복사하고, 길이는 두 측 형식이 같을 때만 복사. 반대쪽이 없음이면 비활성 - 테스트 갱신. 전체 670건 통과, 타입 검사 · 빌드 통과. 브라우저 시각 확인은 미실시 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4ef3650454
commit
886347471e
5 files changed
+101
-75
No files matched your search
+16
-12
@@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import * as XLSX from 'xlsx';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { applyAbutEdit, applyBearingEdit, restoreAbutDefault, setWingForm, setWingsLinked, applyWingDim } from '../src/core/abut/edit';
|
||||
import { applyAbutEdit, applyBearingEdit, restoreAbutDefault, setWingForm, applyWingDim, copyWingDims } from '../src/core/abut/edit';
|
||||
import { parseAbutments } from '../src/core/abut/parse';
|
||||
|
||||
const RAG = fileURLToPath(new URL('../../../RAG/운곡교P1입력.xlsx', import.meta.url));
|
||||
@@ -25,23 +25,27 @@ describe('교대 입력 편집 (교대 편집 카드)', () => {
|
||||
expect(() => applyAbutEdit(rec, 'seatEl', rec.foundationBottomEl)).toThrow('기초 하단 EL보다 높아야');
|
||||
});
|
||||
|
||||
it('a wing form change sets both sides while 좌우 같게 (default), one side once it is off', () => {
|
||||
expect(setWingForm(rec, 'left', 'short').wings).toEqual({ left: 'short', right: 'short' });
|
||||
const apart = setWingsLinked(rec, false);
|
||||
expect(setWingForm(apart, 'left', 'short').wings).toEqual({ left: 'short', right: 'general' });
|
||||
it('a wing form change sets one side and keeps the other (좌 · 우 따로)', () => {
|
||||
expect(setWingForm(rec, 'left', 'short').wings).toEqual({ left: 'short', right: 'general' });
|
||||
expect(rec.wings).toBeUndefined();
|
||||
});
|
||||
|
||||
it('wing dims: 좌우 같게 applies to both sides, off applies to one; turning it on copies the left side', () => {
|
||||
const both = applyWingDim(rec, 'left', 'lengthMm', 6000);
|
||||
expect(both.wingDims).toEqual({ left: { lengthMm: 6000 }, right: { lengthMm: 6000 } });
|
||||
const apart = applyWingDim(setWingsLinked(rec, false), 'right', 'thicknessMm', 500);
|
||||
expect(apart.wingDims).toEqual({ left: {}, right: { thicknessMm: 500 } });
|
||||
const relinked = setWingsLinked(applyWingDim(apart, 'left', 'lengthMm', 5000), true);
|
||||
expect(relinked.wingDims).toEqual({ left: { lengthMm: 5000 }, right: { lengthMm: 5000 } });
|
||||
it('wing dims are per side; 0 thickness and a negative haunch are refused', () => {
|
||||
expect(applyWingDim(rec, 'left', 'lengthMm', 6000).wingDims).toEqual({ left: { lengthMm: 6000 } });
|
||||
expect(() => applyWingDim(rec, 'left', 'thicknessMm', 0)).toThrow('두께');
|
||||
expect(() => applyWingDim(rec, 'left', 'haunchMm', -1)).toThrow('헌치');
|
||||
});
|
||||
|
||||
it('반대쪽에도 적용: copies 두께 · 끝 높이 · 헌치 once, and the 길이 only when both forms match', () => {
|
||||
let r = applyWingDim(applyWingDim(rec, 'right', 'lengthMm', 6000), 'right', 'thicknessMm', 500);
|
||||
expect(copyWingDims(r, 'right').wingDims?.left).toEqual({ lengthMm: 6000, thicknessMm: 500 });
|
||||
r = setWingForm(r, 'left', 'short');
|
||||
expect(copyWingDims(r, 'right').wingDims?.left).toEqual({ thicknessMm: 500 }); // 형식이 달라 길이는 복사하지 않음
|
||||
expect(() => copyWingDims(setWingForm(r, 'left', 'none'), 'right')).toThrow('반대쪽');
|
||||
// one copy, no link: a later change on the right does not move the left
|
||||
const copied = copyWingDims(applyWingDim(rec, 'right', 'haunchMm', 200), 'right');
|
||||
expect(applyWingDim(copied, 'right', 'haunchMm', 250).wingDims?.left).toEqual({ haunchMm: 200 });
|
||||
});
|
||||
});
|
||||
|
||||
describe('교대 기본값 복원과 받침 편집', () => {
|
||||
|
||||
Reference in new issue
Block a user