| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | __title__ = "FreeCAD FEM constraint body heat source document object" |
| | __author__ = "Markus Hovorka, Bernd Hahnebach, Mario Passaglia" |
| | __url__ = "https://www.freecad.org" |
| |
|
| | |
| | |
| | |
| |
|
| | import FreeCAD |
| |
|
| | from . import base_fempythonobject |
| |
|
| | _PropHelper = base_fempythonobject._PropHelper |
| |
|
| |
|
| | class ConstraintBodyHeatSource(base_fempythonobject.BaseFemPythonObject): |
| |
|
| | Type = "Fem::ConstraintBodyHeatSource" |
| |
|
| | def __init__(self, obj): |
| | super().__init__(obj) |
| |
|
| | for prop in self._get_properties(): |
| | prop.add_to_object(obj) |
| |
|
| | def _get_properties(self): |
| | prop = [] |
| |
|
| | prop.append( |
| | _PropHelper( |
| | type="App::PropertyDissipationRate", |
| | name="DissipationRate", |
| | group="Constraint Body Heat Source", |
| | doc="Power dissipated per unit mass", |
| | value="0 W/kg", |
| | ) |
| | ) |
| | prop.append( |
| | _PropHelper( |
| | type="App::PropertyPower", |
| | name="TotalPower", |
| | group="Constraint Body Heat Source", |
| | doc="Total power dissipated", |
| | value="0 W", |
| | ) |
| | ) |
| | prop.append( |
| | _PropHelper( |
| | type="App::PropertyEnumeration", |
| | name="Mode", |
| | group="Constraint Body Heat Source", |
| | doc="Switch quantity input mode", |
| | value=["Dissipation Rate", "Total Power"], |
| | ) |
| | ) |
| | prop.append( |
| | _PropHelper( |
| | type="App::PropertyBool", |
| | name="EnableAmplitude", |
| | group="Constraint Body Heat Source", |
| | doc="Amplitude of the body heat source", |
| | value=False, |
| | ) |
| | ) |
| | prop.append( |
| | _PropHelper( |
| | type="App::PropertyStringList", |
| | name="AmplitudeValues", |
| | group="Constraint Body Heat Source", |
| | doc="Amplitude values", |
| | value=["0, 0", "1, 1"], |
| | ) |
| | ) |
| | return prop |
| |
|
| | def onDocumentRestored(self, obj): |
| | |
| | for prop in self._get_properties(): |
| | try: |
| | obj.getPropertyByName(prop.name) |
| | except FreeCAD.Base.PropertyError: |
| | prop.add_to_object(obj) |
| |
|
| | |
| | try: |
| | value = obj.getPropertyByName("HeatSource") |
| | obj.DissipationRate = FreeCAD.Units.Quantity(value, "W/kg") |
| | obj.Mode = "Dissipation Rate" |
| | obj.setPropertyStatus("HeatSource", "-LockDynamic") |
| | obj.removeProperty("HeatSource") |
| | except FreeCAD.Base.PropertyError: |
| | pass |
| |
|