fix(B07 표준도): 노선 저장값 일치
B06 계산과 같은 횡단경사 하한을 사용하고, 그리는 노선의 저장값을 도면과 지문에 함께 적용.
This commit is contained in:
@@ -141,7 +141,7 @@ def _section_geometry(values: dict[str, Any]) -> dict[str, Any]:
|
||||
bottom_width = _number(ditch.get("bottom_width_m"), 0.3)
|
||||
depth = _number(ditch.get("depth_m"), 0.3)
|
||||
slope = values.get("cross_slope_pct") if isinstance(values.get("cross_slope_pct"), dict) else {}
|
||||
cross_pct = _number(slope.get("max"), _number(slope.get("min"), 3.0))
|
||||
cross_pct = _number(slope.get("min"), _number(slope.get("max"), 3.0))
|
||||
cut_ratio = _number(values.get("cut_slope_ratio"), 1.0)
|
||||
fill_ratio = _number(values.get("fill_slope_ratio"), 1.2)
|
||||
|
||||
|
||||
@@ -359,7 +359,7 @@ async def get_design_drawing(
|
||||
source_design = ((section or {}).get("data") or {}).get("mass_haul")
|
||||
elif drawing_id == CROSS_STANDARD_ID:
|
||||
# 표준 횡단면도는 B06 「표준 횡단면 설정」 저장값으로 그린다(없으면 config 기본값).
|
||||
source_design = await standard_cross_source(project_id)
|
||||
source_design = await standard_cross_source(project_id, route_id)
|
||||
elif DEVELOPMENT_ID.fullmatch(drawing_id):
|
||||
# 전개도 — 추가 흙막이 단 수 · 포장 빈 폭을 측점별 설계에서 읽음(377)
|
||||
source_design = await _designs_by_chainage(route_id)
|
||||
|
||||
@@ -354,22 +354,18 @@ async def plan_copy_key(
|
||||
return prints[drawing_id]["fingerprint"]
|
||||
|
||||
|
||||
async def standard_cross_source(project_id: UUID) -> Any:
|
||||
"""표준 횡단면 설정(B06) — GET 과 지문이 같은 값을 씀."""
|
||||
from B06_Section.B06_Section_Repository import get_project_standard_cross_section
|
||||
async def standard_cross_source(project_id: UUID, route_id: int) -> Any:
|
||||
"""그리는 노선의 표준 횡단면 설정(B06) — GET 과 지문이 같은 값을 씀."""
|
||||
from B06_Section.B06_Section_Repository import get_longitudinal_section
|
||||
from config.config_db import get_db_pool
|
||||
|
||||
pool = get_db_pool()
|
||||
async with pool.acquire() as connection:
|
||||
async with connection.cursor() as cursor:
|
||||
await cursor.execute(
|
||||
"SELECT company_id FROM projects WHERE id = %s AND deleted_at IS NULL",
|
||||
(str(project_id),),
|
||||
)
|
||||
row = await cursor.fetchone()
|
||||
if not row:
|
||||
return None
|
||||
return await get_project_standard_cross_section(connection, int(row[0]), project_id)
|
||||
section = await get_longitudinal_section(connection, project_id, route_id)
|
||||
data = (section or {}).get("data") or {}
|
||||
options = data.get("options") if isinstance(data, dict) else None
|
||||
standard = options.get("standard_cross_section") if isinstance(options, dict) else None
|
||||
return standard if isinstance(standard, dict) else None
|
||||
|
||||
|
||||
async def drawing_fingerprints(
|
||||
@@ -424,7 +420,7 @@ async def drawing_fingerprints(
|
||||
|
||||
async def read_standard() -> None:
|
||||
if _STANDARD_ID in ids:
|
||||
sources["standard"] = await standard_cross_source(project_id)
|
||||
sources["standard"] = await standard_cross_source(project_id, route_id)
|
||||
|
||||
async def read_cross() -> None:
|
||||
if not has_sheet:
|
||||
|
||||
Reference in New Issue
Block a user