Skip to content

Commit

Permalink
FEM: Don't import FemGui when it's not required
Browse files Browse the repository at this point in the history
This is part of preparation to create automated FEM wb tests

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
  • Loading branch information
PrzemoF committed Jul 27, 2015
1 parent ddac5ee commit f5ad8ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Mod/Fem/FemTools.py
Expand Up @@ -22,7 +22,6 @@


import FreeCAD
import FemGui
from PySide import QtCore


Expand All @@ -37,6 +36,7 @@ def __init__(self, analysis=None):
if analysis:
self.analysis = analysis
else:
import FemGui
self.analysis = FemGui.getActiveAnalysis()
if self.analysis:
self.update_objects()
Expand Down
16 changes: 8 additions & 8 deletions src/Mod/Fem/MechanicalAnalysis.py
Expand Up @@ -23,12 +23,12 @@
import ccxFrdReader
import FreeCAD
from FemTools import FemTools
import FemGui
import os
import time

if FreeCAD.GuiUp:
import FreeCADGui
import FemGui
from PySide import QtCore, QtGui
from PySide.QtCore import Qt
from PySide.QtGui import QApplication
Expand Down Expand Up @@ -79,7 +79,6 @@ def Activated(self):
FreeCADGui.Selection.clearSelection()

def IsActive(self):
import FemGui
return FreeCADGui.ActiveDocument is not None and FemGui.getActiveAnalysis() is None


Expand Down Expand Up @@ -649,9 +648,10 @@ def results_present():
return results


FreeCADGui.addCommand('Fem_NewMechanicalAnalysis', _CommandNewMechanicalAnalysis())
FreeCADGui.addCommand('Fem_CreateFromShape', _CommandFemFromShape())
FreeCADGui.addCommand('Fem_MechanicalJobControl', _CommandMechanicalJobControl())
FreeCADGui.addCommand('Fem_Quick_Analysis', _CommandQuickAnalysis())
FreeCADGui.addCommand('Fem_PurgeResults', _CommandPurgeFemResults())
FreeCADGui.addCommand('Fem_ShowResult', _CommandMechanicalShowResult())
if FreeCAD.GuiUp:
FreeCADGui.addCommand('Fem_NewMechanicalAnalysis', _CommandNewMechanicalAnalysis())
FreeCADGui.addCommand('Fem_CreateFromShape', _CommandFemFromShape())
FreeCADGui.addCommand('Fem_MechanicalJobControl', _CommandMechanicalJobControl())
FreeCADGui.addCommand('Fem_Quick_Analysis', _CommandQuickAnalysis())
FreeCADGui.addCommand('Fem_PurgeResults', _CommandPurgeFemResults())
FreeCADGui.addCommand('Fem_ShowResult', _CommandMechanicalShowResult())

0 comments on commit f5ad8ca

Please sign in to comment.