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() QApplication.restoreOverrideCursor()
def get_active_analysis(self): def get_active_analysis(self):
self.analysis = FemGui.getActiveAnalysis() analysis = FemGui.getActiveAnalysis()
if self.analysis: if not analysis:
for m in FemGui.getActiveAnalysis().Group: 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: if m.Name == self.mesh_obj.Name:
FreeCAD.Console.PrintMessage( FreeCAD.Console.PrintMessage(
"Active analysis found: {}\n" "Active analysis found: {}\n"
.format(self.analysis.Name) .format(self.analysis.Name)
) )
return self.analysis = analysis # group meshing
break
else: else:
FreeCAD.Console.PrintLog( FreeCAD.Console.PrintLog(
"Mesh is not member of active analysis, means no group meshing.\n" "Mesh is not member of active analysis, means no group meshing.\n"
) )
self.analysis = None # no group meshing self.analysis = None # no group meshing
else: return
FreeCAD.Console.PrintLog("No active analysis, means no group meshing.\n")
self.analysis = None # no group meshing