Skip to content

Commit

Permalink
FEM: Migrate _CommandMechanicalJobControl 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 13, 2015
1 parent 1ad481b commit 6725c54
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Mod/Fem/_CommandMechanicalJobControl.py
Expand Up @@ -25,20 +25,23 @@
__url__ = "http://www.freecadweb.org"

import FreeCAD
from FemCommands import FemCommands

if FreeCAD.GuiUp:
import FreeCADGui
import FemGui
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
Expand All @@ -47,9 +50,6 @@ def Activated(self):
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())

0 comments on commit 6725c54

Please sign in to comment.