From 24f35a22c31c64564f91e62e3073360d55946a38 Mon Sep 17 00:00:00 2001
From: Paul Wolok
Date: Mon, 15 Dec 2025 10:21:54 +0100
Subject: [PATCH 1/2] Offset berechnung verbessert (angefangen
---
lib/Elemente/VarioFoerderer.py | 113 +++++++++++++++++++++++++--------
lib/plant2dxf.py | 6 +-
2 files changed, 93 insertions(+), 26 deletions(-)
diff --git a/lib/Elemente/VarioFoerderer.py b/lib/Elemente/VarioFoerderer.py
index 5377567..94e6a14 100644
--- a/lib/Elemente/VarioFoerderer.py
+++ b/lib/Elemente/VarioFoerderer.py
@@ -71,8 +71,8 @@ class VarioFoerderer(BaseModel):
if (gefaellestrecke_vario.get("Winkel") != None or gefaellestrecke_vario.get("Kurvenrichtung") != None) and ((winkel == 3 and voerder_richtung == "Ab")or voerder_richtung == "Horizontal"):
# Überprüfung wo es verbunden ist und mit welchen fördere vorne ist ende der Fahrrichtung
if gefaellestrecke_vario.get("h0") != None :
- if float(gefaellestrecke_vario.get("h0")) == lower_hoehe_vario:
- if (gefaellestrecke_vario.get("Foerderrichtung") == "Auf" or gefaellestrecke_vario.get("Foerderrichtung") == "Horizontal"):
+ if float(gefaellestrecke_vario.get("h0")) == lower_hoehe_vario and voerder_richtung != "Horizontal":
+ if (gefaellestrecke_vario.get("Foerderrichtung") == "Auf"):
# Nehmen des winkels und diesen plus 3 nehmen, um den Bogen zu imporieren für heraufinden der Delta werte
winkel_vorne_plusbogen = int(gefaellestrecke_vario.get("Winkel")) +3
winkel_vorne = int(gefaellestrecke_vario.get("Winkel"))
@@ -83,7 +83,7 @@ class VarioFoerderer(BaseModel):
# Ausrechnen des Offsets
winkel_VP_offset_hinten = (SP_1_nachbar_vorne[0] - VP_1_nachbar_vorne[0]) * math.cos(math.radians(3)) + (SP_1_nachbar_vorne[2] - VP_1_nachbar_vorne[2])*math.sin(math.radians(3)), VP_1_nachbar_vorne[1],- (SP_1_nachbar_vorne[0] - VP_1_nachbar_vorne[0]) * math.sin(math.radians(3)) + (SP_1_nachbar_vorne[2] - VP_1_nachbar_vorne[2])*math.cos(math.radians(3))
- elif gefaellestrecke_vario.get("Foerderrichtung") == "Ab":
+ elif gefaellestrecke_vario.get("Foerderrichtung") == "Ab" :
# Nehmen des winkels und diesen minus 3 nehmen, um den Bogen zu imporieren für heraufinden der Delta werte
winkel_vorne_minusbogen = int(gefaellestrecke_vario.get("Winkel")) -3
winkel_vorne = int(gefaellestrecke_vario.get("Winkel"))
@@ -94,9 +94,9 @@ class VarioFoerderer(BaseModel):
VP_0_nachbar_vorne = list(float(att)for att in re.split(r"[;,]", att_vorne["DELTA_VP_0"]))
# Ausrechnung des Offsets
winkel_VP_offset_hinten = (SP_0_nachbar_vorne[0] - VP_0_nachbar_vorne[0]) * math.cos(math.radians(3)) + (SP_0_nachbar_vorne[2] - VP_0_nachbar_vorne[2])*math.sin(math.radians(3)), VP_0_nachbar_vorne[1],- (SP_0_nachbar_vorne[0] - VP_0_nachbar_vorne[0]) * math.sin(math.radians(3)) + (SP_0_nachbar_vorne[2] - VP_0_nachbar_vorne[2])*math.cos(math.radians(3))
-
- elif float(gefaellestrecke_vario.get("h1")) == upper_hoehe_vario and gefaellestrecke_vario.get("Foerderrichtung") != None:
- if (gefaellestrecke_vario.get("Foerderrichtung") == "Auf" or gefaellestrecke_vario.get("Foerderrichtung") == "Horizontal"):
+
+ elif float(gefaellestrecke_vario.get("h1")) == upper_hoehe_vario and voerder_richtung != "Horizontal":
+ if (gefaellestrecke_vario.get("Foerderrichtung") == "Auf" ):
# Nehmen des winkels und diesen plus 3 nehmen, um den Bogen zu imporieren für heraufinden der Delta werte
winkel_hinten_plusbogen = int(gefaellestrecke_vario.get("Winkel")) +3
winkel_hinten = int(gefaellestrecke_vario.get("Winkel"))
@@ -119,6 +119,38 @@ class VarioFoerderer(BaseModel):
VP_1_nachbar_hinten = list(float(att)for att in re.split(r"[;,]", att_hinten["DELTA_VP_1"]))
# Ausrechnung des Offsets
winkel_VP_offset_vorne = (SP_1_nachbar_hinten[0] - VP_1_nachbar_hinten[0]) * math.cos(math.radians(winkel_hinten)) + (SP_1_nachbar_hinten[2] - VP_1_nachbar_hinten[2])*math.sin(math.radians(winkel_hinten)), VP_1_nachbar_hinten[1],- (SP_1_nachbar_hinten[0] - VP_1_nachbar_hinten[0]) * math.sin(math.radians(winkel_hinten)) + (SP_1_nachbar_hinten[2] - VP_1_nachbar_hinten[2])*math.cos(math.radians(winkel_hinten))
+ elif voerder_richtung == "Horizontal":
+ winkel_vorne_plusbogen = int(gefaellestrecke_vario.get("Winkel")) +3
+ winkel_hinten = int(gefaellestrecke_vario.get("Winkel"))
+ blockname = (f"Vario_Bogen_auf_{winkel_vorne_plusbogen}°")
+ att_vorne =plant2dxf.import_block(blockname,lib_doc,doc)
+ SP_0_nachbar_hinten = list(float(att)for att in re.split(r"[;,]", att_vorne["DELTA_SP_1"]))
+ VP_0_nachbar_hinten = list(float(att)for att in re.split(r"[;,]", att_vorne["DELTA_VP_1"]))
+ SP_1_nachbar_vorne = list(float(att)for att in re.split(r"[;,]", att_vorne["DELTA_SP_0"]))
+ VP_1_nachbar_vorne = list(float(att)for att in re.split(r"[;,]", att_vorne["DELTA_VP_0"]))
+ x_foerderer =gefaellestrecke_vario.get("X_foerderer")
+ y_foerderer =gefaellestrecke_vario.get("Y_foerderer")
+ x = foerderer.x
+ y = foerderer.y
+ rotation_zwischen = rotation
+ if rotation_zwischen == 0.0:
+ rotation_zwischen = -360.0
+ if (((-360.0<= rotation_zwischen< -270.0)and y > y_foerderer) or ((-90.0< rotation< 0.0)and y > y_foerderer) or
+ ((-270.0< rotation_zwischen< -90.0)and y < y_foerderer) or
+ (rotation == -90.0 and x < x_foerderer) or ((rotation == -270.0)and x 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 y_foerderer) or ((-90.0< rotation< 0.0)and y > y_foerderer) or
+ ((-270.0< rotation_zwischen< -90.0)and y < y_foerderer) or
+ (rotation == -90.0 and x < x_foerderer) or ((rotation == -270.0)and x dict:
h0 = foerderer_objekt.h0
h1 = foerderer_objekt.h1
foerderrichtung = foerderer_objekt.foerderer_richtung
- geraden.append({"Id": Id,"NachbarIds":NachbarIds, "Winkel":winkel, "h0": h0,"h1": h1,"Foerderrichtung":foerderrichtung
+ geraden.append({"Id": Id,"NachbarIds":NachbarIds, "Winkel":winkel, "h0": h0,"h1": h1,"Foerderrichtung":foerderrichtung,"X_foerderer": x,"Y_foerderer": y
})
if bezeichner =="ILS 2.0 Kurve angetrieben":
Id = row["TeileId"].strip()
@@ -1333,12 +1333,16 @@ def get_nachbar_information(csv_path:Path) -> dict:
if vario_gerade["Id"] in gerade["NachbarIds"] and vario_gerade.get("Winkel") != None:
if geraden_anweisung == 0:
+ eintrag["X_foerderer"] = vario_gerade.get("X_foerderer")
+ eintrag["Y_foerderer"] = vario_gerade.get("Y_foerderer")
eintrag["Winkel"] = vario_gerade.get("Winkel")
eintrag["h0"] = vario_gerade.get("h0")
eintrag["h1"] = vario_gerade.get("h1")
eintrag["Foerderrichtung"] = vario_gerade.get("Foerderrichtung")
geraden_anweisung =1
elif geraden_anweisung == 1:
+ eintrag["X_foerderer_2"] = vario_gerade.get("X_foerderer")
+ eintrag["Y_foerderer_2"] = vario_gerade.get("Y_foerderer")
eintrag["Winkel_2"] = vario_gerade.get("Winkel")
eintrag["h0_2"] = vario_gerade.get("h0")
eintrag["h1_2"] = vario_gerade.get("h1")
From 161fc9cebb60d1abc04f8eda4443b3a6a8a3b164 Mon Sep 17 00:00:00 2001
From: Paul Wolok
Date: Mon, 15 Dec 2025 12:40:49 +0100
Subject: [PATCH 2/2] =?UTF-8?q?Fertigstellung=20f=C3=BCr=20Offset=20f?=
=?UTF-8?q?=C3=BCr=20Vario=20kurven=20im=20Vario?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/Elemente/VarioFoerderer.py | 53 +++++++++++++++++++++-------------
1 file changed, 33 insertions(+), 20 deletions(-)
diff --git a/lib/Elemente/VarioFoerderer.py b/lib/Elemente/VarioFoerderer.py
index 94e6a14..de189d4 100644
--- a/lib/Elemente/VarioFoerderer.py
+++ b/lib/Elemente/VarioFoerderer.py
@@ -158,11 +158,18 @@ class VarioFoerderer(BaseModel):
VP_0_nachbar = list(float(att)for att in re.split(r"[;,]", att_kurve["DELTA_VP_0"]))
SP_1_nachbar = list(float(att)for att in re.split(r"[;,]", att_kurve["DELTA_SP_1"]))
VP_1_nachbar= list(float(att)for att in re.split(r"[;,]", att_kurve["DELTA_VP_1"]))
+ if (SP_1_nachbar[0] < 0 and VP_1_nachbar[0] < 0) or (SP_1_nachbar[0] >= 0 and VP_1_nachbar[0] < 0):
+ SP_1_nachbar[0] = SP_1_nachbar[0] * -1
+ VP_1_nachbar[0] = VP_1_nachbar[0] * -1
+ if (SP_0_nachbar[1] < 0 and VP_0_nachbar[1] < 0) or (SP_0_nachbar[1] >= 0 and VP_0_nachbar[1] < 0):
+ SP_0_nachbar[1] = SP_0_nachbar[1] * -1
+ VP_0_nachbar[1] = VP_0_nachbar[1] * -1
if voerder_richtung == "Ab":
+
if float(gefaellestrecke_vario.get("vario_hoehe_1")) == lower_hoehe_vario:
winkel_VP_offset_hinten = (SP_1_nachbar[0] -VP_1_nachbar[0] ),0,( SP_1_nachbar[2]- VP_1_nachbar[2])
else:
- winkel_VP_offset_vorne = (SP_1_nachbar[0] -VP_1_nachbar[0] ),0,( SP_1_nachbar[2]- VP_1_nachbar[2])
+ winkel_VP_offset_vorne = (SP_0_nachbar[1] -VP_0_nachbar[1] ),0,( SP_1_nachbar[2]- VP_0_nachbar[2])
else:
x_angetrieben = gefaellestrecke_vario.get("X_angetrieben")
y_angetrieben = gefaellestrecke_vario.get("Y_angetrieben")
@@ -174,7 +181,7 @@ class VarioFoerderer(BaseModel):
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 < x_angetrieben)):
- winkel_VP_offset_hinten = winkel_VP_offset_hinten = (SP_1_nachbar[0] -VP_1_nachbar[0] ),0,( SP_1_nachbar[2]- VP_1_nachbar[2])
+ winkel_VP_offset_hinten = (SP_0_nachbar[1] -VP_0_nachbar[1] ),0,( SP_1_nachbar[2]- VP_0_nachbar[2])
else:
winkel_VP_offset_vorne = (SP_1_nachbar[0] -VP_1_nachbar[0] ),0,( SP_1_nachbar[2]- VP_1_nachbar[2])
@@ -269,25 +276,31 @@ class VarioFoerderer(BaseModel):
VP_0_nachbar = list(float(att)for att in re.split(r"[;,]", att_kurve["DELTA_VP_0"]))
SP_1_nachbar = list(float(att)for att in re.split(r"[;,]", att_kurve["DELTA_SP_1"]))
VP_1_nachbar= list(float(att)for att in re.split(r"[;,]", att_kurve["DELTA_VP_1"]))
- if voerder_richtung == "Ab":
- if float(gefaellestrecke_vario.get("vario_hoehe_1")) == lower_hoehe_vario:
+ if (SP_1_nachbar[0] < 0 and VP_1_nachbar[0] < 0) or (SP_1_nachbar[0] >= 0 and VP_1_nachbar[0] < 0):
+ SP_1_nachbar[0] = SP_1_nachbar[0] * -1
+ VP_1_nachbar[0] = VP_1_nachbar[0] * -1
+ if (SP_0_nachbar[1] < 0 and VP_0_nachbar[1] < 0) or (SP_0_nachbar[1] >= 0 and VP_0_nachbar[1] < 0):
+ SP_0_nachbar[1] = SP_0_nachbar[1] * -1
+ VP_0_nachbar[1] = VP_0_nachbar[1] * -1
+ if voerder_richtung == "Ab":
+ if float(gefaellestrecke_vario.get("vario_hoehe_1_1")) == lower_hoehe_vario:
winkel_VP_offset_hinten = (SP_1_nachbar[0] -VP_1_nachbar[0] ),0,( SP_1_nachbar[2]- VP_1_nachbar[2])
else:
- winkel_VP_offset_vorne = (SP_1_nachbar[0] -VP_1_nachbar[0] ),0,( SP_1_nachbar[2]- VP_1_nachbar[2])
+ winkel_VP_offset_vorne = (SP_0_nachbar[1] -VP_0_nachbar[1] ),0,( SP_0_nachbar[2]- VP_0_nachbar[2])
+ else:
+ x_angetrieben = gefaellestrecke_vario.get("X_angetrieben_1")
+ y_angetrieben = gefaellestrecke_vario.get("Y_angetrieben_1")
+ x = foerderer.x
+ y = foerderer.y
+ 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 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