Skip to content

Commit

Permalink
FEM: Move _FemAnalysis class to separate file
Browse files Browse the repository at this point in the history
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
  • Loading branch information
PrzemoF authored and wwmayer committed Oct 11, 2015
1 parent c5d0fd8 commit d6392b7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 22 deletions.
2 changes: 2 additions & 0 deletions src/Mod/Fem/App/CMakeLists.txt
Expand Up @@ -85,6 +85,8 @@ SET(FemScripts_SRCS
_ResultControlTaskPanel.py
_JobControlTaskPanel.py
_ViewProviderFemAnalysis.py
_FemAnalysis.py

)
#SOURCE_GROUP("Scripts" FILES ${FemScripts_SRCS})

Expand Down
1 change: 1 addition & 0 deletions src/Mod/Fem/CMakeLists.txt
Expand Up @@ -27,6 +27,7 @@ INSTALL(
_ResultControlTaskPanel.py
_JobControlTaskPanel.py
_ViewProviderFemAnalysis.py
_FemAnalysis.py
DESTINATION
Mod/Fem
)
Expand Down
24 changes: 2 additions & 22 deletions src/Mod/Fem/MechanicalAnalysis.py
Expand Up @@ -36,7 +36,8 @@
def makeMechanicalAnalysis(name):
'''makeFemAnalysis(name): makes a Fem Analysis object'''
obj = FreeCAD.ActiveDocument.addObject("Fem::FemAnalysisPython", name)
_FemAnalysis(obj)
import _FemAnalysis
_FemAnalysis._FemAnalysis(obj)
import _ViewProviderFemAnalysis
_ViewProviderFemAnalysis._ViewProviderFemAnalysis()
#FreeCAD.ActiveDocument.recompute()
Expand Down Expand Up @@ -224,27 +225,6 @@ def IsActive(self):
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


Expand Down
20 changes: 20 additions & 0 deletions src/Mod/Fem/_FemAnalysis.py
@@ -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

0 comments on commit d6392b7

Please sign in to comment.