From 161fc9cebb60d1abc04f8eda4443b3a6a8a3b164 Mon Sep 17 00:00:00 2001 From: Paul Wolok Date: Mon, 15 Dec 2025 12:40:49 +0100 Subject: [PATCH] =?UTF-8?q?Fertigstellung=20f=C3=BCr=20Offset=20f=C3=BCr?= =?UTF-8?q?=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