- 짝 `common_util_structure_attach.ts` attachShapes ↔ `B06_Section_Engine_Attach.py` attach_shapes — 열쇠 걷고 관 세트 → 벽 → 포장 → 맹암거 → 빈칸 경고(측점 계획 자리 · 「옹벽 높이」 · 「배관 관경」 · 「맹암거 암거 높이」 · 「물넘이포장 월류 높이」) - 서버 `_read_section_detail` · 재생성 응답 = attach_saved_shapes 하나 · 화면 `withDraftShapes`(현황 = 초안 ?? 저장분 · 초안 없어지면 저장분으로 한 번) — decorate 관 세트 · withDraftPipeKinds · 맹암거 · 포장 · 벽 블록 걷음 · 구조물 초안 없을 때 미리 뜬 횡단에 포장 · 벽 · 맹암거 빠지던 것 · 반폭 넓힘 뒤 날 상세(초안 빠짐) 고침 - 파이썬 얹기 = 목록 함수(culvert_sets_from · attach_culvert_specs · wall_specs_from · attach_wall_specs · underdrains_from · attach_underdrain_specs) + 옛 파일 함수는 감쌈 - 3D 지문 = SHAPE_KEYS(`common_util_structure_shape_keys.ts`) + 조작값 통째(손 해시 걷음 · 벽 기초 · 단 · 포장 · 맹암거 빠짐) · C군 벽 = 기준 측점과 가장 가까운 측점에서만 시작 ~ 끝 스윕(`wallSweepAt`) - 소단 = 표 형상 berm(BERM_TYPE_ID 걷음 · 화면 isBermType · 서버 catalog_row) - 시험: test_323_4_attach_mirror(42종 + 빈칸 · 서버 = 화면 · 옛 자리 걷힘 · 벽 한 번 · 지문) · 전수 표 ★ 둘(물넘이포장 걸친 격자 100 = 서버와 같음 · STAGE 4) · 옛 도움 파일 = 측점 → 형상 차례 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ji4nuyLVHcxrXWHTdb5nRD
51 lines
2.1 KiB
JavaScript
51 lines
2.1 KiB
JavaScript
/* 횡단 보기 반폭 [적용](PLAN 173-6) 단위검증 헬퍼 — `createSampleWidener` 를 그 자리에서 트랜스파일해 돌린다.
|
|
* 보유 샘플(20 m) 안 요청은 재생성 없이 true · 넘는 요청만 재생성 한 번. 결과는 표준출력에 JSON 한 벌.
|
|
* 짝 = `test_173_6_half_width_apply.py`.
|
|
*/
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
const ts = require(path.join(__dirname, "..", "..", "config", "node_modules", "typescript"));
|
|
|
|
const ROOT = path.join(__dirname, "..", "..");
|
|
const calls = { regenerate: [], overlay: 0 };
|
|
const STUBS = {
|
|
"@ui/ui_template_locale": {
|
|
currentLanguageIndex: 0,
|
|
ui_locales: new Proxy({}, { get: () => [""] }),
|
|
},
|
|
"@ui/ui_template_elements": {
|
|
showLoadingOverlay: () => calls.overlay++,
|
|
hideLoadingOverlay: () => {},
|
|
showToast: () => {},
|
|
},
|
|
"./B06_Section_Api_Fetch": {
|
|
regenerateSections: async (_p, _r, width) => calls.regenerate.push(width),
|
|
},
|
|
// 다시 받기 = 공유 캐시 길(초안 측점 · 그림 자료 · 323-4)
|
|
"./B06_Section_Section_Store": { loadSectionDetail: async () => ({ cross_sections: [] }) },
|
|
};
|
|
|
|
const file = path.join(ROOT, "B06_Section", "B06_Section_UI_Page_Common.ts");
|
|
const js = ts.transpileModule(fs.readFileSync(file, "utf8"), {
|
|
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 },
|
|
}).outputText;
|
|
const box = { exports: {} };
|
|
new Function("exports", "module", "require", js)(box.exports, box, (r) => STUBS[r]);
|
|
|
|
(async () => {
|
|
let sampled = 20;
|
|
const widen = box.exports.createSampleWidener({
|
|
target: () => ({ projectId: "p", routeId: 1 }),
|
|
sampledHalfWidth: () => sampled,
|
|
applyDetail: () => (sampled = calls.regenerate.at(-1)),
|
|
});
|
|
const out = {};
|
|
out.within = [await widen(10), await widen(15), await widen(20)];
|
|
out.withinCalls = calls.regenerate.length;
|
|
out.over = await widen(25);
|
|
out.overCalls = [...calls.regenerate];
|
|
out.again = await widen(25); // 넓힌 뒤 같은 값은 재생성 없음
|
|
out.againCalls = calls.regenerate.length;
|
|
process.stdout.write(JSON.stringify(out));
|
|
})();
|