fix
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user