hw_import --dxf: gemeinsame Zeichnung (Layout + E-Planung) als Hardwarequelle
hw_import liest mit --dxf statt der Positionsdatei eine DXF, in der Layout
und E-Planung zusammen liegen (Dematic): jeder Block mit Attribut IO ist ein
E-Bauteil (IO/VERW/BEZEICHNUNG/KENNZEICHNUNG, Einfuegepunkt), schon in
Layout-Koordinaten (HardwareDocument.layoutCoordinates). --conveyor-from-motor
nimmt den Foerderer aus der Motornummer, wenn kein K0102/#106 dasteht
("Motor KR-MA0055" -> K0055); "ILS-VARIO" zaehlt als Strecke.
merge_hw_layout: bei layoutCoordinates kein Lagebezug (Identitaet, nichts
abgelegt); --rules findet einen blossen Namen in SKEL_CFG. Neue Regeldatei
cfg/e_planning_dematic.ini (Sensor/Stopper gleiche Nummer, Weichenventil =
Nummer des Stausensors, Abstaende an dematic_merge..dxf gemessen).
Fehler behoben: zwei Antriebs-TROs auf einem Layout-Foerderer (Dematic VF_6,
TRO04/TRO06) bekamen beide denselben Vario-Motor. Jetzt Widerspruch mit
Vorschlag; scl_context faellt dann nicht auf den Motor des Foerderers zurueck.
Dematic: 115 Namen im FB_Main (alle im TIA-Import), offene Stellen 730 -> 615.
cfg/dematic_merge_tro_ids.ini: TRO-IDs der Dematic-Anlage.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+14
-3
@@ -150,6 +150,13 @@ class HwSource:
|
||||
geraet = self.device(tro_id, slot, role, layout)
|
||||
return _bekannt(fmt.format(bmk=geraet[0])) if geraet else _offen(offen)
|
||||
|
||||
def conflict(self, tro_id: str, slot: str, role: str) -> bool:
|
||||
"""True, wenn die Anlagen-JSON fuer die Slot-Rolle einen Widerspruch fuehrt."""
|
||||
if self.anlage is None:
|
||||
return False
|
||||
b = self.anlage.binding(tro_id, slot, role)
|
||||
return b is not None and b.status == "widerspruch"
|
||||
|
||||
def conveyor(self, host: str) -> ConveyorBinding | None:
|
||||
"""Foerderer der Hardwareplanung (K0102) am Layout-Foerderer ("0010-R")."""
|
||||
if self.anlage is None or not host:
|
||||
@@ -643,7 +650,9 @@ def _drive(tro: TroBase, hw: HwSource) -> tuple[SclName, SclName]:
|
||||
|
||||
Erst der Antriebs-Slot (Rollen motor/motorProtection); fehlt er, der
|
||||
Foerderer der Hardwareplanung am Host des TRO - der Vario-Antrieb ist
|
||||
dessen Motor (MA/FC-Paar aus hw_import).
|
||||
dessen Motor (MA/FC-Paar aus hw_import). Ein Widerspruch im Slot (z. B.
|
||||
zwei Vario-TROs auf einem Foerderer) bleibt offen, statt den Motor des
|
||||
Foerderers zu erben.
|
||||
"""
|
||||
motor = hw.output(tro.tro_id, "drive", "motor", offen="MA____")
|
||||
schutz = hw.output(tro.tro_id, "drive", "motorProtection",
|
||||
@@ -651,9 +660,11 @@ def _drive(tro: TroBase, hw: HwSource) -> tuple[SclName, SclName]:
|
||||
hosts = list(getattr(tro, "hosts", []) or [])
|
||||
conveyor = hw.conveyor(hosts[0]) if hosts else None
|
||||
if conveyor is not None:
|
||||
if motor.todo and conveyor.motor:
|
||||
if (motor.todo and conveyor.motor
|
||||
and not hw.conflict(tro.tro_id, "drive", "motor")):
|
||||
motor = _bekannt(conveyor.motor)
|
||||
if schutz.todo and conveyor.protection:
|
||||
if (schutz.todo and conveyor.protection
|
||||
and not hw.conflict(tro.tro_id, "drive", "motorProtection")):
|
||||
schutz = _bekannt(f'"{conveyor.protection}"')
|
||||
return motor, schutz
|
||||
|
||||
|
||||
Reference in New Issue
Block a user