alles neu mit black formatiert. handler_context.py impl. um weniger Übergabeparameter zu haben

This commit is contained in:
2026-01-27 16:09:52 +01:00
parent 4d09aee02b
commit 19282888ee
16 changed files with 4228 additions and 1682 deletions
+9 -11
View File
@@ -1,14 +1,18 @@
from pydantic import BaseModel, Field, field_validator
from typing import Optional
class Bt_element(BaseModel):
"""Das sind beide BTMT Elemente"""
teileid: str
drehung: Optional [float] = Field(default=0.0,description="Rotation des Elements")
hoehe: Optional [float] = Field(default=0.0,description="Hoehe des Elements")
drehung: Optional[float] = Field(default=0.0, description="Rotation des Elements")
hoehe: Optional[float] = Field(default=0.0, description="Hoehe des Elements")
@classmethod
def from_merkmale(cls, teileid: str, x: float, y: float, merkmale: dict) -> 'Bt_element':
def from_merkmale(
cls, teileid: str, x: float, y: float, merkmale: dict
) -> "Bt_element":
try:
hoehe = float(merkmale.get("Höhe in Meter"))
except Exception as e:
@@ -17,11 +21,5 @@ class Bt_element(BaseModel):
drehung = float(merkmale.get("Drehung"))
except Exception as e:
drehung = 0.0
return cls(
teileid = teileid,
x = x,
y = y,
hoehe = hoehe,
drehung = drehung
)
return cls(teileid=teileid, x=x, y=y, hoehe=hoehe, drehung=drehung)