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")