- 1 가림막 저장(확정)도 도중 고침 검사 · 「저장 중 고친 값」 알림(키는 안 막음 · B07~B09 안 번짐) - 2b snapOptions 간격 = 10 만 · 옛 초안 0.1 · 1 m = null(load_station_snap_step 거울) - 3 추가 측점 = 측점 묶음 data-plus · B05 누름 · 가까이 표시가 그 속성으로 - 4d 숨은 동안 고른 카드 = 다음 다시 그림 끝에 밂 · 휠 · 누름이면 버림 - 7 pipe_calc set 다섯 = 풀개 · 횡단 · 종단 보기 onDispose - 8 저장 중 [초기화] = [저장]과 같은 알림 + 막음 · /route/reset = 프로젝트 잠금 안 - 9 isUserPick 거름 = 묶음 띄운 그 누름만 · 계산 중 새 누름 = 폄 - 시험 test_505_2_save_pick 새 · 398_1 busyPick 1 · 390_5 글 맞춤 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
54 lines
2.4 KiB
JavaScript
54 lines
2.4 KiB
JavaScript
/* PLAN 505-2 단위검증 헬퍼 — 진짜 `design_pipeline_stations.ts` snapOptions(옛 초안 간격) ·
|
|
* `design_structure_pipe_calc.ts` set 풀개(떠난 페이지를 놓음). 짝 = `test_505_2_save_pick.py`. */
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
const ts = require(path.join(__dirname, "..", "..", "config", "node_modules", "typescript"));
|
|
|
|
const ROOT = path.join(__dirname, "..", "..");
|
|
|
|
function load(rel) {
|
|
const js = ts.transpileModule(fs.readFileSync(path.join(ROOT, rel), "utf8"), {
|
|
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 },
|
|
}).outputText;
|
|
const box = { exports: {} };
|
|
new Function("exports", "module", "require", js)(box.exports, box, () => ({}));
|
|
return box.exports;
|
|
}
|
|
|
|
(async () => {
|
|
const out = {};
|
|
// 2b — 초안 간격 · 저장 간격 → 측점 셈 간격(서버 load_station_snap_step 과 같아야 함)
|
|
const { snapOptions } = load("A00_Common/design/logic/design_pipeline_stations.ts");
|
|
out.draft = [10, 0.1, 1, 20, null].map(
|
|
(step) => snapOptions({ stationSnap: true, stationSnapStep: step }, null).stationSnapStep,
|
|
);
|
|
out.saved = [10, 0.1, 1, null].map(
|
|
(step) => snapOptions(null, { station_snap: true, station_snap_step: step }).stationSnapStep,
|
|
);
|
|
out.snapKept = snapOptions({ stationSnap: true, stationSnapStep: 0.1 }, null).stationSnap;
|
|
|
|
// 7 — 풀개는 자기 값일 때만 비움
|
|
const calc = load("A00_Common/design/design_structure_pipe_calc.ts");
|
|
const opened = { a: 0, b: 0 };
|
|
const releaseA = calc.setPipeCrossOpener(async () => void (opened.a += 1));
|
|
releaseA();
|
|
await calc.setPipeExtraCount(null, 1);
|
|
out.afterRelease = opened.a; // 0 — 풀린 옛 페이지를 안 부름
|
|
const releaseA2 = calc.setPipeCrossOpener(async () => void (opened.a += 1));
|
|
calc.setPipeCrossOpener(async () => void (opened.b += 1));
|
|
releaseA2(); // 옛 것 풀개 — 새 것은 그대로
|
|
await calc.setPipeExtraCount(null, 1);
|
|
out.newKept = { ...opened };
|
|
let sunk = 0;
|
|
const releaseSink = calc.setPipeExtraCountSink(() => void (sunk += 1));
|
|
await calc.setPipeExtraCount(null, 1);
|
|
out.sinkOpened = opened.b; // sink 있으면 열지 않음 → 그대로 1
|
|
releaseSink();
|
|
await calc.setPipeExtraCount(null, 1);
|
|
out.sinkReleasedOpened = opened.b; // sink 풀림 → 새 횡단 보기를 엶 → 2
|
|
process.stdout.write(JSON.stringify(out));
|
|
})().catch((error) => {
|
|
console.error(error);
|
|
process.exit(1);
|
|
});
|