FEM: Migrate _CommandMechanicalJobControl to FemCommands
Signed-off-by: Przemo Firszt <przemo@firszt.eu>
This commit is contained in:
parent
1ad481b435
commit
6725c540a6
|
@ -25,6 +25,7 @@ __author__ = "Juergen Riegel"
|
||||||
__url__ = "http://www.freecadweb.org"
|
__url__ = "http://www.freecadweb.org"
|
||||||
|
|
||||||
import FreeCAD
|
import FreeCAD
|
||||||
|
from FemCommands import FemCommands
|
||||||
|
|
||||||
if FreeCAD.GuiUp:
|
if FreeCAD.GuiUp:
|
||||||
import FreeCADGui
|
import FreeCADGui
|
||||||
|
@ -32,13 +33,15 @@ if FreeCAD.GuiUp:
|
||||||
from PySide import QtCore
|
from PySide import QtCore
|
||||||
|
|
||||||
|
|
||||||
class _CommandMechanicalJobControl:
|
class _CommandMechanicalJobControl(FemCommands):
|
||||||
"the Fem JobControl command definition"
|
"the Fem JobControl command definition"
|
||||||
def GetResources(self):
|
def __init__(self):
|
||||||
return {'Pixmap': 'fem-new-analysis',
|
super(_CommandMechanicalJobControl, self).__init__()
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Fem_JobControl", "Start calculation"),
|
self.resources = {'Pixmap': 'fem-new-analysis',
|
||||||
'Accel': "S, C",
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Fem_JobControl", "Start calculation"),
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_JobControl", "Dialog to start the calculation of the mechanical anlysis")}
|
'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):
|
def Activated(self):
|
||||||
import _JobControlTaskPanel
|
import _JobControlTaskPanel
|
||||||
|
@ -47,9 +50,6 @@ class _CommandMechanicalJobControl:
|
||||||
taskd.update()
|
taskd.update()
|
||||||
FreeCADGui.Control.showDialog(taskd)
|
FreeCADGui.Control.showDialog(taskd)
|
||||||
|
|
||||||
def IsActive(self):
|
|
||||||
return FreeCADGui.ActiveDocument is not None and FemGui.getActiveAnalysis() is not None
|
|
||||||
|
|
||||||
|
|
||||||
if FreeCAD.GuiUp:
|
if FreeCAD.GuiUp:
|
||||||
FreeCADGui.addCommand('Fem_MechanicalJobControl', _CommandMechanicalJobControl())
|
FreeCADGui.addCommand('Fem_MechanicalJobControl', _CommandMechanicalJobControl())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user