[FIX] Export: ZUORDNUNG-Attribut vor BBox-Suche bei Separator/Scanner
Separatoren an einer Kreisel-Kreisel-Weiche ragen mit Toleranz in die Box beider Kreisel; compute_kreisel_umlauf/compute_sensor_zuordnung nahmen den ersten Treffer (test_system: Separator 0018 an Kreisel 0006 statt 0005, 0015 an 0003 statt 0002). Das ZUORDNUNG-Attribut aus count_sep_scan hat jetzt Vorrang, sofern es einen vorhandenen Carrier nennt; die Haelfte L/R wird weiter per BBox bestimmt, ohne Attribut bleibt die BBox-Suche. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -255,6 +255,14 @@ def build_sensor_merkmale(block):
|
||||
}
|
||||
|
||||
|
||||
def _sensor_zuordnung_attr(block):
|
||||
"""Carrier-ID (Kreisel/GF/VF-TeileId) eines Separator-/Scanner-Blocks aus
|
||||
der Zeichnung: zuordnung_fix (verpackte Kopie, siehe build_sensor_
|
||||
merkmale) vor dem ZUORDNUNG-Attribut. "" wenn nichts gesetzt ist."""
|
||||
return (block.get("zuordnung_fix")
|
||||
or block.get("attribs", {}).get("ZUORDNUNG", "") or "").strip()
|
||||
|
||||
|
||||
def build_element_merkmale(block):
|
||||
"""Merkmale-Dict fuer eine ausgepackte VF_n/GF_n-Sub-Komponente (Bogen/
|
||||
Streckenelement/Umlenkstation/Motorstation) - siehe csv:element-proxies-
|
||||
@@ -1341,6 +1349,11 @@ def process_blocks(blocks, lookup, dbg=None, lisp_weichen=None):
|
||||
# Zuordnung, die compute_sensor_zuordnung unten nicht
|
||||
# ueberschreiben darf - siehe build_sensor_merkmale.
|
||||
"_zuordnung_fix": bool(block.get("zuordnung_fix")),
|
||||
# Privates Feld: Carrier-ID aus der Zeichnung (zuordnung_fix
|
||||
# bzw. ZUORDNUNG-Attribut, von cs-zuordnung-lauf in
|
||||
# Lisp/count_sep_scan.lsp gepflegt) - hat in compute_sensor_
|
||||
# zuordnung/compute_kreisel_umlauf Vorrang vor der BBox-Suche.
|
||||
"_zuordnung_attr": _sensor_zuordnung_attr(block),
|
||||
# Roher INSERT-Punkt (nicht der bbox-Mittelpunkt) - dient
|
||||
# map_sepliste_kette_items als Koordinaten-FALLBACK, falls der
|
||||
# sepliste-Eintrag (noch) kein "id"-Feld traegt (Altbestand;
|
||||
@@ -1368,6 +1381,7 @@ def process_blocks(blocks, lookup, dbg=None, lisp_weichen=None):
|
||||
# sammelt - csv:block-to-json (export.lsp) haengt den Text als
|
||||
# "warnung"-Feld an den betroffenen Scanner-Block im JSON an.
|
||||
"warnung": block.get("warnung", ""),
|
||||
"_zuordnung_attr": _sensor_zuordnung_attr(block),
|
||||
**bbox_columns(block),
|
||||
})
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user