feat(ground): 하상 selectable; 설계홍수위 and 세굴 깊이 for 하상
- shape-options: a per-option "confirmed" flag; 하상 is confirmed, 해상 is not. - The 위치 chips store the choice in the pier's draft; 선택 shows it. - 하상: the groundwater inputs give way to 설계홍수위 DHWL (floodLevelEl) and 세굴 깊이 (scourDepthM). The groundwater value is kept (남겨두기). - Checks: G07 DHWL missing, G08 DHWL below the 지반고, G09 scour negative or the scour line below the footing bottom. The groundwater check is skipped for 하상. - Section: the DHWL as a solid line and the 세굴선 dashed. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7b5517e312
commit
26a5aff517
9 files changed
+163
-45
No files matched your search
@@ -171,3 +171,48 @@ describe('N값 입력 (승인 2026-10-26: 글자 입력, 타수/관입량 mm)',
|
||||
expect(() => parseProject(text)).toThrow('지층 행 형식');
|
||||
});
|
||||
});
|
||||
|
||||
describe('하상 (승인 2026-10-26: 설계홍수위 DHWL, 세굴 깊이)', () => {
|
||||
const river = { groundPosition: '하상' as const };
|
||||
|
||||
it('G07: a 하상 without the DHWL', () => {
|
||||
expect(ground(withGround({ ...river }))).toEqual(['G07']);
|
||||
});
|
||||
|
||||
it('G08: a DHWL below the 지반고', () => {
|
||||
expect(ground(withGround({ ...river, floodLevelEl: 28 }))).toEqual(['G08']);
|
||||
});
|
||||
|
||||
it('a DHWL above the 지반고 passes', () => {
|
||||
expect(ground(withGround({ ...river, floodLevelEl: 30 }))).toEqual([]);
|
||||
});
|
||||
|
||||
it('G09: a negative scour depth, or a scour line below the footing bottom', () => {
|
||||
expect(ground(withGround({ ...river, floodLevelEl: 30, scourDepthM: -1 }))).toEqual(['G09']);
|
||||
// 28.931 − 3 = 25.931 is below the footing bottom 26.208; 28.931 − 1 = 27.931 is above it
|
||||
expect(ground(withGround({ ...river, floodLevelEl: 30, scourDepthM: 3 }))).toEqual(['G09']);
|
||||
expect(ground(withGround({ ...river, floodLevelEl: 30, scourDepthM: 1 }))).toEqual([]);
|
||||
});
|
||||
|
||||
it('the groundwater check does not apply to a 하상, so a high groundwater value is ignored there', () => {
|
||||
expect(ground(withGround({ ...river, floodLevelEl: 30, groundWaterOn: true, groundWaterEl: 99 }))).toEqual([]);
|
||||
});
|
||||
|
||||
it('the 설계홍수위 is kept when the position is changed back to 육상 (남겨두기)', () => {
|
||||
const input = withGround({ ...river, floodLevelEl: 30 });
|
||||
const back = { ...input, groundPosition: '육상' as const };
|
||||
expect(back.floodLevelEl).toBe(30);
|
||||
});
|
||||
|
||||
it('the copy item carries the 설계홍수위 with the position', () => {
|
||||
expect(COPY_ITEMS['ground-position'].keys).toContain('floodLevelEl');
|
||||
});
|
||||
|
||||
it('the section draws the 설계홍수위 and the 세굴선, and no groundwater label', () => {
|
||||
const model = buildPier(base);
|
||||
const svg = groundSectionSvg(withGround({ ...river, floodLevelEl: 30, scourDepthM: 1, groundWaterOn: true, groundWaterEl: 25 }), model);
|
||||
expect(svg).toContain('설계홍수위 DHWL 30.000');
|
||||
expect(svg).toContain('세굴선 27.931');
|
||||
expect(svg).not.toContain('지하수위 25');
|
||||
});
|
||||
});
|
||||
@@ -16,11 +16,11 @@ describe('형상 선택지 (spec §5.2, plan C5)', () => {
|
||||
expect(defaultSummary('ground')).toBe('육상');
|
||||
});
|
||||
|
||||
it('only defaults are selectable; every other option is refused with the reason', () => {
|
||||
it('defaults and confirmed options are selectable (하상, 승인 2026-10-26); every other option is refused with the reason', () => {
|
||||
for (const m of MEMBERS) {
|
||||
SHAPE_GROUPS[m].forEach((g, gi) => {
|
||||
for (const o of g.options) {
|
||||
if (o.isDefault) {
|
||||
if (o.isDefault || o.confirmed) {
|
||||
expect(choose(m, gi, o.label)).toBe(o.label);
|
||||
} else {
|
||||
expect(isSelectable(o)).toBe(false);
|
||||
@@ -35,3 +35,9 @@ describe('형상 선택지 (spec §5.2, plan C5)', () => {
|
||||
expect(() => choose('coping', 0, '없는선택')).toThrow('알 수 없는');
|
||||
});
|
||||
});
|
||||
|
||||
it('하상 is the only confirmed ground option; 해상 stays refused until its rule is confirmed', () => {
|
||||
const ground = SHAPE_GROUPS.ground[0].options;
|
||||
expect(ground.find((o) => o.label === '하상')!.confirmed).toBe(true);
|
||||
expect(() => choose('ground', 0, '해상')).toThrow('규칙 미정');
|
||||
});
|
||||
Reference in new issue
Block a user