refactoren einfügen von scanner und separtor zu Omniflogerade
This commit is contained in:
+25
-7
@@ -9,14 +9,18 @@ class Omniflo(BaseModel):
|
||||
teileid:str
|
||||
x:float
|
||||
y:float
|
||||
|
||||
sivasnummer:str
|
||||
laenge: Optional [float]
|
||||
drehung: float
|
||||
hoehe : Optional[float]
|
||||
h0: Optional[float] = Field(default = 0.0,description="Höhe unten im CSV")
|
||||
h1: Optional[float] = Field(default = 0.0, description="Höhe Oben im CSV")
|
||||
anzahl_scanner: Optional [int] = Field(default=0, description="Anzahl der Scanner")
|
||||
anzahl_separatoren: Optional [int] = Field(default=0, description="Anzahl der Separatoren")
|
||||
|
||||
@property
|
||||
def hight_zwischen(self):
|
||||
return ((self.h0 + self.h1) /2)
|
||||
@classmethod
|
||||
def from_merkmale(cls, teileid,x,y, merkmale):
|
||||
sivasnummer = merkmale.get("SivasNummer")
|
||||
@@ -40,6 +44,14 @@ class Omniflo(BaseModel):
|
||||
h1 = float(merkmale.get("Höhe oben"))
|
||||
except Exception:
|
||||
h1 = 0.0
|
||||
try:
|
||||
anzahl_scanner = int(merkmale.get("Anzahl der Scanner", "0").replace(",", ".")) * 1000 # Meter → mm
|
||||
except Exception:
|
||||
anzahl_scanner = 0
|
||||
try:
|
||||
anzahl_separatoren = float(merkmale.get("Anzahl der Separatoren", "0").replace(",", ".")) * 1000 # Meter → mm
|
||||
except Exception:
|
||||
anzahl_separatoren = 0
|
||||
return cls(
|
||||
teileid= teileid,
|
||||
x=x,
|
||||
@@ -49,13 +61,17 @@ class Omniflo(BaseModel):
|
||||
drehung = winkel,
|
||||
hoehe = hoehe,
|
||||
h0 = h0,
|
||||
h1 = h1
|
||||
h1 = h1,
|
||||
anzahl_scanner = anzahl_scanner,
|
||||
anzahl_separatoren = anzahl_separatoren
|
||||
)
|
||||
def Omniflo_geraden_erstellung(msp, x, y, doc, tefsivas, omniflo_objekt):
|
||||
def Omniflo_geraden_erstellung(msp, doc, tefsivas, omniflo_objekt):
|
||||
"""Erstellung der Tef gerade und Omniflo gerade"""
|
||||
winkel_rad = math.radians(omniflo_objekt.drehung)
|
||||
halbe_laenge = omniflo_objekt.laenge / 2
|
||||
# Man muss bei sin -1 machen wegen des links koordinaten system
|
||||
x = omniflo_objekt.x
|
||||
y = omniflo_objekt.y
|
||||
# Man muss bei sin -1 machen wegen des links koordinaten system
|
||||
dx = halbe_laenge * math.sin(winkel_rad * -1)
|
||||
dy = halbe_laenge * math.cos(winkel_rad)
|
||||
start = (x + dx, y + dy, omniflo_objekt.h1 )
|
||||
@@ -69,15 +85,17 @@ class Omniflo(BaseModel):
|
||||
linie.dxf.layer = "F-1"
|
||||
else:
|
||||
linie.dxf.layer = "A-2"
|
||||
def omniflo_foerdererstellung(msp, x, y, doc, lib_doc, omniflo_objekt, rotation):
|
||||
def omniflo_foerdererstellung(msp, doc, lib_doc, omniflo_objekt):
|
||||
""""Erstellung des Kettenförderers aktuell nur grundriss"""
|
||||
block_methoden.import_block("bogen1",lib_doc,doc)
|
||||
block_methoden.import_block("bogen2",lib_doc,doc)
|
||||
|
||||
x = omniflo_objekt.x
|
||||
y = omniflo_objekt.y
|
||||
rotation = omniflo_objekt.drehung
|
||||
laenge = omniflo_objekt.laenge
|
||||
h0 = omniflo_objekt.h0
|
||||
h1 = omniflo_objekt.h1
|
||||
h_zwischen = (h0 + h1)/2
|
||||
h_zwischen = omniflo_objekt.hight_zwischen
|
||||
blockname = (f"OF_Förderer_{laenge}_{h_zwischen}")
|
||||
winkel_rad = math.radians(rotation)
|
||||
halbe_laenge = laenge / 2
|
||||
|
||||
Reference in New Issue
Block a user