FEM: Move _CommandMechanicalJobControl class to separate file

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
This commit is contained in:
Przemo Firszt 2015-10-09 20:05:56 +01:00 committed by wmayer
parent 7a0c300aa3
commit dfb2335421
5 changed files with 32 additions and 20 deletions

View File

@ -90,6 +90,7 @@ SET(FemScripts_SRCS
_CommandFrequencyAnalysis.py
_CommandQuickAnalysis.py
_CommandPurgeFemResults.py
_CommandMechanicalJobControl.py
)
#SOURCE_GROUP("Scripts" FILES ${FemScripts_SRCS})

View File

@ -32,6 +32,7 @@ INSTALL(
_CommandFrequencyAnalysis.py
_CommandQuickAnalysis.py
_CommandPurgeFemResults.py
_CommandMechanicalJobControl.py
DESTINATION
Mod/Fem
)

View File

@ -106,6 +106,7 @@ void FemGuiExport initFemGui()
Base::Interpreter().loadModule("_CommandFrequencyAnalysis");
Base::Interpreter().loadModule("_CommandQuickAnalysis");
Base::Interpreter().loadModule("_CommandPurgeFemResults");
Base::Interpreter().loadModule("_CommandMechanicalJobControl");
Base::Interpreter().loadModule("MechanicalAnalysis");
Base::Interpreter().loadModule("MechanicalMaterial");
Base::Interpreter().loadModule("FemBeamSection");

View File

@ -104,26 +104,6 @@ class _CommandFemFromShape:
return False
class _CommandMechanicalJobControl:
"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 Activated(self):
import _JobControlTaskPanel
taskd = _JobControlTaskPanel._JobControlTaskPanel(FemGui.getActiveAnalysis())
#taskd.obj = vobj.Object
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_NewMechanicalAnalysis', _CommandNewMechanicalAnalysis())
FreeCADGui.addCommand('Fem_CreateFromShape', _CommandFemFromShape())
FreeCADGui.addCommand('Fem_MechanicalJobControl', _CommandMechanicalJobControl())

View File

@ -0,0 +1,29 @@
import FreeCAD
if FreeCAD.GuiUp:
import FreeCADGui
import FemGui
from PySide import QtCore
class _CommandMechanicalJobControl:
"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 Activated(self):
import _JobControlTaskPanel
taskd = _JobControlTaskPanel._JobControlTaskPanel(FemGui.getActiveAnalysis())
#taskd.obj = vobj.Object
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())