fix(467 덧 새 측점 계획고): 짝 없는 새 측점(구조물 · 추가 측점 · 새 관)엔 계획선 꼭짓점을 안 세움 — [저장]으로 계획고가 지반고로 바뀌던 흠
- 파이썬 _follow_moved_stations · TS followMovedNodes(짝) — seat 기본 = 빈 목록 · 짝 있는 옮긴 관 · 구조물은 427 그대로 - 검증_sub5(계획고 = 지반고 상태) 소단 22+0 저장 = −17,595.6 → −17,499.3 이던 것 · 435 · 445 m 계획고가 지반고로 바뀜 - 시험 test_427_1(짝 없는 새 측점 = 꼭짓점 없음 · 놓기 전 계획선 높이 · TS 거울 125 · 287 그대로 통과) · test_384_3(심은 측점에 꼭짓점 없음) 고침 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -311,9 +311,9 @@ def _follow_moved_stations(
|
||||
남기면 측점선 없는 변화점이 계획선을 꺾는다(192-1 — 관 769.28 → 769.38 뒤 두 자리에
|
||||
편집이 남아 0.1m 사이 −465% 계단). 반올림 차이(0.006m 안) · 옛 소수 측점의 정수 m 맞춤
|
||||
자리(272)는 옮김. 옮긴 관 · 구조물(427 · 요구 255-2) — 짝 못 찾은 옛 측점과 새 측점이 같은
|
||||
수면 차례대로 짝 · 높이 고친 꼭짓점(`station_offsets`)은 높이째 · 편집째 옮기고, 나머지 새
|
||||
측점은 자동 계획선 규칙(원지반 지남 · `_seat_born_nodes`)으로 꼭짓점을 세움(되돌리면 처음
|
||||
값) · 짝 없는 옛 측점 꼭짓점은 지움.
|
||||
수면 차례대로 짝 · 높이 고친 꼭짓점(`station_offsets`)은 높이째 · 편집째 옮기고, 나머지 짝
|
||||
새 측점은 자동 계획선 규칙(원지반 지남 · `_seat_born_nodes`)으로 꼭짓점을 세움(되돌리면 처음
|
||||
값) · 짝 없는 새 측점은 꼭짓점 안 세움(467) · 짝 없는 옛 측점 꼭짓점은 지움.
|
||||
측점 목록이 계획선 측점 줄과 달라져도 다시 센다(272). 다시 셌으면 새 등급 요약(DB 몫)을,
|
||||
아니면 `None`.
|
||||
"""
|
||||
@@ -351,8 +351,9 @@ def _follow_moved_stations(
|
||||
)
|
||||
lost = sorted((key for key, target in moves.items() if target is None), key=float)
|
||||
offsets = (stored.get("edits") or {}).get("station_offsets") or {}
|
||||
# 꼭짓점을 새로 세울 측점 — 짝이면 높이 안 고친 것만(편집 R 은 옮김) · 짝 없으면 새 측점 전부
|
||||
seat = born
|
||||
# 꼭짓점을 새로 세울 측점 — 짝(옮긴 관 · 구조물)이면 높이 안 고친 것만(편집 R 은 옮김) · 짝 없는 새 측점은
|
||||
# 안 세움(계획선 그대로 = 브라우저가 보인 계획고 · [저장]으로 값이 안 바뀜 · 467 · 요구 272)
|
||||
seat: list[float] = []
|
||||
if lost and len(lost) == len(born):
|
||||
seat = []
|
||||
for old_key, value in zip(lost, born):
|
||||
|
||||
@@ -347,8 +347,9 @@ export function oneStationList<S extends ListedStation, P extends { chainage_m:
|
||||
* 사라진 구조물 측점(`gone`)의 계획선 꼭짓점을 새 측점(`born`)으로 옮기거나 지우고, 새로 세울 측점을 고른다 —
|
||||
* 서버 `_follow_moved_stations`(B05_Profile_Router_Confirm.py) 짝: 0.006m 안 반올림 차이 · 옛 소수 측점의
|
||||
* 정수 m 맞춤 자리(272)면 높이 그대로 옮김. 옮긴 관 · 구조물(427) — 짝 못 찾은 옛 측점과 새 측점이 같은
|
||||
* 수면 차례대로 짝 · 높이 고친 꼭짓점(`edited` = 저장 `station_offsets` 키)은 높이째 · 나머지 새 측점은
|
||||
* `seat`(세움은 부르는 쪽이 `seatBornNodes` · B05_Profile/logic/B05_Profile_Grade_Seat.ts) · 짝 없는 옛
|
||||
* 수면 차례대로 짝 · 높이 고친 꼭짓점(`edited` = 저장 `station_offsets` 키)은 높이째 · 나머지 짝 새 측점은
|
||||
* `seat`(세움은 부르는 쪽이 `seatBornNodes` · B05_Profile/logic/B05_Profile_Grade_Seat.ts) · 짝 없는 새 측점은
|
||||
* 안 세움(467) · 짝 없는 옛
|
||||
* 꼭짓점은 지움 · `held` = 옮긴 뒤 높이 고친 꼭짓점 측점(서버 옮긴 `station_offsets` 키 · 433-5).
|
||||
* 거울 시험 = `resources/tester/test_427_1_follow_seat.py`.
|
||||
*/
|
||||
@@ -370,8 +371,9 @@ export function followMovedNodes<N extends { chainage_m: number }>(
|
||||
.filter((value) => taken.every((key) => Math.abs(key - value) >= EPS))
|
||||
.sort((a, b) => a - b);
|
||||
const lost = gone.filter((old) => moves.get(old) === null).sort((a, b) => a - b);
|
||||
// 꼭짓점을 새로 세울 측점 — 짝이면 높이 안 고친 것만 · 짝 없으면 새 측점 전부
|
||||
let seat = left;
|
||||
// 꼭짓점을 새로 세울 측점 — 짝(옮긴 관 · 구조물)이면 높이 안 고친 것만 · 짝 없는 새 측점은 안 세움(계획선
|
||||
// 그대로 · [저장]으로 값이 안 바뀜 · 467)
|
||||
let seat: number[] = [];
|
||||
if (lost.length && lost.length === left.length) {
|
||||
seat = [];
|
||||
lost.forEach((old, index) => {
|
||||
|
||||
@@ -71,10 +71,9 @@ def test_저장_기준_입력이_심는_측점(planted):
|
||||
"both"
|
||||
] # 꺼진 종류도
|
||||
assert planted["noDetail"] is True # 상세 없음 = 종단도 기준
|
||||
# 저장 꼭짓점(양 끝) + 심은 측점마다 세운 꼭짓점(427 · seatBornNodes)
|
||||
born = [c for k, c in planted["both"] if k == "irregular" and 0 < c < 60]
|
||||
assert planted["pviAt"] == sorted([0, 60, *born])
|
||||
assert planted["pvi"] == 2 + len(born)
|
||||
# 저장 꼭짓점(양 끝)만 — 짝 없는 새(심은) 측점엔 꼭짓점 안 세움(계획선 그대로 · 467 · 요구 272)
|
||||
assert planted["pviAt"] == [0, 60]
|
||||
assert planted["pvi"] == 2
|
||||
|
||||
|
||||
def test_늦게_심어도_안_돎(r):
|
||||
|
||||
@@ -35,6 +35,7 @@ from B05_Profile.B05_Profile_Engine_Grade_Profile import ( # noqa: E402
|
||||
rebuild_alignment_profile,
|
||||
)
|
||||
from B05_Profile.B05_Profile_Router_Confirm import _merge_irregular_into_longitudinal # noqa: E402
|
||||
from common_util.common_util_route_profile import design_elevation_from_longitudinal # noqa: E402
|
||||
|
||||
REL = "B06_Section/longitudinal/longitudinal.json"
|
||||
PIPE = 351.0
|
||||
@@ -147,15 +148,20 @@ def test_높이_고친_꼭짓점은_높이째_옮김(tmp_path: Path) -> None:
|
||||
assert after[at] == pytest.approx(value, abs=1e-6), at
|
||||
|
||||
|
||||
def test_짝_없는_새_측점도_세우고_옛_꼭짓점은_지움(tmp_path: Path) -> None:
|
||||
"""관 하나 지우고 둘 놓음(수가 다름) — 새 측점 둘 다 원지반 지남 · 옛 편집 지움."""
|
||||
_write(tmp_path, _longitudinal({"351.000": 0.4}))
|
||||
def test_짝_없는_새_측점은_꼭짓점_안_세우고_옛_꼭짓점은_지움(tmp_path: Path) -> None:
|
||||
"""관 하나 지우고 둘 놓음(수가 다름) — 새 측점 둘 = 꼭짓점 안 세움 · 계획고 = 놓기 전 계획선 높이
|
||||
(브라우저가 보인 값 · [저장]으로 안 바뀜 · 467 · 요구 272) · 옛 편집 지움."""
|
||||
before = _longitudinal({"351.000": 0.4})
|
||||
_write(tmp_path, before)
|
||||
after = _move(tmp_path, 125.0, 287.0)
|
||||
rows = _rows(after, 0, 400)
|
||||
assert PIPE not in rows
|
||||
assert after["profile_alignment"]["edits"]["station_offsets"] == {}
|
||||
nodes = [float(n["chainage_m"]) for n in after["profile_alignment"]["base_pvi"]]
|
||||
for at in (125.0, 287.0):
|
||||
assert rows[at] == pytest.approx(_ground(at), abs=1e-4)
|
||||
assert all(abs(at - s) > 0.006 for s in nodes) # 꼭짓점 없음
|
||||
assert rows[at] == pytest.approx(design_elevation_from_longitudinal(before, at), abs=1e-3)
|
||||
assert abs(rows[at] - _ground(at)) > 1e-3 # 원지반으로 안 내려앉음
|
||||
|
||||
|
||||
def _ts(tmp_path: Path, cases: list[dict]) -> list[list[dict]]:
|
||||
|
||||
Reference in New Issue
Block a user