fix(448 B05 페이지 설정): 계획고 저장이 평면 최소 R 지우던 흠 · 시종점 칸 되돌리기 뒤 다시 비춤
- AlignmentPolicy.from_dict 가 min_plan_radius_m · hairpin_min_radius_m 을 읽음 — 계획고 저장마다 0 으로 굳던 것(브레인 지시) - 「기준값 직접 지정」을 편 동안 누름 · 키 뒤마다 시 · 종점 계획고 조정 칸을 종단 편집으로 다시 비춤(되돌리기 · 끝점 ▲▼) - 시험 test_442_2_page_settings 평면 R 유지 한 건 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -142,6 +142,12 @@ class AlignmentPolicy:
|
||||
max_grade_pct=float(payload.get("max_grade_pct") or 9.0),
|
||||
curve_skip_delta_pct=float(payload.get("curve_skip_delta_pct") or 5.0),
|
||||
paved=bool(payload.get("paved", False)),
|
||||
# 평면 R 경고 기준도 물려받음 — 빠지면 계획고 저장마다 0(판정 안 함)으로(448)
|
||||
min_plan_radius_m=float(payload.get("min_plan_radius_m") or 0.0),
|
||||
hairpin_min_radius_m=float(
|
||||
payload.get("hairpin_min_radius_m")
|
||||
or FOREST_ROAD_PROFILE_CRITERIA["hairpin_min_radius_m"]
|
||||
),
|
||||
min_vertical_radius_m=float(payload.get("min_vertical_radius_m") or 0.0),
|
||||
min_curve_length_m=float(payload.get("min_curve_length_m") or 0.0),
|
||||
)
|
||||
|
||||
@@ -102,8 +102,6 @@ def retarget_longitudinal(
|
||||
previous["criteria"] = {**options.as_dict(), "resolved_main_direction": direction}
|
||||
longitudinal["design_profiles"] = [previous, *(profiles or [])[1:]]
|
||||
alignment, profile = rebuild_alignment_profile(longitudinal, stored.get("edits"))
|
||||
# `AlignmentPolicy.from_dict` 가 평면 최소 R 을 안 읽음 — 다시 셈한 정책에 되얹음
|
||||
alignment["policy"]["min_plan_radius_m"] = policy["min_plan_radius_m"]
|
||||
longitudinal["profile_alignment"] = alignment
|
||||
longitudinal["design_profiles"][0] = profile
|
||||
return alignment, {"id": profile["id"], **profile["summary"]}
|
||||
|
||||
@@ -135,9 +135,14 @@ export function createSettingsPart(callbacks: SettingsPartCallbacks) {
|
||||
const gradeAdvanced = document.createElement("details");
|
||||
const gradeSummary = document.createElement("summary");
|
||||
gradeSummary.textContent = "기준값 직접 지정";
|
||||
// 칸을 펼 때 · 칸 위로 올 때 종단 편집을 다시 비춤(끝점 ▲▼ · 되돌리기 · [저장] 뒤)
|
||||
// 칸을 펼 때 · 펴 둔 동안 누름 · 키 뒤마다 종단 편집을 다시 비춤(끝점 ▲▼ · 되돌리기 · [저장] 뒤)
|
||||
// ponytail: 문서 듣기는 페이지마다 하나 · 떼지 않음(가벼움) — 새는 게 보이면 페이지 수명에 묶을 것
|
||||
gradeAdvanced.addEventListener("toggle", () => gradeAdvanced.open && showEndOffsets());
|
||||
gradeAdvanced.addEventListener("pointerenter", showEndOffsets);
|
||||
const refreshSoon = (): void => {
|
||||
if (gradeAdvanced.isConnected && gradeAdvanced.open) requestAnimationFrame(showEndOffsets);
|
||||
};
|
||||
document.addEventListener("pointerup", refreshSoon);
|
||||
document.addEventListener("keyup", refreshSoon);
|
||||
gradeAdvanced.append(
|
||||
gradeSummary,
|
||||
maxGradePct.wrapper,
|
||||
|
||||
@@ -394,3 +394,11 @@ def test_시작_측점은_열쇠_다른_페이지에_안_섞임():
|
||||
"B05_Profile/B05_Profile_UI_Page_Latest.ts",
|
||||
}
|
||||
assert {hit for hit in hits if not hit.startswith("resources/")} <= allowed
|
||||
|
||||
|
||||
def test_저장_정책을_다시_읽어도_평면_R_유지():
|
||||
from B05_Profile.B05_Profile_Engine_Grade_Alignment import AlignmentPolicy
|
||||
|
||||
policy = AlignmentPolicy.from_dict({"min_plan_radius_m": 30, "max_grade_pct": 8})
|
||||
assert policy.min_plan_radius_m == 30 and policy.hairpin_min_radius_m == 10
|
||||
assert AlignmentPolicy.from_dict({}).min_plan_radius_m == 0 # 옛 정책 = 판정 안 함 그대로
|
||||
|
||||
Reference in New Issue
Block a user