Skip to content

Commit

Permalink
FEM: Always import FemGui
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 yorikvanhavre committed Jun 9, 2015
1 parent 6de28c1 commit 5853eab
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/Mod/Fem/MechanicalAnalysis.py
Expand Up @@ -22,14 +22,14 @@

import ccxFrdReader
import FreeCAD
import FemGui
import os
import sys
import tempfile
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 @@ -119,15 +119,12 @@ def GetResources(self):
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_JobControl", "Dialog to start the calculation of the mechanical anlysis")}

def Activated(self):
import FemGui

taskd = _JobControlTaskPanel(FemGui.getActiveAnalysis())
#taskd.obj = vobj.Object
taskd.update()
FreeCADGui.Control.showDialog(taskd)

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


Expand Down Expand Up @@ -156,7 +153,6 @@ def GetResources(self):
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Fem_ResultDisplacement", "Show result information of an analysis")}

def Activated(self):
import FemGui
DisplacementObject = None
for i in FemGui.getActiveAnalysis().Member:
if i.isDerivedFrom("Fem::FemResultVector"):
Expand Down Expand Up @@ -224,7 +220,6 @@ def onChanged(self, vobj, prop):
return

def doubleClicked(self, vobj):
import FemGui
if not FemGui.getActiveAnalysis() == self.Object:
if FreeCADGui.activeWorkbench().name() != 'FemWorkbench':
FreeCADGui.activateWorkbench("FemWorkbench")
Expand Down Expand Up @@ -633,7 +628,6 @@ def reject(self):


def results_present():
import FemGui
results = False
analysis_members = FemGui.getActiveAnalysis().Member
for o in analysis_members:
Expand All @@ -645,7 +639,6 @@ def results_present():


def purge_fem_results(Analysis=None):
import FemGui
if Analysis is None:
analysis_members = FemGui.getActiveAnalysis().Member
else:
Expand All @@ -658,7 +651,6 @@ def purge_fem_results(Analysis=None):


def reset_mesh_color(mesh=None):
import FemGui
if mesh is None:
for i in FemGui.getActiveAnalysis().Member:
if i.isDerivedFrom("Fem::FemMeshObject"):
Expand All @@ -669,7 +661,6 @@ def reset_mesh_color(mesh=None):


def reset_mesh_deformation(mesh=None):
import FemGui
if mesh is None:
for i in FemGui.getActiveAnalysis().Member:
if i.isDerivedFrom("Fem::FemMeshObject"):
Expand Down

0 comments on commit 5853eab

Please sign in to comment.