FEM: Move _FemAnalysis class to separate file
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
This commit is contained in:
parent
c5d0fd8d4b
commit
d6392b751a
|
@ -85,6 +85,8 @@ SET(FemScripts_SRCS
|
||||||
_ResultControlTaskPanel.py
|
_ResultControlTaskPanel.py
|
||||||
_JobControlTaskPanel.py
|
_JobControlTaskPanel.py
|
||||||
_ViewProviderFemAnalysis.py
|
_ViewProviderFemAnalysis.py
|
||||||
|
_FemAnalysis.py
|
||||||
|
|
||||||
)
|
)
|
||||||
#SOURCE_GROUP("Scripts" FILES ${FemScripts_SRCS})
|
#SOURCE_GROUP("Scripts" FILES ${FemScripts_SRCS})
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ INSTALL(
|
||||||
_ResultControlTaskPanel.py
|
_ResultControlTaskPanel.py
|
||||||
_JobControlTaskPanel.py
|
_JobControlTaskPanel.py
|
||||||
_ViewProviderFemAnalysis.py
|
_ViewProviderFemAnalysis.py
|
||||||
|
_FemAnalysis.py
|
||||||
DESTINATION
|
DESTINATION
|
||||||
Mod/Fem
|
Mod/Fem
|
||||||
)
|
)
|
||||||
|
|
|
@ -36,7 +36,8 @@ __url__ = "http://www.freecadweb.org"
|
||||||
def makeMechanicalAnalysis(name):
|
def makeMechanicalAnalysis(name):
|
||||||
'''makeFemAnalysis(name): makes a Fem Analysis object'''
|
'''makeFemAnalysis(name): makes a Fem Analysis object'''
|
||||||
obj = FreeCAD.ActiveDocument.addObject("Fem::FemAnalysisPython", name)
|
obj = FreeCAD.ActiveDocument.addObject("Fem::FemAnalysisPython", name)
|
||||||
_FemAnalysis(obj)
|
import _FemAnalysis
|
||||||
|
_FemAnalysis._FemAnalysis(obj)
|
||||||
import _ViewProviderFemAnalysis
|
import _ViewProviderFemAnalysis
|
||||||
_ViewProviderFemAnalysis._ViewProviderFemAnalysis()
|
_ViewProviderFemAnalysis._ViewProviderFemAnalysis()
|
||||||
#FreeCAD.ActiveDocument.recompute()
|
#FreeCAD.ActiveDocument.recompute()
|
||||||
|
@ -224,27 +225,6 @@ class _CommandMechanicalShowResult:
|
||||||
return FreeCADGui.ActiveDocument is not None and results_present()
|
return FreeCADGui.ActiveDocument is not None and results_present()
|
||||||
|
|
||||||
|
|
||||||
class _FemAnalysis:
|
|
||||||
"The FemAnalysis container object"
|
|
||||||
def __init__(self, obj):
|
|
||||||
self.Type = "FemAnalysis"
|
|
||||||
obj.Proxy = self
|
|
||||||
obj.addProperty("App::PropertyString", "OutputDir", "Base", "Directory where the jobs get generated")
|
|
||||||
|
|
||||||
def execute(self, obj):
|
|
||||||
return
|
|
||||||
|
|
||||||
def onChanged(self, obj, prop):
|
|
||||||
if prop in ["MaterialName"]:
|
|
||||||
return
|
|
||||||
|
|
||||||
def __getstate__(self):
|
|
||||||
return self.Type
|
|
||||||
|
|
||||||
def __setstate__(self, state):
|
|
||||||
if state:
|
|
||||||
self.Type = state
|
|
||||||
|
|
||||||
# Helpers
|
# Helpers
|
||||||
|
|
||||||
|
|
||||||
|
|
20
src/Mod/Fem/_FemAnalysis.py
Normal file
20
src/Mod/Fem/_FemAnalysis.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
class _FemAnalysis:
|
||||||
|
"The FemAnalysis container object"
|
||||||
|
def __init__(self, obj):
|
||||||
|
self.Type = "FemAnalysis"
|
||||||
|
obj.Proxy = self
|
||||||
|
obj.addProperty("App::PropertyString", "OutputDir", "Base", "Directory where the jobs get generated")
|
||||||
|
|
||||||
|
def execute(self, obj):
|
||||||
|
return
|
||||||
|
|
||||||
|
def onChanged(self, obj, prop):
|
||||||
|
if prop in ["MaterialName"]:
|
||||||
|
return
|
||||||
|
|
||||||
|
def __getstate__(self):
|
||||||
|
return self.Type
|
||||||
|
|
||||||
|
def __setstate__(self, state):
|
||||||
|
if state:
|
||||||
|
self.Type = state
|
Loading…
Reference in New Issue
Block a user