FEM: small code change to get lgtm quit

This commit is contained in:
Bernd Hahnebach
2020-11-26 09:06:10 +01:00
parent f2bf17ea1e
commit c6faecdcee

View File

@@ -222,20 +222,22 @@ class _TaskPanel:
QApplication.restoreOverrideCursor()
def get_active_analysis(self):
self.analysis = FemGui.getActiveAnalysis()
if self.analysis:
for m in FemGui.getActiveAnalysis().Group:
analysis = FemGui.getActiveAnalysis()
if not analysis:
FreeCAD.Console.PrintLog("No active analysis, means no group meshing.\n")
self.analysis = None # no group meshing
else:
for m in analysis.Group:
if m.Name == self.mesh_obj.Name:
FreeCAD.Console.PrintMessage(
"Active analysis found: {}\n"
.format(self.analysis.Name)
)
return
self.analysis = analysis # group meshing
break
else:
FreeCAD.Console.PrintLog(
"Mesh is not member of active analysis, means no group meshing.\n"
)
self.analysis = None # no group meshing
else:
FreeCAD.Console.PrintLog("No active analysis, means no group meshing.\n")
self.analysis = None # no group meshing
return