diff --git a/B05_Profile/B05_Profile_Engine_Grade_Alignment.py b/B05_Profile/B05_Profile_Engine_Grade_Alignment.py index 863e075b7..5bd1d5a71 100644 --- a/B05_Profile/B05_Profile_Engine_Grade_Alignment.py +++ b/B05_Profile/B05_Profile_Engine_Grade_Alignment.py @@ -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), ) diff --git a/B05_Profile/B05_Profile_PageSettings.py b/B05_Profile/B05_Profile_PageSettings.py index 428eb0d87..c58e610d6 100644 --- a/B05_Profile/B05_Profile_PageSettings.py +++ b/B05_Profile/B05_Profile_PageSettings.py @@ -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"]} diff --git a/B05_Profile/B05_Profile_UI_Panel_Settings.ts b/B05_Profile/B05_Profile_UI_Panel_Settings.ts index 2c1506eb3..017784cfb 100644 --- a/B05_Profile/B05_Profile_UI_Panel_Settings.ts +++ b/B05_Profile/B05_Profile_UI_Panel_Settings.ts @@ -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, diff --git a/resources/tester/test_442_2_page_settings.py b/resources/tester/test_442_2_page_settings.py index a5fb9d28e..494919197 100644 --- a/resources/tester/test_442_2_page_settings.py +++ b/resources/tester/test_442_2_page_settings.py @@ -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 # 옛 정책 = 판정 안 함 그대로