Skip to content

Commit

Permalink
FEM: Migrate _CommandMechanicalMaterial to FemCommands
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 19, 2015
1 parent ddb20e7 commit f76933e
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/Mod/Fem/MechanicalMaterial.py
Expand Up @@ -21,6 +21,7 @@
# ***************************************************************************

import FreeCAD
from FemCommands import FemCommands

if FreeCAD.GuiUp:
import FreeCADGui
Expand All @@ -45,13 +46,15 @@ def makeMechanicalMaterial(name):
return obj


class _CommandMechanicalMaterial:
class _CommandMechanicalMaterial(FemCommands):
"the Fem Material command definition"
def GetResources(self):
return {'Pixmap': 'fem-material',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Fem_Material", "Mechanical material..."),
'Accel': "M, M",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_Material", "Creates or edit the mechanical material definition.")}
def __init__(self):
super(_CommandMechanicalMaterial, self).__init__()
self.resources = {'Pixmap': 'fem-material',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Fem_Material", "Mechanical material..."),
'Accel': "M, M",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_Material", "Creates or edit the mechanical material definition.")}
self.is_active = 'with_analysis'

def Activated(self):
MatObj = None
Expand All @@ -74,12 +77,6 @@ def Activated(self):
FreeCADGui.setActiveDocument(MatObj.Document)
FreeCADGui.doCommand("Gui.activeDocument().setEdit('" + MatObj.Name + "',0)")

def IsActive(self):
if FemGui.getActiveAnalysis():
return True
else:
return False


class _MechanicalMaterial:
"The Material object"
Expand Down

0 comments on commit f76933e

Please sign in to comment.