From 843011bab929c39e22678e2b449d05186eca7a19 Mon Sep 17 00:00:00 2001
From: Paul Wolok
Date: Wed, 17 Dec 2025 14:42:53 +0100
Subject: [PATCH] =?UTF-8?q?Vario=20Kurve=20mit=20Gef=C3=A4llestrecke=20ver?=
=?UTF-8?q?bunden=20verbessert,=20Sonderfall=20horinzonal=20und=203=20grad?=
=?UTF-8?q?=20bogen=20hinzugef=C3=BCgt?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/Elemente/Gefaehllestrecke.py | 96 +++++++-----
lib/plant2dxf.py | 253 +++++++++++++++++++------------
2 files changed, 219 insertions(+), 130 deletions(-)
diff --git a/lib/Elemente/Gefaehllestrecke.py b/lib/Elemente/Gefaehllestrecke.py
index 32c2bdf..4a92d84 100644
--- a/lib/Elemente/Gefaehllestrecke.py
+++ b/lib/Elemente/Gefaehllestrecke.py
@@ -37,73 +37,95 @@ class Gefaellestrecke(BaseModel):
anzahl_scanner = int(merkmale.get("Anzahl der Scanner")),
anzahl_separatoren = int(merkmale.get("Anzahl der Separatoren"))
)
- def hat_motor_umlenk_station (doc, lib_doc, upper_hoehe_gefaehlle, lower_hoehe_gefaehlle, gefaellestrecke_nachbarn):
+ def hat_motor_umlenk_station (gefaelle_objekt, gefaellestrecke_nachbarn):
hat_motor_0 = None
hat_motor_1 = None
hat_umlenk_0 = None
hat_umlenk_1 = None
tefkurve_0 = None
tefkurve_1 = None
+ umlenk_gerade = False
+ motor_gerade = False
+ upper_hoehe_gefaehlle = gefaelle_objekt.h1
+ lower_hoehe_gefaehlle = gefaelle_objekt.h0
+ rotation = gefaelle_objekt.drehung
+ x = gefaelle_objekt.x
+ y = gefaelle_objekt.y
+
+
if "Kurvenrichtung" in gefaellestrecke_nachbarn:
vario_hoehe_0 = float(gefaellestrecke_nachbarn.get("vario_hoehe_0"))
vario_hoehe_1 = float(gefaellestrecke_nachbarn.get("vario_hoehe_1"))
kurvenrichtung = gefaellestrecke_nachbarn.get("Kurvenrichtung")
- tefkurve_0 = gefaellestrecke_nachbarn.get("Tefkurve")
- if (kurvenrichtung == "links" and tefkurve_0 == "Aussen") or kurvenrichtung == "rechts" and tefkurve_0 == "Innen":
- tefkurve_0 = "links"
- else:
+ tefkurve_0 = gefaellestrecke_nachbarn.get("Tefkurve")
+ x_angetrieben = gefaellestrecke_nachbarn.get("X_angetrieben")
+ y_angetrieben = gefaellestrecke_nachbarn.get("Y_angetrieben")
+ if (kurvenrichtung == "links" and tefkurve_0 == "außen") or kurvenrichtung == "rechts" and tefkurve_0 == "innen":
tefkurve_0 = "rechts"
- block_Vario_Umlenkstation_500mm ="Vario_Umlenkstation_500mm"
- block_Vario_Motorstation_500mm = "Vario_Motorstation_500mm"
- blockname_motor_links = block_Vario_Motorstation_500mm +"links"
- blockname_umlenk_links = block_Vario_Umlenkstation_500mm + "links"
- plant2dxf.import_block(block_Vario_Umlenkstation_500mm,lib_doc,doc)
- plant2dxf.import_block(block_Vario_Motorstation_500mm,lib_doc,doc)
- block_Vario_Umlenkstation_500mm =plant2dxf.dreh_block(block_Vario_Umlenkstation_500mm,doc,lib_doc,math.radians(3))
- block_Vario_Motorstation_500mm =plant2dxf.dreh_block(block_Vario_Motorstation_500mm,doc,lib_doc,math.radians(3))
- if blockname_motor_links not in doc.blocks:
- matrix = Matrix44.scale(1,-1,1)
- block_motor_links = doc.blocks.new(name=blockname_motor_links,base_point=(0,0,0))
- block_umlenk_links = doc.blocks.new(name=blockname_umlenk_links,base_point=(0,0,0))
- block_motor_rechts = doc.blocks[block_Vario_Motorstation_500mm]
- block_umlenk_rechts = doc.blocks[block_Vario_Umlenkstation_500mm]
- for e in block_motor_rechts:
- copy = e.copy()
- copy.transform(matrix)
- block_motor_links.add_entity(copy)
-
- for e in block_umlenk_rechts:
- copy = e.copy()
- copy.transform(matrix)
- block_umlenk_links.add_entity(copy)
-
+ else:
+ tefkurve_0 = "links"
+
if upper_hoehe_gefaehlle > lower_hoehe_gefaehlle:
if vario_hoehe_0 == upper_hoehe_gefaehlle or vario_hoehe_1 == upper_hoehe_gefaehlle:
hat_motor_0 = True
else:
hat_umlenk_0 = True
- if upper_hoehe_gefaehlle < lower_hoehe_gefaehlle:
+ elif upper_hoehe_gefaehlle < lower_hoehe_gefaehlle:
if vario_hoehe_0 == lower_hoehe_gefaehlle or vario_hoehe_1 == lower_hoehe_gefaehlle:
hat_motor_0 = True
else:
hat_umlenk_0 = True
+ else:
+ rotation_zwischen = rotation
+ if rotation_zwischen == 0.0:
+ rotation_zwischen = -360.0
+ if (((-360.0<= rotation_zwischen< -270.0)and y > y_angetrieben) or ((-90.0< rotation< 0.0)and y > y_angetrieben) or
+ ((-270.0< rotation_zwischen< -90.0)and y < y_angetrieben) or
+ (rotation == -90.0 and x < x_angetrieben) or ((rotation == -270.0)and x lower_hoehe_gefaehlle:
if vario_hoehe_0_1 == upper_hoehe_gefaehlle or vario_hoehe_1_1 == upper_hoehe_gefaehlle:
hat_motor_1 = True
else:
hat_umlenk_1 = True
- if upper_hoehe_gefaehlle < lower_hoehe_gefaehlle:
+ elif upper_hoehe_gefaehlle < lower_hoehe_gefaehlle:
if vario_hoehe_0_1 == lower_hoehe_gefaehlle or vario_hoehe_1_1 == lower_hoehe_gefaehlle:
hat_motor_1 = True
else:
hat_umlenk_1 = True
- return hat_motor_0,hat_umlenk_0,hat_motor_1,hat_umlenk_1, tefkurve_0, tefkurve_1
\ No newline at end of file
+ else:
+ rotation_zwischen = rotation
+ if rotation_zwischen == 0.0:
+ rotation_zwischen = -360.0
+ if (((-360.0<= rotation_zwischen< -270.0)and y > y_angetrieben) or ((-90.0< rotation< 0.0)and y > y_angetrieben) or
+ ((-270.0< rotation_zwischen< -90.0)and y < y_angetrieben) or
+ (rotation == -90.0 and x < x_angetrieben) or ((rotation == -270.0)and x