update mubea with BTMT information
This commit is contained in:
@@ -300,6 +300,21 @@ def build_sensor_merkmale(block):
|
||||
}
|
||||
|
||||
|
||||
def build_btmt_merkmale(block):
|
||||
"""Merkmale-Dict fuer eine eigenstaendige BTMT-Beladung/SC_Entladung-Station
|
||||
(siehe pattern_btmt_beladung/pattern_btmt_entladung in cfg/export.cfg).
|
||||
|
||||
Anders als build_sensor_merkmale ohne "Zuordnung": eine BTMT-Station ist
|
||||
keinem Kreisel/GF/VF-Carrier zugeordnet, das ZUORDNUNG-Attribut existiert
|
||||
hier nicht."""
|
||||
attribs = block.get("attribs", {})
|
||||
return {
|
||||
"ARTINR": attribs.get("ARTINR", ""),
|
||||
"Höhe": get_hoehe(block),
|
||||
"Drehung": get_drehung(block),
|
||||
}
|
||||
|
||||
|
||||
def format_sensor_id(prefix, n):
|
||||
"""Fallback-TeileId fuer Separator/Scanner-Zeilen im CSV-Export, falls das
|
||||
Block-Attribut "ID" (noch) leer ist.
|
||||
@@ -581,6 +596,8 @@ def process_blocks(blocks, lookup, dbg=None):
|
||||
strecke_modul_count = 0
|
||||
separator_count = 0
|
||||
scanner_count = 0
|
||||
btmt_beladung_count = 0
|
||||
btmt_entladung_count = 0
|
||||
|
||||
# Zaehlung fuer die Omniflo-Sum-Zeile (nur Bogen/Weiche/Gerade)
|
||||
cnt_wk = cnt_einzel = cnt_delta = cnt_doppel = cnt_stern = 0
|
||||
@@ -798,6 +815,39 @@ def process_blocks(blocks, lookup, dbg=None):
|
||||
})
|
||||
continue
|
||||
|
||||
# BTMT-Beladestation - eigene TeileArt-Zeile, sonst analog zu Separator/
|
||||
# Scanner oben. Anders als dort NICHT von export_sivas.py ausgeschlossen
|
||||
# (siehe SEP_SCANNER_PATTERNS-Kommentar) - eine BTMT-Station wird von
|
||||
# keinem anderen Element mitgezaehlt.
|
||||
if matches_any(bname, BLOCKPATTERNS.get("pattern_btmt_beladung", [])):
|
||||
elem_nr += 1
|
||||
btmt_beladung_count += 1
|
||||
items.append({
|
||||
"nr": elem_nr,
|
||||
"teileart": "ILS 2.0 BTMT Beladung",
|
||||
"teileid": block.get("attribs", {}).get("ID") or format_sensor_id("BEL", btmt_beladung_count),
|
||||
"bezeichnung": f"BTMT Beladung :{btmt_beladung_count}",
|
||||
"planquadrat": planquadrat_column(block, planquadrat_cfg),
|
||||
"merkmale": build_btmt_merkmale(block),
|
||||
**bbox_columns(block),
|
||||
})
|
||||
continue
|
||||
|
||||
# BTMT-Entladestation (Abwurfstation) - analog zur Beladestation oben.
|
||||
if matches_any(bname, BLOCKPATTERNS.get("pattern_btmt_entladung", [])):
|
||||
elem_nr += 1
|
||||
btmt_entladung_count += 1
|
||||
items.append({
|
||||
"nr": elem_nr,
|
||||
"teileart": "ILS 2.0 BTMT Entladung",
|
||||
"teileid": block.get("attribs", {}).get("ID") or format_sensor_id("ENT", btmt_entladung_count),
|
||||
"bezeichnung": f"BTMT Entladung :{btmt_entladung_count}",
|
||||
"planquadrat": planquadrat_column(block, planquadrat_cfg),
|
||||
"merkmale": build_btmt_merkmale(block),
|
||||
**bbox_columns(block),
|
||||
})
|
||||
continue
|
||||
|
||||
if has_omniflo:
|
||||
elem_nr += 1
|
||||
items.append({
|
||||
|
||||
+60
-1
@@ -339,6 +339,10 @@ def process_blocks(blocks, lookup):
|
||||
strecke_bezeichnungen = [] # Bezeichnung-Attribut loser Strecke-Elemente
|
||||
vario_list = [] # Liste von VarioFoerderer-Compound-Bloecken (VF_N), je einer Zeile
|
||||
gefaelle_list = [] # Liste von Gefaellestrecke-Bloecken (GF_*), je einer Zeile
|
||||
btmt_beladung_ids = [] # IDs aller BTMT-Beladung*-Bloecke (eine gruppierte Zeile)
|
||||
btmt_beladung_bezeichnungen = []
|
||||
btmt_entladung_ids = [] # IDs aller SC_Entladung*-Bloecke (eine gruppierte Zeile)
|
||||
btmt_entladung_bezeichnungen = []
|
||||
|
||||
counters = {
|
||||
"anzahl_boegen": 0,
|
||||
@@ -381,6 +385,23 @@ def process_blocks(blocks, lookup):
|
||||
if matches_any(bname, SEP_SCANNER_PATTERNS):
|
||||
continue
|
||||
|
||||
# --- BTMT-Beladestation ---
|
||||
# Anders als Separator/Scanner wird sie von keinem Carrier-Attribut
|
||||
# mitgezaehlt, darum eigene (gruppierte) Zeile UND eigener Zaehler in
|
||||
# der ILS-Automation-Summierungszeile (siehe unten).
|
||||
if matches_any(bname, BLOCKPATTERNS.get("pattern_btmt_beladung", [])):
|
||||
btmt_beladung_ids.append(get_id(block))
|
||||
btmt_beladung_bezeichnungen.append(block.get("attribs", {}).get("Bezeichnung", ""))
|
||||
counters["anzahl_btbeladung"] += 1
|
||||
continue
|
||||
|
||||
# --- BTMT-Entladestation (Abwurfstation) ---
|
||||
if matches_any(bname, BLOCKPATTERNS.get("pattern_btmt_entladung", [])):
|
||||
btmt_entladung_ids.append(get_id(block))
|
||||
btmt_entladung_bezeichnungen.append(block.get("attribs", {}).get("Bezeichnung", ""))
|
||||
counters["anzahl_abwurfstationen"] += 1
|
||||
continue
|
||||
|
||||
# --- Omniflo Bogen oder Weiche (erkannt via Katalog) ---
|
||||
if bname in lookup:
|
||||
typ, eintrag = lookup[bname]
|
||||
@@ -649,6 +670,42 @@ def process_blocks(blocks, lookup):
|
||||
})
|
||||
nr += 1
|
||||
|
||||
# BTMT-Beladestationen: eine gruppierte Zeile fuer alle Instanzen (wie die
|
||||
# losen Strecke-Elemente oben) - Stueckzahl zusaetzlich im Automation-
|
||||
# Zaehler "Anzahl aller BTBeladung" (siehe counters oben).
|
||||
if btmt_beladung_ids:
|
||||
sivasnr, teileart = ILS_SIVASNR["bt_beladung"]
|
||||
items.append({
|
||||
"nr": nr,
|
||||
"teileart": teileart,
|
||||
"sivasnr": sivasnr,
|
||||
"sivasnr_quoted": True,
|
||||
"bezeichnung": ", ".join(b for b in btmt_beladung_bezeichnungen if b),
|
||||
"dispgruppe": 20,
|
||||
"anzahl": len(btmt_beladung_ids),
|
||||
"laenge_mm": "",
|
||||
"ids": btmt_beladung_ids,
|
||||
"details": {},
|
||||
})
|
||||
nr += 1
|
||||
|
||||
# BTMT-Entladestationen (Abwurfstationen): analog gruppiert.
|
||||
if btmt_entladung_ids:
|
||||
sivasnr, teileart = ILS_SIVASNR["bg_entladung"]
|
||||
items.append({
|
||||
"nr": nr,
|
||||
"teileart": teileart,
|
||||
"sivasnr": sivasnr,
|
||||
"sivasnr_quoted": True,
|
||||
"bezeichnung": ", ".join(b for b in btmt_entladung_bezeichnungen if b),
|
||||
"dispgruppe": 20,
|
||||
"anzahl": len(btmt_entladung_ids),
|
||||
"laenge_mm": "",
|
||||
"ids": btmt_entladung_ids,
|
||||
"details": {},
|
||||
})
|
||||
nr += 1
|
||||
|
||||
# VarioFoerderer-Compound-Bloecke (VF_N) - je Block eine eigene Zeile mit
|
||||
# vollstaendigen Gefaelle-/Angetrieben-Teilgruppen (immer TYP "Streckengruppe").
|
||||
for block in vario_list:
|
||||
@@ -699,7 +756,9 @@ def process_blocks(blocks, lookup):
|
||||
has_ils = (counters["anzahl_kreisel"] > 0
|
||||
or counters["anzahl_eckraeder"] > 0
|
||||
or counters["anzahl_variofoerderer"] > 0
|
||||
or counters["anzahl_gefaellestrecken"] > 0)
|
||||
or counters["anzahl_gefaellestrecken"] > 0
|
||||
or counters["anzahl_btbeladung"] > 0
|
||||
or counters["anzahl_abwurfstationen"] > 0)
|
||||
if has_ils:
|
||||
automation_details = {
|
||||
"Anzahl Kreisel": counters["anzahl_kreisel"],
|
||||
|
||||
Reference in New Issue
Block a user