This commit is contained in:
2026-07-28 16:27:36 +02:00
parent 98f1c64c3d
commit dc23a5f1a0
5 changed files with 101 additions and 0 deletions
+63
View File
@@ -188,6 +188,33 @@ def build_gerade_merkmale(block):
}
def build_sensor_merkmale(block):
"""Merkmale-Dict fuer einen eigenstaendigen Separator_SP/S-LP- oder
Scanner-Block (siehe pattern_separator/pattern_scanner in cfg/export.cfg).
Diese Bloecke haben (anders als Kreisel/GF/VF) kein ID-Attribut -
ZUORDNUNG/ARTINR/LAYER sind die einzigen ATTDEFs (siehe ils-insert-sensor/
mubea:build-separator-one)."""
attribs = block.get("attribs", {})
return {
"Zuordnung": attribs.get("ZUORDNUNG", ""),
"ARTINR": attribs.get("ARTINR", ""),
"Höhe": get_hoehe(block),
"Drehung": get_drehung(block),
}
def format_sensor_id(prefix, n):
"""Erzeugt eine laufende TeileId fuer Separator/Scanner-Zeilen im CSV-Export.
Diese Bloecke haben KEIN persistiertes ID-Attribut in der Zeichnung
(anders als Kreisel/GF/VF, deren "ID" von ssg-id-generate/ssg-id-check-all
beim Insert bzw. vor jedem Export vergeben wird) - der Praefix macht das
sichtbar: eine rein fuer diesen Exportlauf erzeugte, NICHT ueber mehrere
Exportlaeufe hinweg stabile laufende Nummer, keine echte Block-ID.
"""
return f"{prefix}-{n:04d}"
# ---------------------------------------------------------------------------
# Omniflo Sum-Zeile (Anzahl Boegen/Weichentypen, Gesamtlaenge AP110/AP60)
# ---------------------------------------------------------------------------
@@ -329,6 +356,8 @@ def process_blocks(blocks, lookup, dbg=None):
vf_count = 0
gf_count = 0
strecke_modul_count = 0
separator_count = 0
scanner_count = 0
# Zaehlung fuer die Omniflo-Sum-Zeile (nur Bogen/Weiche/Gerade)
cnt_wk = cnt_einzel = cnt_delta = cnt_doppel = cnt_stern = 0
@@ -479,6 +508,40 @@ def process_blocks(blocks, lookup, dbg=None):
})
continue
# Separator (Separator_SP/S-LP) - eigene TeileArt-Zeile mit laufender
# ID (siehe format_sensor_id; kein echtes ID-Attribut am Block, anders
# als Kreisel/GF/VF). EXPORTSIVAS schliesst denselben Blockpattern
# bewusst aus (siehe export_sivas.py) - dort zaehlt bereits
# ANZAHL_SEPARATOR am zugehoerigen Kreisel/GF/VF.
if matches_any(bname, BLOCKPATTERNS.get("pattern_separator", [])):
elem_nr += 1
separator_count += 1
items.append({
"nr": elem_nr,
"teileart": "ILS 2.0 Separator",
"teileid": format_sensor_id("SEP", separator_count),
"bezeichnung": f"Separator :{separator_count}",
"planquadrat": planquadrat_column(block, planquadrat_cfg),
"merkmale": build_sensor_merkmale(block),
**bbox_columns(block),
})
continue
# Scanner - eigene TeileArt-Zeile, sonst analog zu Separator oben.
if matches_any(bname, BLOCKPATTERNS.get("pattern_scanner", [])):
elem_nr += 1
scanner_count += 1
items.append({
"nr": elem_nr,
"teileart": "ILS 2.0 Scanner",
"teileid": format_sensor_id("SCN", scanner_count),
"bezeichnung": f"Scanner :{scanner_count}",
"planquadrat": planquadrat_column(block, planquadrat_cfg),
"merkmale": build_sensor_merkmale(block),
**bbox_columns(block),
})
continue
if has_omniflo:
elem_nr += 1
items.append({
+15
View File
@@ -255,6 +255,17 @@ def build_eckrad_details(block):
# --- Bekannte Bloecke ignorieren ---
SKIP_BLOCKS = set(BLOCKPATTERNS.get("pattern_ks_subblocks", ["K1", "K2", "K3", "K4", "KS_EIN", "KS_AUS"]))
# Eigenstaendige Separator_SP/S-LP- und Scanner-Bloecke werden von der Lisp-
# Sammlung (csv:collect-export-blocks) zwar mit in export_raw.json geschrieben
# (export_csv.py gibt ihnen dort eigene TeileArt-Zeilen), aber HIER bewusst
# NICHT in eine eigene Sivas-Zeile uebernommen: ihre Stueckzahl wird bereits
# ueber die ANZAHL_SEPARATOR/ANZAHL_SCANNER-Attribute des zugehoerigen
# Kreisel/GF/VF-Blocks gezaehlt (siehe kreisel_signature/build_*_details
# oben) - ein zusaetzlicher eigener Eintrag wuerde doppelt zaehlen.
SEP_SCANNER_PATTERNS = (
BLOCKPATTERNS.get("pattern_separator", []) + BLOCKPATTERNS.get("pattern_scanner", [])
)
# Sivas-Nummern und Bezeichnungen je ILS-Elementtyp
# Hinweis: "ils_kurve", sind aktuell nur
# Typnamen-Platzhalter - die zugehoerigen Menuebefehle sind noch Dummies
@@ -330,6 +341,10 @@ def process_blocks(blocks, lookup):
if bname in SKIP_BLOCKS:
continue
# Separator/Scanner: siehe Kommentar bei SEP_SCANNER_PATTERNS oben.
if matches_any(bname, SEP_SCANNER_PATTERNS):
continue
# --- Omniflo Bogen oder Weiche (erkannt via Katalog) ---
if bname in lookup:
typ, eintrag = lookup[bname]