fix(구조물표): 323-9 ③ M02 부품 끔 막힘 안내 — 형상 부품을 꺼서 형상이 「없음」이 된 것이면 「부품 「맹암거」 끔 — 이 부품을 쓰는 종류(A 횡단배수 · 맹암거)의 횡단도를 「안 만듦」으로 바꿔야 저장」 한 줄(부품 이름 + 쓰는 종류 전부) · 막음은 그대로 · 화면 · 서버 짝
- M02_SO_Def_Check.ts ↔ M02_SO_Check.py: 부품 끄기 전 표로 끈 탓 가름 · 부품마다 한 줄 - 시험: test_322_2_check_mirror(벽 끔 = 다섯 종류 한 줄 · 맹암거 끔 = A 횡단배수 · 맹암거 · 짝 같음) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ji4nuyLVHcxrXWHTdb5nRD
This commit is contained in:
@@ -121,11 +121,17 @@ const hiddenIn = (doc: CheckDef | null, tid: string): string[] =>
|
||||
function rowErrors(doc: CheckDef, before: CheckDef | null): string[] {
|
||||
const out: string[] = [];
|
||||
const rows = resolveCatalog(doc);
|
||||
const raw = resolveCatalog({ ...doc, 부품: {} }); // 부품 끄기 전 — 끈 탓 가름(323-9)
|
||||
const offUsers = new Map<string, string[]>(); // 끈 형상 부품 → 횡단도를 바꿔야 하는 종류
|
||||
for (const t of doc.types ?? []) {
|
||||
const row = rows.get(t.type_id);
|
||||
if (!row) continue;
|
||||
if (row.shape === "none" && row.station !== "none")
|
||||
out.push(`「${row.name}」 형상이 「없음」이면 횡단도도 「안 만듦」`);
|
||||
if (row.shape === "none" && row.station !== "none") {
|
||||
const was = raw.get(t.type_id)?.shape ?? "none";
|
||||
if (was !== "none" && doc.부품?.[`형상.${was}`] === false)
|
||||
offUsers.set(was, [...(offUsers.get(was) ?? []), `${row.groupName} · ${row.name}`]);
|
||||
else out.push(`「${row.name}」 형상이 「없음」이면 횡단도도 「안 만듦」`);
|
||||
}
|
||||
// 앞 판 없음 = 새로 숨긴 것 없음 · 복사한 종류 = 본보기가 앞 판에서 숨긴 칸도 그대로(323-7)
|
||||
const kept = [t.type_id, row.base].flatMap((id) => hiddenIn(before ?? doc, id));
|
||||
const hidden = hiddenIn(doc, t.type_id).filter((key) => !kept.includes(key));
|
||||
@@ -158,6 +164,12 @@ function rowErrors(doc: CheckDef, before: CheckDef | null): string[] {
|
||||
);
|
||||
}
|
||||
}
|
||||
offUsers.forEach((names, id) =>
|
||||
out.push(
|
||||
`부품 「${shortName(partOf("형상", id)?.이름 ?? id)}」 끔 — 이 부품을 쓰는 종류(${names.join(", ")})의 ` +
|
||||
"횡단도를 「안 만듦」으로 바꿔야 저장",
|
||||
),
|
||||
);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user