fix(B06): 단면 유형 없는 옛 설계 기본값 = 상단측 깎기 하나 (PLAN 472-8 ① · 요구 409)
- 브라우저 다시 셈(Cross_Refresh_Calc) · 묶음 cross 단계(Cross_Stage) 의 좌 깎기 고정 폴백 걷음 · cross 단계는 이미 있는 uphillSide(Pipeline_Detail) 다시 씀 - 서버 [저장] 두 길도 같은 규칙 — 파이썬 stored_section_mode(Router_Design 셋 · SampleExtend) · Node Cross_Save storedOptions · Node 에 측점 uphill_side 넘김(Server_Calc_Prebuild) · 화면만 상단측이면 [저장] 뒤 좌 깎기로 뒤집혀 같이 고침 - 값 바뀜 = section_mode 없는 설계뿐(지금 DB 16 측점 · 한 프로젝트) · 그 밖 0 차 - 거울 시험 test_472_8_section_mode_default(파이썬 = Node = 브라우저 · 없음 = 상단측 적음) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -127,6 +127,7 @@ def extend_unclosed_sections(
|
||||
ford_surface_drops,
|
||||
stored_berm,
|
||||
stored_cut_slope,
|
||||
stored_section_mode,
|
||||
)
|
||||
from common_util.common_util_route_profile import design_elevation_from_longitudinal
|
||||
from config.config_system import STANDARD_ROCK_BOUNDARY_DEFAULT_OFFSET_M
|
||||
@@ -146,7 +147,7 @@ def extend_unclosed_sections(
|
||||
elevation = design_elevation_from_longitudinal(longitudinal, chainage)
|
||||
options = dict(
|
||||
ground_type=str(design.get("ground_type") or "ripping_rock"),
|
||||
section_mode=str(design.get("section_mode") or "left_cut"),
|
||||
section_mode=stored_section_mode(design, section),
|
||||
ditch_side=design.get("ditch_side"),
|
||||
ditch_type=str(design.get("ditch_type") or "standard"),
|
||||
paved=bool(design.get("paved", False)),
|
||||
|
||||
@@ -179,7 +179,7 @@ def enforce_pavement_ranges(
|
||||
try:
|
||||
options = dict(
|
||||
ground_type=str(design.get("ground_type") or "ripping_rock"),
|
||||
section_mode=str(design.get("section_mode") or "left_cut"),
|
||||
section_mode=stored_section_mode(design, section),
|
||||
ditch_side=design.get("ditch_side"),
|
||||
ditch_type=str(design.get("ditch_type") or "standard"),
|
||||
paved=wanted,
|
||||
@@ -230,7 +230,7 @@ def enforce_design_lines(
|
||||
try:
|
||||
options = dict(
|
||||
ground_type=str(design.get("ground_type") or "ripping_rock"),
|
||||
section_mode=str(design.get("section_mode") or "left_cut"),
|
||||
section_mode=stored_section_mode(design, section),
|
||||
ditch_side=design.get("ditch_side"),
|
||||
ditch_type=str(design.get("ditch_type") or "standard"),
|
||||
paved=bool(design.get("paved", False)),
|
||||
@@ -280,7 +280,7 @@ def enforce_ford_surface_drops(
|
||||
try:
|
||||
options = dict(
|
||||
ground_type=str(design.get("ground_type") or "ripping_rock"),
|
||||
section_mode=str(design.get("section_mode") or "left_cut"),
|
||||
section_mode=stored_section_mode(design, section),
|
||||
ditch_side=design.get("ditch_side"),
|
||||
ditch_type=str(design.get("ditch_type") or "standard"),
|
||||
paved=bool(design.get("paved", False)),
|
||||
@@ -395,6 +395,16 @@ def attach_default_designs(
|
||||
section["design"] = design
|
||||
|
||||
|
||||
def stored_section_mode(stored: dict[str, Any], section: dict[str, Any]) -> str:
|
||||
"""저장분 단면 유형 — 없으면(옛 설계) 상단측 깎기(지형이 정함 · 요구 409) · 상단측 모르면 좌.
|
||||
|
||||
짝: TS `B06_Section_Cross_Save` storedOptions · `B06_Section_Cross_Refresh_Calc` ·
|
||||
`B06_Section_Cross_Stage`(`uphillSide`) · 거울 시험 `test_472_8_section_mode_default.py`.
|
||||
"""
|
||||
side = section.get("uphill_side")
|
||||
return str(stored.get("section_mode") or f"{side if side in ('left', 'right') else 'left'}_cut")
|
||||
|
||||
|
||||
def stored_cut_slope(stored: dict[str, Any]) -> float | None:
|
||||
"""저장분에 남은 측점별 암 절토 경사비 — 없거나 0(표준값으로 되돌림)이면 None.
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ def _enforce_on_node(
|
||||
from common_util.common_util_json import atomic_write_json
|
||||
from config.config_system import STANDARD_ROCK_BOUNDARY_DEFAULT_OFFSET_M
|
||||
|
||||
keys = ("chainage_m", "design", "samples", "frame", *CURVE_KEYS)
|
||||
keys = ("chainage_m", "design", "samples", "frame", "uphill_side", *CURVE_KEYS)
|
||||
profiles = longitudinal.get("design_profiles") or []
|
||||
results = run_calc(
|
||||
["cross.enforce"],
|
||||
|
||||
@@ -209,9 +209,12 @@ export function refreshDesigns(
|
||||
groundType:
|
||||
choice?.ground_type ??
|
||||
(typeof design.ground_type === "string" ? design.ground_type : "ripping_rock"),
|
||||
// 없으면(옛 설계) 상단측 깎기 · 모르면 좌(요구 409 · 서버 `stored_section_mode` 짝)
|
||||
sectionMode:
|
||||
choice?.section_mode ??
|
||||
(typeof design.section_mode === "string" ? design.section_mode : "left_cut"),
|
||||
(typeof design.section_mode === "string" && design.section_mode
|
||||
? design.section_mode
|
||||
: `${section.uphill_side === "right" ? "right" : "left"}_cut`),
|
||||
ditchSide:
|
||||
choice?.ditch_side ?? (typeof design.ditch_side === "string" ? design.ditch_side : null),
|
||||
// 저장분은 측구가 없으면 `ditch_type: null` 이다 — 서버와 같이 기본형으로 되돌린다.
|
||||
|
||||
@@ -165,7 +165,10 @@ export function elevationAt(
|
||||
function storedOptions(design: Raw, section: Raw, rockDefaultM: number): Raw {
|
||||
return {
|
||||
ground_type: String(design.ground_type || "ripping_rock"),
|
||||
section_mode: String(design.section_mode || "left_cut"),
|
||||
// 없으면(옛 설계) 상단측 깎기 · 모르면 좌(요구 409 · 파이썬 `stored_section_mode`)
|
||||
section_mode: String(
|
||||
design.section_mode || `${section.uphill_side === "right" ? "right" : "left"}_cut`,
|
||||
),
|
||||
ditch_side: design.ditch_side ?? null,
|
||||
ditch_type: String(design.ditch_type || "standard"),
|
||||
paved: Boolean(design.paved),
|
||||
@@ -190,6 +193,7 @@ export interface SaveSection {
|
||||
plan_radius_m?: number | null;
|
||||
curve_outer_side?: string | null;
|
||||
curve_widening_m?: number | null;
|
||||
uphill_side?: "left" | "right" | null;
|
||||
}
|
||||
|
||||
export interface SaveCrossInput {
|
||||
|
||||
@@ -29,10 +29,11 @@ import { extendUnclosed } from "../../B05_Profile/logic/B05_Profile_Sections_Gro
|
||||
import type { DtmGrid } from "@util/common_util_surface_sampler";
|
||||
import type { CulvertPipePoint } from "@util/common_util_culvert_sets";
|
||||
import { facilityAt, facilityRanges, type FacilityStructure } from "./B06_Section_Cross_Enforce";
|
||||
import { uphillSide } from "../../B05_Profile/logic/B05_Profile_Pipeline_Detail";
|
||||
|
||||
export { groundSamples };
|
||||
|
||||
/** 측점 하나의 횡단 입력 — 비면 기본(지반 리핑암 · 좌절토 · 표준 측구 · 표준 경사). 확폭은 측점(stations)이 줌. */
|
||||
/** 측점 하나의 횡단 입력 — 비면 기본(지반 리핑암 · 상단측 절토 · 표준 측구 · 표준 경사). 확폭은 측점(stations)이 줌. */
|
||||
export type CrossStationInput = Partial<
|
||||
Omit<CrossDesignOptions, "standard" | "planRadiusM" | "curveOuterSide" | "curveWideningM">
|
||||
>;
|
||||
@@ -53,7 +54,7 @@ function optionsFor(
|
||||
): CrossDesignOptions {
|
||||
return {
|
||||
groundType: "ripping_rock",
|
||||
sectionMode: "left_cut",
|
||||
sectionMode: `${uphillSide(station) ?? "left"}_cut`, // 상단측 깎기 · 모르면 좌(요구 409)
|
||||
ditchType: "standard",
|
||||
...input,
|
||||
standard,
|
||||
|
||||
Reference in New Issue
Block a user