From bf3996435aff8db4b3dca789fbbbb956ea3bff2f Mon Sep 17 00:00:00 2001 From: Michael Stangl Date: Tue, 30 Jun 2026 10:00:17 +0200 Subject: [PATCH] =?UTF-8?q?Weitere=20TOS=20Nummern=20f=C3=BCr=20Zusatzmodu?= =?UTF-8?q?l,=20Weichen=20Strecke=20und=20Automation=20in=20den=20Code=20f?= =?UTF-8?q?=C3=BCr=20Export=20eingepflegt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/export_sivas.py | 69 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 60 insertions(+), 9 deletions(-) diff --git a/lib/export_sivas.py b/lib/export_sivas.py index 3242e12..f5b34a9 100644 --- a/lib/export_sivas.py +++ b/lib/export_sivas.py @@ -103,7 +103,18 @@ def build_kreisel_details(block): # --- Bekannte Bloecke ignorieren --- SKIP_BLOCKS = {"K1", "K2", "K3", "K4", "KS_EIN", "KS_AUS"} -VARIO_BLOCKS = { +# Sivas-Nummern und Bezeichnungen je ILS-Elementtyp +ILS_SIVASNR = { + "kreisel": ("6200", "ILS 2.0 Kreisel"), + "eckrad": ("6210", "ILS 2.0 Eckrad"), + "zusatzmodul":("6215", "ILS 2.0 Zusatzmodul"), + "ils_weiche": ("6216", "ILS 2.0 Weichen"), + "strecke": ("6220", "ILS 2.0 Strecke - Module"), + "automation": ("6269", "ILS 2.0 Automation und Pneumatik - Gesamtanlage"), +} + +# Strecken-Module: Blocknamen-Fragmente fuer Vario/Staustrecke-Elemente +STRECKE_BLOCKS = { "AUS_Element_links", "EIN_Element_links", "Staustrecke_SP_1000_mm", "Staustrecke_Separator_SP_300_mm", "Vario_Spannstation_SP_500mm", "Vario_Motorstation_SP_500mm", @@ -233,9 +244,14 @@ def process_blocks(blocks, lookup): counters["anzahl_streckengruppen"] = 1 continue - # --- VarioFoerderer --- - for vb in VARIO_BLOCKS: - if vb in bname: + # --- ILS Eckrad --- + if bname.startswith("ECKRAD_"): + counters["anzahl_eckraeder"] += 1 + continue + + # --- ILS Strecke-Module (Vario/Staustrecke) --- + for sb in STRECKE_BLOCKS: + if sb in bname: counters["anzahl_variofoerderer"] += 1 break @@ -286,10 +302,11 @@ def process_blocks(blocks, lookup): nr += 1 for block in kreisel_list: + sivasnr, teileart = ILS_SIVASNR["kreisel"] items.append({ "nr": nr, - "teileart": "ILS 2.0 Kreisel", - "sivasnr": "6200", + "teileart": teileart, + "sivasnr": sivasnr, "sivasnr_quoted": True, "dispgruppe": 20, "anzahl": 1, @@ -299,8 +316,41 @@ def process_blocks(blocks, lookup): }) nr += 1 + if counters["anzahl_eckraeder"] > 0: + sivasnr, teileart = ILS_SIVASNR["eckrad"] + items.append({ + "nr": nr, + "teileart": teileart, + "sivasnr": sivasnr, + "sivasnr_quoted": True, + "dispgruppe": 20, + "anzahl": counters["anzahl_eckraeder"], + "laenge_mm": "", + "hoehe_m": "", + "details": {}, + }) + nr += 1 + + if counters["anzahl_variofoerderer"] > 0: + sivasnr, teileart = ILS_SIVASNR["strecke"] + items.append({ + "nr": nr, + "teileart": teileart, + "sivasnr": sivasnr, + "sivasnr_quoted": True, + "dispgruppe": 20, + "anzahl": counters["anzahl_variofoerderer"], + "laenge_mm": "", + "hoehe_m": "", + "details": {}, + }) + nr += 1 + # ILS Automation Summierungszeile (nur wenn ILS-Elemente vorhanden) - if counters["anzahl_kreisel"] > 0 or counters["anzahl_variofoerderer"] > 0: + has_ils = (counters["anzahl_kreisel"] > 0 + or counters["anzahl_eckraeder"] > 0 + or counters["anzahl_variofoerderer"] > 0) + if has_ils: automation_details = { "Anzahl Kreisel": counters["anzahl_kreisel"], "Anzahl Kreisel mit Pinband": counters["anzahl_kreisel_pinband"], @@ -323,10 +373,11 @@ def process_blocks(blocks, lookup): "Anzahl aller BTBeladung": counters["anzahl_btbeladung"], "Anzahl aller Abwurfstationen": counters["anzahl_abwurfstationen"], } + auto_sivasnr, auto_teileart = ILS_SIVASNR["automation"] items.append({ "nr": nr, - "teileart": "ILS 2.0 Automation", - "sivasnr": "6270", + "teileart": auto_teileart, + "sivasnr": auto_sivasnr, "sivasnr_quoted": True, "dispgruppe": 20, "anzahl": 1,