FEM: Migrate _CommandMechanicalJobControl to FemCommands

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
This commit is contained in:
Przemo Firszt 2015-10-13 15:25:57 +01:00 committed by wmayer
parent 1ad481b435
commit 6725c540a6

View File

@ -25,6 +25,7 @@ __author__ = "Juergen Riegel"
__url__ = "http://www.freecadweb.org"
import FreeCAD
from FemCommands import FemCommands
if FreeCAD.GuiUp:
import FreeCADGui
@ -32,13 +33,15 @@ if FreeCAD.GuiUp:
from PySide import QtCore
class _CommandMechanicalJobControl:
class _CommandMechanicalJobControl(FemCommands):
"the Fem JobControl command definition"
def GetResources(self):
return {'Pixmap': 'fem-new-analysis',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Fem_JobControl", "Start calculation"),
'Accel': "S, C",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_JobControl", "Dialog to start the calculation of the mechanical anlysis")}
def __init__(self):
super(_CommandMechanicalJobControl, self).__init__()
self.resources = {'Pixmap': 'fem-new-analysis',
'MenuText': QtCore.QT_TRANSLATE_NOOP("Fem_JobControl", "Start calculation"),
'Accel': "S, C",
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_JobControl", "Dialog to start the calculation of the mechanical anlysis")}
self.is_active = 'with_analysis'
def Activated(self):
import _JobControlTaskPanel
@ -47,9 +50,6 @@ class _CommandMechanicalJobControl:
taskd.update()
FreeCADGui.Control.showDialog(taskd)
def IsActive(self):
return FreeCADGui.ActiveDocument is not None and FemGui.getActiveAnalysis() is not None
if FreeCAD.GuiUp:
FreeCADGui.addCommand('Fem_MechanicalJobControl', _CommandMechanicalJobControl())