tro_flow: Weichen-Separator nach Laufrichtung, Weichen-Slots mit Bauteil

Steuernder Separator einer ILS Weiche (_find_weiche_separators) ist der
letzte freie Separator in Laufrichtung VOR der Weiche, gemessen auf dem
Kreisel-Umlauf aus Lage und Drehrichtung (kreisel_junctions.separators_before)
- nicht mehr der CSV-Nachbar. Ein Nachbar hinter der Weiche steuert sie nie;
Hoechstabstand weiche_vorlauf_max in cfg/parameter.ini [tro_flow]. Mubea
(Export 2026-10-16): 2Sep2Swi = 0005 (Ausschleus 0061) + 0036 (Weiche 0130)
statt 0005 + 0012; 0012 bleibt 1Sep, Kreisel1 wieder angebunden. Dematic,
HundM05, showroom, test_system unveraendert.

TRO-JSON: DerivedTro.switches (optional) nennt die Weichen-Bauteile in
Slot-Reihenfolge (switch<i> gehoert bei 2Sep-Typen zu separator<i>);
derive_slots traegt sie in die switch<n>-Slots, merge_hw_layout bindet das
Ventil dort. e_planning.ini: Rollen ventil -> valve (Slot-Rolle der SCL),
neue Regel Ausschleus_Weiche.valve fuer Ausschleusventile an Kreisel-Weichen.
Mubea: MB0715, MB0724, MB0627, MB0671 statt TODO(E-Planung).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 13:42:16 +02:00
parent 39b445a7c4
commit d414bd6cf3
8 changed files with 297 additions and 46 deletions
+15 -1
View File
@@ -127,10 +127,24 @@ def test_pflichtrollen_ohne_bmk_sind_offen_optionale_nicht():
anlage = run()
roles = {(b.slot, b.role): b.status for b in anlage.bindings if b.tro == "TRO06"}
assert roles == {("separator1", "sensor"): "offen", ("separator1", "stopper"): "offen"}
# die Weiche hat noch keine Layout-ID -> Ventil offen
# ohne switches (TRO-JSON vor 2026-10-16) keine Layout-ID -> Ventil offen
assert anlage.binding("TRO02", "switch1", "valve").status == "offen"
def test_weichen_slot_bekommt_ventil_des_ausschleuselements():
# TRO02 steuert Ausschleuselement 0030 (tro_flow: switches) -> switch1 traegt
# 0030, das Ausschleusventil (Nummer = Stausensor + 1) landet im Slot.
doc = layout()
tro = doc.by_id("TRO02")
tro.switches = ["0030"]
tro.slots = derive_slots(tro)
hw = hardware()
hw.devices.append(_dev("MB0602", "AE ABZW", (0.0, 2000.0 + 1414.0), direction="out"))
valve = run(doc=doc, hw=hw).binding("TRO02", "switch1", "valve")
assert (valve.bmk, valve.layout_id, valve.rule, valve.status) == (
"MB0602", "0030", "nummer", "zugeordnet")
def test_bauteil_ohne_slot_bleibt_sichtbar():
loose = [b for b in run().bindings if not b.tro]
assert [(b.role, b.layout_id, b.bmk, b.status) for b in loose] == [