Änderung paar Umvormulierungen zusatz von paar Kommentarten
This commit is contained in:
@@ -305,7 +305,10 @@ class VarioFoerderer(BaseModel):
|
|||||||
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_1_nachbar[0] -VP_1_nachbar[0] ),0,( SP_1_nachbar[2]- VP_1_nachbar[2])
|
||||||
|
|
||||||
return winkel_VP_offset_vorne,winkel_VP_offset_hinten
|
return winkel_VP_offset_vorne,winkel_VP_offset_hinten
|
||||||
|
|
||||||
def horizontale_ausrichtung(x, y, voerder_richtung, rotation, x0_kreisel, y0_kreisel):
|
def horizontale_ausrichtung(x, y, voerder_richtung, rotation, x0_kreisel, y0_kreisel):
|
||||||
|
"""Schaut was für eine Ausrichtung der Horizontale Förder hat"""
|
||||||
|
# mit_horizontal_verbunden None als String für einen späteren vergleich
|
||||||
mit_horizontal_verbunden = "None"
|
mit_horizontal_verbunden = "None"
|
||||||
if voerder_richtung == "Horizontal":
|
if voerder_richtung == "Horizontal":
|
||||||
if rotation == 0.0:
|
if rotation == 0.0:
|
||||||
@@ -330,25 +333,27 @@ class VarioFoerderer(BaseModel):
|
|||||||
mit_horizontal_verbunden = "oben_drehung_-180_or_-270"
|
mit_horizontal_verbunden = "oben_drehung_-180_or_-270"
|
||||||
return mit_horizontal_verbunden
|
return mit_horizontal_verbunden
|
||||||
def vario_verbuden_am_kreisel(foerderer, block_vario, start, ende, mit_horizontal_verbunden = None,kreisel_verbunden = None,am_kreisel = None,erster_kreisel_höher = None):
|
def vario_verbuden_am_kreisel(foerderer, block_vario, start, ende, mit_horizontal_verbunden = None,kreisel_verbunden = None,am_kreisel = None,erster_kreisel_höher = None):
|
||||||
|
"""""Methode für Erstellung der Gefällestrecke für Vario Förderrer die direkt am dem Kreisel hängt"""
|
||||||
lower_hoehe_vario = foerderer.h0
|
lower_hoehe_vario = foerderer.h0
|
||||||
upper_hoehe_vario = foerderer.h1
|
upper_hoehe_vario = foerderer.h1
|
||||||
voerder_richtung = foerderer.foerderer_richtung
|
voerder_richtung = foerderer.foerderer_richtung
|
||||||
hoehe_vario = foerderer.hight_zwischen
|
hoehe_vario = foerderer.hight_zwischen
|
||||||
x = foerderer.x
|
x = foerderer.x
|
||||||
y = foerderer.y
|
y = foerderer.y
|
||||||
|
gefaelle_länge = 500
|
||||||
if (kreisel_verbunden == 2 or (am_kreisel == 1 and erster_kreisel_höher == True)or (am_kreisel == 2 and erster_kreisel_höher == False))and voerder_richtung != "Horizontal":
|
if (kreisel_verbunden == 2 or (am_kreisel == 1 and erster_kreisel_höher == True)or (am_kreisel == 2 and erster_kreisel_höher == False))and voerder_richtung != "Horizontal":
|
||||||
l = (start[0],start[1],upper_hoehe_vario)
|
l = (start[0],start[1],upper_hoehe_vario)
|
||||||
# Eine 500 mm gefällestrecke an anfang und am ende reintuen
|
# Eine 500 mm gefällestrecke an anfang und am ende reintuen
|
||||||
if voerder_richtung =="Auf":
|
if voerder_richtung =="Auf":
|
||||||
m = (start[0],start[1] - 500*math.cos(math.radians(3)),upper_hoehe_vario +500* math.sin(math.radians(3)))
|
m = (start[0],start[1] - gefaelle_länge*math.cos(math.radians(3)),upper_hoehe_vario +gefaelle_länge* math.sin(math.radians(3)))
|
||||||
start = m
|
start = m
|
||||||
|
|
||||||
elif voerder_richtung == "Ab":
|
elif voerder_richtung == "Ab":
|
||||||
m = (start[0],start[1] - 500*math.cos(math.radians(3)),upper_hoehe_vario -500* math.sin(math.radians(3)))
|
m = (start[0],start[1] - gefaelle_länge*math.cos(math.radians(3)),upper_hoehe_vario -gefaelle_länge* math.sin(math.radians(3)))
|
||||||
start = m
|
start = m
|
||||||
|
|
||||||
else:
|
else:
|
||||||
m = (start[0],start[1] - 500*math.cos(math.radians(3)),upper_hoehe_vario )
|
m = (start[0],start[1] - gefaelle_länge*math.cos(math.radians(3)),upper_hoehe_vario )
|
||||||
start = m
|
start = m
|
||||||
if kreisel_verbunden == 1:
|
if kreisel_verbunden == 1:
|
||||||
z1 = m[2]
|
z1 = m[2]
|
||||||
@@ -362,14 +367,14 @@ class VarioFoerderer(BaseModel):
|
|||||||
if (kreisel_verbunden == 2 or (am_kreisel == 1 and erster_kreisel_höher == False)or (am_kreisel == 2 and erster_kreisel_höher == True)) and voerder_richtung != "Horizontal":
|
if (kreisel_verbunden == 2 or (am_kreisel == 1 and erster_kreisel_höher == False)or (am_kreisel == 2 and erster_kreisel_höher == True)) and voerder_richtung != "Horizontal":
|
||||||
l = (ende[0],ende[1],lower_hoehe_vario)
|
l = (ende[0],ende[1],lower_hoehe_vario)
|
||||||
if voerder_richtung =="Auf":
|
if voerder_richtung =="Auf":
|
||||||
m = (ende[0],ende[1] + 500*math.cos(math.radians(3)) ,lower_hoehe_vario - 500* math.sin(math.radians(3)))
|
m = (ende[0],ende[1] + gefaelle_länge*math.cos(math.radians(3)) ,lower_hoehe_vario - gefaelle_länge* math.sin(math.radians(3)))
|
||||||
ende = m
|
ende = m
|
||||||
|
|
||||||
elif voerder_richtung == "Ab":
|
elif voerder_richtung == "Ab":
|
||||||
m = (ende[0],ende[1] + 500*math.cos(math.radians(3)) ,lower_hoehe_vario + 500* math.sin(math.radians(3)))
|
m = (ende[0],ende[1] + gefaelle_länge*math.cos(math.radians(3)) ,lower_hoehe_vario + gefaelle_länge* math.sin(math.radians(3)))
|
||||||
ende = m
|
ende = m
|
||||||
else:
|
else:
|
||||||
m = (ende[0],ende[1] + 500*math.cos(math.radians(3)) ,lower_hoehe_vario )
|
m = (ende[0],ende[1] + gefaelle_länge*math.cos(math.radians(3)) ,lower_hoehe_vario )
|
||||||
ende = m
|
ende = m
|
||||||
line = Line.new(dxfattribs={"start": l,"end":m })
|
line = Line.new(dxfattribs={"start": l,"end":m })
|
||||||
line.dxf.layer = "6-SP"
|
line.dxf.layer = "6-SP"
|
||||||
@@ -382,7 +387,7 @@ class VarioFoerderer(BaseModel):
|
|||||||
elif voerder_richtung == "Horizontal":
|
elif voerder_richtung == "Horizontal":
|
||||||
if mit_horizontal_verbunden == "oben_drehung_0_or_-90" or mit_horizontal_verbunden == "unten_drehung_-180_or_-270":
|
if mit_horizontal_verbunden == "oben_drehung_0_or_-90" or mit_horizontal_verbunden == "unten_drehung_-180_or_-270":
|
||||||
l = (start[0],start[1],upper_hoehe_vario)
|
l = (start[0],start[1],upper_hoehe_vario)
|
||||||
m = (start[0],start[1] - 500*math.cos(math.radians(3)),upper_hoehe_vario)
|
m = (start[0],start[1] - gefaelle_länge*math.cos(math.radians(3)),upper_hoehe_vario)
|
||||||
start = m
|
start = m
|
||||||
line = Line.new(dxfattribs={"start": l,"end":m })
|
line = Line.new(dxfattribs={"start": l,"end":m })
|
||||||
line.dxf.layer = "6-SP"
|
line.dxf.layer = "6-SP"
|
||||||
@@ -391,7 +396,7 @@ class VarioFoerderer(BaseModel):
|
|||||||
block_vario.add_entity(copy)
|
block_vario.add_entity(copy)
|
||||||
else:
|
else:
|
||||||
end = (ende[0],ende[1],lower_hoehe_vario)
|
end = (ende[0],ende[1],lower_hoehe_vario)
|
||||||
en = (ende[0],ende[1] + 500*math.cos(math.radians(3)) ,lower_hoehe_vario )
|
en = (ende[0],ende[1] + gefaelle_länge*math.cos(math.radians(3)) ,lower_hoehe_vario )
|
||||||
ende = en
|
ende = en
|
||||||
line = Line.new(dxfattribs={"start": end,"end":en })
|
line = Line.new(dxfattribs={"start": end,"end":en })
|
||||||
line.dxf.layer = "6-SP"
|
line.dxf.layer = "6-SP"
|
||||||
@@ -403,6 +408,7 @@ class VarioFoerderer(BaseModel):
|
|||||||
else:
|
else:
|
||||||
return start, ende
|
return start, ende
|
||||||
def vario_erstellung(foerderer, doc, lib_doc, config, block, block_name_links, start, ende, voerder_richtung, winkel_VP_offset_vorne, winkel_VP_offset_hinten ):
|
def vario_erstellung(foerderer, doc, lib_doc, config, block, block_name_links, start, ende, voerder_richtung, winkel_VP_offset_vorne, winkel_VP_offset_hinten ):
|
||||||
|
"""Erstellung der Vario Blöcke"""
|
||||||
# Entnehmen der Motor und Umlenk station um die Gefähle auzurechnen und ob man diese tatsächlich einfügen muss
|
# Entnehmen der Motor und Umlenk station um die Gefähle auzurechnen und ob man diese tatsächlich einfügen muss
|
||||||
winkel_motor = float(config.get("Ils 2.0 core winkel","winkel_motor"))
|
winkel_motor = float(config.get("Ils 2.0 core winkel","winkel_motor"))
|
||||||
winkel_umlenk = float(config.get("Ils 2.0 core winkel","winkel_umlenk"))
|
winkel_umlenk = float(config.get("Ils 2.0 core winkel","winkel_umlenk"))
|
||||||
@@ -488,7 +494,7 @@ class VarioFoerderer(BaseModel):
|
|||||||
block.add_blockref(block_Vario_Motorstation_500mm, (start[0]-x , start[1] - motor_offset_x/2 -y ,start[2] - hoehe_vario +motor_offset_z/2),dxfattribs={"rotation": 90, "layer":layer_motor,"color": color_motor})
|
block.add_blockref(block_Vario_Motorstation_500mm, (start[0]-x , start[1] - motor_offset_x/2 -y ,start[2] - hoehe_vario +motor_offset_z/2),dxfattribs={"rotation": 90, "layer":layer_motor,"color": color_motor})
|
||||||
start = start[0] , start[1] - motor_offset_x,start[2] + motor_offset_z
|
start = start[0] , start[1] - motor_offset_x,start[2] + motor_offset_z
|
||||||
|
|
||||||
# Einfügen der 51 grad Bogen und deren notwendigen Werten von den attributen des bogens in den block
|
# Einfügen der grad Bogen und deren notwendigen Werten von den attributen des bogens in den block
|
||||||
winkel_core = int(config.get("Ils 2.0 core winkel","winkel_boegen"))
|
winkel_core = int(config.get("Ils 2.0 core winkel","winkel_boegen"))
|
||||||
winkel_plus = winkel + winkel_core
|
winkel_plus = winkel + winkel_core
|
||||||
block_Vario_Bogen_auf = (f"Vario_Bogen_auf_{winkel_plus}°")
|
block_Vario_Bogen_auf = (f"Vario_Bogen_auf_{winkel_plus}°")
|
||||||
@@ -501,14 +507,14 @@ class VarioFoerderer(BaseModel):
|
|||||||
block_Vario_Bogen_auf = block_methoden.dreh_block(block_Vario_Bogen_auf, doc,lib_doc,math.radians(winkel_core))
|
block_Vario_Bogen_auf = block_methoden.dreh_block(block_Vario_Bogen_auf, doc,lib_doc,math.radians(winkel_core))
|
||||||
block_Vario_Bogen_ab = block_methoden.dreh_block(block_Vario_Bogen_ab, doc,lib_doc,math.radians(-winkel))
|
block_Vario_Bogen_ab = block_methoden.dreh_block(block_Vario_Bogen_ab, doc,lib_doc,math.radians(-winkel))
|
||||||
|
|
||||||
|
#Entnehmen der Werte von den Attributen
|
||||||
Vario_Bogen_auf_Delta_SP_0 = list(float(att)for att in re.split(r"[;,]", auf_attrib["DELTA_SP_0"]))
|
Vario_Bogen_auf_Delta_SP_0 = list(float(att)for att in re.split(r"[;,]", auf_attrib["DELTA_SP_0"]))
|
||||||
Vario_Bogen_auf_Delta_SP_1 = list(float(att) for att in re.split(r"[;,]", auf_attrib["DELTA_SP_1"]))
|
Vario_Bogen_auf_Delta_SP_1 = list(float(att) for att in re.split(r"[;,]", auf_attrib["DELTA_SP_1"]))
|
||||||
Vario_Bogen_ab_Delta_SP_0 = list(float(att) for att in re.split(r"[;,]", ab_attrib["DELTA_SP_0"]))
|
Vario_Bogen_ab_Delta_SP_0 = list(float(att) for att in re.split(r"[;,]", ab_attrib["DELTA_SP_0"]))
|
||||||
Vario_Bogen_ab_Delta_SP_1 = list(float(att) for att in re.split(r"[;,]", ab_attrib["DELTA_SP_1"]))
|
Vario_Bogen_ab_Delta_SP_1 = list(float(att) for att in re.split(r"[;,]", ab_attrib["DELTA_SP_1"]))
|
||||||
Vario_Bogen_auf_Delta_VP_1 = list(float(att) for att in re.split(r"[;,]", auf_attrib["DELTA_VP_1"]))
|
Vario_Bogen_auf_Delta_VP_1 = list(float(att) for att in re.split(r"[;,]", auf_attrib["DELTA_VP_1"]))
|
||||||
Vario_Bogen_ab_Delta_VP_0= list(float(att) for att in re.split(r"[;,]", ab_attrib["DELTA_VP_0"]))
|
Vario_Bogen_ab_Delta_VP_0= list(float(att) for att in re.split(r"[;,]", ab_attrib["DELTA_VP_0"]))
|
||||||
|
# Werte von den Attributen durch den Winkel ändern wegen der Neugung in 3 Dimensionalen raum
|
||||||
Vario_Bogen_auf_Delta_SP_0 = [Vario_Bogen_auf_Delta_SP_0 [0] * math.cos(math.radians(winkel_core))+ Vario_Bogen_auf_Delta_SP_0[2]* math.sin(math.radians(winkel_core)) ,Vario_Bogen_auf_Delta_SP_0[1],-Vario_Bogen_auf_Delta_SP_0[0] * math.sin(math.radians(winkel_core))+ Vario_Bogen_auf_Delta_SP_0[2] * math.cos(math.radians(winkel_core)) ]
|
Vario_Bogen_auf_Delta_SP_0 = [Vario_Bogen_auf_Delta_SP_0 [0] * math.cos(math.radians(winkel_core))+ Vario_Bogen_auf_Delta_SP_0[2]* math.sin(math.radians(winkel_core)) ,Vario_Bogen_auf_Delta_SP_0[1],-Vario_Bogen_auf_Delta_SP_0[0] * math.sin(math.radians(winkel_core))+ Vario_Bogen_auf_Delta_SP_0[2] * math.cos(math.radians(winkel_core)) ]
|
||||||
Vario_Bogen_auf_Delta_SP_1 = [Vario_Bogen_auf_Delta_SP_1 [0] * math.cos(math.radians(winkel_core))+ Vario_Bogen_auf_Delta_SP_1[2]* math.sin(math.radians(winkel_core)) ,Vario_Bogen_auf_Delta_SP_1[1],-Vario_Bogen_auf_Delta_SP_1[0] * math.sin(math.radians(winkel_core))+ Vario_Bogen_auf_Delta_SP_1[2] * math.cos(math.radians(winkel_core)) ]
|
Vario_Bogen_auf_Delta_SP_1 = [Vario_Bogen_auf_Delta_SP_1 [0] * math.cos(math.radians(winkel_core))+ Vario_Bogen_auf_Delta_SP_1[2]* math.sin(math.radians(winkel_core)) ,Vario_Bogen_auf_Delta_SP_1[1],-Vario_Bogen_auf_Delta_SP_1[0] * math.sin(math.radians(winkel_core))+ Vario_Bogen_auf_Delta_SP_1[2] * math.cos(math.radians(winkel_core)) ]
|
||||||
Vario_Bogen_ab_Delta_SP_0 = [Vario_Bogen_ab_Delta_SP_0 [0] * math.cos(math.radians(-winkel))+ Vario_Bogen_ab_Delta_SP_0[2]* math.sin(math.radians(-winkel)) ,Vario_Bogen_ab_Delta_SP_0[1],-Vario_Bogen_ab_Delta_SP_0[0] * math.sin(math.radians(-winkel))+ Vario_Bogen_ab_Delta_SP_0[2] * math.cos(math.radians(-winkel)) ]
|
Vario_Bogen_ab_Delta_SP_0 = [Vario_Bogen_ab_Delta_SP_0 [0] * math.cos(math.radians(-winkel))+ Vario_Bogen_ab_Delta_SP_0[2]* math.sin(math.radians(-winkel)) ,Vario_Bogen_ab_Delta_SP_0[1],-Vario_Bogen_ab_Delta_SP_0[0] * math.sin(math.radians(-winkel))+ Vario_Bogen_ab_Delta_SP_0[2] * math.cos(math.radians(-winkel)) ]
|
||||||
@@ -656,6 +662,7 @@ class VarioFoerderer(BaseModel):
|
|||||||
ende = ende[0] , ende[1] + motor_offset_x,ende[2] +motor_offset_z
|
ende = ende[0] , ende[1] + motor_offset_x,ende[2] +motor_offset_z
|
||||||
elif winkel == 3:
|
elif winkel == 3:
|
||||||
ende_Motor_VP = ende[0] - vario_abstand, ende[1]- winkel_VP_offset_vorne[0] ,ende[2] - winkel_VP_offset_hinten[2]
|
ende_Motor_VP = ende[0] - vario_abstand, ende[1]- winkel_VP_offset_vorne[0] ,ende[2] - winkel_VP_offset_hinten[2]
|
||||||
|
|
||||||
if winkel != 3:
|
if winkel != 3:
|
||||||
winkel_core = int(config.get("Ils 2.0 core winkel","winkel_boegen"))
|
winkel_core = int(config.get("Ils 2.0 core winkel","winkel_boegen"))
|
||||||
winkel_minus = winkel - winkel_core
|
winkel_minus = winkel - winkel_core
|
||||||
@@ -728,7 +735,7 @@ class VarioFoerderer(BaseModel):
|
|||||||
copy = line.copy()
|
copy = line.copy()
|
||||||
copy.translate(-x,-y,-hoehe_vario)
|
copy.translate(-x,-y,-hoehe_vario)
|
||||||
block.add_entity(copy)
|
block.add_entity(copy)
|
||||||
|
#Sonderlogik für grad 3, weil es kein bogen braucht
|
||||||
elif winkel == 3:
|
elif winkel == 3:
|
||||||
# Nur erstellung der zwischen und Vario linie weil der Bogen hier nicht nötig ist
|
# Nur erstellung der zwischen und Vario linie weil der Bogen hier nicht nötig ist
|
||||||
line_VP = Line.new(dxfattribs={"start": start_Umlenkstation_VP,"end": ende_Motor_VP})
|
line_VP = Line.new(dxfattribs={"start": start_Umlenkstation_VP,"end": ende_Motor_VP})
|
||||||
|
|||||||
+47
-61
@@ -17,7 +17,6 @@ from Elemente import Kreisel, VarioFoerderer,Gefaehllestrecke,Angetriebene_Kurve
|
|||||||
import as_es_methoden
|
import as_es_methoden
|
||||||
import block_methoden
|
import block_methoden
|
||||||
import arbeiten_mit_csv
|
import arbeiten_mit_csv
|
||||||
|
|
||||||
# --------------------------------------------------------- Konstante Parameter
|
# --------------------------------------------------------- Konstante Parameter
|
||||||
ATTR_TAG = "TeileId" # Attributtag im Block
|
ATTR_TAG = "TeileId" # Attributtag im Block
|
||||||
RADIUS = 400 # Radius der Kreiselkreise (mm)
|
RADIUS = 400 # Radius der Kreiselkreise (mm)
|
||||||
@@ -102,7 +101,6 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
lower_hoehe_gefaehlle = gefaelle_objekt.h0
|
lower_hoehe_gefaehlle = gefaelle_objekt.h0
|
||||||
hoehe_gefaehlle = gefaelle_objekt.hight_zwischen
|
hoehe_gefaehlle = gefaelle_objekt.hight_zwischen
|
||||||
laenge = gefaelle_objekt.laenge
|
laenge = gefaelle_objekt.laenge
|
||||||
|
|
||||||
halbe_laenge = laenge / 2
|
halbe_laenge = laenge / 2
|
||||||
rotation= gefaelle_objekt.drehung
|
rotation= gefaelle_objekt.drehung
|
||||||
winkel = math.radians(float(rotation))
|
winkel = math.radians(float(rotation))
|
||||||
@@ -179,7 +177,6 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
start = [x , y + dy ,upper_hoehe_gefaehlle]
|
start = [x , y + dy ,upper_hoehe_gefaehlle]
|
||||||
ende = [x , y - dy ,lower_hoehe_gefaehlle]
|
ende = [x , y - dy ,lower_hoehe_gefaehlle]
|
||||||
start, ende = Gefaehllestrecke.Gefaellestrecke.ein_motor_oder_eine_umlenk(x, y,start,ende, doc, lib_doc, hoehe_gefaehlle, block_Vario_Umlenkstation_500mm, block_Vario_Motorstation_500mm, blockname_motor_links, blockname_umlenk_links, hat_motor_0, hat_umlenk_0, tefkurve_0, block,umlenk_gerade,motor_gerade)
|
start, ende = Gefaehllestrecke.Gefaellestrecke.ein_motor_oder_eine_umlenk(x, y,start,ende, doc, lib_doc, hoehe_gefaehlle, block_Vario_Umlenkstation_500mm, block_Vario_Motorstation_500mm, blockname_motor_links, blockname_umlenk_links, hat_motor_0, hat_umlenk_0, tefkurve_0, block,umlenk_gerade,motor_gerade)
|
||||||
|
|
||||||
line = Line.new(dxfattribs={"start":start,"end":ende})
|
line = Line.new(dxfattribs={"start":start,"end":ende})
|
||||||
line.translate(-x,-y,-hoehe_gefaehlle)
|
line.translate(-x,-y,-hoehe_gefaehlle)
|
||||||
block.add_entity(line)
|
block.add_entity(line)
|
||||||
@@ -229,9 +226,8 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
as_es_rotation= 0
|
as_es_rotation= 0
|
||||||
else:
|
else:
|
||||||
as_es_rotation= -180
|
as_es_rotation= -180
|
||||||
|
# Fügt as oder es Element ein oder fügt nur as oder es element hinzu falls nötig
|
||||||
only_es_or_as = as_es_methoden.erstellung_gefaelle_block_verbunenden_am_einen(msp,x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_hoehe_gefaehlle, hoehe_gefaehlle, drehung0, laenge, blockname,config,hight,None,None,None,block,start,ende,None,as_es_rotation)
|
only_es_or_as = as_es_methoden.erstellung_gefaelle_block_verbunenden_am_einen(msp,x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_hoehe_gefaehlle, hoehe_gefaehlle, drehung0, laenge, blockname,config,hight,None,None,None,block,start,ende,None,as_es_rotation)
|
||||||
|
|
||||||
if only_es_or_as == False:
|
if only_es_or_as == False:
|
||||||
bref =msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation,"layer": gefaelle_layer})
|
bref =msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation,"layer": gefaelle_layer})
|
||||||
a =bref.add_attrib(
|
a =bref.add_attrib(
|
||||||
@@ -351,51 +347,6 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation,"layer": gefaelle_layer})
|
msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation,"layer": gefaelle_layer})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def anzahl_seperatoren_oder_scan(msp, x, y, doc, lib_doc, klassen_objekt, hoehe, rotation):
|
|
||||||
"""Importiert alle seperatoren und/oder scanner für das nötige objekt"""
|
|
||||||
separatoren = klassen_objekt.anzahl_separatoren
|
|
||||||
scanner = klassen_objekt.anzahl_scanner
|
|
||||||
# Schauen welche Ausrichtung das Objekt hat, damit man die Separtoren unbd Scanner nicht in das Objekt tut
|
|
||||||
if rotation == 0 or rotation == -180:
|
|
||||||
ausrichtung = "V"
|
|
||||||
else:
|
|
||||||
ausrichtung = "H"
|
|
||||||
if ausrichtung == "V":
|
|
||||||
einsatz_fest = [x + 300, y,hoehe]
|
|
||||||
modular = 2
|
|
||||||
else:
|
|
||||||
einsatz_fest = [x,y - 150,hoehe]
|
|
||||||
modular = 3
|
|
||||||
block_scanner = "SCAN"
|
|
||||||
block_separatoren = "S-LP"
|
|
||||||
block_methoden.import_block(block_scanner,lib_doc,doc)
|
|
||||||
block_methoden.import_block(block_separatoren,lib_doc,doc)
|
|
||||||
layer_scan, color_scan = block_methoden.get_insert_color_layer(lib_doc, block_scanner)
|
|
||||||
layer_separatioren, color_separatioren = block_methoden.get_insert_color_layer(lib_doc, block_separatoren)
|
|
||||||
einsatz_zwischen =[ einsatz_fest[0],einsatz_fest[1],einsatz_fest[2]]
|
|
||||||
anzahl =0
|
|
||||||
while anzahl < separatoren:
|
|
||||||
anzahl = anzahl + 1
|
|
||||||
msp.add_blockref(block_separatoren,einsatz_zwischen, dxfattribs={"layer": layer_separatioren,"color": color_separatioren})
|
|
||||||
if anzahl % modular == 0:
|
|
||||||
einsatz_fest[1] = einsatz_fest[1] - 150
|
|
||||||
einsatz_zwischen = einsatz_fest.copy()
|
|
||||||
else:
|
|
||||||
einsatz_zwischen[0] = einsatz_zwischen[0]+ 300
|
|
||||||
|
|
||||||
if anzahl % modular != 0:
|
|
||||||
einsatz_fest[1] = einsatz_fest[1] - 150
|
|
||||||
einsatz_zwischen = einsatz_fest.copy()
|
|
||||||
anzahl =0
|
|
||||||
while anzahl < scanner:
|
|
||||||
anzahl = anzahl + 1
|
|
||||||
msp.add_blockref(block_scanner,einsatz_zwischen,dxfattribs={"layer": layer_scan,"color": color_scan})
|
|
||||||
if anzahl % modular == 0:
|
|
||||||
einsatz_fest[1] = einsatz_fest[1] - 150
|
|
||||||
einsatz_zwischen = einsatz_fest.copy()
|
|
||||||
else:
|
|
||||||
einsatz_zwischen[0] = einsatz_zwischen[0]+ 300
|
|
||||||
|
|
||||||
def handle_ils_2_0_variofoerderer(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, strecken_nachbarn,config,config_allgemein):
|
def handle_ils_2_0_variofoerderer(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, strecken_nachbarn,config,config_allgemein):
|
||||||
"""Erstellt ein Vario Förderer in der neuen Dxf"""
|
"""Erstellt ein Vario Förderer in der neuen Dxf"""
|
||||||
@@ -435,8 +386,6 @@ def handle_ils_2_0_variofoerderer(msp, teileid, merkmale, x, y, doc, lib_doc, ve
|
|||||||
# Korrektur der rotation mit der Umstellung der Höhe
|
# Korrektur der rotation mit der Umstellung der Höhe
|
||||||
rotation = rotation -180
|
rotation = rotation -180
|
||||||
foerderer.drehung = rotation
|
foerderer.drehung = rotation
|
||||||
|
|
||||||
|
|
||||||
# Hollen der Information der Nachbarn strukturen ob diese Kreisel sind
|
# Hollen der Information der Nachbarn strukturen ob diese Kreisel sind
|
||||||
for nachbarn in strecken_nachbarn:
|
for nachbarn in strecken_nachbarn:
|
||||||
if teileid == nachbarn.get("Id"):
|
if teileid == nachbarn.get("Id"):
|
||||||
@@ -450,6 +399,7 @@ def handle_ils_2_0_variofoerderer(msp, teileid, merkmale, x, y, doc, lib_doc, ve
|
|||||||
# Für spätere berechnung schauen ob der erste Kreis in der Liste höher ist
|
# Für spätere berechnung schauen ob der erste Kreis in der Liste höher ist
|
||||||
if upper_hoehe_vario == gefaellestrecke_vario.get("Hoehe0"):
|
if upper_hoehe_vario == gefaellestrecke_vario.get("Hoehe0"):
|
||||||
ein_kreisel_höher = True
|
ein_kreisel_höher = True
|
||||||
|
# Falls der Förderer mit einem Eckrad verbunden ist
|
||||||
if "Eckrad_x" in gefaellestrecke_vario and "Eckrad_x_1" not in gefaellestrecke_vario:
|
if "Eckrad_x" in gefaellestrecke_vario and "Eckrad_x_1" not in gefaellestrecke_vario:
|
||||||
x0_eckrad = gefaellestrecke_vario.get("Eckrad_x")
|
x0_eckrad = gefaellestrecke_vario.get("Eckrad_x")
|
||||||
y0_eckrad = gefaellestrecke_vario.get("Eckrad_y")
|
y0_eckrad = gefaellestrecke_vario.get("Eckrad_y")
|
||||||
@@ -476,6 +426,7 @@ def handle_ils_2_0_variofoerderer(msp, teileid, merkmale, x, y, doc, lib_doc, ve
|
|||||||
elif merkmale.get("Motorseite")== "rechts":
|
elif merkmale.get("Motorseite")== "rechts":
|
||||||
msp.add_blockref(blockname,(x,y,hoehe_vario),dxfattribs={"rotation": rotation})
|
msp.add_blockref(blockname,(x,y,hoehe_vario),dxfattribs={"rotation": rotation})
|
||||||
return
|
return
|
||||||
|
# Falls der Förderer mit zwei Eckrads verbunden ist
|
||||||
if "Eckrad_x" in gefaellestrecke_vario and "Eckrad_x_1" in gefaellestrecke_vario:
|
if "Eckrad_x" in gefaellestrecke_vario and "Eckrad_x_1" in gefaellestrecke_vario:
|
||||||
|
|
||||||
blockname = (f"Vario_Foerderer_{winkel}_{voerder_richtung}_{laenge}_{hoehe_vario}_rechts_2_{motor_vorhanden}_{umlenk_vorhanden}_{gefaelle}_{gefahellewinkel}")
|
blockname = (f"Vario_Foerderer_{winkel}_{voerder_richtung}_{laenge}_{hoehe_vario}_rechts_2_{motor_vorhanden}_{umlenk_vorhanden}_{gefaelle}_{gefahellewinkel}")
|
||||||
@@ -496,7 +447,6 @@ def handle_ils_2_0_variofoerderer(msp, teileid, merkmale, x, y, doc, lib_doc, ve
|
|||||||
msp.add_blockref(blockname,(x,y,hoehe_vario),dxfattribs={"rotation": rotation})
|
msp.add_blockref(blockname,(x,y,hoehe_vario),dxfattribs={"rotation": rotation})
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
# Aufruf falls nur mit einem Kreisel verbunden
|
# Aufruf falls nur mit einem Kreisel verbunden
|
||||||
if "Drehung0" in gefaellestrecke_vario and "Drehung1" not in gefaellestrecke_vario:
|
if "Drehung0" in gefaellestrecke_vario and "Drehung1" not in gefaellestrecke_vario:
|
||||||
# Vorbereitund der Daten des Kreisel
|
# Vorbereitund der Daten des Kreisel
|
||||||
@@ -511,9 +461,7 @@ def handle_ils_2_0_variofoerderer(msp, teileid, merkmale, x, y, doc, lib_doc, ve
|
|||||||
y0_kreisel = float(gefaellestrecke_vario.get("y0"))
|
y0_kreisel = float(gefaellestrecke_vario.get("y0"))
|
||||||
richtung0 = float(gefaellestrecke_vario.get("rotation0"))
|
richtung0 = float(gefaellestrecke_vario.get("rotation0"))
|
||||||
richtung_rad0= math.radians(richtung0)
|
richtung_rad0= math.radians(richtung0)
|
||||||
# Herausfinden ob der Förderere direkt mit dem Kreisel verbunden ist, die Werte für den Zweiten Kreisel wird auf None gesetzt weil diese nicht existieren
|
|
||||||
|
|
||||||
# None als string für späteren vergleich
|
|
||||||
mit_horizontal_verbunden = VarioFoerderer.VarioFoerderer.horizontale_ausrichtung(x, y, voerder_richtung, rotation, x0_kreisel, y0_kreisel)
|
mit_horizontal_verbunden = VarioFoerderer.VarioFoerderer.horizontale_ausrichtung(x, y, voerder_richtung, rotation, x0_kreisel, y0_kreisel)
|
||||||
am_kreisel,kreseil_verbunden =as_es_methoden.am_kreisel_direct_verbunden(x, y, upper_hoehe_vario, lower_hoehe_vario, x0_kreisel, y0_kreisel, richtung_rad0, abstand0, dx, dy, None, None, None, None )
|
am_kreisel,kreseil_verbunden =as_es_methoden.am_kreisel_direct_verbunden(x, y, upper_hoehe_vario, lower_hoehe_vario, x0_kreisel, y0_kreisel, richtung_rad0, abstand0, dx, dy, None, None, None, None )
|
||||||
if am_kreisel == 1:
|
if am_kreisel == 1:
|
||||||
@@ -536,7 +484,6 @@ def handle_ils_2_0_variofoerderer(msp, teileid, merkmale, x, y, doc, lib_doc, ve
|
|||||||
# Erstellung einer Gefällestrecke von 500 mm in der Vario rein, wo es verbunden ist
|
# Erstellung einer Gefällestrecke von 500 mm in der Vario rein, wo es verbunden ist
|
||||||
start, ende = VarioFoerderer.VarioFoerderer.vario_verbuden_am_kreisel(foerderer, block_vario, start, ende, mit_horizontal_verbunden,kreseil_verbunden,am_kreisel,ein_kreisel_höher)
|
start, ende = VarioFoerderer.VarioFoerderer.vario_verbuden_am_kreisel(foerderer, block_vario, start, ende, mit_horizontal_verbunden,kreseil_verbunden,am_kreisel,ein_kreisel_höher)
|
||||||
|
|
||||||
|
|
||||||
# Erstellung des Vario_förderes selber
|
# Erstellung des Vario_förderes selber
|
||||||
VarioFoerderer.VarioFoerderer.vario_erstellung(foerderer, doc, lib_doc, config, block_vario,block_name_links, start, ende,voerder_richtung ,winkel_VP_offset_vorne,winkel_VP_offset_hinten)
|
VarioFoerderer.VarioFoerderer.vario_erstellung(foerderer, doc, lib_doc, config, block_vario,block_name_links, start, ende,voerder_richtung ,winkel_VP_offset_vorne,winkel_VP_offset_hinten)
|
||||||
# reintuen des förderes in den Modelspace
|
# reintuen des förderes in den Modelspace
|
||||||
@@ -685,7 +632,6 @@ def handle_ils_2_0_variofoerderer(msp, teileid, merkmale, x, y, doc, lib_doc, ve
|
|||||||
elif merkmale.get("Motorseite")== "rechts":
|
elif merkmale.get("Motorseite")== "rechts":
|
||||||
msp.add_blockref(blockname,(x,y,hoehe_vario),dxfattribs={"rotation": rotation})
|
msp.add_blockref(blockname,(x,y,hoehe_vario),dxfattribs={"rotation": rotation})
|
||||||
return
|
return
|
||||||
|
|
||||||
# Erstellung des Blocks und diesen in die Modelspace tuen. Die Linke version wird bei der vario erstellung selber am ende gemacht
|
# Erstellung des Blocks und diesen in die Modelspace tuen. Die Linke version wird bei der vario erstellung selber am ende gemacht
|
||||||
block_vario = doc.blocks.new(blockname, base_point=(0,0,0))
|
block_vario = doc.blocks.new(blockname, base_point=(0,0,0))
|
||||||
# Schauen welche es oder as element man braucht man braucht und diese in den block einfügen
|
# Schauen welche es oder as element man braucht man braucht und diese in den block einfügen
|
||||||
@@ -732,8 +678,6 @@ def handle_ils_2_0_variofoerderer(msp, teileid, merkmale, x, y, doc, lib_doc, ve
|
|||||||
if merkmale.get("Motorseite")== "rechts":
|
if merkmale.get("Motorseite")== "rechts":
|
||||||
msp.add_blockref(blockname,(x,y,hoehe_vario),dxfattribs={"rotation": rotation})
|
msp.add_blockref(blockname,(x,y,hoehe_vario),dxfattribs={"rotation": rotation})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def handle_ils_2_0_kurve_angetrieben(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, strecken_nachbarn,config,config_allgemein):
|
def handle_ils_2_0_kurve_angetrieben(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, strecken_nachbarn,config,config_allgemein):
|
||||||
"""Erstellt eine Angetriebene Kurve (Förderer Kurve) in der neuen Dxf"""
|
"""Erstellt eine Angetriebene Kurve (Förderer Kurve) in der neuen Dxf"""
|
||||||
voerder_kurve = Angetriebene_Kurve.Angetriebene_Kurve.from_merkmale(teileid,x,y,merkmale)
|
voerder_kurve = Angetriebene_Kurve.Angetriebene_Kurve.from_merkmale(teileid,x,y,merkmale)
|
||||||
@@ -746,7 +690,6 @@ def handle_ils_2_0_kurve_angetrieben(msp, teileid, merkmale, x, y, doc, lib_doc,
|
|||||||
block_methoden.import_block(blockname,lib_doc,doc)
|
block_methoden.import_block(blockname,lib_doc,doc)
|
||||||
layer, color = block_methoden.get_insert_color_layer(lib_doc, blockname)
|
layer, color = block_methoden.get_insert_color_layer(lib_doc, blockname)
|
||||||
msp.add_blockref(blockname,(x,y,h_zwischen),dxfattribs={"rotation": rotation,"layer": layer, "color":color})
|
msp.add_blockref(blockname,(x,y,h_zwischen),dxfattribs={"rotation": rotation,"layer": layer, "color":color})
|
||||||
|
|
||||||
|
|
||||||
def handle_ils_2_0_kurve(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, strecken_nachbarn,config,config_allgemein):
|
def handle_ils_2_0_kurve(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, strecken_nachbarn,config,config_allgemein):
|
||||||
"""Erstellt eine Kurve (Gefälle Kurve) in der neuen Dxf"""
|
"""Erstellt eine Kurve (Gefälle Kurve) in der neuen Dxf"""
|
||||||
@@ -778,7 +721,6 @@ def handle_bt___entladung(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, s
|
|||||||
block_methoden.import_block(blockname,lib_doc,doc)
|
block_methoden.import_block(blockname,lib_doc,doc)
|
||||||
msp.add_blockref(blockname,(x,y,hight),dxfattribs={"rotation": rotation})
|
msp.add_blockref(blockname,(x,y,hight),dxfattribs={"rotation": rotation})
|
||||||
|
|
||||||
|
|
||||||
def handle_omniflo(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, strecken_nachbarn,config,config_allgemein):
|
def handle_omniflo(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, strecken_nachbarn,config,config_allgemein):
|
||||||
"""
|
"""
|
||||||
Für Omniflo Gerade: zeichnet eine Linie (Mitte = Koordinate, Länge und Winkel aus Merkmale).
|
Für Omniflo Gerade: zeichnet eine Linie (Mitte = Koordinate, Länge und Winkel aus Merkmale).
|
||||||
@@ -812,6 +754,50 @@ def handle_omniflo(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols,
|
|||||||
layer, color = block_methoden.get_insert_color_layer(lib_doc, omniflo_objekt.sivasnummer)
|
layer, color = block_methoden.get_insert_color_layer(lib_doc, omniflo_objekt.sivasnummer)
|
||||||
msp.add_blockref(blockname, (x, y,omniflo_objekt.hoehe), dxfattribs={"rotation": rotation,"layer": layer, "color": color})
|
msp.add_blockref(blockname, (x, y,omniflo_objekt.hoehe), dxfattribs={"rotation": rotation,"layer": layer, "color": color})
|
||||||
|
|
||||||
|
def anzahl_seperatoren_oder_scan(msp, x, y, doc, lib_doc, klassen_objekt, hoehe, rotation):
|
||||||
|
"""Importiert alle seperatoren und/oder scanner für das nötige objekt"""
|
||||||
|
separatoren = klassen_objekt.anzahl_separatoren
|
||||||
|
scanner = klassen_objekt.anzahl_scanner
|
||||||
|
# Schauen welche Ausrichtung das Objekt hat, damit man die Separtoren unbd Scanner nicht in das Objekt tut
|
||||||
|
if rotation == 0 or rotation == -180:
|
||||||
|
ausrichtung = "V"
|
||||||
|
else:
|
||||||
|
ausrichtung = "H"
|
||||||
|
if ausrichtung == "V":
|
||||||
|
einsatz_fest = [x + 300, y,hoehe]
|
||||||
|
modular = 2
|
||||||
|
else:
|
||||||
|
einsatz_fest = [x,y - 150,hoehe]
|
||||||
|
modular = 3
|
||||||
|
block_scanner = "SCAN"
|
||||||
|
block_separatoren = "S-LP"
|
||||||
|
block_methoden.import_block(block_scanner,lib_doc,doc)
|
||||||
|
block_methoden.import_block(block_separatoren,lib_doc,doc)
|
||||||
|
layer_scan, color_scan = block_methoden.get_insert_color_layer(lib_doc, block_scanner)
|
||||||
|
layer_separatioren, color_separatioren = block_methoden.get_insert_color_layer(lib_doc, block_separatoren)
|
||||||
|
einsatz_zwischen =[ einsatz_fest[0],einsatz_fest[1],einsatz_fest[2]]
|
||||||
|
anzahl =0
|
||||||
|
while anzahl < separatoren:
|
||||||
|
anzahl = anzahl + 1
|
||||||
|
msp.add_blockref(block_separatoren,einsatz_zwischen, dxfattribs={"layer": layer_separatioren,"color": color_separatioren})
|
||||||
|
if anzahl % modular == 0:
|
||||||
|
einsatz_fest[1] = einsatz_fest[1] - 150
|
||||||
|
einsatz_zwischen = einsatz_fest.copy()
|
||||||
|
else:
|
||||||
|
einsatz_zwischen[0] = einsatz_zwischen[0]+ 300
|
||||||
|
|
||||||
|
if anzahl % modular != 0:
|
||||||
|
einsatz_fest[1] = einsatz_fest[1] - 150
|
||||||
|
einsatz_zwischen = einsatz_fest.copy()
|
||||||
|
anzahl =0
|
||||||
|
while anzahl < scanner:
|
||||||
|
anzahl = anzahl + 1
|
||||||
|
msp.add_blockref(block_scanner,einsatz_zwischen,dxfattribs={"layer": layer_scan,"color": color_scan})
|
||||||
|
if anzahl % modular == 0:
|
||||||
|
einsatz_fest[1] = einsatz_fest[1] - 150
|
||||||
|
einsatz_zwischen = einsatz_fest.copy()
|
||||||
|
else:
|
||||||
|
einsatz_zwischen[0] = einsatz_zwischen[0]+ 300
|
||||||
def get_libfile_cfg(teileart, cfg_path):
|
def get_libfile_cfg(teileart, cfg_path):
|
||||||
"""Liest den Bibliotheksdateinamen für eine TeileArt aus der allgemein.cfg."""
|
"""Liest den Bibliotheksdateinamen für eine TeileArt aus der allgemein.cfg."""
|
||||||
parser = configparser.ConfigParser()
|
parser = configparser.ConfigParser()
|
||||||
|
|||||||
Reference in New Issue
Block a user